From 43e57a42832ea8b4ceb0317f3c9028a4174ffa7b Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 8 Aug 2007 07:25:32 +0000 Subject: Adapted project directory structure to suit the new maven based build process. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@909 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../java/test/at/gv/egovernment/moa/AllTests.java | 38 + .../test/at/gv/egovernment/moa/MOATestCase.java | 75 ++ .../at/gv/egovernment/moa/util/DOMUtilsTest.java | 137 ++ .../gv/egovernment/moa/util/DateTimeUtilsTest.java | 104 ++ .../gv/egovernment/moa/util/KeyStoreUtilsTest.java | 90 ++ .../at/gv/egovernment/moa/util/SSLUtilsTest.java | 160 +++ .../at/gv/egovernment/moa/util/URLDecoderTest.java | 29 + .../at/gv/egovernment/moa/util/URLEncoderTest.java | 43 + .../moa/util/XMLGrammarBuilderTest.java | 99 ++ .../at/gv/egovernment/moa/util/XPathUtilsTest.java | 51 + common/build.xml | 85 -- .../properties/common_messages_de.properties | 16 - common/res/resources/schemas/Core-1.2.xsd | 881 ------------ common/res/resources/schemas/Core.20020225.xsd | 399 ------ common/res/resources/schemas/Core.20020831.xsd | 153 --- .../resources/schemas/ECDSAKeyValue.ancient.xsd | 122 -- .../res/resources/schemas/ECDSAKeyValue.wrong.xsd | 122 -- common/res/resources/schemas/ECDSAKeyValue.xsd | 122 -- .../resources/schemas/MOA-ID-Configuration-1.2.xsd | 350 ----- .../resources/schemas/MOA-ID-Configuration-1.3.xsd | 424 ------ .../resources/schemas/MOA-ID-Configuration-1.4.xsd | 505 ------- common/res/resources/schemas/MOA-SPSS-1.3.xsd | 469 ------- .../res/resources/schemas/MOA-SPSS-config-1.3.xsd | 253 ---- common/res/resources/schemas/MOAIdentities.xsd | 51 - common/res/resources/schemas/PersonData.xsd | 426 ------ .../resources/schemas/PersonData_20_en_moaWID.xsd | 1229 ----------------- common/res/resources/schemas/PersonName-1_2.xsd | 115 -- common/res/resources/schemas/PostalAddress-1_2.xsd | 95 -- common/res/resources/schemas/TelcomNumber-1_0.xsd | 89 -- .../res/resources/schemas/XMLSchema-instance.xsd | 37 - common/res/resources/schemas/XMLSchema.dtd | 402 ------ .../schemas/cs-sstc-schema-assertion-01.xsd | 194 --- .../schemas/cs-sstc-schema-protocol-01.xsd | 127 -- common/res/resources/schemas/datatypes.dtd | 203 --- .../schemas/exclusive-canonicalization.xsd | 22 - common/res/resources/schemas/xml.xsd | 83 -- .../res/resources/schemas/xmldsig-core-schema.xsd | 264 ---- common/res/resources/schemas/xmldsig-filter2.xsd | 38 - .../src/at/gv/egovernment/moa/logging/LogMsg.java | 43 - .../src/at/gv/egovernment/moa/logging/Logger.java | 175 --- .../gv/egovernment/moa/logging/LoggingContext.java | 46 - .../moa/logging/LoggingContextManager.java | 56 - .../at/gv/egovernment/moa/util/Base64Utils.java | 109 -- .../src/at/gv/egovernment/moa/util/BoolUtils.java | 24 - .../gv/egovernment/moa/util/CollectionUtils.java | 36 - .../src/at/gv/egovernment/moa/util/Constants.java | 318 ----- .../src/at/gv/egovernment/moa/util/DOMUtils.java | 971 -------------- .../at/gv/egovernment/moa/util/DateTimeUtils.java | 326 ----- .../egovernment/moa/util/EntityResolverChain.java | 52 - .../src/at/gv/egovernment/moa/util/FileUtils.java | 116 -- .../at/gv/egovernment/moa/util/KeyStoreUtils.java | 134 -- .../gv/egovernment/moa/util/MOADefaultHandler.java | 82 -- .../gv/egovernment/moa/util/MOAEntityResolver.java | 103 -- .../gv/egovernment/moa/util/MOAErrorHandler.java | 85 -- .../src/at/gv/egovernment/moa/util/MOATimer.java | 110 -- .../gv/egovernment/moa/util/MessageProvider.java | 63 - .../src/at/gv/egovernment/moa/util/Messages.java | 117 -- .../egovernment/moa/util/NodeIteratorAdapter.java | 87 -- .../gv/egovernment/moa/util/NodeListAdapter.java | 44 - .../at/gv/egovernment/moa/util/OutputXML2File.java | 78 -- .../egovernment/moa/util/ResourceBundleChain.java | 66 - .../src/at/gv/egovernment/moa/util/SSLUtils.java | 221 --- .../egovernment/moa/util/StreamEntityResolver.java | 64 - .../at/gv/egovernment/moa/util/StreamUtils.java | 128 -- .../at/gv/egovernment/moa/util/StringUtils.java | 164 --- .../src/at/gv/egovernment/moa/util/URLDecoder.java | 60 - .../src/at/gv/egovernment/moa/util/URLEncoder.java | 63 - .../at/gv/egovernment/moa/util/XPathException.java | 58 - .../src/at/gv/egovernment/moa/util/XPathUtils.java | 526 -------- .../java/at/gv/egovernment/moa/logging/LogMsg.java | 43 + .../java/at/gv/egovernment/moa/logging/Logger.java | 175 +++ .../gv/egovernment/moa/logging/LoggingContext.java | 46 + .../moa/logging/LoggingContextManager.java | 56 + .../at/gv/egovernment/moa/util/Base64Utils.java | 109 ++ .../java/at/gv/egovernment/moa/util/BoolUtils.java | 24 + .../gv/egovernment/moa/util/CollectionUtils.java | 36 + .../java/at/gv/egovernment/moa/util/Constants.java | 318 +++++ .../java/at/gv/egovernment/moa/util/DOMUtils.java | 971 ++++++++++++++ .../at/gv/egovernment/moa/util/DateTimeUtils.java | 326 +++++ .../egovernment/moa/util/EntityResolverChain.java | 52 + .../java/at/gv/egovernment/moa/util/FileUtils.java | 116 ++ .../at/gv/egovernment/moa/util/KeyStoreUtils.java | 134 ++ .../gv/egovernment/moa/util/MOADefaultHandler.java | 82 ++ .../gv/egovernment/moa/util/MOAEntityResolver.java | 103 ++ .../gv/egovernment/moa/util/MOAErrorHandler.java | 85 ++ .../java/at/gv/egovernment/moa/util/MOATimer.java | 110 ++ .../gv/egovernment/moa/util/MessageProvider.java | 63 + .../java/at/gv/egovernment/moa/util/Messages.java | 117 ++ .../egovernment/moa/util/NodeIteratorAdapter.java | 87 ++ .../gv/egovernment/moa/util/NodeListAdapter.java | 44 + .../at/gv/egovernment/moa/util/OutputXML2File.java | 78 ++ .../egovernment/moa/util/ResourceBundleChain.java | 66 + .../java/at/gv/egovernment/moa/util/SSLUtils.java | 221 +++ .../egovernment/moa/util/StreamEntityResolver.java | 64 + .../at/gv/egovernment/moa/util/StreamUtils.java | 128 ++ .../at/gv/egovernment/moa/util/StringUtils.java | 164 +++ .../at/gv/egovernment/moa/util/URLDecoder.java | 60 + .../at/gv/egovernment/moa/util/URLEncoder.java | 63 + .../at/gv/egovernment/moa/util/XPathException.java | 58 + .../at/gv/egovernment/moa/util/XPathUtils.java | 526 ++++++++ .../src/test/at/gv/egovernment/moa/AllTests.java | 38 - .../test/at/gv/egovernment/moa/MOATestCase.java | 75 -- .../at/gv/egovernment/moa/util/DOMUtilsTest.java | 137 -- .../gv/egovernment/moa/util/DateTimeUtilsTest.java | 104 -- .../gv/egovernment/moa/util/KeyStoreUtilsTest.java | 90 -- .../at/gv/egovernment/moa/util/SSLUtilsTest.java | 160 --- .../at/gv/egovernment/moa/util/URLDecoderTest.java | 29 - .../at/gv/egovernment/moa/util/URLEncoderTest.java | 43 - .../moa/util/XMLGrammarBuilderTest.java | 99 -- .../at/gv/egovernment/moa/util/XPathUtilsTest.java | 51 - id.oa/.classpath | 6 - id.oa/.cvsignore | 1 - id.oa/.project | 23 - id.oa/build.xml | 32 - id.oa/html/auth.jsp | 48 - id.oa/html/chooseBKU.jsp | 19 - id.oa/html/form.jsp | 20 - id.oa/html/getBKUSelectTag.jsp | 6 - id.oa/html/index.jsp | 60 - id.oa/html/stateful_login.jsp | 29 - id.oa/web.xml | 9 - .../data/deploy/conf/Catalina/localhost/proxy.xml | 25 - .../data/deploy/conf/moa-id/MOAIdentities.xsd | 59 - .../data/deploy/conf/moa-id/SampleIdentities.xml | 34 - .../conf/moa-id/SampleMOAIDConfiguration.xml | 113 -- .../conf/moa-id/SampleMOAIDConfigurationProxy.xml | 135 -- .../SampleMOAIDConfiguration_withTestBKs.xml | 118 -- .../SampleMOAIDConfiguration_withTestBKsProxy.xml | 138 -- .../conf/moa-id/SampleMOAWIDConfiguration.xml | 121 -- .../conf/moa-id/SampleMOAWIDConfigurationProxy.xml | 143 -- .../SampleMOAWIDConfiguration_withTestBKs.xml | 123 -- .../SampleMOAWIDConfiguration_withTestBKsProxy.xml | 145 -- id.server/data/deploy/conf/moa-id/log4j.properties | 25 - .../deploy/conf/moa-id/oa/BasicOAConfiguration.xml | 9 - .../conf/moa-id/oa/HeaderOAConfiguration.xml | 10 - .../deploy/conf/moa-id/oa/ParamOAConfiguration.xml | 10 - .../conf/moa-id/oa/SampleOAConfiguration.xml | 9 - .../conf/moa-id/oa/SamplewbPKOAConfiguration.xml | 9 - .../moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt | 21 - .../SampleBKUSelectionTemplate.html | 44 - .../moa-id/sampleTemplates/SampleTemplate.html | 56 - .../moa-id/transforms/TransformsInfoAuthBlock.xml | 105 -- .../transforms/TransformsInfoAuthBlockText.xml | 44 - .../TransformsInfoAuthBlockText_deprecated.xml | 49 - .../TransformsInfoAuthBlock_deprecated.xml | 107 -- .../conf/moa-spss/SampleMOASPSSConfiguration.xml | 79 -- ...a-signaturdienst-allekunden(pwd=allekunden).p12 | Bin 3716 -> 0 bytes .../keys/common/moa-signaturdienst-allekunden.der | Bin 1020 -> 0 bytes .../moa-signaturdienst-kunde1(pwd=kunde1).p12 | Bin 3932 -> 0 bytes .../keys/customer1/moa-signaturdienst-kunde1.der | Bin 920 -> 0 bytes .../moa-signaturdienst-kunde2(pwd=kunde2).p12 | Bin 3908 -> 0 bytes .../keys/customer2/moa-signaturdienst-kunde2.der | Bin 1200 -> 0 bytes ...a-signaturdienst-strafregisterbescheinigung.p12 | Bin 4097 -> 0 bytes .../moa-spss/profiles/MOAIDTransformAuthBlock.xml | 103 -- .../profiles/MOAIDTransformAuthBlockText.xml | 42 - .../MOAIDTransformAuthBlockText_deprecated.xml | 47 - .../MOAIDTransformAuthBlock_deprecated.xml | 105 -- .../customer1/moa-ssl-kunde1(pwd=kunde1).p12 | Bin 3926 -> 0 bytes .../moa-spss/sslKeys/customer1/moa-ssl-kunde1.der | Bin 882 -> 0 bytes .../customer1/trustedServers(pwd=servers).keystore | Bin 943 -> 0 bytes .../customer2/moa-ssl-kunde2(pwd=kunde2).p12 | Bin 3926 -> 0 bytes .../moa-spss/sslKeys/customer2/moa-ssl-kunde2.der | Bin 882 -> 0 bytes .../customer2/trustedServers(pwd=servers).keystore | Bin 943 -> 0 bytes .../sslKeys/server/moa-ssl-server(pwd=server).p12 | Bin 3808 -> 0 bytes .../moa-spss/sslKeys/server/moa-ssl-server.der | Bin 877 -> 0 bytes .../sslKeys/tomcat/tomcat(pwd=server).keystore | Bin 5200 -> 0 bytes .../tomcat/trustedClients(pwd=clients).keystore | Bin 988 -> 0 bytes ...-20041130.SerNo01f6(SecureSignatureKeypair).cer | Bin 901 -> 0 bytes ...-20041215.SerNo021e(SecureSignatureKeypair).cer | Bin 901 -> 0 bytes ...-20050207.SerNo0291(SecureSignatureKeypair).cer | Bin 1110 -> 0 bytes ...-20050207.SerNo210d(SecureSignatureKeypair).cer | Bin 1110 -> 0 bytes ...-20141201.SerNoE243(SecureSignatureKeypair).cer | Bin 1111 -> 0 bytes ...-20141203.SerNoE248(SecureSignatureKeypair).cer | Bin 975 -> 0 bytes ...ignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer | Bin 1018 -> 0 bytes ...t-Sig-01-SN0588(SecureSignatureKeypair_alt).cer | Bin 1151 -> 0 bytes ...011201-20041201.SerNo0213(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...010427-20040427.SerNo006f(CertifiedKeypair).cer | Bin 860 -> 0 bytes ...011212-20041212.SerNo0213(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...011212-20041212.SerNo0218(CertifiedKeypair).cer | Bin 861 -> 0 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...041201-20141201.SerNoe242(CertifiedKeypair).cer | Bin 865 -> 0 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 979 -> 0 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 1747 -> 0 bytes ...bsstelle-TestCACrypt-SN04(CertifiedKeypair).der | 22 - ...elle-TestCASig-SN03(SecureSignatureKeypair).der | Bin 914 -> 0 bytes ...TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer | Bin 1136 -> 0 bytes ...TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer | Bin 1136 -> 0 bytes ...remium-Sig-01SN16f9(SecureSignatureKeypair).cer | Bin 1171 -> 0 bytes ...remium-Sig-01SN484a(SecureSignatureKeypair).cer | Bin 1133 -> 0 bytes ...46(SecureSignatureKeypair_CertifiedKeypair).cer | Bin 1076 -> 0 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 1141 -> 0 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 870 -> 0 bytes ...-20041130.SerNo01f6(SecureSignatureKeypair).cer | Bin 901 -> 0 bytes ...-20041215.SerNo021e(SecureSignatureKeypair).cer | Bin 901 -> 0 bytes ...-20050207.SerNo0291(SecureSignatureKeypair).cer | Bin 1110 -> 0 bytes ...-20050207.SerNo210d(SecureSignatureKeypair).cer | Bin 1110 -> 0 bytes ...-20141201.SerNoE243(SecureSignatureKeypair).cer | Bin 1111 -> 0 bytes ...-20141203.SerNoE248(SecureSignatureKeypair).cer | Bin 975 -> 0 bytes ...011201-20041201.SerNo0213(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...010427-20040427.SerNo006f(CertifiedKeypair).cer | Bin 860 -> 0 bytes ...011212-20041212.SerNo0213(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...011212-20041212.SerNo0218(CertifiedKeypair).cer | Bin 861 -> 0 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...041201-20141201.SerNoe242(CertifiedKeypair).cer | Bin 865 -> 0 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 979 -> 0 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 1747 -> 0 bytes ...46(SecureSignatureKeypair_CertifiedKeypair).cer | Bin 1076 -> 0 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 1141 -> 0 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 870 -> 0 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 1205 -> 0 bytes ...rate-light-03-20051114-20151114.SerNo01AAED.cer | Bin 1171 -> 0 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 1205 -> 0 bytes ...rate-light-03-20051114-20151114.SerNo01AAED.cer | Bin 1171 -> 0 bytes .../data/deploy/templates/LIESMICH_TEMPLATES.txt | 39 - .../data/deploy/templates/moaid-templates.war | Bin 32185 -> 0 bytes id.server/data/deploy/tomcat/server.mod_jk.xml | 162 --- id.server/data/deploy/tomcat/server.xml | 171 --- .../tomcat-util-4.1.27-patched/tomcat-util.jar | Bin 178544 -> 0 bytes id.server/data/deploy/tomcat/unix/tomcat-start.sh | 28 - id.server/data/deploy/tomcat/unix/tomcat-stop.sh | 7 - .../data/deploy/tomcat/uriworkermap.properties | 9 - id.server/data/deploy/tomcat/win32/startTomcat.bat | 26 - id.server/data/deploy/tomcat/win32/stopTomcat.bat | 13 - id.server/data/deploy/tomcat/workers.properties | 6 - id.server/doc/Architektur ID.vsd | Bin 318464 -> 0 bytes id.server/doc/MOA ID 1.x.wsdl | 41 - id.server/doc/MOA-ID Feinspezifikation.doc | Bin 268288 -> 0 bytes id.server/doc/MOA-ID-Configuration-1.2.xsd | 350 ----- id.server/doc/MOA-ID-Configuration-1.3.xsd | 424 ------ id.server/doc/MOA-ID-Configuration-1.4.xsd | 505 ------- id.server/doc/MOA_ID_1.2_20040315.pdf | Bin 577309 -> 0 bytes id.server/doc/MOA_ID_1.3_20060315.pdf | Bin 355156 -> 0 bytes id.server/doc/MOA_ID_1.4_20070802.pdf | Bin 239502 -> 0 bytes id.server/doc/OID-1-0-3.pdf | Bin 347041 -> 0 bytes id.server/doc/api-doc/allclasses-frame.html | 35 - .../moa/id/AuthenticationException.html | 171 --- .../moa/id/auth/AuthenticationServer.html | 259 ---- .../id/auth/class-use/AuthenticationServer.html | 114 -- .../moa/id/class-use/AuthenticationException.html | 194 --- .../moa/id/config/proxy/OAConfiguration.html | 526 -------- .../id/config/proxy/class-use/OAConfiguration.html | 126 -- .../moa/id/data/AuthenticationData.html | 751 ----------- .../moa/id/data/class-use/AuthenticationData.html | 152 --- .../moa/id/proxy/ConnectionBuilder.html | 204 --- .../moa/id/proxy/LoginParameterResolver.html | 364 ----- .../moa/id/proxy/class-use/ConnectionBuilder.html | 91 -- .../id/proxy/class-use/LoginParameterResolver.html | 91 -- id.server/doc/api-doc/deprecated-list.html | 89 -- id.server/doc/api-doc/help-doc.html | 142 -- id.server/doc/api-doc/index-all.html | 422 ------ id.server/doc/api-doc/index.html | 22 - id.server/doc/api-doc/overview-tree.html | 101 -- id.server/doc/api-doc/package-list | 0 id.server/doc/api-doc/packages.html | 26 - id.server/doc/api-doc/serialized-form.html | 89 -- id.server/doc/api-doc/stylesheet.css | 29 - id.server/doc/bku-auswahl.20030408.pdf | Bin 131587 -> 0 bytes id.server/doc/cs-sstc-schema-assertion-01.xsd | 194 --- id.server/doc/cs-sstc-schema-protocol-01.xsd | 127 -- id.server/doc/moa-id.htm | 7 - id.server/doc/moa_id/api-doc/allclasses-frame.html | 44 - .../doc/moa_id/api-doc/allclasses-noframe.html | 44 - .../moa/id/AuthenticationException.html | 251 ---- .../moa/id/auth/AuthenticationServer.html | 631 --------- .../id/auth/class-use/AuthenticationServer.html | 172 --- .../gv/egovernment/moa/id/auth/package-frame.html | 32 - .../egovernment/moa/id/auth/package-summary.html | 148 -- .../gv/egovernment/moa/id/auth/package-tree.html | 145 -- .../at/gv/egovernment/moa/id/auth/package-use.html | 162 --- .../moa/id/class-use/AuthenticationException.html | 228 ---- .../moa/id/config/proxy/OAConfiguration.html | 613 --------- .../id/config/proxy/class-use/OAConfiguration.html | 184 --- .../moa/id/config/proxy/package-frame.html | 32 - .../moa/id/config/proxy/package-summary.html | 149 -- .../moa/id/config/proxy/package-tree.html | 145 -- .../moa/id/config/proxy/package-use.html | 163 --- .../moa/id/data/AuthenticationData.html | 906 ------------- .../moa/id/data/class-use/AuthenticationData.html | 214 --- .../gv/egovernment/moa/id/data/package-frame.html | 32 - .../egovernment/moa/id/data/package-summary.html | 148 -- .../gv/egovernment/moa/id/data/package-tree.html | 145 -- .../at/gv/egovernment/moa/id/data/package-use.html | 181 --- .../at/gv/egovernment/moa/id/package-frame.html | 32 - .../at/gv/egovernment/moa/id/package-summary.html | 148 -- .../at/gv/egovernment/moa/id/package-tree.html | 147 -- .../at/gv/egovernment/moa/id/package-use.html | 162 --- .../moa/id/proxy/ConnectionBuilder.html | 249 ---- .../moa/id/proxy/LoginParameterResolver.html | 506 ------- .../id/proxy/LoginParameterResolverException.html | 251 ---- .../moa/id/proxy/NotAllowedException.html | 253 ---- .../moa/id/proxy/class-use/ConnectionBuilder.html | 136 -- .../id/proxy/class-use/LoginParameterResolver.html | 136 -- .../class-use/LoginParameterResolverException.html | 192 --- .../id/proxy/class-use/NotAllowedException.html | 182 --- .../gv/egovernment/moa/id/proxy/package-frame.html | 47 - .../egovernment/moa/id/proxy/package-summary.html | 175 --- .../gv/egovernment/moa/id/proxy/package-tree.html | 154 --- .../gv/egovernment/moa/id/proxy/package-use.html | 170 --- id.server/doc/moa_id/api-doc/constant-values.html | 262 ---- id.server/doc/moa_id/api-doc/deprecated-list.html | 134 -- id.server/doc/moa_id/api-doc/help-doc.html | 193 --- id.server/doc/moa_id/api-doc/index-all.html | 462 ------- id.server/doc/moa_id/api-doc/index.html | 26 - id.server/doc/moa_id/api-doc/overview-frame.html | 50 - id.server/doc/moa_id/api-doc/overview-summary.html | 165 --- id.server/doc/moa_id/api-doc/overview-tree.html | 155 --- id.server/doc/moa_id/api-doc/package-list | 5 - id.server/doc/moa_id/api-doc/packages.html | 37 - id.server/doc/moa_id/api-doc/resources/inherit.gif | Bin 57 -> 0 bytes id.server/doc/moa_id/api-doc/serialized-form.html | 169 --- id.server/doc/moa_id/api-doc/stylesheet.css | 29 - .../doc/moa_id/examples/BKUSelectionTemplate.html | 52 - id.server/doc/moa_id/examples/ChainingModes.txt | 6 - .../doc/moa_id/examples/IdentityLinkSigners.txt | 9 - .../doc/moa_id/examples/LoginServletExample.txt | 171 --- .../SampleMOAIDVerifyInfoboxesConfiguration.xml | 148 -- id.server/doc/moa_id/examples/Template.html | 50 - .../moa_id/examples/TransformsInfoAuthBlock.txt | 35 - .../moa_id/examples/conf/MOA-ID-Configuration.xml | 103 -- .../doc/moa_id/examples/conf/OAConfBasicAuth.xml | 9 - .../doc/moa_id/examples/conf/OAConfHeaderAuth.xml | 10 - .../doc/moa_id/examples/conf/OAConfParamAuth.xml | 10 - id.server/doc/moa_id/examples/moa-id-env.sh.txt | 15 - id.server/doc/moa_id/examples/startTomcat.bat.txt | 26 - id.server/doc/moa_id/faqs.htm | 217 --- id.server/doc/moa_id/id-admin.htm | 317 ----- id.server/doc/moa_id/id-admin_1.htm | 539 -------- id.server/doc/moa_id/id-admin_2.htm | 1417 -------------------- id.server/doc/moa_id/id-admin_3.htm | 204 --- id.server/doc/moa_id/id-anwendung.htm | 104 -- id.server/doc/moa_id/id-anwendung_1.htm | 205 --- id.server/doc/moa_id/id-anwendung_2.htm | 247 ---- id.server/doc/moa_id/links.htm | 141 -- id.server/doc/moa_id/moa-id-ablauf.jpg | Bin 15550 -> 0 bytes id.server/doc/moa_id/moa.htm | 248 ---- id.server/doc/moa_images/east.gif | Bin 966 -> 0 bytes id.server/doc/moa_images/idle.gif | Bin 869 -> 0 bytes id.server/doc/moa_images/moa_diagramm1.jpg | Bin 60602 -> 0 bytes id.server/doc/moa_images/moa_thema.gif | Bin 25120 -> 0 bytes id.server/doc/moa_images/north.gif | Bin 967 -> 0 bytes id.server/doc/moa_images/pfeil.gif | Bin 843 -> 0 bytes id.server/doc/moa_images/print.gif | Bin 211 -> 0 bytes id.server/doc/moa_images/select.gif | Bin 880 -> 0 bytes id.server/doc/moa_images/south.gif | Bin 965 -> 0 bytes id.server/doc/moa_images/transdot.gif | Bin 43 -> 0 bytes id.server/doc/moa_images/west.gif | Bin 966 -> 0 bytes id.server/html/auth/WEB-INF/server-config.wsdd | 29 - id.server/html/auth/WEB-INF/web.xml | 113 -- id.server/html/auth/errorpage-auth.jsp | 50 - id.server/html/auth/index.jsp | 40 - id.server/html/auth/message-auth.jsp | 20 - id.server/html/proxy/WEB-INF/web.xml | 82 -- id.server/html/proxy/errorpage-proxy.jsp | 50 - id.server/html/proxy/message-proxy.jsp | 20 - ....apache.axis.components.net.SecureSocketFactory | 1 - .../resources/properties/id_messages_de.properties | 158 --- id.server/res/resources/wsdl/MOA-ID-1.0.wsdl | 40 - id.server/res/resources/wsdl/MOA-ID-1.x.wsdl | 40 - id.server/res/resources/wsdl/MOA-SPSS-1.2.xsd | 454 ------- .../resources/xmldata/CertInfoDsigSignature.xml | 139 -- .../moa/id/AuthenticationException.java | 31 - .../at/gv/egovernment/moa/id/BuildException.java | 34 - .../moa/id/ECDSAConverterException.java | 34 - .../at/gv/egovernment/moa/id/MOAIDException.java | 159 --- .../at/gv/egovernment/moa/id/ParseException.java | 34 - .../at/gv/egovernment/moa/id/ServiceException.java | 34 - .../moa/id/auth/AuthenticationServer.java | 1019 -------------- .../moa/id/auth/AuthenticationSessionCleaner.java | 52 - .../moa/id/auth/MOAIDAuthConstants.java | 75 -- .../moa/id/auth/MOAIDAuthInitializer.java | 163 --- .../moa/id/auth/WrongParametersException.java | 21 - .../builder/AuthenticationAssertionBuilder.java | 88 -- .../AuthenticationBlockAssertionBuilder.java | 146 -- .../AuthenticationDataAssertionBuilder.java | 156 --- .../moa/id/auth/builder/BPKBuilder.java | 49 - .../egovernment/moa/id/auth/builder/Builder.java | 59 - .../CertInfoVerifyXMLSignatureRequestBuilder.java | 84 -- .../builder/CreateXMLSignatureRequestBuilder.java | 93 -- .../moa/id/auth/builder/DataURLBuilder.java | 83 -- .../auth/builder/GetIdentityLinkFormBuilder.java | 150 --- .../id/auth/builder/InfoboxReadRequestBuilder.java | 86 -- .../builder/InfoboxValidatorParamsBuilder.java | 82 -- .../moa/id/auth/builder/PersonDataBuilder.java | 59 - .../moa/id/auth/builder/SAMLArtifactBuilder.java | 60 - .../moa/id/auth/builder/SAMLResponseBuilder.java | 91 -- .../moa/id/auth/builder/SelectBKUFormBuilder.java | 63 - .../builder/VerifyXMLSignatureRequestBuilder.java | 206 --- .../moa/id/auth/data/AuthenticationSession.java | 383 ------ .../id/auth/data/CreateXMLSignatureResponse.java | 71 - .../moa/id/auth/data/ExtendedSAMLAttribute.java | 73 - .../id/auth/data/ExtendedSAMLAttributeImpl.java | 137 -- .../egovernment/moa/id/auth/data/IdentityLink.java | 266 ---- .../egovernment/moa/id/auth/data/InfoboxToken.java | 65 - .../moa/id/auth/data/InfoboxTokenImpl.java | 129 -- .../moa/id/auth/data/InfoboxValidationResult.java | 57 - .../id/auth/data/InfoboxValidationResultImpl.java | 101 -- .../moa/id/auth/data/InfoboxValidatorParams.java | 172 --- .../id/auth/data/InfoboxValidatorParamsImpl.java | 348 ----- .../moa/id/auth/data/SAMLAttribute.java | 79 -- .../at/gv/egovernment/moa/id/auth/data/Schema.java | 26 - .../egovernment/moa/id/auth/data/SchemaImpl.java | 63 - .../id/auth/data/VerifyXMLSignatureResponse.java | 177 --- .../auth/invoke/SignatureVerificationInvoker.java | 92 -- .../parser/CreateXMLSignatureResponseParser.java | 193 --- .../moa/id/auth/parser/ErrorResponseParser.java | 72 - .../parser/ExtendedInfoboxReadResponseParser.java | 157 --- .../auth/parser/IdentityLinkAssertionParser.java | 319 ----- .../id/auth/parser/InfoboxReadResponseParser.java | 165 --- .../moa/id/auth/parser/SAMLArtifactParser.java | 58 - .../parser/VerifyXMLSignatureResponseParser.java | 156 --- .../moa/id/auth/servlet/AuthServlet.java | 202 --- .../moa/id/auth/servlet/ConfigurationServlet.java | 75 -- .../auth/servlet/GetAuthenticationDataService.java | 135 -- .../moa/id/auth/servlet/SelectBKUServlet.java | 99 -- .../auth/servlet/StartAuthenticationServlet.java | 103 -- .../servlet/VerifyAuthenticationBlockServlet.java | 120 -- .../id/auth/servlet/VerifyIdentityLinkServlet.java | 107 -- .../CreateXMLSignatureResponseValidator.java | 274 ---- .../id/auth/validator/IdentityLinkValidator.java | 159 --- .../moa/id/auth/validator/InfoboxValidator.java | 32 - .../moa/id/auth/validator/ValidateException.java | 35 - .../VerifyXMLSignatureResponseValidator.java | 177 --- .../moa/id/config/ConfigurationBuilder.java | 894 ------------ .../moa/id/config/ConfigurationException.java | 31 - .../moa/id/config/ConfigurationProvider.java | 128 -- .../moa/id/config/ConnectionParameter.java | 106 -- .../gv/egovernment/moa/id/config/OAParameter.java | 76 -- .../id/config/auth/AuthConfigurationProvider.java | 414 ------ .../moa/id/config/auth/OAAuthParameter.java | 268 ---- .../moa/id/config/auth/VerifyInfoboxParameter.java | 360 ----- .../id/config/auth/VerifyInfoboxParameters.java | 135 -- .../moa/id/config/proxy/OAConfiguration.java | 173 --- .../moa/id/config/proxy/OAProxyParameter.java | 184 --- .../id/config/proxy/ProxyConfigurationBuilder.java | 268 ---- .../config/proxy/ProxyConfigurationProvider.java | 188 --- .../moa/id/data/AuthenticationData.java | 394 ------ .../src/at/gv/egovernment/moa/id/data/Cookie.java | 119 -- .../gv/egovernment/moa/id/data/CookieManager.java | 114 -- .../egovernment/moa/id/data/IssuerAndSerial.java | 111 -- .../at/gv/egovernment/moa/id/data/SAMLStatus.java | 59 - .../id/iaik/config/CertStoreConfigurationImpl.java | 96 -- .../moa/id/iaik/config/LoggerConfigImpl.java | 51 - .../moa/id/iaik/config/PKIConfigurationImpl.java | 66 - .../iaik/config/RevocationConfigurationImpl.java | 36 - .../iaik/config/ValidationConfigurationImpl.java | 51 - .../moa/id/iaik/pki/PKIProfileImpl.java | 186 --- .../moa/id/iaik/pki/jsse/MOAIDTrustManager.java | 119 -- .../iaik/servertools/observer/ObservableImpl.java | 46 - .../moa/id/proxy/ConnectionBuilder.java | 64 - .../moa/id/proxy/ConnectionBuilderFactory.java | 68 - .../moa/id/proxy/DefaultConnectionBuilder.java | 149 -- .../id/proxy/DefaultLoginParameterResolver.java | 142 -- .../moa/id/proxy/ElakConnectionBuilder.java | 249 ---- .../moa/id/proxy/EnhancedConnectionBuilder.java | 211 --- .../moa/id/proxy/LoginParameterResolver.java | 86 -- .../id/proxy/LoginParameterResolverException.java | 37 - .../id/proxy/LoginParameterResolverFactory.java | 82 -- .../moa/id/proxy/MOAIDProxyInitializer.java | 95 -- .../moa/id/proxy/NotAllowedException.java | 39 - .../XMLLoginParameterResolverEncryptedData.java | 678 ---------- .../proxy/XMLLoginParameterResolverPlainData.java | 422 ------ .../moa/id/proxy/builder/SAMLRequestBuilder.java | 55 - .../proxy/invoke/GetAuthenticationDataInvoker.java | 143 -- .../parser/AuthenticationDataAssertionParser.java | 158 --- .../moa/id/proxy/parser/SAMLResponseParser.java | 100 -- .../moa/id/proxy/servlet/ConfigurationServlet.java | 71 - .../moa/id/proxy/servlet/ProxyException.java | 35 - .../moa/id/proxy/servlet/ProxyServlet.java | 879 ------------ .../moa/id/util/AxisSecureSocketFactory.java | 212 --- .../gv/egovernment/moa/id/util/ECDSAConstants.java | 36 - .../moa/id/util/ECDSAKeyValueConverter.java | 572 -------- .../moa/id/util/HTTPRequestJSPForwarder.java | 76 -- .../at/gv/egovernment/moa/id/util/HTTPUtils.java | 68 - .../moa/id/util/InOrderServletRequestWrapper.java | 374 ------ .../moa/id/util/MOAIDMessageProvider.java | 58 - .../moa/id/util/ParameterInOrderFilter.java | 62 - .../src/at/gv/egovernment/moa/id/util/Random.java | 22 - .../at/gv/egovernment/moa/id/util/SSLUtils.java | 180 --- id.server/src/test/MOAIDTestCase.java | 203 --- .../test/abnahme/A/Test100StartAuthentication.java | 171 --- .../test/abnahme/A/Test200VerifyIdentityLink.java | 369 ----- .../src/test/abnahme/A/Test300VerifyAuthBlock.java | 609 --------- .../abnahme/A/Test400GetAuthenticationData.java | 137 -- .../A/Test500StartAuthenticationServlet.java | 305 ----- .../A/Test600GetAuthenticationDataService.java | 281 ---- id.server/src/test/abnahme/A/Test700SelectBKU.java | 63 - id.server/src/test/abnahme/AbnahmeTestCase.java | 163 --- id.server/src/test/abnahme/AllTests.java | 49 - .../src/test/abnahme/C/Test100Konfiguration.java | 60 - .../abnahme/P/Test100LoginParameterResolver.java | 146 -- .../test/at/gv/egovernment/moa/id/AllTests.java | 41 - .../at/gv/egovernment/moa/id/UnitTestCase.java | 35 - .../moa/id/auth/AuthenticationServerTest.java | 56 - .../moa/id/auth/MOAIDAuthInitialiserTest.java | 47 - .../egovernment/moa/id/auth/builder/AllTests.java | 33 - .../AuthenticationBlockAssertionBuilderTest.java | 47 - .../builder/CreateXMLSignatureBuilderTest.java | 105 -- .../builder/GetIdentityLinkFormBuilderTest.java | 73 - .../builder/InfoboxReadRequestBuilderTest.java | 29 - .../moa/id/auth/builder/PersonDataBuilderTest.java | 51 - .../id/auth/builder/SAMLArtifactBuilderTest.java | 52 - .../VerifyXMLSignatureRequestBuilderTest.java | 93 -- .../moa/id/auth/invoke/MOASPSSTestCase.java | 38 - .../id/auth/invoke/SignatureVerificationTest.java | 166 --- .../egovernment/moa/id/auth/parser/AllTests.java | 29 - .../parser/IdentityLinkAssertionParserTest.java | 137 -- .../auth/parser/InfoboxReadResponseParserTest.java | 67 - .../moa/id/auth/parser/SAMLArtifactParserTest.java | 55 - .../servlet/GetAuthenticationDataServiceTest.java | 91 -- .../auth/MOAIDAuthConfigurationProviderTest.java | 112 -- .../proxy/MOAIDProxyConfigurationProviderTest.java | 127 -- .../at/gv/egovernment/moa/id/proxy/AllTests.java | 31 - .../moa/id/proxy/builder/DOMTreeCompare.java | 462 ------- .../id/proxy/builder/SAMLRequestBuilderTest.java | 32 - .../moa/id/proxy/builder/SAMLRequestCompare.java | 19 - .../id/proxy/parser/SAMLResponseParserTest.java | 180 --- .../gv/egovernment/moa/id/util/SSLUtilsTest.java | 92 -- id.server/src/test/lasttest/Dispatcher.java | 64 - .../src/test/lasttest/HostnameVerifierHack.java | 13 - id.server/src/test/lasttest/LasttestClient.java | 218 --- id.server/src/test/lasttest/TestThread.java | 251 ---- id.templates/.project | 23 - id.templates/build.xml | 32 - id.templates/html/SampleBKUSelectionTemplate.html | 52 - id.templates/html/SampleLogo.gif | Bin 24664 -> 0 bytes id.templates/html/SampleTemplate.html | 62 - id.templates/html/css/display.css | 52 - id.templates/html/css/main.css | 74 - id.templates/html/valid-html401.gif | Bin 2328 -> 0 bytes id.templates/web.xml | 9 - id/oa/src/main/webapp/WEB-INF/web.xml | 9 + id/oa/src/main/webapp/auth.jsp | 48 + id/oa/src/main/webapp/chooseBKU.jsp | 19 + id/oa/src/main/webapp/form.jsp | 20 + id/oa/src/main/webapp/getBKUSelectTag.jsp | 6 + id/oa/src/main/webapp/index.jsp | 60 + id/oa/src/main/webapp/stateful_login.jsp | 29 + .../src/main/webapp/WEB-INF/server-config.wsdd | 29 + id/server/auth/src/main/webapp/WEB-INF/web.xml | 113 ++ id/server/auth/src/main/webapp/errorpage-auth.jsp | 50 + id/server/auth/src/main/webapp/index.jsp | 40 + id/server/auth/src/main/webapp/message-auth.jsp | 20 + .../data/deploy/conf/Catalina/localhost/proxy.xml | 25 + .../data/deploy/conf/moa-id/MOAIdentities.xsd | 59 + .../data/deploy/conf/moa-id/SampleIdentities.xml | 34 + .../conf/moa-id/SampleMOAIDConfiguration.xml | 113 ++ .../conf/moa-id/SampleMOAIDConfigurationProxy.xml | 135 ++ .../SampleMOAIDConfiguration_withTestBKs.xml | 118 ++ .../SampleMOAIDConfiguration_withTestBKsProxy.xml | 138 ++ .../conf/moa-id/SampleMOAWIDConfiguration.xml | 121 ++ .../conf/moa-id/SampleMOAWIDConfigurationProxy.xml | 143 ++ .../SampleMOAWIDConfiguration_withTestBKs.xml | 123 ++ .../SampleMOAWIDConfiguration_withTestBKsProxy.xml | 145 ++ id/server/data/deploy/conf/moa-id/log4j.properties | 25 + .../deploy/conf/moa-id/oa/BasicOAConfiguration.xml | 9 + .../conf/moa-id/oa/HeaderOAConfiguration.xml | 10 + .../deploy/conf/moa-id/oa/ParamOAConfiguration.xml | 10 + .../conf/moa-id/oa/SampleOAConfiguration.xml | 9 + .../conf/moa-id/oa/SamplewbPKOAConfiguration.xml | 9 + .../moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt | 21 + .../SampleBKUSelectionTemplate.html | 44 + .../moa-id/sampleTemplates/SampleTemplate.html | 56 + .../moa-id/transforms/TransformsInfoAuthBlock.xml | 105 ++ .../transforms/TransformsInfoAuthBlockText.xml | 44 + .../TransformsInfoAuthBlockText_deprecated.xml | 49 + .../TransformsInfoAuthBlock_deprecated.xml | 107 ++ .../conf/moa-spss/SampleMOASPSSConfiguration.xml | 79 ++ ...a-signaturdienst-allekunden(pwd=allekunden).p12 | Bin 0 -> 3716 bytes .../keys/common/moa-signaturdienst-allekunden.der | Bin 0 -> 1020 bytes .../moa-signaturdienst-kunde1(pwd=kunde1).p12 | Bin 0 -> 3932 bytes .../keys/customer1/moa-signaturdienst-kunde1.der | Bin 0 -> 920 bytes .../moa-signaturdienst-kunde2(pwd=kunde2).p12 | Bin 0 -> 3908 bytes .../keys/customer2/moa-signaturdienst-kunde2.der | Bin 0 -> 1200 bytes ...a-signaturdienst-strafregisterbescheinigung.p12 | Bin 0 -> 4097 bytes .../moa-spss/profiles/MOAIDTransformAuthBlock.xml | 103 ++ .../profiles/MOAIDTransformAuthBlockText.xml | 42 + .../MOAIDTransformAuthBlockText_deprecated.xml | 47 + .../MOAIDTransformAuthBlock_deprecated.xml | 105 ++ .../customer1/moa-ssl-kunde1(pwd=kunde1).p12 | Bin 0 -> 3926 bytes .../moa-spss/sslKeys/customer1/moa-ssl-kunde1.der | Bin 0 -> 882 bytes .../customer1/trustedServers(pwd=servers).keystore | Bin 0 -> 943 bytes .../customer2/moa-ssl-kunde2(pwd=kunde2).p12 | Bin 0 -> 3926 bytes .../moa-spss/sslKeys/customer2/moa-ssl-kunde2.der | Bin 0 -> 882 bytes .../customer2/trustedServers(pwd=servers).keystore | Bin 0 -> 943 bytes .../sslKeys/server/moa-ssl-server(pwd=server).p12 | Bin 0 -> 3808 bytes .../moa-spss/sslKeys/server/moa-ssl-server.der | Bin 0 -> 877 bytes .../sslKeys/tomcat/tomcat(pwd=server).keystore | Bin 0 -> 5200 bytes .../tomcat/trustedClients(pwd=clients).keystore | Bin 0 -> 988 bytes ...-20041130.SerNo01f6(SecureSignatureKeypair).cer | Bin 0 -> 901 bytes ...-20041215.SerNo021e(SecureSignatureKeypair).cer | Bin 0 -> 901 bytes ...-20050207.SerNo0291(SecureSignatureKeypair).cer | Bin 0 -> 1110 bytes ...-20050207.SerNo210d(SecureSignatureKeypair).cer | Bin 0 -> 1110 bytes ...-20141201.SerNoE243(SecureSignatureKeypair).cer | Bin 0 -> 1111 bytes ...-20141203.SerNoE248(SecureSignatureKeypair).cer | Bin 0 -> 975 bytes ...ignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer | Bin 0 -> 1018 bytes ...t-Sig-01-SN0588(SecureSignatureKeypair_alt).cer | Bin 0 -> 1151 bytes ...011201-20041201.SerNo0213(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...010427-20040427.SerNo006f(CertifiedKeypair).cer | Bin 0 -> 860 bytes ...011212-20041212.SerNo0213(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...011212-20041212.SerNo0218(CertifiedKeypair).cer | Bin 0 -> 861 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...041201-20141201.SerNoe242(CertifiedKeypair).cer | Bin 0 -> 865 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 0 -> 979 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 0 -> 1747 bytes ...bsstelle-TestCACrypt-SN04(CertifiedKeypair).der | 22 + ...elle-TestCASig-SN03(SecureSignatureKeypair).der | Bin 0 -> 914 bytes ...TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer | Bin 0 -> 1136 bytes ...TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer | Bin 0 -> 1136 bytes ...remium-Sig-01SN16f9(SecureSignatureKeypair).cer | Bin 0 -> 1171 bytes ...remium-Sig-01SN484a(SecureSignatureKeypair).cer | Bin 0 -> 1133 bytes ...46(SecureSignatureKeypair_CertifiedKeypair).cer | Bin 0 -> 1076 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 0 -> 1141 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 0 -> 870 bytes ...-20041130.SerNo01f6(SecureSignatureKeypair).cer | Bin 0 -> 901 bytes ...-20041215.SerNo021e(SecureSignatureKeypair).cer | Bin 0 -> 901 bytes ...-20050207.SerNo0291(SecureSignatureKeypair).cer | Bin 0 -> 1110 bytes ...-20050207.SerNo210d(SecureSignatureKeypair).cer | Bin 0 -> 1110 bytes ...-20141201.SerNoE243(SecureSignatureKeypair).cer | Bin 0 -> 1111 bytes ...-20141203.SerNoE248(SecureSignatureKeypair).cer | Bin 0 -> 975 bytes ...011201-20041201.SerNo0213(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...010427-20040427.SerNo006f(CertifiedKeypair).cer | Bin 0 -> 860 bytes ...011212-20041212.SerNo0213(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...011212-20041212.SerNo0218(CertifiedKeypair).cer | Bin 0 -> 861 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...041201-20141201.SerNoe242(CertifiedKeypair).cer | Bin 0 -> 865 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 0 -> 979 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 0 -> 1747 bytes ...46(SecureSignatureKeypair_CertifiedKeypair).cer | Bin 0 -> 1076 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 0 -> 1141 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 0 -> 870 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 0 -> 1205 bytes ...rate-light-03-20051114-20151114.SerNo01AAED.cer | Bin 0 -> 1171 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 0 -> 1205 bytes ...rate-light-03-20051114-20151114.SerNo01AAED.cer | Bin 0 -> 1171 bytes .../data/deploy/templates/LIESMICH_TEMPLATES.txt | 39 + .../data/deploy/templates/moaid-templates.war | Bin 0 -> 32185 bytes id/server/data/deploy/tomcat/server.mod_jk.xml | 162 +++ id/server/data/deploy/tomcat/server.xml | 171 +++ .../tomcat-util-4.1.27-patched/tomcat-util.jar | Bin 0 -> 178544 bytes id/server/data/deploy/tomcat/unix/tomcat-start.sh | 28 + id/server/data/deploy/tomcat/unix/tomcat-stop.sh | 7 + .../data/deploy/tomcat/uriworkermap.properties | 9 + id/server/data/deploy/tomcat/win32/startTomcat.bat | 26 + id/server/data/deploy/tomcat/win32/stopTomcat.bat | 13 + id/server/data/deploy/tomcat/workers.properties | 6 + id/server/doc/Architektur ID.vsd | Bin 0 -> 318464 bytes id/server/doc/MOA ID 1.x.wsdl | 41 + id/server/doc/MOA-ID Feinspezifikation.doc | Bin 0 -> 268288 bytes id/server/doc/MOA-ID-Configuration-1.2.xsd | 350 +++++ id/server/doc/MOA-ID-Configuration-1.3.xsd | 424 ++++++ id/server/doc/MOA-ID-Configuration-1.4.xsd | 505 +++++++ id/server/doc/MOA_ID_1.2_20040315.pdf | Bin 0 -> 577309 bytes id/server/doc/MOA_ID_1.3_20060315.pdf | Bin 0 -> 355156 bytes id/server/doc/MOA_ID_1.4_20070802.pdf | Bin 0 -> 239502 bytes id/server/doc/OID-1-0-3.pdf | Bin 0 -> 347041 bytes id/server/doc/api-doc/allclasses-frame.html | 35 + .../moa/id/AuthenticationException.html | 171 +++ .../moa/id/auth/AuthenticationServer.html | 259 ++++ .../id/auth/class-use/AuthenticationServer.html | 114 ++ .../moa/id/class-use/AuthenticationException.html | 194 +++ .../moa/id/config/proxy/OAConfiguration.html | 526 ++++++++ .../id/config/proxy/class-use/OAConfiguration.html | 126 ++ .../moa/id/data/AuthenticationData.html | 751 +++++++++++ .../moa/id/data/class-use/AuthenticationData.html | 152 +++ .../moa/id/proxy/ConnectionBuilder.html | 204 +++ .../moa/id/proxy/LoginParameterResolver.html | 364 +++++ .../moa/id/proxy/class-use/ConnectionBuilder.html | 91 ++ .../id/proxy/class-use/LoginParameterResolver.html | 91 ++ id/server/doc/api-doc/deprecated-list.html | 89 ++ id/server/doc/api-doc/help-doc.html | 142 ++ id/server/doc/api-doc/index-all.html | 422 ++++++ id/server/doc/api-doc/index.html | 22 + id/server/doc/api-doc/overview-tree.html | 101 ++ id/server/doc/api-doc/package-list | 0 id/server/doc/api-doc/packages.html | 26 + id/server/doc/api-doc/serialized-form.html | 89 ++ id/server/doc/api-doc/stylesheet.css | 29 + id/server/doc/bku-auswahl.20030408.pdf | Bin 0 -> 131587 bytes id/server/doc/cs-sstc-schema-assertion-01.xsd | 194 +++ id/server/doc/cs-sstc-schema-protocol-01.xsd | 127 ++ id/server/doc/moa-id.htm | 7 + id/server/doc/moa_id/api-doc/allclasses-frame.html | 44 + .../doc/moa_id/api-doc/allclasses-noframe.html | 44 + .../moa/id/AuthenticationException.html | 251 ++++ .../moa/id/auth/AuthenticationServer.html | 631 +++++++++ .../id/auth/class-use/AuthenticationServer.html | 172 +++ .../gv/egovernment/moa/id/auth/package-frame.html | 32 + .../egovernment/moa/id/auth/package-summary.html | 148 ++ .../gv/egovernment/moa/id/auth/package-tree.html | 145 ++ .../at/gv/egovernment/moa/id/auth/package-use.html | 162 +++ .../moa/id/class-use/AuthenticationException.html | 228 ++++ .../moa/id/config/proxy/OAConfiguration.html | 613 +++++++++ .../id/config/proxy/class-use/OAConfiguration.html | 184 +++ .../moa/id/config/proxy/package-frame.html | 32 + .../moa/id/config/proxy/package-summary.html | 149 ++ .../moa/id/config/proxy/package-tree.html | 145 ++ .../moa/id/config/proxy/package-use.html | 163 +++ .../moa/id/data/AuthenticationData.html | 906 +++++++++++++ .../moa/id/data/class-use/AuthenticationData.html | 214 +++ .../gv/egovernment/moa/id/data/package-frame.html | 32 + .../egovernment/moa/id/data/package-summary.html | 148 ++ .../gv/egovernment/moa/id/data/package-tree.html | 145 ++ .../at/gv/egovernment/moa/id/data/package-use.html | 181 +++ .../at/gv/egovernment/moa/id/package-frame.html | 32 + .../at/gv/egovernment/moa/id/package-summary.html | 148 ++ .../at/gv/egovernment/moa/id/package-tree.html | 147 ++ .../at/gv/egovernment/moa/id/package-use.html | 162 +++ .../moa/id/proxy/ConnectionBuilder.html | 249 ++++ .../moa/id/proxy/LoginParameterResolver.html | 506 +++++++ .../id/proxy/LoginParameterResolverException.html | 251 ++++ .../moa/id/proxy/NotAllowedException.html | 253 ++++ .../moa/id/proxy/class-use/ConnectionBuilder.html | 136 ++ .../id/proxy/class-use/LoginParameterResolver.html | 136 ++ .../class-use/LoginParameterResolverException.html | 192 +++ .../id/proxy/class-use/NotAllowedException.html | 182 +++ .../gv/egovernment/moa/id/proxy/package-frame.html | 47 + .../egovernment/moa/id/proxy/package-summary.html | 175 +++ .../gv/egovernment/moa/id/proxy/package-tree.html | 154 +++ .../gv/egovernment/moa/id/proxy/package-use.html | 170 +++ id/server/doc/moa_id/api-doc/constant-values.html | 262 ++++ id/server/doc/moa_id/api-doc/deprecated-list.html | 134 ++ id/server/doc/moa_id/api-doc/help-doc.html | 193 +++ id/server/doc/moa_id/api-doc/index-all.html | 462 +++++++ id/server/doc/moa_id/api-doc/index.html | 26 + id/server/doc/moa_id/api-doc/overview-frame.html | 50 + id/server/doc/moa_id/api-doc/overview-summary.html | 165 +++ id/server/doc/moa_id/api-doc/overview-tree.html | 155 +++ id/server/doc/moa_id/api-doc/package-list | 5 + id/server/doc/moa_id/api-doc/packages.html | 37 + id/server/doc/moa_id/api-doc/resources/inherit.gif | Bin 0 -> 57 bytes id/server/doc/moa_id/api-doc/serialized-form.html | 169 +++ id/server/doc/moa_id/api-doc/stylesheet.css | 29 + .../doc/moa_id/examples/BKUSelectionTemplate.html | 52 + id/server/doc/moa_id/examples/ChainingModes.txt | 6 + .../doc/moa_id/examples/IdentityLinkSigners.txt | 9 + .../doc/moa_id/examples/LoginServletExample.txt | 171 +++ .../SampleMOAIDVerifyInfoboxesConfiguration.xml | 148 ++ id/server/doc/moa_id/examples/Template.html | 50 + .../moa_id/examples/TransformsInfoAuthBlock.txt | 35 + .../moa_id/examples/conf/MOA-ID-Configuration.xml | 103 ++ .../doc/moa_id/examples/conf/OAConfBasicAuth.xml | 9 + .../doc/moa_id/examples/conf/OAConfHeaderAuth.xml | 10 + .../doc/moa_id/examples/conf/OAConfParamAuth.xml | 10 + id/server/doc/moa_id/examples/moa-id-env.sh.txt | 15 + id/server/doc/moa_id/examples/startTomcat.bat.txt | 26 + id/server/doc/moa_id/faqs.htm | 217 +++ id/server/doc/moa_id/id-admin.htm | 317 +++++ id/server/doc/moa_id/id-admin_1.htm | 539 ++++++++ id/server/doc/moa_id/id-admin_2.htm | 1417 ++++++++++++++++++++ id/server/doc/moa_id/id-admin_3.htm | 204 +++ id/server/doc/moa_id/id-anwendung.htm | 104 ++ id/server/doc/moa_id/id-anwendung_1.htm | 205 +++ id/server/doc/moa_id/id-anwendung_2.htm | 247 ++++ id/server/doc/moa_id/links.htm | 141 ++ id/server/doc/moa_id/moa-id-ablauf.jpg | Bin 0 -> 15550 bytes id/server/doc/moa_id/moa.htm | 248 ++++ id/server/doc/moa_images/east.gif | Bin 0 -> 966 bytes id/server/doc/moa_images/idle.gif | Bin 0 -> 869 bytes id/server/doc/moa_images/moa_diagramm1.jpg | Bin 0 -> 60602 bytes id/server/doc/moa_images/moa_thema.gif | Bin 0 -> 25120 bytes id/server/doc/moa_images/north.gif | Bin 0 -> 967 bytes id/server/doc/moa_images/pfeil.gif | Bin 0 -> 843 bytes id/server/doc/moa_images/print.gif | Bin 0 -> 211 bytes id/server/doc/moa_images/select.gif | Bin 0 -> 880 bytes id/server/doc/moa_images/south.gif | Bin 0 -> 965 bytes id/server/doc/moa_images/transdot.gif | Bin 0 -> 43 bytes id/server/doc/moa_images/west.gif | Bin 0 -> 966 bytes .../moa/id/AuthenticationException.java | 31 + .../at/gv/egovernment/moa/id/BuildException.java | 34 + .../moa/id/ECDSAConverterException.java | 34 + .../at/gv/egovernment/moa/id/MOAIDException.java | 159 +++ .../at/gv/egovernment/moa/id/ParseException.java | 34 + .../at/gv/egovernment/moa/id/ServiceException.java | 34 + .../moa/id/auth/AuthenticationServer.java | 1019 ++++++++++++++ .../moa/id/auth/AuthenticationSessionCleaner.java | 52 + .../moa/id/auth/MOAIDAuthConstants.java | 75 ++ .../moa/id/auth/MOAIDAuthInitializer.java | 163 +++ .../moa/id/auth/WrongParametersException.java | 21 + .../builder/AuthenticationAssertionBuilder.java | 88 ++ .../AuthenticationBlockAssertionBuilder.java | 146 ++ .../AuthenticationDataAssertionBuilder.java | 156 +++ .../moa/id/auth/builder/BPKBuilder.java | 49 + .../egovernment/moa/id/auth/builder/Builder.java | 59 + .../CertInfoVerifyXMLSignatureRequestBuilder.java | 84 ++ .../builder/CreateXMLSignatureRequestBuilder.java | 93 ++ .../moa/id/auth/builder/DataURLBuilder.java | 83 ++ .../auth/builder/GetIdentityLinkFormBuilder.java | 150 +++ .../id/auth/builder/InfoboxReadRequestBuilder.java | 86 ++ .../builder/InfoboxValidatorParamsBuilder.java | 82 ++ .../moa/id/auth/builder/PersonDataBuilder.java | 59 + .../moa/id/auth/builder/SAMLArtifactBuilder.java | 60 + .../moa/id/auth/builder/SAMLResponseBuilder.java | 91 ++ .../moa/id/auth/builder/SelectBKUFormBuilder.java | 63 + .../builder/VerifyXMLSignatureRequestBuilder.java | 206 +++ .../moa/id/auth/data/AuthenticationSession.java | 383 ++++++ .../id/auth/data/CreateXMLSignatureResponse.java | 71 + .../moa/id/auth/data/ExtendedSAMLAttribute.java | 73 + .../id/auth/data/ExtendedSAMLAttributeImpl.java | 137 ++ .../egovernment/moa/id/auth/data/IdentityLink.java | 266 ++++ .../egovernment/moa/id/auth/data/InfoboxToken.java | 65 + .../moa/id/auth/data/InfoboxTokenImpl.java | 129 ++ .../moa/id/auth/data/InfoboxValidationResult.java | 57 + .../id/auth/data/InfoboxValidationResultImpl.java | 101 ++ .../moa/id/auth/data/InfoboxValidatorParams.java | 172 +++ .../id/auth/data/InfoboxValidatorParamsImpl.java | 348 +++++ .../moa/id/auth/data/SAMLAttribute.java | 79 ++ .../at/gv/egovernment/moa/id/auth/data/Schema.java | 26 + .../egovernment/moa/id/auth/data/SchemaImpl.java | 63 + .../id/auth/data/VerifyXMLSignatureResponse.java | 177 +++ .../auth/invoke/SignatureVerificationInvoker.java | 92 ++ .../parser/CreateXMLSignatureResponseParser.java | 193 +++ .../moa/id/auth/parser/ErrorResponseParser.java | 72 + .../parser/ExtendedInfoboxReadResponseParser.java | 157 +++ .../auth/parser/IdentityLinkAssertionParser.java | 319 +++++ .../id/auth/parser/InfoboxReadResponseParser.java | 165 +++ .../moa/id/auth/parser/SAMLArtifactParser.java | 58 + .../parser/VerifyXMLSignatureResponseParser.java | 156 +++ .../moa/id/auth/servlet/AuthServlet.java | 202 +++ .../moa/id/auth/servlet/ConfigurationServlet.java | 75 ++ .../auth/servlet/GetAuthenticationDataService.java | 135 ++ .../moa/id/auth/servlet/SelectBKUServlet.java | 99 ++ .../auth/servlet/StartAuthenticationServlet.java | 103 ++ .../servlet/VerifyAuthenticationBlockServlet.java | 120 ++ .../id/auth/servlet/VerifyIdentityLinkServlet.java | 107 ++ .../CreateXMLSignatureResponseValidator.java | 274 ++++ .../id/auth/validator/IdentityLinkValidator.java | 159 +++ .../moa/id/auth/validator/InfoboxValidator.java | 32 + .../moa/id/auth/validator/ValidateException.java | 35 + .../VerifyXMLSignatureResponseValidator.java | 177 +++ .../moa/id/config/ConfigurationBuilder.java | 894 ++++++++++++ .../moa/id/config/ConfigurationException.java | 31 + .../moa/id/config/ConfigurationProvider.java | 128 ++ .../moa/id/config/ConnectionParameter.java | 106 ++ .../gv/egovernment/moa/id/config/OAParameter.java | 76 ++ .../id/config/auth/AuthConfigurationProvider.java | 414 ++++++ .../moa/id/config/auth/OAAuthParameter.java | 268 ++++ .../moa/id/config/auth/VerifyInfoboxParameter.java | 360 +++++ .../id/config/auth/VerifyInfoboxParameters.java | 135 ++ .../moa/id/config/proxy/OAConfiguration.java | 173 +++ .../moa/id/config/proxy/OAProxyParameter.java | 184 +++ .../id/config/proxy/ProxyConfigurationBuilder.java | 268 ++++ .../config/proxy/ProxyConfigurationProvider.java | 188 +++ .../moa/id/data/AuthenticationData.java | 394 ++++++ .../java/at/gv/egovernment/moa/id/data/Cookie.java | 119 ++ .../gv/egovernment/moa/id/data/CookieManager.java | 114 ++ .../egovernment/moa/id/data/IssuerAndSerial.java | 111 ++ .../at/gv/egovernment/moa/id/data/SAMLStatus.java | 59 + .../id/iaik/config/CertStoreConfigurationImpl.java | 96 ++ .../moa/id/iaik/config/LoggerConfigImpl.java | 51 + .../moa/id/iaik/config/PKIConfigurationImpl.java | 66 + .../iaik/config/RevocationConfigurationImpl.java | 36 + .../iaik/config/ValidationConfigurationImpl.java | 51 + .../moa/id/iaik/pki/PKIProfileImpl.java | 186 +++ .../moa/id/iaik/pki/jsse/MOAIDTrustManager.java | 119 ++ .../iaik/servertools/observer/ObservableImpl.java | 46 + .../moa/id/proxy/ConnectionBuilder.java | 64 + .../moa/id/proxy/ConnectionBuilderFactory.java | 68 + .../moa/id/proxy/DefaultConnectionBuilder.java | 149 ++ .../id/proxy/DefaultLoginParameterResolver.java | 142 ++ .../moa/id/proxy/ElakConnectionBuilder.java | 249 ++++ .../moa/id/proxy/EnhancedConnectionBuilder.java | 211 +++ .../moa/id/proxy/LoginParameterResolver.java | 86 ++ .../id/proxy/LoginParameterResolverException.java | 37 + .../id/proxy/LoginParameterResolverFactory.java | 82 ++ .../moa/id/proxy/MOAIDProxyInitializer.java | 95 ++ .../moa/id/proxy/NotAllowedException.java | 39 + .../XMLLoginParameterResolverEncryptedData.java | 678 ++++++++++ .../proxy/XMLLoginParameterResolverPlainData.java | 422 ++++++ .../moa/id/proxy/builder/SAMLRequestBuilder.java | 55 + .../proxy/invoke/GetAuthenticationDataInvoker.java | 143 ++ .../parser/AuthenticationDataAssertionParser.java | 158 +++ .../moa/id/proxy/parser/SAMLResponseParser.java | 100 ++ .../moa/id/proxy/servlet/ConfigurationServlet.java | 71 + .../moa/id/proxy/servlet/ProxyException.java | 35 + .../moa/id/proxy/servlet/ProxyServlet.java | 879 ++++++++++++ .../moa/id/util/AxisSecureSocketFactory.java | 212 +++ .../gv/egovernment/moa/id/util/ECDSAConstants.java | 36 + .../moa/id/util/ECDSAKeyValueConverter.java | 572 ++++++++ .../moa/id/util/HTTPRequestJSPForwarder.java | 76 ++ .../at/gv/egovernment/moa/id/util/HTTPUtils.java | 68 + .../moa/id/util/InOrderServletRequestWrapper.java | 374 ++++++ .../moa/id/util/MOAIDMessageProvider.java | 58 + .../moa/id/util/ParameterInOrderFilter.java | 62 + .../java/at/gv/egovernment/moa/id/util/Random.java | 22 + .../at/gv/egovernment/moa/id/util/SSLUtils.java | 180 +++ .../src/test/java/test/MOAIDTestCase.java | 203 +++ .../test/abnahme/A/Test100StartAuthentication.java | 171 +++ .../test/abnahme/A/Test200VerifyIdentityLink.java | 369 +++++ .../test/abnahme/A/Test300VerifyAuthBlock.java | 609 +++++++++ .../abnahme/A/Test400GetAuthenticationData.java | 137 ++ .../A/Test500StartAuthenticationServlet.java | 305 +++++ .../A/Test600GetAuthenticationDataService.java | 281 ++++ .../test/java/test/abnahme/A/Test700SelectBKU.java | 63 + .../test/java/test/abnahme/AbnahmeTestCase.java | 163 +++ .../src/test/java/test/abnahme/AllTests.java | 49 + .../java/test/abnahme/C/Test100Konfiguration.java | 60 + .../abnahme/P/Test100LoginParameterResolver.java | 146 ++ .../test/at/gv/egovernment/moa/id/AllTests.java | 41 + .../at/gv/egovernment/moa/id/UnitTestCase.java | 35 + .../moa/id/auth/AuthenticationServerTest.java | 56 + .../moa/id/auth/MOAIDAuthInitialiserTest.java | 47 + .../egovernment/moa/id/auth/builder/AllTests.java | 33 + .../AuthenticationBlockAssertionBuilderTest.java | 47 + .../builder/CreateXMLSignatureBuilderTest.java | 105 ++ .../builder/GetIdentityLinkFormBuilderTest.java | 73 + .../builder/InfoboxReadRequestBuilderTest.java | 29 + .../moa/id/auth/builder/PersonDataBuilderTest.java | 51 + .../id/auth/builder/SAMLArtifactBuilderTest.java | 52 + .../VerifyXMLSignatureRequestBuilderTest.java | 93 ++ .../moa/id/auth/invoke/MOASPSSTestCase.java | 38 + .../id/auth/invoke/SignatureVerificationTest.java | 166 +++ .../egovernment/moa/id/auth/parser/AllTests.java | 29 + .../parser/IdentityLinkAssertionParserTest.java | 137 ++ .../auth/parser/InfoboxReadResponseParserTest.java | 67 + .../moa/id/auth/parser/SAMLArtifactParserTest.java | 55 + .../servlet/GetAuthenticationDataServiceTest.java | 91 ++ .../auth/MOAIDAuthConfigurationProviderTest.java | 112 ++ .../proxy/MOAIDProxyConfigurationProviderTest.java | 127 ++ .../at/gv/egovernment/moa/id/proxy/AllTests.java | 31 + .../moa/id/proxy/builder/DOMTreeCompare.java | 462 +++++++ .../id/proxy/builder/SAMLRequestBuilderTest.java | 32 + .../moa/id/proxy/builder/SAMLRequestCompare.java | 19 + .../id/proxy/parser/SAMLResponseParserTest.java | 180 +++ .../gv/egovernment/moa/id/util/SSLUtilsTest.java | 92 ++ .../src/test/java/test/lasttest/Dispatcher.java | 64 + .../java/test/lasttest/HostnameVerifierHack.java | 13 + .../test/java/test/lasttest/LasttestClient.java | 218 +++ .../src/test/java/test/lasttest/TestThread.java | 251 ++++ id/server/proxy/src/main/webapp/WEB-INF/web.xml | 82 ++ .../proxy/src/main/webapp/errorpage-proxy.jsp | 50 + id/server/proxy/src/main/webapp/message-proxy.jsp | 20 + .../resources/properties/id_messages_de.properties | 158 +++ id/server/resources/wsdl/MOA-ID-1.0.wsdl | 40 + id/server/resources/wsdl/MOA-ID-1.x.wsdl | 40 + id/server/resources/wsdl/MOA-SPSS-1.2.xsd | 454 +++++++ .../resources/xmldata/CertInfoDsigSignature.xml | 139 ++ ....apache.axis.components.net.SecureSocketFactory | 1 + .../main/webapp/SampleBKUSelectionTemplate.html | 52 + id/templates/src/main/webapp/SampleLogo.gif | Bin 0 -> 24664 bytes id/templates/src/main/webapp/SampleTemplate.html | 62 + id/templates/src/main/webapp/WEB-INF/web.xml | 9 + id/templates/src/main/webapp/css/display.css | 52 + id/templates/src/main/webapp/css/main.css | 74 + id/templates/src/main/webapp/valid-html401.gif | Bin 0 -> 2328 bytes .../commons-discovery-0.2/commons-discovery.jar | Bin 71442 -> 0 bytes .../commons-logging-1.0.4/commons-logging-api.jar | Bin 26202 -> 0 bytes .../lib/commons-logging-1.0.4/commons-logging.jar | Bin 38015 -> 0 bytes .../iaik-moa-20070503/full/iaik_Pkcs11Provider.jar | Bin 335169 -> 0 bytes .../iaik-moa-20070503/full/iaik_Pkcs11Wrapper.jar | Bin 257600 -> 0 bytes .../api/lib/iaik-moa-20070503/full/iaik_cms.jar | Bin 285185 -> 0 bytes .../api/lib/iaik-moa-20070503/full/iaik_ecc.jar | Bin 127014 -> 0 bytes .../api/lib/iaik-moa-20070503/full/iaik_ixsil.jar | Bin 204092 -> 0 bytes .../lib/iaik-moa-20070503/full/iaik_jce_full.jar | Bin 828817 -> 0 bytes .../lib/iaik-moa-20070503/full/iaik_moa_full.jar | Bin 682332 -> 0 bytes .../full/linux/libpkcs11wrapper.so | Bin 113226 -> 0 bytes .../full/linux_x64/libpkcs11wrapper.so | Bin 119858 -> 0 bytes .../full/signed/iaik_Pkcs11Provider.jar | Bin 350831 -> 0 bytes .../lib/iaik-moa-20070503/full/signed/iaik_ecc.jar | Bin 134782 -> 0 bytes .../full/signed/iaik_jce_full.jar | Bin 837275 -> 0 bytes .../full/solaris_sparc/libpkcs11wrapper.so | Bin 151944 -> 0 bytes .../full/solaris_sparcv9/libpkcs11wrapper.so | Bin 211040 -> 0 bytes .../iaik-moa-20070503/full/win32/pkcs11wrapper.dll | Bin 98304 -> 0 bytes .../full/wince30arm/pkcs11wrapper.dll | Bin 67584 -> 0 bytes .../iaik-moa-20070801/full/iaik_Pkcs11Wrapper.jar | Bin 257600 -> 0 bytes .../api/lib/iaik-moa-20070801/full/iaik_cms.jar | Bin 285185 -> 0 bytes .../api/lib/iaik-moa-20070801/full/iaik_ixsil.jar | Bin 204098 -> 0 bytes .../lib/iaik-moa-20070801/full/iaik_moa_full.jar | Bin 692493 -> 0 bytes .../full/linux/libpkcs11wrapper.so | Bin 113226 -> 0 bytes .../full/linux_x64/libpkcs11wrapper.so | Bin 119858 -> 0 bytes .../full/signed/iaik_Pkcs11Provider.jar | Bin 350831 -> 0 bytes .../lib/iaik-moa-20070801/full/signed/iaik_ecc.jar | Bin 134782 -> 0 bytes .../full/signed/iaik_jce_full.jar | Bin 837275 -> 0 bytes .../full/solaris_sparc/libpkcs11wrapper.so | Bin 151944 -> 0 bytes .../full/solaris_sparcv9/libpkcs11wrapper.so | Bin 211040 -> 0 bytes .../iaik-moa-20070801/full/win32/pkcs11wrapper.dll | Bin 98304 -> 0 bytes .../full/wince30arm/pkcs11wrapper.dll | Bin 67584 -> 0 bytes .../clients/api/lib/jaxen-1.0/jaxen-core.jar | Bin 160967 -> 0 bytes .../clients/api/lib/jaxen-1.0/jaxen-dom.jar | Bin 13707 -> 0 bytes .../clients/api/lib/jaxen-1.0/saxpath.jar | Bin 23563 -> 0 bytes spss.handbook/clients/api/lib/jaxp-1.2_01/dom.jar | Bin 26710 -> 0 bytes .../clients/api/lib/jaxp-1.2_01/jaxp-api.jar | Bin 27052 -> 0 bytes spss.handbook/clients/api/lib/jaxp-1.2_01/sax.jar | Bin 26206 -> 0 bytes .../clients/api/lib/log4j-1.2.7/log4j-1.2.7.jar | Bin 350677 -> 0 bytes .../api/lib/postgres-jdbc2-7.3/pg73jdbc2.jar | Bin 163980 -> 0 bytes .../clients/api/lib/xalan-j-2.5.1/xalan.jar | Bin 2907319 -> 0 bytes .../clients/api/signatures/SimpleSignature.xml | 23 - .../handbook/clients/api/CreateXMLSignature.java | 130 -- .../handbook/clients/api/VerifyXMLSignature.java | 147 -- .../clients/common/referencedData/Text.b64 | 1 - .../clients/common/referencedData/Text.txt | 1 - .../clients/common/referencedData/WEB-INF/web.xml | 10 - .../common/referencedData/XMLDocument.Para.xsl | 19 - .../common/referencedData/XMLDocument.signed.xml | 27 - .../XMLDocument.withResolvableSchemaHint.xml | 6 - .../referencedData/XMLDocument.withSchemaHint.xml | 6 - .../clients/common/referencedData/XMLDocument.xml | 6 - .../clients/common/referencedData/XMLDocument.xsd | 15 - .../clients/common/referencedData/XMLDocument.xsl | 18 - .../common/referencedData/XMLDocumentRef.xsl | 4 - .../common/referencedData/referencedData.war | Bin 5601 -> 0 bytes .../clients/webservice/conf/http.properties | 74 - .../clients/webservice/lib/axis-1_1/axis-ant.jar | Bin 385010 -> 0 bytes .../clients/webservice/lib/axis-1_1/axis.jar | Bin 1235721 -> 0 bytes .../webservice/lib/axis-1_1/commons-discovery.jar | Bin 71442 -> 0 bytes .../lib/axis-1_1/commons-logging-api.jar | Bin 26202 -> 0 bytes .../webservice/lib/axis-1_1/commons-logging.jar | Bin 38015 -> 0 bytes .../clients/webservice/lib/axis-1_1/jaxrpc.jar | Bin 35759 -> 0 bytes .../webservice/lib/axis-1_1/log4j-1.2.8.jar | Bin 352668 -> 0 bytes .../clients/webservice/lib/axis-1_1/saaj.jar | Bin 18501 -> 0 bytes .../clients/webservice/lib/axis-1_1/wsdl4j.jar | Bin 113853 -> 0 bytes .../webservice/lib/jsse-1_0_3/jsse-1_0_3.jcert.jar | Bin 11321 -> 0 bytes .../webservice/lib/jsse-1_0_3/jsse-1_0_3.jnet.jar | Bin 5830 -> 0 bytes .../webservice/lib/jsse-1_0_3/jsse-1_0_3.jsse.jar | Bin 512635 -> 0 bytes .../webservice/lib/xerces-j-2.4.0/xercesImpl.jar | Bin 895924 -> 0 bytes .../lib/xerces-j-2.4.0/xmlParserAPIs.jar | Bin 123705 -> 0 bytes .../CreateXMLSignatureRequest.Refs.resp.xml | 31 - .../requests/CreateXMLSignatureRequest.Refs.xml | 137 -- .../CreateXMLSignatureRequest.Simple.resp.xml | 23 - .../requests/CreateXMLSignatureRequest.Simple.xml | 19 - .../CreateXMLSignatureRequest.Supplements.resp.xml | 29 - .../CreateXMLSignatureRequest.Supplements.xml | 40 - .../CreateXMLSignatureRequest.Transforms.resp.xml | 39 - .../CreateXMLSignatureRequest.Transforms.xml | 52 - .../VerifyCMSSignatureRequest.Extended.resp.xml | 29 - .../VerifyCMSSignatureRequest.Extended.xml | 44 - .../VerifyCMSSignatureRequest.Simple.resp.xml | 29 - .../requests/VerifyCMSSignatureRequest.Simple.xml | 39 - .../VerifyXMLSignatureRequest.Enveloped.resp.xml | 28 - .../VerifyXMLSignatureRequest.Enveloped.xml | 10 - .../VerifyXMLSignatureRequest.SigManifest.resp.xml | 24 - .../VerifyXMLSignatureRequest.SigManifest.xml | 50 - .../VerifyXMLSignatureRequest.Simple.resp.xml | 23 - .../requests/VerifyXMLSignatureRequest.Simple.xml | 30 - .../VerifyXMLSignatureRequest.Supplements.resp.xml | 23 - ...ifyXMLSignatureRequest.Supplements.response.xml | 23 - .../VerifyXMLSignatureRequest.Supplements.xml | 62 - ...ifyXMLSignatureRequest.XMLDSigManifest.resp.xml | 23 - .../VerifyXMLSignatureRequest.XMLDSigManifest.xml | 31 - ...gnatureRequest.VerifyXML.Enveloped.response.xml | 27 - ...eateXMLSignatureRequest.VerifyXML.Enveloped.xml | 25 - ...atureRequest.VerifyXML.SigManifest.response.xml | 29 - ...teXMLSignatureRequest.VerifyXML.SigManifest.xml | 30 - ...eRequest.VerifyXML.XMLDSigManifest.response.xml | 23 - ...LSignatureRequest.VerifyXML.XMLDSigManifest.xml | 18 - ...LSignatureRequest.Transforms.hashinput.ref2.txt | 8 - .../resources/sslKeys/customer1/moa-ssl-kunde1.der | Bin 882 -> 0 bytes .../customer1/moa-ssl-kunde1[pwd=kunde1].p12 | Bin 3926 -> 0 bytes .../customer1/trustedServers[pwd=servers].keystore | Bin 943 -> 0 bytes .../resources/sslKeys/customer2/moa-ssl-kunde2.der | Bin 882 -> 0 bytes .../customer2/moa-ssl-kunde2[pwd=kunde2].p12 | Bin 3926 -> 0 bytes .../customer2/trustedServers[pwd=servers].keystore | Bin 943 -> 0 bytes .../moa/spss/handbook/clients/webservice/HTTP.java | 204 --- .../clients/webservice/HTTPSClientAuth.java | 122 -- .../clients/webservice/HTTPSServerAuth.java | 125 -- .../C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 | Bin 1385 -> 0 bytes .../E1201A308CC10323C27D9084B048996E44B8F710 | Bin 806 -> 0 bytes .../D44EED7580C7792242D73E267A89C7DB25E4BD08 | Bin 1314 -> 0 bytes .../7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 | Bin 864 -> 0 bytes .../9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 | Bin 1383 -> 0 bytes .../0F843FB1E0C626540BE638B79A2987E2611CE630 | Bin 1018 -> 0 bytes .../69F21C82DC9A7A940ACEC414593E59C9E61E522F | Bin 990 -> 0 bytes .../FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 | Bin 1087 -> 0 bytes .../FB356CEF4406D1F135E3FC59026B338D3F518F9A | Bin 886 -> 0 bytes .../E7340D1FB627D8917A9C0D23F21515C441BF1214 | Bin 1292 -> 0 bytes .../2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D | Bin 820 -> 0 bytes .../9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 | Bin 1151 -> 0 bytes .../49969819654C230ECDF779ABB9629A211FCC43D6 | Bin 1353 -> 0 bytes .../D0AF386E182F00983637F97C0A5F4708F9F641A7 | Bin 1157 -> 0 bytes .../6814C7316CEA7191C9CB3BE58199B4A957210D9C | Bin 704 -> 0 bytes .../C529469053D9F95810A8F7F2DB9A6596A7655732 | Bin 913 -> 0 bytes .../D3C063F219ED073E34AD5D750B327629FFD59AF2 | Bin 979 -> 0 bytes .../1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 | Bin 991 -> 0 bytes .../AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 | Bin 919 -> 0 bytes .../C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 | Bin 1018 -> 0 bytes .../DFAE695342AC81A521025904406884399822B233 | Bin 987 -> 0 bytes .../12B06E039F1A36D8238AFC508009E1ADF88BF66F | Bin 1253 -> 0 bytes .../0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 | Bin 704 -> 0 bytes .../D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D | Bin 914 -> 0 bytes .../88D6151358A5E3C81D7AE1A536121DC03011BC03 | Bin 1205 -> 0 bytes .../B1D0BC027906A3B7E7518C93ACB26D978233ED27 | Bin 1171 -> 0 bytes .../75F792DE2CF544007F470F1B924961C2BD2EF517 | Bin 802 -> 0 bytes .../65698A39E03FF00FD552D4AD99FB290C2B9D4BEA | Bin 1018 -> 0 bytes .../0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F | Bin 861 -> 0 bytes .../51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE | Bin 865 -> 0 bytes .../9E0512DD61DA5949D1D8631C3F19D75F496C3733 | Bin 864 -> 0 bytes .../E6E6FC88719177C9B7421825757C5E47BCAC85F6 | Bin 860 -> 0 bytes .../C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E | Bin 1298 -> 0 bytes .../C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 | Bin 1234 -> 0 bytes .../23E594945195F2414803B4D564D2A3A3F5D88B8C | Bin 791 -> 0 bytes .../65EF37033859C2F709A64086D3A5BD1B8F1A85A4 | Bin 1045 -> 0 bytes .../3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 | Bin 914 -> 0 bytes .../84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E | Bin 1747 -> 0 bytes .../9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA | Bin 1391 -> 0 bytes .../51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 | Bin 1130 -> 0 bytes .../B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F | Bin 1188 -> 0 bytes .../620127A8E5886A4805403977C3EF7D5EAF881526 | Bin 870 -> 0 bytes .../FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 | Bin 1141 -> 0 bytes .../6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B | Bin 1159 -> 0 bytes .../341EA32E448659125A67DD04177FD17468FCFCB1 | Bin 1366 -> 0 bytes .../334710B9169BCD20687A6302EEB16AEB97F288CD | Bin 825 -> 0 bytes .../D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 | Bin 1213 -> 0 bytes .../ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B | Bin 901 -> 0 bytes .../53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 | Bin 1546 -> 0 bytes .../00845B74CA13FE0A9056E6C0B5126FECF73B0D8C | Bin 740 -> 0 bytes .../474BC41135FB88BF58B5A8D976A1D5583378D85E | Bin 1133 -> 0 bytes .../6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 | Bin 1171 -> 0 bytes .../FDC348410699803DE7D8276813BC2232EA99A878 | Bin 835 -> 0 bytes .../BF648929E7DAABD8D97B3202F48D6C4A19C78F6C | Bin 990 -> 0 bytes .../6DCD5118D1542E6C205C580775C5420B7509506B | Bin 1076 -> 0 bytes .../3B8484BF1370941BF03F206B5C4958DA4E1559BB | Bin 1065 -> 0 bytes .../C0EF3E7A54B4C501295F77974B1995E36B25C92B | Bin 1066 -> 0 bytes .../842B3870A64001CDD90978D0E554DAF94D9ABDFE | Bin 947 -> 0 bytes .../679A4F81FC705DDEC419778DD2EBD875F4C242C6 | Bin 975 -> 0 bytes .../53A6B611F8CEE0315BCCE5D59898931ED390E400 | Bin 761 -> 0 bytes .../45B43346251FDF9E95DCB7F36928785D46D63913 | Bin 1136 -> 0 bytes .../E33619C88426E4FE956041E6751ADDEC9C10F0BC | Bin 1136 -> 0 bytes .../35202B14F69409EAA51CD8AB547AC0CD5E993F3F | Bin 1053 -> 0 bytes .../3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 | Bin 1030 -> 0 bytes .../9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B | Bin 932 -> 0 bytes .../A562C4B99E2847251CB4A1F05DA1FF43E7296F0B | Bin 999 -> 0 bytes .../9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C | Bin 997 -> 0 bytes .../9F0E0FBB25F66FF88C8E033EFF358923C84A2926 | Bin 930 -> 0 bytes .../C87D1855227D995C332C4C9072A2E2053F2CC623 | Bin 1028 -> 0 bytes .../42AD1897A4643D2AA634D980F16349E6694F3B1B | Bin 1237 -> 0 bytes .../FE7891B6ED7B178F528A28B21478299F865889BD | Bin 1333 -> 0 bytes .../3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B | Bin 1201 -> 0 bytes .../8784ED81F5A22779EB0B081945FD151992557FBE | Bin 1159 -> 0 bytes .../20CAECDCA766243AAD6FA1327618FC81BA65DC0F | Bin 1057 -> 0 bytes .../96D5D179016A5A6546973BA63733617EE1F1540D | Bin 1058 -> 0 bytes .../DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A | Bin 1110 -> 0 bytes .../E619D25B380B7B13FDA33E8A58CD82D8A88E0515 | Bin 1111 -> 0 bytes .../F825578F8F5484DFB40F81867C392D6CB0012B92 | Bin 1110 -> 0 bytes .../A9D28607928FA8615E2615CC9D71B535C5D0D419 | Bin 734 -> 0 bytes .../4D523730501ADB80A76B0B473A4D21C7D86F8374 | Bin 1167 -> 0 bytes .../AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 | Bin 1339 -> 0 bytes .../07A6DEED70213CCF598F278789680DA4C04A0331 | Bin 1266 -> 0 bytes .../7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 | Bin 920 -> 0 bytes .../D1474E7D99512D05B98DD37B3FE86496A03D088D | Bin 922 -> 0 bytes .../7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 | Bin 700 -> 0 bytes .../DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE | Bin 823 -> 0 bytes .../6955D95F6B0799F7D96F4FC28E6E6C64758C1240 | Bin 1224 -> 0 bytes .../F96FE4F59166EFA9000B21A16EF22CF14468890C | Bin 944 -> 0 bytes .../C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED | Bin 406 -> 0 bytes .../7666A8BD2C2513DE489C06D08D566F177ECE84AA | Bin 1260 -> 0 bytes .../02A0E6456442E35198532ACFFB6FEE3B606D9FA3 | Bin 1366 -> 0 bytes .../8AB0A3519AFA7F3C04074522678BAA1CB3DC734F | Bin 930 -> 0 bytes .../DF47B3040E7632614464BD2EC4ECD1B8030F53E3 | Bin 933 -> 0 bytes .../E117479B4A41D7F3223FCAE50560B0D57B22217D | Bin 997 -> 0 bytes .../07976A2A16EC182670161B46886B05E1FEAC16B1 | Bin 1209 -> 0 bytes .../52ED0FAFBD38A868C678174D7EB03D266ADB221C | Bin 994 -> 0 bytes .../8BA5C0847597612C7E16970EAE55EF58D32E9CF3 | Bin 1202 -> 0 bytes .../27337257493B86B9BFF78D569F938D692A430EAE | Bin 1218 -> 0 bytes .../4832F0A28C3724A92F6CB3314F747D0E74FC7344 | Bin 1217 -> 0 bytes .../B4B77C83465979E3679E3A33F972F48EE3730A18 | Bin 924 -> 0 bytes .../3AAD23B00CA10E54E6368DF7952E3F4B5108B65C | Bin 606 -> 0 bytes .../14E59C02A6877B0EBD2C4203886BA25959C1D267 | Bin 1020 -> 0 bytes .../ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 | Bin 1067 -> 0 bytes .../F3AE9FEA4DECEE5330770A2520BD86909929E7BE | Bin 758 -> 0 bytes .../CAF84A42305615AC2C582F6412BDA3E36DAC3D25 | Bin 786 -> 0 bytes .../D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 | Bin 660 -> 0 bytes .../EC988340526163D5B7AC80481B2AC76828EDDC6C | Bin 1157 -> 0 bytes .../keys/common/moa-signaturdienst-allekunden.der | Bin 1020 -> 0 bytes ...a-signaturdienst-allekunden[pwd=allekunden].p12 | Bin 3716 -> 0 bytes .../keys/customer1/moa-signaturdienst-kunde1.der | Bin 920 -> 0 bytes .../moa-signaturdienst-kunde1[pwd=kunde1].p12 | Bin 3932 -> 0 bytes .../keys/customer2/moa-signaturdienst-kunde2.der | Bin 1200 -> 0 bytes .../moa-signaturdienst-kunde2[pwd=kunde2].p12 | Bin 3908 -> 0 bytes spss.handbook/conf/moa-spss/log4j.properties | 37 - spss.handbook/conf/moa-spss/sp.minimum.config.xml | 44 - spss.handbook/conf/moa-spss/spss.config.xml | 149 -- spss.handbook/conf/moa-spss/ss.minimum.config.xml | 34 - .../moa-spss/sslKeys/server/moa-ssl-server.der | Bin 877 -> 0 bytes .../sslKeys/server/moa-ssl-server[pwd=server].p12 | Bin 3808 -> 0 bytes .../sslKeys/tomcat/tomcat[pwd=server].keystore | Bin 5200 -> 0 bytes .../tomcat/trustedClients[pwd=clients].keystore | Bin 1003 -> 0 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...-Trust-nQual-01.20041201-20141201.SerNoe242.cer | Bin 865 -> 0 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 979 -> 0 bytes ...010427-20040427.SerNo006f[CertifiedKeypair].cer | Bin 860 -> 0 bytes ...011212-20041212.SerNo0213[CertifiedKeypair].cer | Bin 864 -> 0 bytes ...011212-20041212.SerNo0218[CertifiedKeypair].cer | Bin 861 -> 0 bytes ...011206-20041206.SerNo0450[CertifiedKeypair].cer | Bin 1018 -> 0 bytes ...021120-20051120.SerNo16f8[CertifiedKeypair].cer | Bin 1136 -> 0 bytes ...030903-20060903.SerNo4848[CertifiedKeypair].cer | Bin 1136 -> 0 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 1747 -> 0 bytes ...040518-20100101.SerNo0004[CertifiedKeypair].der | 22 - ...-20140326.SerNo6646[SecureSignatureKeypair].cer | Bin 1076 -> 0 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 1141 -> 0 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 870 -> 0 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 864 -> 0 bytes ...-Trust-nQual-01.20041201-20141201.SerNoe242.cer | Bin 865 -> 0 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 979 -> 0 bytes ...010427-20040427.SerNo006f[CertifiedKeypair].cer | Bin 860 -> 0 bytes ...011212-20041212.SerNo0213[CertifiedKeypair].cer | Bin 864 -> 0 bytes ...011212-20041212.SerNo0218[CertifiedKeypair].cer | Bin 861 -> 0 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 1747 -> 0 bytes ...kom.A1-Signatur.20040326-20140326.SerNo6646.cer | Bin 1076 -> 0 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 1141 -> 0 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 870 -> 0 bytes ...traut Kotschy.20070119-20120119.SerNo02de1c.cer | Bin 1385 -> 0 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 1205 -> 0 bytes .../MOA-Test-CA-Signaturdienste.cer | Bin 835 -> 0 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 1205 -> 0 bytes ...rate-light-03-20051114-20151114.SerNo01aaed.der | Bin 1171 -> 0 bytes ...traut Kotschy-20070119-20120119.SerNo02de1c.der | Bin 1385 -> 0 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 1205 -> 0 bytes ...ab-BM-f-Inneres-20040219-20070219.SerNo5c39.der | Bin 1205 -> 0 bytes ...rate-light-03-20051114-20151114.SerNo01aaed.der | Bin 1171 -> 0 bytes ...A-Trust-Qual-01.20041201-20141201.SerNoE243.cer | Bin 1111 -> 0 bytes ...A-Trust-Qual-02.20041203-20141203.SerNoE248.cer | Bin 975 -> 0 bytes ...-20041130.SerNo01f6[SecureSignatureKeypair].cer | Bin 901 -> 0 bytes ...-20041215.SerNo021e[SecureSignatureKeypair].cer | Bin 901 -> 0 bytes ...-20050207.SerNo0291[SecureSignatureKeypair].cer | Bin 1110 -> 0 bytes ...-20050207.SerNo210d[SecureSignatureKeypair].cer | Bin 1110 -> 0 bytes ...-20041206.SerNo0588[SecureSignatureKeypair].cer | Bin 1151 -> 0 bytes ...-20051120.SerNo16f9[SecureSignatureKeypair].cer | Bin 1171 -> 0 bytes ...-20060903.SerNo484a[SecureSignatureKeypair].cer | Bin 1133 -> 0 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 1747 -> 0 bytes ...040518-20100101.SerNo0003[CertifiedKeypair].der | Bin 914 -> 0 bytes ...-20140326.SerNo6646[SecureSignatureKeypair].cer | Bin 1076 -> 0 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 1141 -> 0 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 870 -> 0 bytes ...-20141201.SerNoE243[SecureSignatureKeypair].cer | Bin 1111 -> 0 bytes ...-20141203.SerNoE248[SecureSignatureKeypair].cer | Bin 975 -> 0 bytes ...-20041130.SerNo01f6[SecureSignatureKeypair].cer | Bin 901 -> 0 bytes ...-20041215.SerNo021e[SecureSignatureKeypair].cer | Bin 901 -> 0 bytes ...-20050207.SerNo0291[SecureSignatureKeypair].cer | Bin 1110 -> 0 bytes ...-20050207.SerNo210d[SecureSignatureKeypair].cer | Bin 1110 -> 0 bytes ...A-Trust-Qual-01.20041201-20141201.SerNoE243.cer | Bin 1111 -> 0 bytes ...A-Trust-Qual-02.20041203-20141203.SerNoE248.cer | Bin 975 -> 0 bytes ...-20041130.SerNo01f6[SecureSignatureKeypair].cer | Bin 901 -> 0 bytes ...-20041215.SerNo021e[SecureSignatureKeypair].cer | Bin 901 -> 0 bytes ...-20050207.SerNo0291[SecureSignatureKeypair].cer | Bin 1110 -> 0 bytes ...-20050207.SerNo210d[SecureSignatureKeypair].cer | Bin 1110 -> 0 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 1747 -> 0 bytes ...-20140326.SerNo6646[SecureSignatureKeypair].cer | Bin 1076 -> 0 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 1141 -> 0 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 870 -> 0 bytes .../moa-spss/trustProfiles/test/signaturdienst.der | Bin 914 -> 0 bytes spss.handbook/handbook.html | 6 - spss.handbook/handbook/common/LogoBKA.png | Bin 8062 -> 0 bytes .../handbook/common/LogoMoa4c.3148x3545.jpg | Bin 1584855 -> 0 bytes spss.handbook/handbook/common/LogoMoa4c.jpg | Bin 45624 -> 0 bytes spss.handbook/handbook/common/LogoMoaBw.jpg | Bin 41375 -> 0 bytes spss.handbook/handbook/common/MOA.css | 300 ----- .../handbook/config/MOA-SPSS-config-1.3.xsd | 254 ---- spss.handbook/handbook/config/config.html | 1014 -------------- spss.handbook/handbook/faq/faq.html | 126 -- spss.handbook/handbook/index.html | 34 - spss.handbook/handbook/install/install.html | 486 ------- spss.handbook/handbook/intro/intro.html | 44 - spss.handbook/handbook/spec/MOA-SPSS-1.3.pdf | Bin 146062 -> 0 bytes spss.handbook/handbook/spec/MOA-SPSS-1.3.wsdl | 105 -- spss.handbook/handbook/spec/MOA-SPSS-1.3.xsd | 469 ------- spss.handbook/handbook/usage/usage.html | 1236 ----------------- spss.server/data/deploy/tomcat/server.mod_jk.xml | 166 --- spss.server/data/deploy/tomcat/server.xml | 169 --- spss.server/data/deploy/tomcat/unix/moa-env.sh | 12 - .../data/deploy/tomcat/uriworkermap.properties | 4 - .../data/deploy/tomcat/win32/startTomcat.bat | 27 - .../data/deploy/tomcat/win32/stopTomcat.bat | 13 - spss.server/data/deploy/tomcat/workers.properties | 6 - spss.server/data/deploy/tools/certtool.bat | 25 - spss.server/data/deploy/tools/certtool.sh | 20 - spss.server/data/deploy/tools/configtool.bat | 25 - spss.server/data/deploy/tools/configtool.sh | 20 - spss.server/licenses/Apache-2.0.txt | 202 --- spss.server/licenses/IAIK-License.txt | 13 - spss.server/licenses/Jaxen.txt | 40 - spss.server/licenses/PostgreSQL-JDBC.txt | 26 - .../properties/spss_messages_de.properties | 151 --- spss.server/res/resources/security/cacerts | Bin 7365 -> 0 bytes .../res/resources/tools/ConfigurationMapper.xsl | 343 ----- spss.server/res/resources/wsdl/MOA-SPSS-1.3.wsdl | 105 -- spss.server/res/resources/wsdl/MOA-SPSS-1.3.xsd | 469 ------- spss.server/server-config.wsdd | 48 - spss.server/spec/MOA-SPSS-1.3.doc | Bin 559616 -> 0 bytes .../moa/spss/MOAApplicationException.java | 41 - .../at/gv/egovernment/moa/spss/MOAException.java | 161 --- .../egovernment/moa/spss/MOARuntimeException.java | 163 --- .../egovernment/moa/spss/MOASystemException.java | 40 - .../gv/egovernment/moa/spss/api/Configurator.java | 60 - .../gv/egovernment/moa/spss/api/SPSSFactory.java | 1012 -------------- .../moa/spss/api/SignatureCreationService.java | 57 - .../moa/spss/api/SignatureVerificationService.java | 69 - .../moa/spss/api/cmsverify/CMSContent.java | 28 - .../spss/api/cmsverify/CMSContentExcplicit.java | 19 - .../spss/api/cmsverify/CMSContentReference.java | 17 - .../moa/spss/api/cmsverify/CMSDataObject.java | 25 - .../api/cmsverify/VerifyCMSSignatureRequest.java | 52 - .../api/cmsverify/VerifyCMSSignatureResponse.java | 21 - .../VerifyCMSSignatureResponseElement.java | 32 - .../moa/spss/api/common/Base64Transform.java | 13 - .../spss/api/common/CanonicalizationTransform.java | 17 - .../moa/spss/api/common/CheckResult.java | 25 - .../egovernment/moa/spss/api/common/Content.java | 47 - .../moa/spss/api/common/ContentBinary.java | 21 - .../moa/spss/api/common/ContentLocRef.java | 17 - .../moa/spss/api/common/ContentReference.java | 11 - .../moa/spss/api/common/ContentXML.java | 19 - .../moa/spss/api/common/ElementSelector.java | 28 - .../api/common/EnvelopedSignatureTransform.java | 15 - .../common/ExclusiveCanonicalizationTransform.java | 27 - .../egovernment/moa/spss/api/common/InputData.java | 47 - .../egovernment/moa/spss/api/common/MetaInfo.java | 37 - .../moa/spss/api/common/SignerInfo.java | 43 - .../egovernment/moa/spss/api/common/Transform.java | 16 - .../moa/spss/api/common/X509IssuerSerial.java | 25 - .../spss/api/common/XMLDataObjectAssociation.java | 25 - .../moa/spss/api/common/XPathFilter.java | 38 - .../moa/spss/api/common/XPathFilter2Transform.java | 25 - .../moa/spss/api/common/XPathTransform.java | 30 - .../moa/spss/api/common/XSLTTransform.java | 23 - .../moa/spss/api/impl/Base64TransformImpl.java | 22 - .../moa/spss/api/impl/CMSContentExplicitImpl.java | 40 - .../moa/spss/api/impl/CMSContentReferenceImpl.java | 38 - .../moa/spss/api/impl/CMSDataObjectImpl.java | 46 - .../api/impl/CanonicalizationTransformImpl.java | 25 - .../moa/spss/api/impl/CheckResultImpl.java | 52 - .../moa/spss/api/impl/ContentBinaryImpl.java | 40 - .../egovernment/moa/spss/api/impl/ContentImpl.java | 28 - .../moa/spss/api/impl/ContentLocRefImpl.java | 44 - .../moa/spss/api/impl/ContentReferenceImpl.java | 24 - .../moa/spss/api/impl/ContentXMLImpl.java | 40 - ...ateSignatureEnvironmentProfileExplicitImpl.java | 66 - .../CreateSignatureEnvironmentProfileIDImpl.java | 39 - .../moa/spss/api/impl/CreateSignatureInfoImpl.java | 50 - .../spss/api/impl/CreateSignatureLocationImpl.java | 31 - .../spss/api/impl/CreateTransformsInfoImpl.java | 51 - .../CreateTransformsInfoProfileExplicitImpl.java | 62 - .../impl/CreateTransformsInfoProfileIDImpl.java | 38 - .../api/impl/CreateXMLSignatureRequestImpl.java | 53 - .../api/impl/CreateXMLSignatureResponseImpl.java | 37 - .../moa/spss/api/impl/DataObjectInfoImpl.java | 79 -- .../moa/spss/api/impl/ElementSelectorImpl.java | 47 - .../api/impl/EnvelopedSignatureTransformImpl.java | 22 - .../moa/spss/api/impl/ErrorResponseImpl.java | 52 - .../ExclusiveCanonicalizationTransformImpl.java | 48 - .../moa/spss/api/impl/InputDataBinaryImpl.java | 99 -- .../moa/spss/api/impl/InputDataXMLImpl.java | 99 -- .../spss/api/impl/ManifestRefsCheckResultImpl.java | 44 - .../api/impl/ManifestRefsCheckResultInfoImpl.java | 32 - .../moa/spss/api/impl/MetaInfoImpl.java | 75 -- .../moa/spss/api/impl/ReferenceInfoImpl.java | 38 - .../spss/api/impl/ReferencesCheckResultImpl.java | 46 - .../api/impl/ReferencesCheckResultInfoImpl.java | 46 - .../moa/spss/api/impl/SPSSFactoryImpl.java | 568 -------- .../api/impl/SignatureEnvironmentResponseImpl.java | 41 - .../api/impl/SignatureManifestCheckParamsImpl.java | 52 - .../moa/spss/api/impl/SignerInfoImpl.java | 81 -- .../moa/spss/api/impl/SingleSignatureInfoImpl.java | 49 - .../api/impl/SupplementProfileExplicitImpl.java | 39 - .../moa/spss/api/impl/SupplementProfileIDImpl.java | 37 - .../moa/spss/api/impl/TransformImpl.java | 26 - .../api/impl/TransformParameterBinaryImpl.java | 42 - .../moa/spss/api/impl/TransformParameterImpl.java | 25 - .../spss/api/impl/TransformParameterURIImpl.java | 24 - .../spss/api/impl/TransformPatameterHashImpl.java | 54 - .../api/impl/VerifyCMSSignatureRequestImpl.java | 93 -- .../VerifyCMSSignatureResponseElementImpl.java | 62 - .../api/impl/VerifyCMSSinatureResponseImpl.java | 37 - .../moa/spss/api/impl/VerifySignatureInfoImpl.java | 47 - .../spss/api/impl/VerifySignatureLocationImpl.java | 15 - .../spss/api/impl/VerifyTransformsDataImpl.java | 36 - .../VerifyTransformsInfoProfileExplicitImpl.java | 61 - .../impl/VerifyTransformsInfoProfileIDImpl.java | 38 - .../api/impl/VerifyXMLSignatureRequestImpl.java | 113 -- .../api/impl/VerifyXMLSignatureResponseImpl.java | 141 -- .../moa/spss/api/impl/X509IssuerSerialImpl.java | 45 - .../api/impl/XMLDataObjectAssociationImpl.java | 45 - .../spss/api/impl/XPathFilter2TransformImpl.java | 43 - .../moa/spss/api/impl/XPathFilterImpl.java | 64 - .../moa/spss/api/impl/XPathTransformImpl.java | 59 - .../moa/spss/api/impl/XSLTransformImpl.java | 37 - .../xmlbind/CreateXMLSignatureRequestParser.java | 288 ---- .../xmlbind/CreateXMLSignatureResponseBuilder.java | 119 -- .../moa/spss/api/xmlbind/ProfileParser.java | 285 ---- .../moa/spss/api/xmlbind/RequestParserUtils.java | 157 --- .../moa/spss/api/xmlbind/ResponseBuilderUtils.java | 206 --- .../moa/spss/api/xmlbind/TransformParser.java | 246 ---- .../xmlbind/VerifyCMSSignatureRequestParser.java | 169 --- .../xmlbind/VerifyCMSSignatureResponseBuilder.java | 101 -- .../xmlbind/VerifyXMLSignatureRequestParser.java | 275 ---- .../xmlbind/VerifyXMLSignatureResponseBuilder.java | 310 ----- .../xmlsign/CreateSignatureEnvironmentProfile.java | 30 - .../CreateSignatureEnvironmentProfileExplicit.java | 30 - .../CreateSignatureEnvironmentProfileID.java | 20 - .../moa/spss/api/xmlsign/CreateSignatureInfo.java | 25 - .../spss/api/xmlsign/CreateSignatureLocation.java | 23 - .../moa/spss/api/xmlsign/CreateTransformsInfo.java | 27 - .../api/xmlsign/CreateTransformsInfoProfile.java | 28 - .../CreateTransformsInfoProfileExplicit.java | 26 - .../api/xmlsign/CreateTransformsInfoProfileID.java | 18 - .../api/xmlsign/CreateXMLSignatureRequest.java | 26 - .../api/xmlsign/CreateXMLSignatureResponse.java | 20 - .../xmlsign/CreateXMLSignatureResponseElement.java | 29 - .../moa/spss/api/xmlsign/DataObjectInfo.java | 48 - .../moa/spss/api/xmlsign/ErrorResponse.java | 24 - .../api/xmlsign/SignatureEnvironmentResponse.java | 20 - .../moa/spss/api/xmlsign/SingleSignatureInfo.java | 32 - .../api/xmlverify/ManifestRefsCheckResult.java | 24 - .../api/xmlverify/ManifestRefsCheckResultInfo.java | 19 - .../moa/spss/api/xmlverify/ReferenceInfo.java | 19 - .../spss/api/xmlverify/ReferencesCheckResult.java | 23 - .../api/xmlverify/ReferencesCheckResultInfo.java | 25 - .../xmlverify/SignatureManifestCheckParams.java | 26 - .../moa/spss/api/xmlverify/SupplementProfile.java | 28 - .../api/xmlverify/SupplementProfileExplicit.java | 19 - .../spss/api/xmlverify/SupplementProfileID.java | 18 - .../moa/spss/api/xmlverify/TransformParameter.java | 40 - .../api/xmlverify/TransformParameterBinary.java | 21 - .../spss/api/xmlverify/TransformParameterHash.java | 26 - .../spss/api/xmlverify/TransformParameterURI.java | 12 - .../spss/api/xmlverify/VerifySignatureInfo.java | 27 - .../api/xmlverify/VerifySignatureLocation.java | 13 - .../api/xmlverify/VerifyTransformsInfoProfile.java | 28 - .../VerifyTransformsInfoProfileExplicit.java | 25 - .../xmlverify/VerifyTransformsInfoProfileID.java | 18 - .../api/xmlverify/VerifyXMLSignatureRequest.java | 55 - .../api/xmlverify/VerifyXMLSignatureResponse.java | 60 - .../src/at/gv/egovernment/moa/spss/overview.htm | 155 --- .../spss/server/config/CRLDistributionPoint.java | 165 --- .../spss/server/config/ConfigurationException.java | 34 - .../server/config/ConfigurationPartsBuilder.java | 1239 ----------------- .../spss/server/config/ConfigurationProvider.java | 689 ---------- .../moa/spss/server/config/DistributionPoint.java | 38 - .../spss/server/config/HardwareCryptoModule.java | 60 - .../moa/spss/server/config/HardwareKeyModule.java | 59 - .../moa/spss/server/config/IssuerAndSerial.java | 125 -- .../moa/spss/server/config/KeyGroup.java | 69 - .../moa/spss/server/config/KeyGroupEntry.java | 106 -- .../moa/spss/server/config/KeyModule.java | 41 - .../spss/server/config/OCSPDistributionPoint.java | 33 - .../moa/spss/server/config/SoftwareKeyModule.java | 48 - .../moa/spss/server/config/TrustProfile.java | 58 - .../CMSSignatureVerificationProfileImpl.java | 37 - .../config/AbstractKeyModuleConfigurationImpl.java | 36 - .../config/AbstractObservableConfiguration.java | 48 - .../iaik/config/ArchiveConfigurationImpl.java | 97 -- .../moa/spss/server/iaik/config/CRLRetriever.java | 69 - .../iaik/config/CertStoreConfigurationImpl.java | 50 - .../server/iaik/config/ConfigurationDataImpl.java | 121 -- .../iaik/config/DataBaseArchiveParameterImpl.java | 33 - .../config/DirectoryCertStoreParametersImpl.java | 81 -- .../HardwareCryptoModuleConfigurationImpl.java | 51 - .../config/HardwareKeyModuleConfigurationImpl.java | 55 - .../spss/server/iaik/config/IaikConfigurator.java | 173 --- .../spss/server/iaik/config/LoggerConfigImpl.java | 34 - .../server/iaik/config/PKIConfigurationImpl.java | 80 -- .../iaik/config/RevocationConfigurationImpl.java | 53 - .../config/SoftwareKeyModuleConfigurationImpl.java | 75 -- .../iaik/config/ValidationConfigurationImpl.java | 56 - .../moa/spss/server/iaik/pki/PKIProfileImpl.java | 116 -- .../pki/pathvalidation/ValidationProfileImpl.java | 107 -- .../iaik/pki/revocation/RevocationProfileImpl.java | 64 - .../store/truststore/TrustStoreProfileImpl.java | 135 -- .../server/iaik/xml/Base64TransformationImpl.java | 43 - .../server/iaik/xml/ByteArrayDataObjectImpl.java | 54 - .../server/iaik/xml/ByteStreamDataObjectImpl.java | 49 - .../spss/server/iaik/xml/CanonicalizationImpl.java | 43 - .../moa/spss/server/iaik/xml/DataObjectImpl.java | 87 -- .../xml/EnvelopedSignatureTransformationImpl.java | 42 - .../iaik/xml/ExclusiveCanonicalizationImpl.java | 76 -- .../moa/spss/server/iaik/xml/SigningTimeImpl.java | 34 - .../spss/server/iaik/xml/TransformationImpl.java | 43 - .../spss/server/iaik/xml/XMLDataObjectImpl.java | 46 - .../server/iaik/xml/XMLNodeListDataObjectImpl.java | 47 - .../moa/spss/server/iaik/xml/XMLSignatureImpl.java | 43 - .../moa/spss/server/iaik/xml/XPath2FilterImpl.java | 116 -- .../server/iaik/xml/XPath2TransformationImpl.java | 82 -- .../server/iaik/xml/XPathTransformationImpl.java | 98 -- .../server/iaik/xml/XSLTTransformationImpl.java | 168 --- .../iaik/xmlsign/DataObjectTreatmentImpl.java | 150 --- .../xmlsign/XMLSignatureCreationProfileImpl.java | 279 ---- .../xmlsign/XMLSignatureInsertionLocationImpl.java | 45 - .../XMLSignatureVerificationProfileImpl.java | 131 -- .../moa/spss/server/init/ConfiguratorImpl.java | 42 - .../moa/spss/server/init/SystemInitializer.java | 129 -- .../invoke/CMSSignatureVerificationInvoker.java | 221 --- .../CMSSignatureVerificationProfileFactory.java | 61 - .../invoke/CreateXMLSignatureResponseBuilder.java | 71 - .../moa/spss/server/invoke/DataObjectFactory.java | 892 ------------ .../spss/server/invoke/ExternalURIResolver.java | 162 --- .../spss/server/invoke/IaikExceptionMapper.java | 267 ---- .../moa/spss/server/invoke/InvokerUtils.java | 63 - .../moa/spss/server/invoke/ProfileMapper.java | 249 ---- .../spss/server/invoke/ServiceContextUtils.java | 51 - .../invoke/SignatureCreationServiceImpl.java | 45 - .../invoke/SignatureVerificationServiceImpl.java | 72 - .../spss/server/invoke/TransformationFactory.java | 258 ---- .../invoke/VerifyCMSSignatureResponseBuilder.java | 86 -- .../invoke/VerifyXMLSignatureResponseBuilder.java | 437 ------ .../server/invoke/XMLSignatureCreationInvoker.java | 545 -------- .../invoke/XMLSignatureCreationProfileFactory.java | 455 ------- .../invoke/XMLSignatureVerificationInvoker.java | 675 ---------- .../XMLSignatureVerificationProfileFactory.java | 144 -- .../moa/spss/server/logging/IaikLog.java | 126 -- .../moa/spss/server/logging/IaikLogFactory.java | 42 - .../moa/spss/server/logging/IaikLogMsg.java | 54 - .../moa/spss/server/logging/TransactionId.java | 38 - .../moa/spss/server/service/AxisHandler.java | 382 ------ .../spss/server/service/ConfigurationServlet.java | 120 -- .../server/service/RevocationArchiveCleaner.java | 78 -- .../moa/spss/server/service/ServiceUtils.java | 72 - .../server/service/SignatureCreationService.java | 104 -- .../service/SignatureVerificationService.java | 151 --- .../moa/spss/server/tools/CertTool.java | 242 ---- .../moa/spss/server/tools/ConfigTool.java | 59 - .../server/transaction/TransactionContext.java | 264 ---- .../transaction/TransactionContextManager.java | 62 - .../server/transaction/TransactionIDGenerator.java | 51 - .../moa/spss/server/util/IdGenerator.java | 61 - .../egovernment/moa/spss/util/MessageProvider.java | 65 - .../test/at/gv/egovernment/moa/spss/AllTests.java | 40 - .../at/gv/egovernment/moa/spss/SPSSTestCase.java | 82 -- .../egovernment/moa/spss/api/xmlbind/AllTests.java | 24 - .../CreateXMLSignatureRequestParserTest.java | 71 - .../moa/spss/api/xmlbind/TransformParserTest.java | 113 -- .../VerifyCMSSignatureRequestParserTest.java | 61 - .../VerifyXMLSignatureRequestParserTest.java | 81 -- .../moa/spss/server/config/AllTests.java | 20 - .../server/config/ConfigurationProviderTest1.java | 377 ------ .../server/config/ConfigurationProviderTest2.java | 225 ---- .../server/config/ConfigurationProviderTest3.java | 166 --- .../iaik/config/ConfigurationDataImplTest.java | 149 -- .../server/iaik/config/IaikConfiguratorTest.java | 36 - .../moa/spss/server/invoke/AllTests.java | 25 - .../CMSSignatureVerificationInvokerTest.java | 63 - .../spss/server/invoke/DataObjectFactoryTest.java | 180 --- .../server/invoke/TransformationFactoryTest.java | 201 --- .../invoke/XMLSignatureCreationInvokerTest.java | 63 - .../XMLSignatureVerificationInvokerTest.java | 61 - .../moa/spss/server/tools/CertToolTest.java | 50 - spss.server/web.xml | 55 - .../C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 | Bin 0 -> 1385 bytes .../E1201A308CC10323C27D9084B048996E44B8F710 | Bin 0 -> 806 bytes .../D44EED7580C7792242D73E267A89C7DB25E4BD08 | Bin 0 -> 1314 bytes .../7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 | Bin 0 -> 864 bytes .../9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 | Bin 0 -> 1383 bytes .../0F843FB1E0C626540BE638B79A2987E2611CE630 | Bin 0 -> 1018 bytes .../69F21C82DC9A7A940ACEC414593E59C9E61E522F | Bin 0 -> 990 bytes .../FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 | Bin 0 -> 1087 bytes .../FB356CEF4406D1F135E3FC59026B338D3F518F9A | Bin 0 -> 886 bytes .../E7340D1FB627D8917A9C0D23F21515C441BF1214 | Bin 0 -> 1292 bytes .../2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D | Bin 0 -> 820 bytes .../9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 | Bin 0 -> 1151 bytes .../49969819654C230ECDF779ABB9629A211FCC43D6 | Bin 0 -> 1353 bytes .../D0AF386E182F00983637F97C0A5F4708F9F641A7 | Bin 0 -> 1157 bytes .../6814C7316CEA7191C9CB3BE58199B4A957210D9C | Bin 0 -> 704 bytes .../C529469053D9F95810A8F7F2DB9A6596A7655732 | Bin 0 -> 913 bytes .../D3C063F219ED073E34AD5D750B327629FFD59AF2 | Bin 0 -> 979 bytes .../1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 | Bin 0 -> 991 bytes .../AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 | Bin 0 -> 919 bytes .../C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 | Bin 0 -> 1018 bytes .../DFAE695342AC81A521025904406884399822B233 | Bin 0 -> 987 bytes .../12B06E039F1A36D8238AFC508009E1ADF88BF66F | Bin 0 -> 1253 bytes .../0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 | Bin 0 -> 704 bytes .../D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D | Bin 0 -> 914 bytes .../88D6151358A5E3C81D7AE1A536121DC03011BC03 | Bin 0 -> 1205 bytes .../B1D0BC027906A3B7E7518C93ACB26D978233ED27 | Bin 0 -> 1171 bytes .../75F792DE2CF544007F470F1B924961C2BD2EF517 | Bin 0 -> 802 bytes .../65698A39E03FF00FD552D4AD99FB290C2B9D4BEA | Bin 0 -> 1018 bytes .../0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F | Bin 0 -> 861 bytes .../51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE | Bin 0 -> 865 bytes .../9E0512DD61DA5949D1D8631C3F19D75F496C3733 | Bin 0 -> 864 bytes .../E6E6FC88719177C9B7421825757C5E47BCAC85F6 | Bin 0 -> 860 bytes .../C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E | Bin 0 -> 1298 bytes .../C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 | Bin 0 -> 1234 bytes .../23E594945195F2414803B4D564D2A3A3F5D88B8C | Bin 0 -> 791 bytes .../65EF37033859C2F709A64086D3A5BD1B8F1A85A4 | Bin 0 -> 1045 bytes .../3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 | Bin 0 -> 914 bytes .../84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E | Bin 0 -> 1747 bytes .../9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA | Bin 0 -> 1391 bytes .../51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 | Bin 0 -> 1130 bytes .../B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F | Bin 0 -> 1188 bytes .../620127A8E5886A4805403977C3EF7D5EAF881526 | Bin 0 -> 870 bytes .../FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 | Bin 0 -> 1141 bytes .../6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B | Bin 0 -> 1159 bytes .../341EA32E448659125A67DD04177FD17468FCFCB1 | Bin 0 -> 1366 bytes .../334710B9169BCD20687A6302EEB16AEB97F288CD | Bin 0 -> 825 bytes .../D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 | Bin 0 -> 1213 bytes .../ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B | Bin 0 -> 901 bytes .../53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 | Bin 0 -> 1546 bytes .../00845B74CA13FE0A9056E6C0B5126FECF73B0D8C | Bin 0 -> 740 bytes .../474BC41135FB88BF58B5A8D976A1D5583378D85E | Bin 0 -> 1133 bytes .../6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 | Bin 0 -> 1171 bytes .../FDC348410699803DE7D8276813BC2232EA99A878 | Bin 0 -> 835 bytes .../BF648929E7DAABD8D97B3202F48D6C4A19C78F6C | Bin 0 -> 990 bytes .../6DCD5118D1542E6C205C580775C5420B7509506B | Bin 0 -> 1076 bytes .../3B8484BF1370941BF03F206B5C4958DA4E1559BB | Bin 0 -> 1065 bytes .../C0EF3E7A54B4C501295F77974B1995E36B25C92B | Bin 0 -> 1066 bytes .../842B3870A64001CDD90978D0E554DAF94D9ABDFE | Bin 0 -> 947 bytes .../679A4F81FC705DDEC419778DD2EBD875F4C242C6 | Bin 0 -> 975 bytes .../53A6B611F8CEE0315BCCE5D59898931ED390E400 | Bin 0 -> 761 bytes .../45B43346251FDF9E95DCB7F36928785D46D63913 | Bin 0 -> 1136 bytes .../E33619C88426E4FE956041E6751ADDEC9C10F0BC | Bin 0 -> 1136 bytes .../35202B14F69409EAA51CD8AB547AC0CD5E993F3F | Bin 0 -> 1053 bytes .../3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 | Bin 0 -> 1030 bytes .../9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B | Bin 0 -> 932 bytes .../A562C4B99E2847251CB4A1F05DA1FF43E7296F0B | Bin 0 -> 999 bytes .../9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C | Bin 0 -> 997 bytes .../9F0E0FBB25F66FF88C8E033EFF358923C84A2926 | Bin 0 -> 930 bytes .../C87D1855227D995C332C4C9072A2E2053F2CC623 | Bin 0 -> 1028 bytes .../42AD1897A4643D2AA634D980F16349E6694F3B1B | Bin 0 -> 1237 bytes .../FE7891B6ED7B178F528A28B21478299F865889BD | Bin 0 -> 1333 bytes .../3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B | Bin 0 -> 1201 bytes .../8784ED81F5A22779EB0B081945FD151992557FBE | Bin 0 -> 1159 bytes .../20CAECDCA766243AAD6FA1327618FC81BA65DC0F | Bin 0 -> 1057 bytes .../96D5D179016A5A6546973BA63733617EE1F1540D | Bin 0 -> 1058 bytes .../DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A | Bin 0 -> 1110 bytes .../E619D25B380B7B13FDA33E8A58CD82D8A88E0515 | Bin 0 -> 1111 bytes .../F825578F8F5484DFB40F81867C392D6CB0012B92 | Bin 0 -> 1110 bytes .../A9D28607928FA8615E2615CC9D71B535C5D0D419 | Bin 0 -> 734 bytes .../4D523730501ADB80A76B0B473A4D21C7D86F8374 | Bin 0 -> 1167 bytes .../AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 | Bin 0 -> 1339 bytes .../07A6DEED70213CCF598F278789680DA4C04A0331 | Bin 0 -> 1266 bytes .../7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 | Bin 0 -> 920 bytes .../D1474E7D99512D05B98DD37B3FE86496A03D088D | Bin 0 -> 922 bytes .../7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 | Bin 0 -> 700 bytes .../DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE | Bin 0 -> 823 bytes .../6955D95F6B0799F7D96F4FC28E6E6C64758C1240 | Bin 0 -> 1224 bytes .../F96FE4F59166EFA9000B21A16EF22CF14468890C | Bin 0 -> 944 bytes .../C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED | Bin 0 -> 406 bytes .../7666A8BD2C2513DE489C06D08D566F177ECE84AA | Bin 0 -> 1260 bytes .../02A0E6456442E35198532ACFFB6FEE3B606D9FA3 | Bin 0 -> 1366 bytes .../8AB0A3519AFA7F3C04074522678BAA1CB3DC734F | Bin 0 -> 930 bytes .../DF47B3040E7632614464BD2EC4ECD1B8030F53E3 | Bin 0 -> 933 bytes .../E117479B4A41D7F3223FCAE50560B0D57B22217D | Bin 0 -> 997 bytes .../07976A2A16EC182670161B46886B05E1FEAC16B1 | Bin 0 -> 1209 bytes .../52ED0FAFBD38A868C678174D7EB03D266ADB221C | Bin 0 -> 994 bytes .../8BA5C0847597612C7E16970EAE55EF58D32E9CF3 | Bin 0 -> 1202 bytes .../27337257493B86B9BFF78D569F938D692A430EAE | Bin 0 -> 1218 bytes .../4832F0A28C3724A92F6CB3314F747D0E74FC7344 | Bin 0 -> 1217 bytes .../B4B77C83465979E3679E3A33F972F48EE3730A18 | Bin 0 -> 924 bytes .../3AAD23B00CA10E54E6368DF7952E3F4B5108B65C | Bin 0 -> 606 bytes .../14E59C02A6877B0EBD2C4203886BA25959C1D267 | Bin 0 -> 1020 bytes .../ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 | Bin 0 -> 1067 bytes .../F3AE9FEA4DECEE5330770A2520BD86909929E7BE | Bin 0 -> 758 bytes .../CAF84A42305615AC2C582F6412BDA3E36DAC3D25 | Bin 0 -> 786 bytes .../D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 | Bin 0 -> 660 bytes .../EC988340526163D5B7AC80481B2AC76828EDDC6C | Bin 0 -> 1157 bytes .../keys/common/moa-signaturdienst-allekunden.der | Bin 0 -> 1020 bytes ...a-signaturdienst-allekunden[pwd=allekunden].p12 | Bin 0 -> 3716 bytes .../keys/customer1/moa-signaturdienst-kunde1.der | Bin 0 -> 920 bytes .../moa-signaturdienst-kunde1[pwd=kunde1].p12 | Bin 0 -> 3932 bytes .../keys/customer2/moa-signaturdienst-kunde2.der | Bin 0 -> 1200 bytes .../moa-signaturdienst-kunde2[pwd=kunde2].p12 | Bin 0 -> 3908 bytes spss/handbook/conf/moa-spss/log4j.properties | 37 + spss/handbook/conf/moa-spss/sp.minimum.config.xml | 44 + spss/handbook/conf/moa-spss/spss.config.xml | 149 ++ spss/handbook/conf/moa-spss/ss.minimum.config.xml | 34 + .../moa-spss/sslKeys/server/moa-ssl-server.der | Bin 0 -> 877 bytes .../sslKeys/server/moa-ssl-server[pwd=server].p12 | Bin 0 -> 3808 bytes .../sslKeys/tomcat/tomcat[pwd=server].keystore | Bin 0 -> 5200 bytes .../tomcat/trustedClients[pwd=clients].keystore | Bin 0 -> 1003 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...-Trust-nQual-01.20041201-20141201.SerNoe242.cer | Bin 0 -> 865 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 0 -> 979 bytes ...010427-20040427.SerNo006f[CertifiedKeypair].cer | Bin 0 -> 860 bytes ...011212-20041212.SerNo0213[CertifiedKeypair].cer | Bin 0 -> 864 bytes ...011212-20041212.SerNo0218[CertifiedKeypair].cer | Bin 0 -> 861 bytes ...011206-20041206.SerNo0450[CertifiedKeypair].cer | Bin 0 -> 1018 bytes ...021120-20051120.SerNo16f8[CertifiedKeypair].cer | Bin 0 -> 1136 bytes ...030903-20060903.SerNo4848[CertifiedKeypair].cer | Bin 0 -> 1136 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 0 -> 1747 bytes ...040518-20100101.SerNo0004[CertifiedKeypair].der | 22 + ...-20140326.SerNo6646[SecureSignatureKeypair].cer | Bin 0 -> 1076 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 0 -> 1141 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 0 -> 870 bytes ...040326-20070326.SerNo6632(CertifiedKeypair).cer | Bin 0 -> 864 bytes ...-Trust-nQual-01.20041201-20141201.SerNoe242.cer | Bin 0 -> 865 bytes ...rust-nQual-03.20050817-20150817.SerNo016c1e.cer | Bin 0 -> 979 bytes ...010427-20040427.SerNo006f[CertifiedKeypair].cer | Bin 0 -> 860 bytes ...011212-20041212.SerNo0213[CertifiedKeypair].cer | Bin 0 -> 864 bytes ...011212-20041212.SerNo0218[CertifiedKeypair].cer | Bin 0 -> 861 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 0 -> 1747 bytes ...kom.A1-Signatur.20040326-20140326.SerNo6646.cer | Bin 0 -> 1076 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 0 -> 1141 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 0 -> 870 bytes ...traut Kotschy.20070119-20120119.SerNo02de1c.cer | Bin 0 -> 1385 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 0 -> 1205 bytes .../MOA-Test-CA-Signaturdienste.cer | Bin 0 -> 835 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 0 -> 1205 bytes ...rate-light-03-20051114-20151114.SerNo01aaed.der | Bin 0 -> 1171 bytes ...traut Kotschy-20070119-20120119.SerNo02de1c.der | Bin 0 -> 1385 bytes ...Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer | Bin 0 -> 1205 bytes ...ab-BM-f-Inneres-20040219-20070219.SerNo5c39.der | Bin 0 -> 1205 bytes ...rate-light-03-20051114-20151114.SerNo01aaed.der | Bin 0 -> 1171 bytes ...A-Trust-Qual-01.20041201-20141201.SerNoE243.cer | Bin 0 -> 1111 bytes ...A-Trust-Qual-02.20041203-20141203.SerNoE248.cer | Bin 0 -> 975 bytes ...-20041130.SerNo01f6[SecureSignatureKeypair].cer | Bin 0 -> 901 bytes ...-20041215.SerNo021e[SecureSignatureKeypair].cer | Bin 0 -> 901 bytes ...-20050207.SerNo0291[SecureSignatureKeypair].cer | Bin 0 -> 1110 bytes ...-20050207.SerNo210d[SecureSignatureKeypair].cer | Bin 0 -> 1110 bytes ...-20041206.SerNo0588[SecureSignatureKeypair].cer | Bin 0 -> 1151 bytes ...-20051120.SerNo16f9[SecureSignatureKeypair].cer | Bin 0 -> 1171 bytes ...-20060903.SerNo484a[SecureSignatureKeypair].cer | Bin 0 -> 1133 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 0 -> 1747 bytes ...040518-20100101.SerNo0003[CertifiedKeypair].der | Bin 0 -> 914 bytes ...-20140326.SerNo6646[SecureSignatureKeypair].cer | Bin 0 -> 1076 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 0 -> 1141 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 0 -> 870 bytes ...-20141201.SerNoE243[SecureSignatureKeypair].cer | Bin 0 -> 1111 bytes ...-20141203.SerNoE248[SecureSignatureKeypair].cer | Bin 0 -> 975 bytes ...-20041130.SerNo01f6[SecureSignatureKeypair].cer | Bin 0 -> 901 bytes ...-20041215.SerNo021e[SecureSignatureKeypair].cer | Bin 0 -> 901 bytes ...-20050207.SerNo0291[SecureSignatureKeypair].cer | Bin 0 -> 1110 bytes ...-20050207.SerNo210d[SecureSignatureKeypair].cer | Bin 0 -> 1110 bytes ...A-Trust-Qual-01.20041201-20141201.SerNoE243.cer | Bin 0 -> 1111 bytes ...A-Trust-Qual-02.20041203-20141203.SerNoE248.cer | Bin 0 -> 975 bytes ...-20041130.SerNo01f6[SecureSignatureKeypair].cer | Bin 0 -> 901 bytes ...-20041215.SerNo021e[SecureSignatureKeypair].cer | Bin 0 -> 901 bytes ...-20050207.SerNo0291[SecureSignatureKeypair].cer | Bin 0 -> 1110 bytes ...-20050207.SerNo210d[SecureSignatureKeypair].cer | Bin 0 -> 1110 bytes ...band oesterr. Sozialvers.,CN=Root-CA 1-2045.der | Bin 0 -> 1747 bytes ...-20140326.SerNo6646[SecureSignatureKeypair].cer | Bin 0 -> 1076 bytes ...m_A1-Signatur_20060912-20110912_SerNo027866.cer | Bin 0 -> 1141 bytes ...kom_A1-Signatur_20070501-20120501_SerNo6650.cer | Bin 0 -> 870 bytes .../moa-spss/trustProfiles/test/signaturdienst.der | Bin 0 -> 914 bytes spss/handbook/handbook.html | 6 + spss/handbook/handbook/common/LogoBKA.png | Bin 0 -> 8062 bytes .../handbook/common/LogoMoa4c.3148x3545.jpg | Bin 0 -> 1584855 bytes spss/handbook/handbook/common/LogoMoa4c.jpg | Bin 0 -> 45624 bytes spss/handbook/handbook/common/LogoMoaBw.jpg | Bin 0 -> 41375 bytes spss/handbook/handbook/common/MOA.css | 300 +++++ .../handbook/config/MOA-SPSS-config-1.3.xsd | 254 ++++ spss/handbook/handbook/config/config.html | 1014 ++++++++++++++ spss/handbook/handbook/faq/faq.html | 126 ++ spss/handbook/handbook/index.html | 34 + spss/handbook/handbook/install/install.html | 486 +++++++ spss/handbook/handbook/intro/intro.html | 44 + spss/handbook/handbook/spec/MOA-SPSS-1.3.pdf | Bin 0 -> 146062 bytes spss/handbook/handbook/spec/MOA-SPSS-1.3.wsdl | 105 ++ spss/handbook/handbook/spec/MOA-SPSS-1.3.xsd | 469 +++++++ spss/handbook/handbook/usage/usage.html | 1236 +++++++++++++++++ .../resources/data/deploy/tomcat/server.mod_jk.xml | 166 +++ .../resources/data/deploy/tomcat/server.xml | 169 +++ .../resources/data/deploy/tomcat/unix/moa-env.sh | 12 + .../data/deploy/tomcat/uriworkermap.properties | 4 + .../data/deploy/tomcat/win32/startTomcat.bat | 27 + .../data/deploy/tomcat/win32/stopTomcat.bat | 13 + .../data/deploy/tomcat/workers.properties | 6 + .../resources/data/deploy/tools/certtool.bat | 25 + .../resources/data/deploy/tools/certtool.sh | 20 + .../resources/data/deploy/tools/configtool.bat | 25 + .../resources/data/deploy/tools/configtool.sh | 20 + .../serverlib/resources/licenses/Apache-2.0.txt | 202 +++ .../serverlib/resources/licenses/IAIK-License.txt | 13 + spss/server/serverlib/resources/licenses/Jaxen.txt | 40 + .../resources/licenses/PostgreSQL-JDBC.txt | 26 + .../moa/spss/MOAApplicationException.java | 41 + .../at/gv/egovernment/moa/spss/MOAException.java | 161 +++ .../egovernment/moa/spss/MOARuntimeException.java | 163 +++ .../egovernment/moa/spss/MOASystemException.java | 40 + .../gv/egovernment/moa/spss/api/Configurator.java | 60 + .../gv/egovernment/moa/spss/api/SPSSFactory.java | 1012 ++++++++++++++ .../moa/spss/api/SignatureCreationService.java | 57 + .../moa/spss/api/SignatureVerificationService.java | 69 + .../moa/spss/api/cmsverify/CMSContent.java | 28 + .../spss/api/cmsverify/CMSContentExcplicit.java | 19 + .../spss/api/cmsverify/CMSContentReference.java | 17 + .../moa/spss/api/cmsverify/CMSDataObject.java | 25 + .../api/cmsverify/VerifyCMSSignatureRequest.java | 52 + .../api/cmsverify/VerifyCMSSignatureResponse.java | 21 + .../VerifyCMSSignatureResponseElement.java | 32 + .../moa/spss/api/common/Base64Transform.java | 13 + .../spss/api/common/CanonicalizationTransform.java | 17 + .../moa/spss/api/common/CheckResult.java | 25 + .../egovernment/moa/spss/api/common/Content.java | 47 + .../moa/spss/api/common/ContentBinary.java | 21 + .../moa/spss/api/common/ContentLocRef.java | 17 + .../moa/spss/api/common/ContentReference.java | 11 + .../moa/spss/api/common/ContentXML.java | 19 + .../moa/spss/api/common/ElementSelector.java | 28 + .../api/common/EnvelopedSignatureTransform.java | 15 + .../common/ExclusiveCanonicalizationTransform.java | 27 + .../egovernment/moa/spss/api/common/InputData.java | 47 + .../egovernment/moa/spss/api/common/MetaInfo.java | 37 + .../moa/spss/api/common/SignerInfo.java | 43 + .../egovernment/moa/spss/api/common/Transform.java | 16 + .../moa/spss/api/common/X509IssuerSerial.java | 25 + .../spss/api/common/XMLDataObjectAssociation.java | 25 + .../moa/spss/api/common/XPathFilter.java | 38 + .../moa/spss/api/common/XPathFilter2Transform.java | 25 + .../moa/spss/api/common/XPathTransform.java | 30 + .../moa/spss/api/common/XSLTTransform.java | 23 + .../moa/spss/api/impl/Base64TransformImpl.java | 22 + .../moa/spss/api/impl/CMSContentExplicitImpl.java | 40 + .../moa/spss/api/impl/CMSContentReferenceImpl.java | 38 + .../moa/spss/api/impl/CMSDataObjectImpl.java | 46 + .../api/impl/CanonicalizationTransformImpl.java | 25 + .../moa/spss/api/impl/CheckResultImpl.java | 52 + .../moa/spss/api/impl/ContentBinaryImpl.java | 40 + .../egovernment/moa/spss/api/impl/ContentImpl.java | 28 + .../moa/spss/api/impl/ContentLocRefImpl.java | 44 + .../moa/spss/api/impl/ContentReferenceImpl.java | 24 + .../moa/spss/api/impl/ContentXMLImpl.java | 40 + ...ateSignatureEnvironmentProfileExplicitImpl.java | 66 + .../CreateSignatureEnvironmentProfileIDImpl.java | 39 + .../moa/spss/api/impl/CreateSignatureInfoImpl.java | 50 + .../spss/api/impl/CreateSignatureLocationImpl.java | 31 + .../spss/api/impl/CreateTransformsInfoImpl.java | 51 + .../CreateTransformsInfoProfileExplicitImpl.java | 62 + .../impl/CreateTransformsInfoProfileIDImpl.java | 38 + .../api/impl/CreateXMLSignatureRequestImpl.java | 53 + .../api/impl/CreateXMLSignatureResponseImpl.java | 37 + .../moa/spss/api/impl/DataObjectInfoImpl.java | 79 ++ .../moa/spss/api/impl/ElementSelectorImpl.java | 47 + .../api/impl/EnvelopedSignatureTransformImpl.java | 22 + .../moa/spss/api/impl/ErrorResponseImpl.java | 52 + .../ExclusiveCanonicalizationTransformImpl.java | 48 + .../moa/spss/api/impl/InputDataBinaryImpl.java | 99 ++ .../moa/spss/api/impl/InputDataXMLImpl.java | 99 ++ .../spss/api/impl/ManifestRefsCheckResultImpl.java | 44 + .../api/impl/ManifestRefsCheckResultInfoImpl.java | 32 + .../moa/spss/api/impl/MetaInfoImpl.java | 75 ++ .../moa/spss/api/impl/ReferenceInfoImpl.java | 38 + .../spss/api/impl/ReferencesCheckResultImpl.java | 46 + .../api/impl/ReferencesCheckResultInfoImpl.java | 46 + .../moa/spss/api/impl/SPSSFactoryImpl.java | 568 ++++++++ .../api/impl/SignatureEnvironmentResponseImpl.java | 41 + .../api/impl/SignatureManifestCheckParamsImpl.java | 52 + .../moa/spss/api/impl/SignerInfoImpl.java | 81 ++ .../moa/spss/api/impl/SingleSignatureInfoImpl.java | 49 + .../api/impl/SupplementProfileExplicitImpl.java | 39 + .../moa/spss/api/impl/SupplementProfileIDImpl.java | 37 + .../moa/spss/api/impl/TransformImpl.java | 26 + .../api/impl/TransformParameterBinaryImpl.java | 42 + .../moa/spss/api/impl/TransformParameterImpl.java | 25 + .../spss/api/impl/TransformParameterURIImpl.java | 24 + .../spss/api/impl/TransformPatameterHashImpl.java | 54 + .../api/impl/VerifyCMSSignatureRequestImpl.java | 93 ++ .../VerifyCMSSignatureResponseElementImpl.java | 62 + .../api/impl/VerifyCMSSinatureResponseImpl.java | 37 + .../moa/spss/api/impl/VerifySignatureInfoImpl.java | 47 + .../spss/api/impl/VerifySignatureLocationImpl.java | 15 + .../spss/api/impl/VerifyTransformsDataImpl.java | 36 + .../VerifyTransformsInfoProfileExplicitImpl.java | 61 + .../impl/VerifyTransformsInfoProfileIDImpl.java | 38 + .../api/impl/VerifyXMLSignatureRequestImpl.java | 113 ++ .../api/impl/VerifyXMLSignatureResponseImpl.java | 141 ++ .../moa/spss/api/impl/X509IssuerSerialImpl.java | 45 + .../api/impl/XMLDataObjectAssociationImpl.java | 45 + .../spss/api/impl/XPathFilter2TransformImpl.java | 43 + .../moa/spss/api/impl/XPathFilterImpl.java | 64 + .../moa/spss/api/impl/XPathTransformImpl.java | 59 + .../moa/spss/api/impl/XSLTransformImpl.java | 37 + .../xmlbind/CreateXMLSignatureRequestParser.java | 288 ++++ .../xmlbind/CreateXMLSignatureResponseBuilder.java | 119 ++ .../moa/spss/api/xmlbind/ProfileParser.java | 285 ++++ .../moa/spss/api/xmlbind/RequestParserUtils.java | 157 +++ .../moa/spss/api/xmlbind/ResponseBuilderUtils.java | 206 +++ .../moa/spss/api/xmlbind/TransformParser.java | 246 ++++ .../xmlbind/VerifyCMSSignatureRequestParser.java | 169 +++ .../xmlbind/VerifyCMSSignatureResponseBuilder.java | 101 ++ .../xmlbind/VerifyXMLSignatureRequestParser.java | 275 ++++ .../xmlbind/VerifyXMLSignatureResponseBuilder.java | 310 +++++ .../xmlsign/CreateSignatureEnvironmentProfile.java | 30 + .../CreateSignatureEnvironmentProfileExplicit.java | 30 + .../CreateSignatureEnvironmentProfileID.java | 20 + .../moa/spss/api/xmlsign/CreateSignatureInfo.java | 25 + .../spss/api/xmlsign/CreateSignatureLocation.java | 23 + .../moa/spss/api/xmlsign/CreateTransformsInfo.java | 27 + .../api/xmlsign/CreateTransformsInfoProfile.java | 28 + .../CreateTransformsInfoProfileExplicit.java | 26 + .../api/xmlsign/CreateTransformsInfoProfileID.java | 18 + .../api/xmlsign/CreateXMLSignatureRequest.java | 26 + .../api/xmlsign/CreateXMLSignatureResponse.java | 20 + .../xmlsign/CreateXMLSignatureResponseElement.java | 29 + .../moa/spss/api/xmlsign/DataObjectInfo.java | 48 + .../moa/spss/api/xmlsign/ErrorResponse.java | 24 + .../api/xmlsign/SignatureEnvironmentResponse.java | 20 + .../moa/spss/api/xmlsign/SingleSignatureInfo.java | 32 + .../api/xmlverify/ManifestRefsCheckResult.java | 24 + .../api/xmlverify/ManifestRefsCheckResultInfo.java | 19 + .../moa/spss/api/xmlverify/ReferenceInfo.java | 19 + .../spss/api/xmlverify/ReferencesCheckResult.java | 23 + .../api/xmlverify/ReferencesCheckResultInfo.java | 25 + .../xmlverify/SignatureManifestCheckParams.java | 26 + .../moa/spss/api/xmlverify/SupplementProfile.java | 28 + .../api/xmlverify/SupplementProfileExplicit.java | 19 + .../spss/api/xmlverify/SupplementProfileID.java | 18 + .../moa/spss/api/xmlverify/TransformParameter.java | 40 + .../api/xmlverify/TransformParameterBinary.java | 21 + .../spss/api/xmlverify/TransformParameterHash.java | 26 + .../spss/api/xmlverify/TransformParameterURI.java | 12 + .../spss/api/xmlverify/VerifySignatureInfo.java | 27 + .../api/xmlverify/VerifySignatureLocation.java | 13 + .../api/xmlverify/VerifyTransformsInfoProfile.java | 28 + .../VerifyTransformsInfoProfileExplicit.java | 25 + .../xmlverify/VerifyTransformsInfoProfileID.java | 18 + .../api/xmlverify/VerifyXMLSignatureRequest.java | 55 + .../api/xmlverify/VerifyXMLSignatureResponse.java | 60 + .../java/at/gv/egovernment/moa/spss/overview.htm | 155 +++ .../spss/server/config/CRLDistributionPoint.java | 165 +++ .../spss/server/config/ConfigurationException.java | 34 + .../server/config/ConfigurationPartsBuilder.java | 1239 +++++++++++++++++ .../spss/server/config/ConfigurationProvider.java | 689 ++++++++++ .../moa/spss/server/config/DistributionPoint.java | 38 + .../spss/server/config/HardwareCryptoModule.java | 60 + .../moa/spss/server/config/HardwareKeyModule.java | 59 + .../moa/spss/server/config/IssuerAndSerial.java | 125 ++ .../moa/spss/server/config/KeyGroup.java | 69 + .../moa/spss/server/config/KeyGroupEntry.java | 106 ++ .../moa/spss/server/config/KeyModule.java | 41 + .../spss/server/config/OCSPDistributionPoint.java | 33 + .../moa/spss/server/config/SoftwareKeyModule.java | 48 + .../moa/spss/server/config/TrustProfile.java | 58 + .../CMSSignatureVerificationProfileImpl.java | 37 + .../config/AbstractKeyModuleConfigurationImpl.java | 36 + .../config/AbstractObservableConfiguration.java | 48 + .../iaik/config/ArchiveConfigurationImpl.java | 97 ++ .../moa/spss/server/iaik/config/CRLRetriever.java | 69 + .../iaik/config/CertStoreConfigurationImpl.java | 50 + .../server/iaik/config/ConfigurationDataImpl.java | 121 ++ .../iaik/config/DataBaseArchiveParameterImpl.java | 33 + .../config/DirectoryCertStoreParametersImpl.java | 81 ++ .../HardwareCryptoModuleConfigurationImpl.java | 51 + .../config/HardwareKeyModuleConfigurationImpl.java | 55 + .../spss/server/iaik/config/IaikConfigurator.java | 173 +++ .../spss/server/iaik/config/LoggerConfigImpl.java | 34 + .../server/iaik/config/PKIConfigurationImpl.java | 80 ++ .../iaik/config/RevocationConfigurationImpl.java | 53 + .../config/SoftwareKeyModuleConfigurationImpl.java | 75 ++ .../iaik/config/ValidationConfigurationImpl.java | 56 + .../moa/spss/server/iaik/pki/PKIProfileImpl.java | 116 ++ .../pki/pathvalidation/ValidationProfileImpl.java | 107 ++ .../iaik/pki/revocation/RevocationProfileImpl.java | 64 + .../store/truststore/TrustStoreProfileImpl.java | 135 ++ .../server/iaik/xml/Base64TransformationImpl.java | 43 + .../server/iaik/xml/ByteArrayDataObjectImpl.java | 54 + .../server/iaik/xml/ByteStreamDataObjectImpl.java | 49 + .../spss/server/iaik/xml/CanonicalizationImpl.java | 43 + .../moa/spss/server/iaik/xml/DataObjectImpl.java | 87 ++ .../xml/EnvelopedSignatureTransformationImpl.java | 42 + .../iaik/xml/ExclusiveCanonicalizationImpl.java | 76 ++ .../moa/spss/server/iaik/xml/SigningTimeImpl.java | 34 + .../spss/server/iaik/xml/TransformationImpl.java | 43 + .../spss/server/iaik/xml/XMLDataObjectImpl.java | 46 + .../server/iaik/xml/XMLNodeListDataObjectImpl.java | 47 + .../moa/spss/server/iaik/xml/XMLSignatureImpl.java | 43 + .../moa/spss/server/iaik/xml/XPath2FilterImpl.java | 116 ++ .../server/iaik/xml/XPath2TransformationImpl.java | 82 ++ .../server/iaik/xml/XPathTransformationImpl.java | 98 ++ .../server/iaik/xml/XSLTTransformationImpl.java | 168 +++ .../iaik/xmlsign/DataObjectTreatmentImpl.java | 150 +++ .../xmlsign/XMLSignatureCreationProfileImpl.java | 279 ++++ .../xmlsign/XMLSignatureInsertionLocationImpl.java | 45 + .../XMLSignatureVerificationProfileImpl.java | 131 ++ .../moa/spss/server/init/ConfiguratorImpl.java | 42 + .../moa/spss/server/init/SystemInitializer.java | 129 ++ .../invoke/CMSSignatureVerificationInvoker.java | 221 +++ .../CMSSignatureVerificationProfileFactory.java | 61 + .../invoke/CreateXMLSignatureResponseBuilder.java | 71 + .../moa/spss/server/invoke/DataObjectFactory.java | 892 ++++++++++++ .../spss/server/invoke/ExternalURIResolver.java | 162 +++ .../spss/server/invoke/IaikExceptionMapper.java | 267 ++++ .../moa/spss/server/invoke/InvokerUtils.java | 63 + .../moa/spss/server/invoke/ProfileMapper.java | 249 ++++ .../spss/server/invoke/ServiceContextUtils.java | 51 + .../invoke/SignatureCreationServiceImpl.java | 45 + .../invoke/SignatureVerificationServiceImpl.java | 72 + .../spss/server/invoke/TransformationFactory.java | 258 ++++ .../invoke/VerifyCMSSignatureResponseBuilder.java | 86 ++ .../invoke/VerifyXMLSignatureResponseBuilder.java | 437 ++++++ .../server/invoke/XMLSignatureCreationInvoker.java | 545 ++++++++ .../invoke/XMLSignatureCreationProfileFactory.java | 455 +++++++ .../invoke/XMLSignatureVerificationInvoker.java | 675 ++++++++++ .../XMLSignatureVerificationProfileFactory.java | 144 ++ .../moa/spss/server/logging/IaikLog.java | 126 ++ .../moa/spss/server/logging/IaikLogFactory.java | 42 + .../moa/spss/server/logging/IaikLogMsg.java | 54 + .../moa/spss/server/logging/TransactionId.java | 38 + .../moa/spss/server/service/AxisHandler.java | 382 ++++++ .../spss/server/service/ConfigurationServlet.java | 120 ++ .../server/service/RevocationArchiveCleaner.java | 78 ++ .../moa/spss/server/service/ServiceUtils.java | 72 + .../server/service/SignatureCreationService.java | 104 ++ .../service/SignatureVerificationService.java | 151 +++ .../moa/spss/server/tools/CertTool.java | 242 ++++ .../moa/spss/server/tools/ConfigTool.java | 59 + .../server/transaction/TransactionContext.java | 264 ++++ .../transaction/TransactionContextManager.java | 62 + .../server/transaction/TransactionIDGenerator.java | 51 + .../moa/spss/server/util/IdGenerator.java | 61 + .../egovernment/moa/spss/util/MessageProvider.java | 65 + .../properties/spss_messages_de.properties | 151 +++ .../serverlib/src/main/resources/security/cacerts | Bin 0 -> 7365 bytes .../src/main/resources/wsdl/MOA-SPSS-1.3.wsdl | 105 ++ .../src/main/resources/wsdl/MOA-SPSS-1.3.xsd | 469 +++++++ .../test/at/gv/egovernment/moa/spss/AllTests.java | 40 + .../at/gv/egovernment/moa/spss/SPSSTestCase.java | 82 ++ .../egovernment/moa/spss/api/xmlbind/AllTests.java | 24 + .../CreateXMLSignatureRequestParserTest.java | 71 + .../moa/spss/api/xmlbind/TransformParserTest.java | 113 ++ .../VerifyCMSSignatureRequestParserTest.java | 61 + .../VerifyXMLSignatureRequestParserTest.java | 81 ++ .../moa/spss/server/config/AllTests.java | 20 + .../server/config/ConfigurationProviderTest1.java | 377 ++++++ .../server/config/ConfigurationProviderTest2.java | 225 ++++ .../server/config/ConfigurationProviderTest3.java | 166 +++ .../iaik/config/ConfigurationDataImplTest.java | 149 ++ .../server/iaik/config/IaikConfiguratorTest.java | 36 + .../moa/spss/server/invoke/AllTests.java | 25 + .../CMSSignatureVerificationInvokerTest.java | 63 + .../spss/server/invoke/DataObjectFactoryTest.java | 180 +++ .../server/invoke/TransformationFactoryTest.java | 201 +++ .../invoke/XMLSignatureCreationInvokerTest.java | 63 + .../XMLSignatureVerificationInvokerTest.java | 61 + .../moa/spss/server/tools/CertToolTest.java | 50 + spss/server/serverws/spec/MOA-SPSS-1.3.doc | Bin 0 -> 559616 bytes .../src/main/webapp/WEB-INF/server-config.wsdd | 48 + .../serverws/src/main/webapp/WEB-INF/web.xml | 55 + spss/server/serverws/tools/ConfigurationMapper.xsl | 343 +++++ 2014 files changed, 82879 insertions(+), 92208 deletions(-) create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/AllTests.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/MOATestCase.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/DOMUtilsTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/SSLUtilsTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/URLDecoderTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/URLEncoderTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java create mode 100644 common-test/src/main/java/test/at/gv/egovernment/moa/util/XPathUtilsTest.java delete mode 100644 common/build.xml delete mode 100644 common/res/resources/properties/common_messages_de.properties delete mode 100644 common/res/resources/schemas/Core-1.2.xsd delete mode 100644 common/res/resources/schemas/Core.20020225.xsd delete mode 100644 common/res/resources/schemas/Core.20020831.xsd delete mode 100644 common/res/resources/schemas/ECDSAKeyValue.ancient.xsd delete mode 100644 common/res/resources/schemas/ECDSAKeyValue.wrong.xsd delete mode 100644 common/res/resources/schemas/ECDSAKeyValue.xsd delete mode 100644 common/res/resources/schemas/MOA-ID-Configuration-1.2.xsd delete mode 100644 common/res/resources/schemas/MOA-ID-Configuration-1.3.xsd delete mode 100644 common/res/resources/schemas/MOA-ID-Configuration-1.4.xsd delete mode 100644 common/res/resources/schemas/MOA-SPSS-1.3.xsd delete mode 100644 common/res/resources/schemas/MOA-SPSS-config-1.3.xsd delete mode 100644 common/res/resources/schemas/MOAIdentities.xsd delete mode 100644 common/res/resources/schemas/PersonData.xsd delete mode 100644 common/res/resources/schemas/PersonData_20_en_moaWID.xsd delete mode 100644 common/res/resources/schemas/PersonName-1_2.xsd delete mode 100644 common/res/resources/schemas/PostalAddress-1_2.xsd delete mode 100644 common/res/resources/schemas/TelcomNumber-1_0.xsd delete mode 100644 common/res/resources/schemas/XMLSchema-instance.xsd delete mode 100644 common/res/resources/schemas/XMLSchema.dtd delete mode 100644 common/res/resources/schemas/cs-sstc-schema-assertion-01.xsd delete mode 100644 common/res/resources/schemas/cs-sstc-schema-protocol-01.xsd delete mode 100644 common/res/resources/schemas/datatypes.dtd delete mode 100644 common/res/resources/schemas/exclusive-canonicalization.xsd delete mode 100644 common/res/resources/schemas/xml.xsd delete mode 100644 common/res/resources/schemas/xmldsig-core-schema.xsd delete mode 100644 common/res/resources/schemas/xmldsig-filter2.xsd delete mode 100644 common/src/at/gv/egovernment/moa/logging/LogMsg.java delete mode 100644 common/src/at/gv/egovernment/moa/logging/Logger.java delete mode 100644 common/src/at/gv/egovernment/moa/logging/LoggingContext.java delete mode 100644 common/src/at/gv/egovernment/moa/logging/LoggingContextManager.java delete mode 100644 common/src/at/gv/egovernment/moa/util/Base64Utils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/BoolUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/CollectionUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/Constants.java delete mode 100644 common/src/at/gv/egovernment/moa/util/DOMUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/DateTimeUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/EntityResolverChain.java delete mode 100644 common/src/at/gv/egovernment/moa/util/FileUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/KeyStoreUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/MOADefaultHandler.java delete mode 100644 common/src/at/gv/egovernment/moa/util/MOAEntityResolver.java delete mode 100644 common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java delete mode 100644 common/src/at/gv/egovernment/moa/util/MOATimer.java delete mode 100644 common/src/at/gv/egovernment/moa/util/MessageProvider.java delete mode 100644 common/src/at/gv/egovernment/moa/util/Messages.java delete mode 100644 common/src/at/gv/egovernment/moa/util/NodeIteratorAdapter.java delete mode 100644 common/src/at/gv/egovernment/moa/util/NodeListAdapter.java delete mode 100644 common/src/at/gv/egovernment/moa/util/OutputXML2File.java delete mode 100644 common/src/at/gv/egovernment/moa/util/ResourceBundleChain.java delete mode 100644 common/src/at/gv/egovernment/moa/util/SSLUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/StreamEntityResolver.java delete mode 100644 common/src/at/gv/egovernment/moa/util/StreamUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/StringUtils.java delete mode 100644 common/src/at/gv/egovernment/moa/util/URLDecoder.java delete mode 100644 common/src/at/gv/egovernment/moa/util/URLEncoder.java delete mode 100644 common/src/at/gv/egovernment/moa/util/XPathException.java delete mode 100644 common/src/at/gv/egovernment/moa/util/XPathUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/logging/LogMsg.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/logging/Logger.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/logging/LoggingContext.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/logging/LoggingContextManager.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/Base64Utils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/BoolUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/CollectionUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/Constants.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/EntityResolverChain.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/KeyStoreUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/MOADefaultHandler.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/MOAEntityResolver.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/MOATimer.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/MessageProvider.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/Messages.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/NodeIteratorAdapter.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/NodeListAdapter.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/OutputXML2File.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/ResourceBundleChain.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/StreamEntityResolver.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/StreamUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/XPathException.java create mode 100644 common/src/main/java/at/gv/egovernment/moa/util/XPathUtils.java delete mode 100644 common/src/test/at/gv/egovernment/moa/AllTests.java delete mode 100644 common/src/test/at/gv/egovernment/moa/MOATestCase.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/DOMUtilsTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/SSLUtilsTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/URLEncoderTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java delete mode 100644 common/src/test/at/gv/egovernment/moa/util/XPathUtilsTest.java delete mode 100644 id.oa/.classpath delete mode 100644 id.oa/.cvsignore delete mode 100644 id.oa/.project delete mode 100644 id.oa/build.xml delete mode 100644 id.oa/html/auth.jsp delete mode 100644 id.oa/html/chooseBKU.jsp delete mode 100644 id.oa/html/form.jsp delete mode 100644 id.oa/html/getBKUSelectTag.jsp delete mode 100644 id.oa/html/index.jsp delete mode 100644 id.oa/html/stateful_login.jsp delete mode 100644 id.oa/web.xml delete mode 100644 id.server/data/deploy/conf/Catalina/localhost/proxy.xml delete mode 100644 id.server/data/deploy/conf/moa-id/MOAIdentities.xsd delete mode 100644 id.server/data/deploy/conf/moa-id/SampleIdentities.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml delete mode 100644 id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml delete mode 100644 id.server/data/deploy/conf/moa-id/log4j.properties delete mode 100644 id.server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt delete mode 100644 id.server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html delete mode 100644 id.server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html delete mode 100644 id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml delete mode 100644 id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml delete mode 100644 id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml delete mode 100644 id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml delete mode 100644 id.server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der delete mode 100644 id.server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml delete mode 100644 id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml delete mode 100644 id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml delete mode 100644 id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore delete mode 100644 id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer delete mode 100644 id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer delete mode 100644 id.server/data/deploy/templates/LIESMICH_TEMPLATES.txt delete mode 100644 id.server/data/deploy/templates/moaid-templates.war delete mode 100644 id.server/data/deploy/tomcat/server.mod_jk.xml delete mode 100644 id.server/data/deploy/tomcat/server.xml delete mode 100644 id.server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar delete mode 100644 id.server/data/deploy/tomcat/unix/tomcat-start.sh delete mode 100644 id.server/data/deploy/tomcat/unix/tomcat-stop.sh delete mode 100644 id.server/data/deploy/tomcat/uriworkermap.properties delete mode 100644 id.server/data/deploy/tomcat/win32/startTomcat.bat delete mode 100644 id.server/data/deploy/tomcat/win32/stopTomcat.bat delete mode 100644 id.server/data/deploy/tomcat/workers.properties delete mode 100644 id.server/doc/Architektur ID.vsd delete mode 100644 id.server/doc/MOA ID 1.x.wsdl delete mode 100644 id.server/doc/MOA-ID Feinspezifikation.doc delete mode 100644 id.server/doc/MOA-ID-Configuration-1.2.xsd delete mode 100644 id.server/doc/MOA-ID-Configuration-1.3.xsd delete mode 100644 id.server/doc/MOA-ID-Configuration-1.4.xsd delete mode 100644 id.server/doc/MOA_ID_1.2_20040315.pdf delete mode 100644 id.server/doc/MOA_ID_1.3_20060315.pdf delete mode 100644 id.server/doc/MOA_ID_1.4_20070802.pdf delete mode 100644 id.server/doc/OID-1-0-3.pdf delete mode 100644 id.server/doc/api-doc/allclasses-frame.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html delete mode 100644 id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html delete mode 100644 id.server/doc/api-doc/deprecated-list.html delete mode 100644 id.server/doc/api-doc/help-doc.html delete mode 100644 id.server/doc/api-doc/index-all.html delete mode 100644 id.server/doc/api-doc/index.html delete mode 100644 id.server/doc/api-doc/overview-tree.html delete mode 100644 id.server/doc/api-doc/package-list delete mode 100644 id.server/doc/api-doc/packages.html delete mode 100644 id.server/doc/api-doc/serialized-form.html delete mode 100644 id.server/doc/api-doc/stylesheet.css delete mode 100644 id.server/doc/bku-auswahl.20030408.pdf delete mode 100644 id.server/doc/cs-sstc-schema-assertion-01.xsd delete mode 100644 id.server/doc/cs-sstc-schema-protocol-01.xsd delete mode 100644 id.server/doc/moa-id.htm delete mode 100644 id.server/doc/moa_id/api-doc/allclasses-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/allclasses-noframe.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html delete mode 100644 id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html delete mode 100644 id.server/doc/moa_id/api-doc/constant-values.html delete mode 100644 id.server/doc/moa_id/api-doc/deprecated-list.html delete mode 100644 id.server/doc/moa_id/api-doc/help-doc.html delete mode 100644 id.server/doc/moa_id/api-doc/index-all.html delete mode 100644 id.server/doc/moa_id/api-doc/index.html delete mode 100644 id.server/doc/moa_id/api-doc/overview-frame.html delete mode 100644 id.server/doc/moa_id/api-doc/overview-summary.html delete mode 100644 id.server/doc/moa_id/api-doc/overview-tree.html delete mode 100644 id.server/doc/moa_id/api-doc/package-list delete mode 100644 id.server/doc/moa_id/api-doc/packages.html delete mode 100644 id.server/doc/moa_id/api-doc/resources/inherit.gif delete mode 100644 id.server/doc/moa_id/api-doc/serialized-form.html delete mode 100644 id.server/doc/moa_id/api-doc/stylesheet.css delete mode 100644 id.server/doc/moa_id/examples/BKUSelectionTemplate.html delete mode 100644 id.server/doc/moa_id/examples/ChainingModes.txt delete mode 100644 id.server/doc/moa_id/examples/IdentityLinkSigners.txt delete mode 100644 id.server/doc/moa_id/examples/LoginServletExample.txt delete mode 100644 id.server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml delete mode 100644 id.server/doc/moa_id/examples/Template.html delete mode 100644 id.server/doc/moa_id/examples/TransformsInfoAuthBlock.txt delete mode 100644 id.server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml delete mode 100644 id.server/doc/moa_id/examples/conf/OAConfBasicAuth.xml delete mode 100644 id.server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml delete mode 100644 id.server/doc/moa_id/examples/conf/OAConfParamAuth.xml delete mode 100644 id.server/doc/moa_id/examples/moa-id-env.sh.txt delete mode 100644 id.server/doc/moa_id/examples/startTomcat.bat.txt delete mode 100644 id.server/doc/moa_id/faqs.htm delete mode 100644 id.server/doc/moa_id/id-admin.htm delete mode 100644 id.server/doc/moa_id/id-admin_1.htm delete mode 100644 id.server/doc/moa_id/id-admin_2.htm delete mode 100644 id.server/doc/moa_id/id-admin_3.htm delete mode 100644 id.server/doc/moa_id/id-anwendung.htm delete mode 100644 id.server/doc/moa_id/id-anwendung_1.htm delete mode 100644 id.server/doc/moa_id/id-anwendung_2.htm delete mode 100644 id.server/doc/moa_id/links.htm delete mode 100644 id.server/doc/moa_id/moa-id-ablauf.jpg delete mode 100644 id.server/doc/moa_id/moa.htm delete mode 100644 id.server/doc/moa_images/east.gif delete mode 100644 id.server/doc/moa_images/idle.gif delete mode 100644 id.server/doc/moa_images/moa_diagramm1.jpg delete mode 100644 id.server/doc/moa_images/moa_thema.gif delete mode 100644 id.server/doc/moa_images/north.gif delete mode 100644 id.server/doc/moa_images/pfeil.gif delete mode 100644 id.server/doc/moa_images/print.gif delete mode 100644 id.server/doc/moa_images/select.gif delete mode 100644 id.server/doc/moa_images/south.gif delete mode 100644 id.server/doc/moa_images/transdot.gif delete mode 100644 id.server/doc/moa_images/west.gif delete mode 100644 id.server/html/auth/WEB-INF/server-config.wsdd delete mode 100644 id.server/html/auth/WEB-INF/web.xml delete mode 100644 id.server/html/auth/errorpage-auth.jsp delete mode 100644 id.server/html/auth/index.jsp delete mode 100644 id.server/html/auth/message-auth.jsp delete mode 100644 id.server/html/proxy/WEB-INF/web.xml delete mode 100644 id.server/html/proxy/errorpage-proxy.jsp delete mode 100644 id.server/html/proxy/message-proxy.jsp delete mode 100644 id.server/res/META-INF/services/org.apache.axis.components.net.SecureSocketFactory delete mode 100644 id.server/res/resources/properties/id_messages_de.properties delete mode 100644 id.server/res/resources/wsdl/MOA-ID-1.0.wsdl delete mode 100644 id.server/res/resources/wsdl/MOA-ID-1.x.wsdl delete mode 100644 id.server/res/resources/wsdl/MOA-SPSS-1.2.xsd delete mode 100644 id.server/res/resources/xmldata/CertInfoDsigSignature.xml delete mode 100644 id.server/src/at/gv/egovernment/moa/id/AuthenticationException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/BuildException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/ECDSAConverterException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/MOAIDException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/ParseException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/ServiceException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationServer.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/WrongParametersException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/Builder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/IdentityLink.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/Schema.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/ErrorResponseParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/validator/ValidateException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/ConfigurationException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/ConfigurationProvider.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/ConnectionParameter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/OAParameter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/data/AuthenticationData.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/data/Cookie.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/data/IssuerAndSerial.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/data/SAMLStatus.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/NotAllowedException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/ECDSAConstants.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/HTTPUtils.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/Random.java delete mode 100644 id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java delete mode 100644 id.server/src/test/MOAIDTestCase.java delete mode 100644 id.server/src/test/abnahme/A/Test100StartAuthentication.java delete mode 100644 id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java delete mode 100644 id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java delete mode 100644 id.server/src/test/abnahme/A/Test400GetAuthenticationData.java delete mode 100644 id.server/src/test/abnahme/A/Test500StartAuthenticationServlet.java delete mode 100644 id.server/src/test/abnahme/A/Test600GetAuthenticationDataService.java delete mode 100644 id.server/src/test/abnahme/A/Test700SelectBKU.java delete mode 100644 id.server/src/test/abnahme/AbnahmeTestCase.java delete mode 100644 id.server/src/test/abnahme/AllTests.java delete mode 100644 id.server/src/test/abnahme/C/Test100Konfiguration.java delete mode 100644 id.server/src/test/abnahme/P/Test100LoginParameterResolver.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/AllTests.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/UnitTestCase.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/proxy/AllTests.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilderTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java delete mode 100644 id.server/src/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java delete mode 100644 id.server/src/test/lasttest/Dispatcher.java delete mode 100644 id.server/src/test/lasttest/HostnameVerifierHack.java delete mode 100644 id.server/src/test/lasttest/LasttestClient.java delete mode 100644 id.server/src/test/lasttest/TestThread.java delete mode 100644 id.templates/.project delete mode 100644 id.templates/build.xml delete mode 100644 id.templates/html/SampleBKUSelectionTemplate.html delete mode 100644 id.templates/html/SampleLogo.gif delete mode 100644 id.templates/html/SampleTemplate.html delete mode 100644 id.templates/html/css/display.css delete mode 100644 id.templates/html/css/main.css delete mode 100644 id.templates/html/valid-html401.gif delete mode 100644 id.templates/web.xml create mode 100644 id/oa/src/main/webapp/WEB-INF/web.xml create mode 100644 id/oa/src/main/webapp/auth.jsp create mode 100644 id/oa/src/main/webapp/chooseBKU.jsp create mode 100644 id/oa/src/main/webapp/form.jsp create mode 100644 id/oa/src/main/webapp/getBKUSelectTag.jsp create mode 100644 id/oa/src/main/webapp/index.jsp create mode 100644 id/oa/src/main/webapp/stateful_login.jsp create mode 100644 id/server/auth/src/main/webapp/WEB-INF/server-config.wsdd create mode 100644 id/server/auth/src/main/webapp/WEB-INF/web.xml create mode 100644 id/server/auth/src/main/webapp/errorpage-auth.jsp create mode 100644 id/server/auth/src/main/webapp/index.jsp create mode 100644 id/server/auth/src/main/webapp/message-auth.jsp create mode 100644 id/server/data/deploy/conf/Catalina/localhost/proxy.xml create mode 100644 id/server/data/deploy/conf/moa-id/MOAIdentities.xsd create mode 100644 id/server/data/deploy/conf/moa-id/SampleIdentities.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml create mode 100644 id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml create mode 100644 id/server/data/deploy/conf/moa-id/log4j.properties create mode 100644 id/server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt create mode 100644 id/server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html create mode 100644 id/server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html create mode 100644 id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml create mode 100644 id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml create mode 100644 id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml create mode 100644 id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml create mode 100644 id/server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml create mode 100644 id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 create mode 100644 id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der create mode 100644 id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 create mode 100644 id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der create mode 100644 id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 create mode 100644 id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der create mode 100644 id/server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 create mode 100644 id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml create mode 100644 id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml create mode 100644 id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml create mode 100644 id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore create mode 100644 id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer create mode 100644 id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer create mode 100644 id/server/data/deploy/templates/LIESMICH_TEMPLATES.txt create mode 100644 id/server/data/deploy/templates/moaid-templates.war create mode 100644 id/server/data/deploy/tomcat/server.mod_jk.xml create mode 100644 id/server/data/deploy/tomcat/server.xml create mode 100644 id/server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar create mode 100644 id/server/data/deploy/tomcat/unix/tomcat-start.sh create mode 100644 id/server/data/deploy/tomcat/unix/tomcat-stop.sh create mode 100644 id/server/data/deploy/tomcat/uriworkermap.properties create mode 100644 id/server/data/deploy/tomcat/win32/startTomcat.bat create mode 100644 id/server/data/deploy/tomcat/win32/stopTomcat.bat create mode 100644 id/server/data/deploy/tomcat/workers.properties create mode 100644 id/server/doc/Architektur ID.vsd create mode 100644 id/server/doc/MOA ID 1.x.wsdl create mode 100644 id/server/doc/MOA-ID Feinspezifikation.doc create mode 100644 id/server/doc/MOA-ID-Configuration-1.2.xsd create mode 100644 id/server/doc/MOA-ID-Configuration-1.3.xsd create mode 100644 id/server/doc/MOA-ID-Configuration-1.4.xsd create mode 100644 id/server/doc/MOA_ID_1.2_20040315.pdf create mode 100644 id/server/doc/MOA_ID_1.3_20060315.pdf create mode 100644 id/server/doc/MOA_ID_1.4_20070802.pdf create mode 100644 id/server/doc/OID-1-0-3.pdf create mode 100644 id/server/doc/api-doc/allclasses-frame.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html create mode 100644 id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html create mode 100644 id/server/doc/api-doc/deprecated-list.html create mode 100644 id/server/doc/api-doc/help-doc.html create mode 100644 id/server/doc/api-doc/index-all.html create mode 100644 id/server/doc/api-doc/index.html create mode 100644 id/server/doc/api-doc/overview-tree.html create mode 100644 id/server/doc/api-doc/package-list create mode 100644 id/server/doc/api-doc/packages.html create mode 100644 id/server/doc/api-doc/serialized-form.html create mode 100644 id/server/doc/api-doc/stylesheet.css create mode 100644 id/server/doc/bku-auswahl.20030408.pdf create mode 100644 id/server/doc/cs-sstc-schema-assertion-01.xsd create mode 100644 id/server/doc/cs-sstc-schema-protocol-01.xsd create mode 100644 id/server/doc/moa-id.htm create mode 100644 id/server/doc/moa_id/api-doc/allclasses-frame.html create mode 100644 id/server/doc/moa_id/api-doc/allclasses-noframe.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html create mode 100644 id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html create mode 100644 id/server/doc/moa_id/api-doc/constant-values.html create mode 100644 id/server/doc/moa_id/api-doc/deprecated-list.html create mode 100644 id/server/doc/moa_id/api-doc/help-doc.html create mode 100644 id/server/doc/moa_id/api-doc/index-all.html create mode 100644 id/server/doc/moa_id/api-doc/index.html create mode 100644 id/server/doc/moa_id/api-doc/overview-frame.html create mode 100644 id/server/doc/moa_id/api-doc/overview-summary.html create mode 100644 id/server/doc/moa_id/api-doc/overview-tree.html create mode 100644 id/server/doc/moa_id/api-doc/package-list create mode 100644 id/server/doc/moa_id/api-doc/packages.html create mode 100644 id/server/doc/moa_id/api-doc/resources/inherit.gif create mode 100644 id/server/doc/moa_id/api-doc/serialized-form.html create mode 100644 id/server/doc/moa_id/api-doc/stylesheet.css create mode 100644 id/server/doc/moa_id/examples/BKUSelectionTemplate.html create mode 100644 id/server/doc/moa_id/examples/ChainingModes.txt create mode 100644 id/server/doc/moa_id/examples/IdentityLinkSigners.txt create mode 100644 id/server/doc/moa_id/examples/LoginServletExample.txt create mode 100644 id/server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml create mode 100644 id/server/doc/moa_id/examples/Template.html create mode 100644 id/server/doc/moa_id/examples/TransformsInfoAuthBlock.txt create mode 100644 id/server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml create mode 100644 id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml create mode 100644 id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml create mode 100644 id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml create mode 100644 id/server/doc/moa_id/examples/moa-id-env.sh.txt create mode 100644 id/server/doc/moa_id/examples/startTomcat.bat.txt create mode 100644 id/server/doc/moa_id/faqs.htm create mode 100644 id/server/doc/moa_id/id-admin.htm create mode 100644 id/server/doc/moa_id/id-admin_1.htm create mode 100644 id/server/doc/moa_id/id-admin_2.htm create mode 100644 id/server/doc/moa_id/id-admin_3.htm create mode 100644 id/server/doc/moa_id/id-anwendung.htm create mode 100644 id/server/doc/moa_id/id-anwendung_1.htm create mode 100644 id/server/doc/moa_id/id-anwendung_2.htm create mode 100644 id/server/doc/moa_id/links.htm create mode 100644 id/server/doc/moa_id/moa-id-ablauf.jpg create mode 100644 id/server/doc/moa_id/moa.htm create mode 100644 id/server/doc/moa_images/east.gif create mode 100644 id/server/doc/moa_images/idle.gif create mode 100644 id/server/doc/moa_images/moa_diagramm1.jpg create mode 100644 id/server/doc/moa_images/moa_thema.gif create mode 100644 id/server/doc/moa_images/north.gif create mode 100644 id/server/doc/moa_images/pfeil.gif create mode 100644 id/server/doc/moa_images/print.gif create mode 100644 id/server/doc/moa_images/select.gif create mode 100644 id/server/doc/moa_images/south.gif create mode 100644 id/server/doc/moa_images/transdot.gif create mode 100644 id/server/doc/moa_images/west.gif create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/AuthenticationException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/BuildException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ECDSAConverterException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/MOAIDException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ParseException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ServiceException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/WrongParametersException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/Builder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/IdentityLink.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/Schema.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/ErrorResponseParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/ValidateException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConnectionParameter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/Cookie.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/CookieManager.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/IssuerAndSerial.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/SAMLStatus.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAConstants.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPUtils.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java create mode 100644 id/server/idserverlib/src/test/java/test/MOAIDTestCase.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test200VerifyIdentityLink.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test400GetAuthenticationData.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test500StartAuthenticationServlet.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/A/Test700SelectBKU.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/AllTests.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/C/Test100Konfiguration.java create mode 100644 id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/AllTests.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/UnitTestCase.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/AllTests.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilderTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java create mode 100644 id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java create mode 100644 id/server/idserverlib/src/test/java/test/lasttest/Dispatcher.java create mode 100644 id/server/idserverlib/src/test/java/test/lasttest/HostnameVerifierHack.java create mode 100644 id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java create mode 100644 id/server/idserverlib/src/test/java/test/lasttest/TestThread.java create mode 100644 id/server/proxy/src/main/webapp/WEB-INF/web.xml create mode 100644 id/server/proxy/src/main/webapp/errorpage-proxy.jsp create mode 100644 id/server/proxy/src/main/webapp/message-proxy.jsp create mode 100644 id/server/resources/properties/id_messages_de.properties create mode 100644 id/server/resources/wsdl/MOA-ID-1.0.wsdl create mode 100644 id/server/resources/wsdl/MOA-ID-1.x.wsdl create mode 100644 id/server/resources/wsdl/MOA-SPSS-1.2.xsd create mode 100644 id/server/resources/xmldata/CertInfoDsigSignature.xml create mode 100644 id/server/services/org.apache.axis.components.net.SecureSocketFactory create mode 100644 id/templates/src/main/webapp/SampleBKUSelectionTemplate.html create mode 100644 id/templates/src/main/webapp/SampleLogo.gif create mode 100644 id/templates/src/main/webapp/SampleTemplate.html create mode 100644 id/templates/src/main/webapp/WEB-INF/web.xml create mode 100644 id/templates/src/main/webapp/css/display.css create mode 100644 id/templates/src/main/webapp/css/main.css create mode 100644 id/templates/src/main/webapp/valid-html401.gif delete mode 100644 spss.handbook/clients/api/lib/commons-discovery-0.2/commons-discovery.jar delete mode 100644 spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging-api.jar delete mode 100644 spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Provider.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Wrapper.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_cms.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ecc.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ixsil.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_jce_full.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_moa_full.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux_x64/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_Pkcs11Provider.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_ecc.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_jce_full.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparc/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparcv9/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/win32/pkcs11wrapper.dll delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070503/full/wince30arm/pkcs11wrapper.dll delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_Pkcs11Wrapper.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_cms.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_ixsil.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_moa_full.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux_x64/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_Pkcs11Provider.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_ecc.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_jce_full.jar delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparc/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparcv9/libpkcs11wrapper.so delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/win32/pkcs11wrapper.dll delete mode 100644 spss.handbook/clients/api/lib/iaik-moa-20070801/full/wince30arm/pkcs11wrapper.dll delete mode 100644 spss.handbook/clients/api/lib/jaxen-1.0/jaxen-core.jar delete mode 100644 spss.handbook/clients/api/lib/jaxen-1.0/jaxen-dom.jar delete mode 100644 spss.handbook/clients/api/lib/jaxen-1.0/saxpath.jar delete mode 100644 spss.handbook/clients/api/lib/jaxp-1.2_01/dom.jar delete mode 100644 spss.handbook/clients/api/lib/jaxp-1.2_01/jaxp-api.jar delete mode 100644 spss.handbook/clients/api/lib/jaxp-1.2_01/sax.jar delete mode 100644 spss.handbook/clients/api/lib/log4j-1.2.7/log4j-1.2.7.jar delete mode 100644 spss.handbook/clients/api/lib/postgres-jdbc2-7.3/pg73jdbc2.jar delete mode 100644 spss.handbook/clients/api/lib/xalan-j-2.5.1/xalan.jar delete mode 100644 spss.handbook/clients/api/signatures/SimpleSignature.xml delete mode 100644 spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/CreateXMLSignature.java delete mode 100644 spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/VerifyXMLSignature.java delete mode 100644 spss.handbook/clients/common/referencedData/Text.b64 delete mode 100644 spss.handbook/clients/common/referencedData/Text.txt delete mode 100644 spss.handbook/clients/common/referencedData/WEB-INF/web.xml delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.Para.xsl delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.signed.xml delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.withResolvableSchemaHint.xml delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.withSchemaHint.xml delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.xml delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.xsd delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocument.xsl delete mode 100644 spss.handbook/clients/common/referencedData/XMLDocumentRef.xsl delete mode 100644 spss.handbook/clients/common/referencedData/referencedData.war delete mode 100644 spss.handbook/clients/webservice/conf/http.properties delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/axis-ant.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/axis.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/commons-discovery.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/commons-logging-api.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/commons-logging.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/jaxrpc.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/log4j-1.2.8.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/saaj.jar delete mode 100644 spss.handbook/clients/webservice/lib/axis-1_1/wsdl4j.jar delete mode 100644 spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jcert.jar delete mode 100644 spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jnet.jar delete mode 100644 spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jsse.jar delete mode 100644 spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xercesImpl.jar delete mode 100644 spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xmlParserAPIs.jar delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.response.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.resp.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.response.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.response.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.response.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.xml delete mode 100644 spss.handbook/clients/webservice/resources/requests/transformResults/CreateXMLSignatureRequest.Transforms.hashinput.ref2.txt delete mode 100644 spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1.der delete mode 100644 spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1[pwd=kunde1].p12 delete mode 100644 spss.handbook/clients/webservice/resources/sslKeys/customer1/trustedServers[pwd=servers].keystore delete mode 100644 spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2.der delete mode 100644 spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2[pwd=kunde2].p12 delete mode 100644 spss.handbook/clients/webservice/resources/sslKeys/customer2/trustedServers[pwd=servers].keystore delete mode 100644 spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTP.java delete mode 100644 spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSClientAuth.java delete mode 100644 spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSServerAuth.java delete mode 100644 spss.handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 delete mode 100644 spss.handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 delete mode 100644 spss.handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 delete mode 100644 spss.handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 delete mode 100644 spss.handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 delete mode 100644 spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 delete mode 100644 spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F delete mode 100644 spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 delete mode 100644 spss.handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A delete mode 100644 spss.handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 delete mode 100644 spss.handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D delete mode 100644 spss.handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 delete mode 100644 spss.handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 delete mode 100644 spss.handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 delete mode 100644 spss.handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C delete mode 100644 spss.handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 delete mode 100644 spss.handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 delete mode 100644 spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 delete mode 100644 spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 delete mode 100644 spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 delete mode 100644 spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 delete mode 100644 spss.handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F delete mode 100644 spss.handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 delete mode 100644 spss.handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D delete mode 100644 spss.handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 delete mode 100644 spss.handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 delete mode 100644 spss.handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 delete mode 100644 spss.handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA delete mode 100644 spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F delete mode 100644 spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE delete mode 100644 spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 delete mode 100644 spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 delete mode 100644 spss.handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E delete mode 100644 spss.handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 delete mode 100644 spss.handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C delete mode 100644 spss.handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 delete mode 100644 spss.handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 delete mode 100644 spss.handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E delete mode 100644 spss.handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA delete mode 100644 spss.handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 delete mode 100644 spss.handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F delete mode 100644 spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 delete mode 100644 spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 delete mode 100644 spss.handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B delete mode 100644 spss.handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 delete mode 100644 spss.handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD delete mode 100644 spss.handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 delete mode 100644 spss.handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B delete mode 100644 spss.handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 delete mode 100644 spss.handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C delete mode 100644 spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E delete mode 100644 spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 delete mode 100644 spss.handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 delete mode 100644 spss.handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C delete mode 100644 spss.handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B delete mode 100644 spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB delete mode 100644 spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B delete mode 100644 spss.handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE delete mode 100644 spss.handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 delete mode 100644 spss.handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 delete mode 100644 spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 delete mode 100644 spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC delete mode 100644 spss.handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F delete mode 100644 spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 delete mode 100644 spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B delete mode 100644 spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B delete mode 100644 spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C delete mode 100644 spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 delete mode 100644 spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 delete mode 100644 spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B delete mode 100644 spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD delete mode 100644 spss.handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B delete mode 100644 spss.handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE delete mode 100644 spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F delete mode 100644 spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D delete mode 100644 spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A delete mode 100644 spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 delete mode 100644 spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 delete mode 100644 spss.handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 delete mode 100644 spss.handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 delete mode 100644 spss.handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 delete mode 100644 spss.handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 delete mode 100644 spss.handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 delete mode 100644 spss.handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D delete mode 100644 spss.handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 delete mode 100644 spss.handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE delete mode 100644 spss.handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 delete mode 100644 spss.handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C delete mode 100644 spss.handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED delete mode 100644 spss.handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA delete mode 100644 spss.handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 delete mode 100644 spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F delete mode 100644 spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 delete mode 100644 spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D delete mode 100644 spss.handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 delete mode 100644 spss.handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C delete mode 100644 spss.handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 delete mode 100644 spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE delete mode 100644 spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 delete mode 100644 spss.handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 delete mode 100644 spss.handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C delete mode 100644 spss.handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 delete mode 100644 spss.handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 delete mode 100644 spss.handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE delete mode 100644 spss.handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 delete mode 100644 spss.handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 delete mode 100644 spss.handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C delete mode 100644 spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der delete mode 100644 spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 delete mode 100644 spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der delete mode 100644 spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 delete mode 100644 spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der delete mode 100644 spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 delete mode 100644 spss.handbook/conf/moa-spss/log4j.properties delete mode 100644 spss.handbook/conf/moa-spss/sp.minimum.config.xml delete mode 100644 spss.handbook/conf/moa-spss/spss.config.xml delete mode 100644 spss.handbook/conf/moa-spss/ss.minimum.config.xml delete mode 100644 spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der delete mode 100644 spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 delete mode 100644 spss.handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore delete mode 100644 spss.handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer delete mode 100644 spss.handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der delete mode 100644 spss.handbook/handbook.html delete mode 100644 spss.handbook/handbook/common/LogoBKA.png delete mode 100644 spss.handbook/handbook/common/LogoMoa4c.3148x3545.jpg delete mode 100644 spss.handbook/handbook/common/LogoMoa4c.jpg delete mode 100644 spss.handbook/handbook/common/LogoMoaBw.jpg delete mode 100644 spss.handbook/handbook/common/MOA.css delete mode 100644 spss.handbook/handbook/config/MOA-SPSS-config-1.3.xsd delete mode 100644 spss.handbook/handbook/config/config.html delete mode 100644 spss.handbook/handbook/faq/faq.html delete mode 100644 spss.handbook/handbook/index.html delete mode 100644 spss.handbook/handbook/install/install.html delete mode 100644 spss.handbook/handbook/intro/intro.html delete mode 100644 spss.handbook/handbook/spec/MOA-SPSS-1.3.pdf delete mode 100644 spss.handbook/handbook/spec/MOA-SPSS-1.3.wsdl delete mode 100644 spss.handbook/handbook/spec/MOA-SPSS-1.3.xsd delete mode 100644 spss.handbook/handbook/usage/usage.html delete mode 100644 spss.server/data/deploy/tomcat/server.mod_jk.xml delete mode 100644 spss.server/data/deploy/tomcat/server.xml delete mode 100644 spss.server/data/deploy/tomcat/unix/moa-env.sh delete mode 100644 spss.server/data/deploy/tomcat/uriworkermap.properties delete mode 100644 spss.server/data/deploy/tomcat/win32/startTomcat.bat delete mode 100644 spss.server/data/deploy/tomcat/win32/stopTomcat.bat delete mode 100644 spss.server/data/deploy/tomcat/workers.properties delete mode 100644 spss.server/data/deploy/tools/certtool.bat delete mode 100644 spss.server/data/deploy/tools/certtool.sh delete mode 100644 spss.server/data/deploy/tools/configtool.bat delete mode 100644 spss.server/data/deploy/tools/configtool.sh delete mode 100644 spss.server/licenses/Apache-2.0.txt delete mode 100644 spss.server/licenses/IAIK-License.txt delete mode 100644 spss.server/licenses/Jaxen.txt delete mode 100644 spss.server/licenses/PostgreSQL-JDBC.txt delete mode 100644 spss.server/res/resources/properties/spss_messages_de.properties delete mode 100644 spss.server/res/resources/security/cacerts delete mode 100644 spss.server/res/resources/tools/ConfigurationMapper.xsl delete mode 100644 spss.server/res/resources/wsdl/MOA-SPSS-1.3.wsdl delete mode 100644 spss.server/res/resources/wsdl/MOA-SPSS-1.3.xsd delete mode 100644 spss.server/server-config.wsdd delete mode 100644 spss.server/spec/MOA-SPSS-1.3.doc delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/MOAApplicationException.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/MOAException.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/MOASystemException.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/Configurator.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/SignatureCreationService.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/Base64Transform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/CheckResult.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/Content.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentBinary.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentReference.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentXML.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/ElementSelector.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/InputData.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/SignerInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/Transform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathTransform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/overview.htm delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyModule.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/TrustProfile.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLog.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/logging/TransactionId.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/service/AxisHandler.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/tools/CertTool.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/util/IdGenerator.java delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/util/MessageProvider.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/AllTests.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java delete mode 100644 spss.server/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java delete mode 100644 spss.server/web.xml create mode 100644 spss/handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 create mode 100644 spss/handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 create mode 100644 spss/handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 create mode 100644 spss/handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 create mode 100644 spss/handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 create mode 100644 spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 create mode 100644 spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F create mode 100644 spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 create mode 100644 spss/handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A create mode 100644 spss/handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 create mode 100644 spss/handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D create mode 100644 spss/handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 create mode 100644 spss/handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 create mode 100644 spss/handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 create mode 100644 spss/handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C create mode 100644 spss/handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 create mode 100644 spss/handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 create mode 100644 spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 create mode 100644 spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 create mode 100644 spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 create mode 100644 spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 create mode 100644 spss/handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F create mode 100644 spss/handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 create mode 100644 spss/handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D create mode 100644 spss/handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 create mode 100644 spss/handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 create mode 100644 spss/handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 create mode 100644 spss/handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA create mode 100644 spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F create mode 100644 spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE create mode 100644 spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 create mode 100644 spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 create mode 100644 spss/handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E create mode 100644 spss/handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 create mode 100644 spss/handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C create mode 100644 spss/handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 create mode 100644 spss/handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 create mode 100644 spss/handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E create mode 100644 spss/handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA create mode 100644 spss/handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 create mode 100644 spss/handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F create mode 100644 spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 create mode 100644 spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 create mode 100644 spss/handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B create mode 100644 spss/handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 create mode 100644 spss/handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD create mode 100644 spss/handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 create mode 100644 spss/handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B create mode 100644 spss/handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 create mode 100644 spss/handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C create mode 100644 spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E create mode 100644 spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 create mode 100644 spss/handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 create mode 100644 spss/handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C create mode 100644 spss/handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B create mode 100644 spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB create mode 100644 spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B create mode 100644 spss/handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE create mode 100644 spss/handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 create mode 100644 spss/handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 create mode 100644 spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 create mode 100644 spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC create mode 100644 spss/handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F create mode 100644 spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 create mode 100644 spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B create mode 100644 spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B create mode 100644 spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C create mode 100644 spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 create mode 100644 spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 create mode 100644 spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B create mode 100644 spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD create mode 100644 spss/handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B create mode 100644 spss/handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE create mode 100644 spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F create mode 100644 spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D create mode 100644 spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A create mode 100644 spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 create mode 100644 spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 create mode 100644 spss/handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 create mode 100644 spss/handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 create mode 100644 spss/handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 create mode 100644 spss/handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 create mode 100644 spss/handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 create mode 100644 spss/handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D create mode 100644 spss/handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 create mode 100644 spss/handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE create mode 100644 spss/handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 create mode 100644 spss/handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C create mode 100644 spss/handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED create mode 100644 spss/handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA create mode 100644 spss/handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 create mode 100644 spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F create mode 100644 spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 create mode 100644 spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D create mode 100644 spss/handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 create mode 100644 spss/handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C create mode 100644 spss/handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 create mode 100644 spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE create mode 100644 spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 create mode 100644 spss/handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 create mode 100644 spss/handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C create mode 100644 spss/handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 create mode 100644 spss/handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 create mode 100644 spss/handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE create mode 100644 spss/handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 create mode 100644 spss/handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 create mode 100644 spss/handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C create mode 100644 spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der create mode 100644 spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 create mode 100644 spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der create mode 100644 spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 create mode 100644 spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der create mode 100644 spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 create mode 100644 spss/handbook/conf/moa-spss/log4j.properties create mode 100644 spss/handbook/conf/moa-spss/sp.minimum.config.xml create mode 100644 spss/handbook/conf/moa-spss/spss.config.xml create mode 100644 spss/handbook/conf/moa-spss/ss.minimum.config.xml create mode 100644 spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der create mode 100644 spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 create mode 100644 spss/handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore create mode 100644 spss/handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer create mode 100644 spss/handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der create mode 100644 spss/handbook/handbook.html create mode 100644 spss/handbook/handbook/common/LogoBKA.png create mode 100644 spss/handbook/handbook/common/LogoMoa4c.3148x3545.jpg create mode 100644 spss/handbook/handbook/common/LogoMoa4c.jpg create mode 100644 spss/handbook/handbook/common/LogoMoaBw.jpg create mode 100644 spss/handbook/handbook/common/MOA.css create mode 100644 spss/handbook/handbook/config/MOA-SPSS-config-1.3.xsd create mode 100644 spss/handbook/handbook/config/config.html create mode 100644 spss/handbook/handbook/faq/faq.html create mode 100644 spss/handbook/handbook/index.html create mode 100644 spss/handbook/handbook/install/install.html create mode 100644 spss/handbook/handbook/intro/intro.html create mode 100644 spss/handbook/handbook/spec/MOA-SPSS-1.3.pdf create mode 100644 spss/handbook/handbook/spec/MOA-SPSS-1.3.wsdl create mode 100644 spss/handbook/handbook/spec/MOA-SPSS-1.3.xsd create mode 100644 spss/handbook/handbook/usage/usage.html create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/server.mod_jk.xml create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/server.xml create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/unix/moa-env.sh create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/uriworkermap.properties create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/win32/startTomcat.bat create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/win32/stopTomcat.bat create mode 100644 spss/server/serverlib/resources/data/deploy/tomcat/workers.properties create mode 100644 spss/server/serverlib/resources/data/deploy/tools/certtool.bat create mode 100644 spss/server/serverlib/resources/data/deploy/tools/certtool.sh create mode 100644 spss/server/serverlib/resources/data/deploy/tools/configtool.bat create mode 100644 spss/server/serverlib/resources/data/deploy/tools/configtool.sh create mode 100644 spss/server/serverlib/resources/licenses/Apache-2.0.txt create mode 100644 spss/server/serverlib/resources/licenses/IAIK-License.txt create mode 100644 spss/server/serverlib/resources/licenses/Jaxen.txt create mode 100644 spss/server/serverlib/resources/licenses/PostgreSQL-JDBC.txt create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAApplicationException.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOARuntimeException.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOASystemException.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/overview.htm create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroup.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyModule.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/util/IdGenerator.java create mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/util/MessageProvider.java create mode 100644 spss/server/serverlib/src/main/resources/properties/spss_messages_de.properties create mode 100644 spss/server/serverlib/src/main/resources/security/cacerts create mode 100644 spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl create mode 100644 spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java create mode 100644 spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java create mode 100644 spss/server/serverws/spec/MOA-SPSS-1.3.doc create mode 100644 spss/server/serverws/src/main/webapp/WEB-INF/server-config.wsdd create mode 100644 spss/server/serverws/src/main/webapp/WEB-INF/web.xml create mode 100644 spss/server/serverws/tools/ConfigurationMapper.xsl diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/AllTests.java b/common-test/src/main/java/test/at/gv/egovernment/moa/AllTests.java new file mode 100644 index 000000000..00e2c505f --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/AllTests.java @@ -0,0 +1,38 @@ +package test.at.gv.egovernment.moa; + +import test.at.gv.egovernment.moa.util.DOMUtilsTest; +import test.at.gv.egovernment.moa.util.DateTimeUtilsTest; +import test.at.gv.egovernment.moa.util.KeyStoreUtilsTest; +import test.at.gv.egovernment.moa.util.SSLUtilsTest; +import test.at.gv.egovernment.moa.util.XPathUtilsTest; + +import junit.awtui.TestRunner; +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author patrick + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(DOMUtilsTest.class); + suite.addTestSuite(DateTimeUtilsTest.class); + suite.addTestSuite(XPathUtilsTest.class); + suite.addTestSuite(KeyStoreUtilsTest.class); + suite.addTestSuite(SSLUtilsTest.class); + + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/MOATestCase.java b/common-test/src/main/java/test/at/gv/egovernment/moa/MOATestCase.java new file mode 100644 index 000000000..86ea2ee6c --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/MOATestCase.java @@ -0,0 +1,75 @@ +package test.at.gv.egovernment.moa; + +import java.io.FileInputStream; +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; + +import org.xml.sax.InputSource; + +import junit.framework.TestCase; + +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +/** + * Base class for MOA test cases. + * + * Provides some utility functions. + * + * @author Patrick Peck + * @version $Id$ + */ +public class MOATestCase extends TestCase { + + protected static final String TESTDATA_ROOT = "data/test/"; + + /** + * Constructor for MOATestCase. + * @param arg0 + */ + public MOATestCase(String name) { + super(name); + } + + /** + * Parse an XML file non-validating. + */ + public static Document parseXml(String fileName) throws Exception { + return DOMUtils.parseDocument( + new FileInputStream(fileName), + false, + null, + null); + } + + /** + * Parse an XML validating with a given file name. + * + * Uses the local schema resources. + */ + public static Document parseXmlValidating(String fileName) throws Exception { + return DOMUtils.parseDocument( + new FileInputStream(fileName), + true, + Constants.ALL_SCHEMA_LOCATIONS, + null); + } + + /** + * Parse an XML from a String. + */ + public static Document parseXmlString(String xml) throws Exception { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + + factory.setNamespaceAware(true); + builder = factory.newDocumentBuilder(); + + return builder.parse(new InputSource(new StringReader(xml))); + } + +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/DOMUtilsTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/DOMUtilsTest.java new file mode 100644 index 000000000..eb3ad1a5c --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/DOMUtilsTest.java @@ -0,0 +1,137 @@ +package test.at.gv.egovernment.moa.util; +import java.io.FileInputStream; +import java.util.Map; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import test.at.gv.egovernment.moa.*; + +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +/** + * @author Patrick Peck + * @version $Id$ + */ +public class DOMUtilsTest extends MOATestCase { + private static final String TESTDATA_BASE = TESTDATA_ROOT + "xml/"; + private static boolean grammarsInitialized = false; + + /** + * Constructor for DOMUtilsTest. + * @param name + */ + public DOMUtilsTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + if (!grammarsInitialized) { + // preparse XML schema + DOMUtils.addSchemaToPool( + getClass().getResourceAsStream(Constants.XML_SCHEMA_LOCATION), + Constants.XML_NS_URI); + // preparse XMLDsig Filter2 schema + DOMUtils.addSchemaToPool( + getClass().getResourceAsStream(Constants.DSIG_FILTER2_SCHEMA_LOCATION), + Constants.DSIG_FILTER2_NS_URI); + // preparse XMLDsig schema + DOMUtils.addSchemaToPool( + getClass().getResourceAsStream(Constants.DSIG_SCHEMA_LOCATION), + Constants.DSIG_NS_URI); + // preparse MOA schema + DOMUtils.addSchemaToPool( + getClass().getResourceAsStream(Constants.MOA_SCHEMA_LOCATION), + Constants.MOA_NS_URI); + grammarsInitialized = true; + } + } + + private Document parse(String fileName) throws Exception { + return DOMUtils.parseDocument( + new FileInputStream(fileName), + true, + Constants.ALL_SCHEMA_LOCATIONS, + null); + } + + public void testParseCreateXMLSignature() throws Exception { + parse(TESTDATA_BASE + "CreateXMLSignature/TestGeneratorCX2.005.Req.xml"); + parse(TESTDATA_BASE + "CreateXMLSignature/Req000.xml"); + parse(TESTDATA_BASE + "CreateXMLSignature/Req001.xml"); + parse(TESTDATA_BASE + "CreateXMLSignature/Req002.xml"); + parse(TESTDATA_BASE + "CreateXMLSignature/Req004.xml"); + } + + public void testParseVerifyCMSSignature() throws Exception { + parse(TESTDATA_BASE + "VerifyCMSSignature/Req000.xml"); + } + + public void testParseVerifyXMLSignature() throws Exception { + parse(TESTDATA_BASE + "VerifyXMLSignature/Req000.xml"); + parse(TESTDATA_BASE + "VerifyXMLSignature/Req001.xml"); + parse(TESTDATA_BASE + "VerifyXMLSignature/Req002.xml"); + parse(TESTDATA_BASE + "VerifyXMLSignature/TestGeneratorVX.002.Req.xml"); + //parse(TESTDATA_BASE + "VerifyXMLSignature/TestGeneratorVX.006.Req.xml"); + parse(TESTDATA_BASE + "VerifyXMLSignature/VerifySAMLRequest.xml"); + } + + public void testParseInfobox() throws Exception { + parse(TESTDATA_BASE + "Infobox/InfoboxReadResponseMOA4.xml"); + parse(TESTDATA_BASE + "Infobox/InfoboxReadResponse.xml"); + } + + + private Document parsePlain(String fileName) throws Exception { + return DOMUtils.parseDocument( + new FileInputStream(fileName), + false, + null, + null); + } + + public void testValidateCreateXMLSignature() throws Exception { + Document doc; + boolean valid; + + // test a valid request + doc = parsePlain(TESTDATA_BASE + "CreateXMLSignature/Req000.xml"); + valid = + DOMUtils.validateElement( + doc.getDocumentElement(), + Constants.ALL_SCHEMA_LOCATIONS, + null); + assertTrue(valid); + + // test an invalid request + doc = parsePlain(TESTDATA_BASE + "CreateXMLSignature/invalid.xml"); + try { + valid = + DOMUtils.validateElement( + doc.getDocumentElement(), + Constants.ALL_SCHEMA_LOCATIONS, + null); + fail(); + } catch (Exception e) { + } + } + + public void testGetNamespaceDeclarations() throws Exception { + Document doc; + NodeList nl; + Element elem; + Map nsDecls; + + doc = parse(TESTDATA_BASE + "VerifyXMLSignature/Req002.xml"); + nl = doc.getElementsByTagNameNS(Constants.DSIG_NS_URI, "Reference"); + elem = (Element) nl.item(0); + nsDecls = DOMUtils.getNamespaceDeclarations(elem); + + assertEquals(2, nsDecls.size()); + assertEquals(Constants.DSIG_NS_URI, nsDecls.get("dsig")); + assertEquals(Constants.MOA_NS_URI, nsDecls.get("")); + } + +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java new file mode 100644 index 000000000..da6b29b1c --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java @@ -0,0 +1,104 @@ +package test.at.gv.egovernment.moa.util; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import junit.framework.TestCase; + +import at.gv.egovernment.moa.util.DateTimeUtils; + +/** + * @author Patrick Peck + * @version $Id$ + */ +public class DateTimeUtilsTest extends TestCase { + + /** + * Constructor for DateTimeUtilsTest. + * @param arg0 + */ + public DateTimeUtilsTest(String arg0) { + super(arg0); + } + + public void testParseDateTimeValid() throws Exception { + Date date; + DateFormat format = SimpleDateFormat.getDateTimeInstance(); + String dateStr; + + format.setTimeZone(TimeZone.getTimeZone("GMT")); + date = DateTimeUtils.parseDateTime("+1971-12-12T06:30:15"); + date.setTime(date.getTime() + TimeZone.getDefault().getRawOffset()); + dateStr = format.format(date); + assertEquals("12.12.1971 06:30:15", dateStr); + + date = DateTimeUtils.parseDateTime("2000-01-01T23:59:59.012Z"); + dateStr = format.format(date); + assertEquals("01.01.2000 23:59:59", dateStr); + + date = DateTimeUtils.parseDateTime("2003-05-20T12:17:30-05:00"); + dateStr = format.format(date); + assertEquals("20.05.2003 17:17:30", dateStr); + + + date = DateTimeUtils.parseDateTime("2002-02-02T02:02:02.33+04:30"); + dateStr = format.format(date); + assertEquals("01.02.2002 21:32:02", dateStr); + } + + public void testParseDateTimeInvalid() { + try { + DateTimeUtils.parseDateTime("+1971-12-12T6:30:15"); + fail(); + } catch (ParseException e) { + } + + try { + DateTimeUtils.parseDateTime("2000-01-0123:59:59.999999Z"); + fail(); + } catch (ParseException e) { + } + + try { + DateTimeUtils.parseDateTime("2003-05-20T12:17:3005:00"); + fail(); + } catch (ParseException e) { + } + + try { + DateTimeUtils.parseDateTime(" 2002-02-02T02:02:02.33+04:00"); + fail(); + } catch (ParseException e) { + } + + } + + public void testBuildDateTimeGMTMinus3() { + String should = "2002-01-01T01:01:01-03:00"; + doTestBuildDateTime(2002, 1, 1, 1, 1, 1, "GMT-03:00", should); + } + public void testBuildDateTimeMEZSommerzeit() { + String should = "2002-07-31T23:59:59+02:00"; + doTestBuildDateTime(2002, 7, 31, 23, 59, 59, "GMT+01:00", should); + } + public void testBuildDateTimeGMT() { + String should = "2002-01-01T01:01:01"; + doTestBuildDateTime(2002, 1, 1, 1, 1, 1, "GMT+00:00", should); + } + private void doTestBuildDateTime( + int year, int month, int day, + int hour, int min, int sec, + String timeZone, String dateTimeShould) { + + Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(timeZone)); + cal.set(year,month, day, hour, min, sec); + cal.set(Calendar.MILLISECOND, 0); + String dateTimeBuilt = DateTimeUtils.buildDateTime(cal); + assertEquals(dateTimeShould, dateTimeBuilt); + } + +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java new file mode 100644 index 000000000..a6d1847ce --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java @@ -0,0 +1,90 @@ +package test.at.gv.egovernment.moa.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.math.BigInteger; +import java.security.KeyStore; +import java.security.Security; +import java.security.cert.X509Certificate; +import java.util.Enumeration; + +import at.gv.egovernment.moa.util.KeyStoreUtils; + +import junit.framework.TestCase; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class KeyStoreUtilsTest extends TestCase { + private String tmpDir = "tmp/KeyStoreUtilsTest"; + private String tmpDirURL = "file:" + tmpDir; + + public KeyStoreUtilsTest(String arg0) { + super(arg0); + } + + protected void setUp() throws Exception { + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + new File(tmpDir).mkdirs(); + } + protected void tearDown() throws Exception { + new File(tmpDir).delete(); + } + public void testCreateKeyStoreJKS() throws Exception { + String[] certFilenames = new String[] { + "data/test/security/server-certs/baltimore.cer" + }; + KeyStore ks = KeyStoreUtils.createKeyStore("jks", certFilenames); + assertEquals(1, ks.size()); + X509Certificate cert = (X509Certificate)ks.getCertificate("0"); + assertEquals(3424, cert.getSerialNumber().intValue()); + } + public void testCreateKeyStorePKCS12() throws Exception { + String[] certFilenames = new String[] { + "data/test/security/server-certs/baltimore.cer" + }; + KeyStore ks = KeyStoreUtils.createKeyStore("pkcs12", certFilenames); + assertEquals(1, ks.size()); + X509Certificate cert = (X509Certificate)ks.getCertificate("0"); + assertEquals(3424, cert.getSerialNumber().intValue()); + } + public void testCreateKeyStoreFromCertificateDirectory() throws Exception { + // copy certificate files to a temporary directory, + // omitting the "CVS" directory in the source directory + copyCertificates("data/test/security/server-certs", tmpDir); + KeyStore ks = KeyStoreUtils.createKeyStoreFromCertificateDirectory("jks", tmpDirURL); + assertEquals(2, ks.size()); + X509Certificate cert0 = (X509Certificate)ks.getCertificate("0"); + X509Certificate cert1 = (X509Certificate)ks.getCertificate("1"); + assertTrue(3424 == cert0.getSerialNumber().intValue() || 3424 == cert1.getSerialNumber().intValue()); + } + private void copyCertificates(String from, String to) throws IOException { + String[] fromList = new File(from).list(); + for (int i = 0; i < fromList.length; i++) { + File fromFile = new File(from + File.separator + fromList[i]); + if (fromFile.isFile()) { + String toFile = to + "/" + fromList[i]; + FileInputStream in = new FileInputStream(fromFile); + FileOutputStream out = new FileOutputStream(toFile); + for (int ch = in.read(); ch >= 0; ch = in.read()) + out.write(ch); + out.close(); + in.close(); + } + } + + } + public void testLoadKeyStore() throws Exception { + String keyStoreURL = "file:data/test/security/client-certs/sicher-demo(buergerkarte).p12"; + KeyStore ks = KeyStoreUtils.loadKeyStore("pkcs12", keyStoreURL, "buergerkarte"); + assertEquals(1, ks.size()); + Enumeration aliases = ks.aliases(); + String alias = (String)aliases.nextElement(); + X509Certificate cert = (X509Certificate)ks.getCertificate(alias); + assertEquals(new BigInteger("1044289238331").intValue(), cert.getSerialNumber().intValue()); + } + +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/SSLUtilsTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/SSLUtilsTest.java new file mode 100644 index 000000000..7e55cb7d0 --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/SSLUtilsTest.java @@ -0,0 +1,160 @@ +package test.at.gv.egovernment.moa.util; + +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.security.KeyStore; +import java.security.Security; + +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSocketFactory; + +import com.sun.net.ssl.HostnameVerifier; +import com.sun.net.ssl.HttpsURLConnection; + +import at.gv.egovernment.moa.util.KeyStoreUtils; +import at.gv.egovernment.moa.util.SSLUtils; + +import junit.framework.TestCase; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class SSLUtilsTest extends TestCase { + + public SSLUtilsTest(String arg0) { + super(arg0); + } + + + protected void setUp() throws Exception { + //System.setProperty("javax.net.debug", "all"); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("https.cipherSuites", "SSL_DHE_DSS_WITH_DES_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,SSL_RSA_WITH_DES_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_EXPORT_WITH_RC4_40_MD5"); + } + + public void testGetSSLSocketFactoryBaltimoreOK() throws Exception { + doTestGetSSLSocketFactory( + "GET", + "https://www.baltimore.com/", + false, + "file:data/test/security/cacerts+gt_cybertrust_root", + "changeit", + true); + } + public void testGetSSLSocketFactoryBaltimoreNOK() throws Exception { + doTestGetSSLSocketFactory( + "GET", + "https://www.baltimore.com/", + false, + "file:data/test/security/cacerts", + "changeit", + false); + } + public void testGetSSLSocketFactoryVerisignOK() throws Exception { + doTestGetSSLSocketFactory( + "GET", + "https://www.verisign.com/", + false, + "file:data/test/security/cacerts", + "changeit", + true); + } + public void testGetSSLSocketFactoryVerisignNoTruststoreOK() throws Exception { + doTestGetSSLSocketFactory( + "GET", + "https://www.verisign.com/", + false, + null, + null, + true); + } + public void testGetSSLSocketFactoryLocalhostOK() throws Exception { + String urlString = "https://localhost:8443/moa-id-auth/index.jsp"; + doTestGetSSLSocketFactory( + "GET", + urlString, + true, + "file:data/test/security/server.keystore.tomcat", + "changeit", + true); + } + public void testGetSSLSocketFactoryLocalhostNOK() throws Exception { + String urlString = "https://localhost:8443/moa-id-auth/index.jsp"; + doTestGetSSLSocketFactory( + "GET", + urlString, + true, + null, + null, + false); + } + + public void doTestGetSSLSocketFactory( + String requestMethod, + String urlString, + boolean useHostnameVerifierHack, + String truststoreurl, + String trustpassword, + boolean shouldOk + ) throws Exception { + + doTestGetSSLSocketFactory( + requestMethod, urlString, useHostnameVerifierHack, truststoreurl, trustpassword, null, null, null, shouldOk); + } + public void doTestGetSSLSocketFactory( + String requestMethod, + String urlString, + boolean useHostnameVerifierHack, + String truststoreurl, + String trustpassword, + String keystoretype, + String keystoreurl, + String keypassword, + boolean shouldOk + ) throws Exception { + + KeyStore truststore = null; + if (truststoreurl != null) + truststore = KeyStoreUtils.loadKeyStore("jks", truststoreurl, trustpassword); + SSLSocketFactory sf = SSLUtils.getSSLSocketFactory( + truststore, keystoretype, keystoreurl, keypassword); + System.out.println(requestMethod + " " + urlString); + + URL url = new URL(urlString); + HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); + conn.setRequestMethod(requestMethod); + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + conn.setAllowUserInteraction(false); + conn.setSSLSocketFactory(sf); + if (useHostnameVerifierHack) + conn.setHostnameVerifier(new HostnameVerifierHack()); + try { + conn.connect(); + assertTrue(shouldOk); + assertEquals(200, conn.getResponseCode()); + conn.disconnect(); + } + catch (SSLException ex) { + assertFalse(shouldOk); + } + } + private byte[] readTruststore(String filename) throws IOException { + if (filename == null) + return null; + FileInputStream in = new FileInputStream(filename); + byte[] buffer = new byte[in.available()]; + in.read(buffer); + in.close(); + return buffer; + } + private class HostnameVerifierHack implements HostnameVerifier { + public boolean verify(String arg0, String arg1) { + return true; + } + } +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/URLDecoderTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/URLDecoderTest.java new file mode 100644 index 000000000..b6ea0e152 --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/URLDecoderTest.java @@ -0,0 +1,29 @@ +package test.at.gv.egovernment.moa.util; + +import java.net.URLEncoder; + +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.URLDecoder; + +import junit.framework.TestCase; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class URLDecoderTest extends TestCase { + + public void test() throws Exception { + String s = "immerZUA0129<>%==$$%&/()@?{()=} \\\"äöüÄÖÜ?§"; + String senc = URLEncoder.encode(s); + String sdec = URLDecoder.decode(senc, "ISO-8859-1"); + assertEquals(s, sdec); + } + public void testUTF8() throws Exception { + String s = new String(FileUtils.readFile("data/test/xml/CreateXMLSignature/CreateXMLSignatureResponse.xml")); + String senc = URLEncoder.encode(s); + String sdec = URLDecoder.decode(senc, "UTF-8"); + String sutf8 = FileUtils.readFile("data/test/xml/CreateXMLSignature/CreateXMLSignatureResponse.xml", "UTF-8"); + assertEquals(sutf8, sdec); + } +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/URLEncoderTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/URLEncoderTest.java new file mode 100644 index 000000000..43238c51f --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/URLEncoderTest.java @@ -0,0 +1,43 @@ +package test.at.gv.egovernment.moa.util; + +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.URLDecoder; +import at.gv.egovernment.moa.util.URLEncoder; +import junit.framework.TestCase; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class URLEncoderTest extends TestCase { + + public void testUnchangedString() throws Exception { + String s = "AZaz0123456789.-*_"; + String senc = URLEncoder.encode(s, "UTF-8"); + assertEquals(s, senc); + } + public void testAumlUTF8() throws Exception { + String s = "ä"; + String senc = URLEncoder.encode(s, "UTF-8"); + assertEquals("%C3%A4", senc); + } + public void testEncodeDecode() throws Exception { + String s = "AZaz09.-*_ <>%=$%&/()@?{}[]\\\"'äöüÄÖÜߧ"; + String senc = URLEncoder.encode(s, "UTF-8"); + String sdec = URLDecoder.decode(senc, "UTF-8"); + assertEquals(s, sdec); + } + public void testCertInfo() throws Exception { + String s = new String(FileUtils.readFile("data/test/xml/VerifyXMLSignature/CertInfoVerifyXMLSignatureRequest.xml", "UTF-8")); + String senc = URLEncoder.encode(s, "UTF-8"); + String sdec = URLDecoder.decode(senc, "UTF-8"); + assertEquals(s, sdec); + } + /*public void testJDK14() throws Exception { + String s = new String(FileUtils.readFile("data/test/xml/VerifyXMLSignature/CertInfoVerifyXMLSignatureRequest.xml", "UTF-8")); + String senc = URLEncoder.encode(s, "UTF-8"); + String senc14 = java.net.URLEncoder.encode(s, "UTF-8"); + assertEquals(senc, senc14); + }*/ + +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java new file mode 100644 index 000000000..7986fe540 --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java @@ -0,0 +1,99 @@ +package test.at.gv.egovernment.moa.util; +import java.io.FileInputStream; +import java.io.InputStream; + +import org.apache.xerces.parsers.DOMParser; +import org.apache.xerces.parsers.XMLGrammarPreparser; +import org.apache.xerces.util.SymbolTable; +import org.apache.xerces.util.XMLGrammarPoolImpl; +import org.apache.xerces.xni.grammars.Grammar; +import org.apache.xerces.xni.grammars.XMLGrammarDescription; +import org.apache.xerces.xni.parser.XMLInputSource; +import org.xml.sax.InputSource; + +import test.at.gv.egovernment.moa.MOATestCase; + +import at.gv.egovernment.moa.util.Constants; + + +/** + * Experimentation with Xerces grammar caching. + * + * Used the Xerces sample 'XMLGrammarBuilder' as a starting point. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLGrammarBuilderTest extends MOATestCase { + + private static final String GRAMMAR_POOL = + org.apache.xerces.impl.Constants.XERCES_PROPERTY_PREFIX + + org.apache.xerces.impl.Constants.XMLGRAMMAR_POOL_PROPERTY; + + protected static final String NAMESPACES_FEATURE_ID = + "http://xml.org/sax/features/namespaces"; + protected static final String VALIDATION_FEATURE_ID = + "http://xml.org/sax/features/validation"; + protected static final String SCHEMA_VALIDATION_FEATURE_ID = + "http://apache.org/xml/features/validation/schema"; + protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = + "http://apache.org/xml/features/validation/schema-full-checking"; + + private static final int BIG_PRIME = 2039; + private SymbolTable symbolTable; + private XMLGrammarPoolImpl grammarPool; + + /** + * Constructor for XMLGrammarBuilderTest. + * @param name + */ + public XMLGrammarBuilderTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + XMLGrammarPreparser preparser; + + // set up symbol table and grammar pool + symbolTable = new SymbolTable(BIG_PRIME); + grammarPool = new XMLGrammarPoolImpl(); + preparser = new XMLGrammarPreparser(symbolTable); + preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null); + preparser.setProperty(GRAMMAR_POOL, grammarPool); + preparser.setFeature(NAMESPACES_FEATURE_ID, true); + preparser.setFeature(VALIDATION_FEATURE_ID, true); + // now we can still do schema features just in case, + // so long as it's our configuraiton...... + preparser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true); + preparseSchemaResource( + preparser, + Constants.DSIG_SCHEMA_LOCATION, + "/resources/schemas/xmldsig-core-schema.xsd"); + } + + private static Grammar preparseSchemaResource( + XMLGrammarPreparser preparser, + String systemId, + String resource) + throws Exception { + + InputStream is = XMLGrammarBuilderTest.class.getResourceAsStream(resource); + return preparser.preparseGrammar( + XMLGrammarDescription.XML_SCHEMA, + new XMLInputSource(null, systemId, null, is, null)); + } + + public void testParseValidating() throws Exception { + DOMParser parser = new DOMParser(symbolTable, grammarPool); + + parser.setFeature(NAMESPACES_FEATURE_ID, true); + parser.setFeature(VALIDATION_FEATURE_ID, true); + parser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true); + + parser.parse( + new InputSource( + new FileInputStream(TESTDATA_ROOT + "xml/dsigTransform/base64.xml"))); + parser.getDocument(); + } + +} diff --git a/common-test/src/main/java/test/at/gv/egovernment/moa/util/XPathUtilsTest.java b/common-test/src/main/java/test/at/gv/egovernment/moa/util/XPathUtilsTest.java new file mode 100644 index 000000000..559494300 --- /dev/null +++ b/common-test/src/main/java/test/at/gv/egovernment/moa/util/XPathUtilsTest.java @@ -0,0 +1,51 @@ +package test.at.gv.egovernment.moa.util; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; + +import test.at.gv.egovernment.moa.MOATestCase; + +import at.gv.egovernment.moa.util.XPathUtils; + + +/** + * @author Patrick Peck + * @version $Id$ + */ +public class XPathUtilsTest extends MOATestCase { + + private Document doc1; + + /** + * Constructor for XPathUtilsTest. + * @param name + */ + public XPathUtilsTest(String name) { + super(name); + } + + /** + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + doc1 = + parseXml(TESTDATA_ROOT + "xml/VerifyXMLSignature/Req000.xml"); + } + + public void testSelectNodeList() throws Exception { + NodeList nodes; + + nodes = + XPathUtils.selectNodeList( + doc1.getDocumentElement(), + doc1.getDocumentElement(), + "/VerifyXMLSignatureRequest"); + assertEquals(1, nodes.getLength()); + nodes = + XPathUtils.selectNodeList( + doc1.getDocumentElement(), + "//dsig:Signature"); + assertEquals(1, nodes.getLength()); + } + +} diff --git a/common/build.xml b/common/build.xml deleted file mode 100644 index cf352e47b..000000000 --- a/common/build.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/properties/common_messages_de.properties b/common/res/resources/properties/common_messages_de.properties deleted file mode 100644 index ac05b7996..000000000 --- a/common/res/resources/properties/common_messages_de.properties +++ /dev/null @@ -1,16 +0,0 @@ -# This file contains exception messages in the standard Java properties -# format. The messages may contain formatting patterns as definied in the -# java.text.MessageFormat class. - - -# -# Messages private to the MOA common subsystem -# - -parser.00=Leichter Fehler beim Parsen: {0}, SystemID={1}, Zeile={2}, Spalte={3} -parser.01=Fehler beim Parsen: {0}, SystemID={1}, Zeile={2}, Spalte={3} -parser.02=Schwerer Fehler beim Parsen: {0}, SystemID={1}, Zeile={2}, Spalte={3} - -xpath.00=Fehler beim Auswerten des XPath-Ausdruckes: {0} - -datetime.00=Fehler beim Parsen der DateTime \ No newline at end of file diff --git a/common/res/resources/schemas/Core-1.2.xsd b/common/res/resources/schemas/Core-1.2.xsd deleted file mode 100644 index 864fee6d5..000000000 --- a/common/res/resources/schemas/Core-1.2.xsd +++ /dev/null @@ -1,881 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/Core.20020225.xsd b/common/res/resources/schemas/Core.20020225.xsd deleted file mode 100644 index 5dd2836a0..000000000 --- a/common/res/resources/schemas/Core.20020225.xsd +++ /dev/null @@ -1,399 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/Core.20020831.xsd b/common/res/resources/schemas/Core.20020831.xsd deleted file mode 100644 index 6ec40be63..000000000 --- a/common/res/resources/schemas/Core.20020831.xsd +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/ECDSAKeyValue.ancient.xsd b/common/res/resources/schemas/ECDSAKeyValue.ancient.xsd deleted file mode 100644 index 833d327f2..000000000 --- a/common/res/resources/schemas/ECDSAKeyValue.ancient.xsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/ECDSAKeyValue.wrong.xsd b/common/res/resources/schemas/ECDSAKeyValue.wrong.xsd deleted file mode 100644 index db83c9df5..000000000 --- a/common/res/resources/schemas/ECDSAKeyValue.wrong.xsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/ECDSAKeyValue.xsd b/common/res/resources/schemas/ECDSAKeyValue.xsd deleted file mode 100644 index 7a01b23d1..000000000 --- a/common/res/resources/schemas/ECDSAKeyValue.xsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/MOA-ID-Configuration-1.2.xsd b/common/res/resources/schemas/MOA-ID-Configuration-1.2.xsd deleted file mode 100644 index 4b018db64..000000000 --- a/common/res/resources/schemas/MOA-ID-Configuration-1.2.xsd +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - enthält Konfigurationsparameter der - Proxy-Komponente - - - - - - enthält Parameter für die Kommunikation zw. - Proxykomponente und Authenttisierungskomponente - - - - - - enthält Parameter für die SOAP-Verbindung von der - Proxy-Komponente zur Auth-Komponente (vgl. - AuthComponent/MOA-SP/ConnectionParameter) - - - - - - - - - - - enthält Parameter für die OA - - - - - - - - - - - - - spezifiziert den Algorithmus ("pkix" oder "chaining") für die - Zertifikatspfadvalidierung - - - - - - ein vom SystemDefaultMode abweichender ChiningMode kann - für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das vertrauenswürdige CA - (Zwischen-CA, Wurzel-CA) Zertifikate enthält. - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - das Attribut filename verweist auf eine Datei mit globalem - Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo - werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks - inkludiert - - - - - - - - - - - enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA - SP Modul - - - - - - enthält Parameter für die SOAP-Verbindung von der - AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; - wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; - wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben - werden; wird das Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - enthält Parameter für die Ãœberprüfung der - Personenbindung - - - - - - - - - - enthält Parameter für die Ãœberprüfung des - AUTH-Blocks - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers des - IdentityLinks - - - - - - akzeptierte Signer des IdentityLinks werden per - X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der - TLS-Verbindung enthält (keine CA-Zertifikate) - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel, der für - die TLS-Client-Authentisierung verwendetwird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/MOA-ID-Configuration-1.3.xsd b/common/res/resources/schemas/MOA-ID-Configuration-1.3.xsd deleted file mode 100644 index 66c6e1832..000000000 --- a/common/res/resources/schemas/MOA-ID-Configuration-1.3.xsd +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - enthält Konfigurationsparameter der - Proxy-Komponente - - - - - - enthält Parameter für die Kommunikation zw. - Proxykomponente und Authenttisierungskomponente - - - - - - enthält Parameter für die SOAP-Verbindung von der - Proxy-Komponente zur Auth-Komponente (vgl. - AuthComponent/MOA-SP/ConnectionParameter) - - - - - - - - - - - enthält Parameter für die OA - - - - - - - - - - - - - - - - - - - - - spezifiziert den Algorithmus ("pkix" oder "chaining") für die - Zertifikatspfadvalidierung - - - - - - ein vom SystemDefaultMode abweichender ChiningMode kann - für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das vertrauenswürdige CA - (Zwischen-CA, Wurzel-CA) Zertifikate enthält. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - - - - - enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA - SP Modul - - - - - - enthält Parameter für die SOAP-Verbindung von der - AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; - wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; - wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben - werden; wird das Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - enthält Parameter für die Ãœberprüfung der - Personenbindung - - - - - - - - - - enthält Parameter für die Ãœberprüfung des - AUTH-Blocks - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers des - IdentityLinks - - - - - - akzeptierte Signer des IdentityLinks werden per - X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - - - das Attribut filename verweist auf eine Datei mit globalem - Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo - werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks - inkludiert - - - - - - - - - - - - das Attribut URL spezifiziert die Lage des Templates - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der - TLS-Verbindung enthält (keine CA-Zertifikate) - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel, der für - die TLS-Client-Authentisierung verwendetwird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/MOA-ID-Configuration-1.4.xsd b/common/res/resources/schemas/MOA-ID-Configuration-1.4.xsd deleted file mode 100644 index 66a9c0ed4..000000000 --- a/common/res/resources/schemas/MOA-ID-Configuration-1.4.xsd +++ /dev/null @@ -1,505 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - enthält Konfigurationsparameter der - Proxy-Komponente - - - - - - enthält Parameter für die Kommunikation zw. - Proxykomponente und Authenttisierungskomponente - - - - - - enthält Parameter für die SOAP-Verbindung von der - Proxy-Komponente zur Auth-Komponente (vgl. - AuthComponent/MOA-SP/ConnectionParameter) - - - - - - - - - - - enthält Parameter für die OA - - - - - - - - - - - - - - - - - - - - - - spezifiziert den Algorithmus ("pkix" oder "chaining") für die - Zertifikatspfadvalidierung - - - - - - ein vom SystemDefaultMode abweichender ChiningMode kann - für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das vertrauenswürdige CA - (Zwischen-CA, Wurzel-CA) Zertifikate enthält. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - - - - - enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA - SP Modul - - - - - - enthält Parameter für die SOAP-Verbindung von der - AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; - wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; - wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben - werden; wird das Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - enthält Parameter für die Ãœberprüfung der - Personenbindung - - - - - - - - - - enthält Parameter für die Ãœberprüfung des - AUTH-Blocks - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers des - IdentityLinks - - - - - - akzeptierte Signer des IdentityLinks werden per - X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - enthält Defaultparameter für die Ãœberprüfung weiterer Infoboxen - - - - - - - das Attribut filename verweist auf eine Datei mit globalem - Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo - werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks - inkludiert - - - - - - - - - - - - das Attribut URL spezifiziert die Lage des Templates - - - - - - Verifikation zusätzlicher Infoboxen - - - - - Optionales DefaultTrustprofil für die Ãœberprüfung aller weiteren Infoboxen - - - - - - - - - - Parameter für Ãœberprüfung weiterer Infoboxen - - - - - - optionalervName, der für Fehlermeldungen verwendet werden soll; - z.B.: "Stellvertretungen" für "Mandates"; fehlt dieser Parameter, dann wird - das Identifier-Attribut verwendet - - - - - TrustProfil, das für die Ãœberprüfung der Infobox - verwendet werden soll - - - - - Validatorklasse, die für die Prüfung der Infobox - verwendet werden soll; muss gesetzt werden, wenn Package- und Klassenname - vom Default Package- und Klassennamen abweichen - - - - - - Infobox spezifische Parameter, die der jeweiligen Prüfapplikation - übergeben werden - - - - - - - - - - - - - - - - - - - Spezifiziert die Lage von XML Schemas - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der - TLS-Verbindung enthält (keine CA-Zertifikate) - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel, der für - die TLS-Client-Authentisierung verwendetwird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/MOA-SPSS-1.3.xsd b/common/res/resources/schemas/MOA-SPSS-1.3.xsd deleted file mode 100644 index 756b51279..000000000 --- a/common/res/resources/schemas/MOA-SPSS-1.3.xsd +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage - - - - Resultat, falls die Signaturerstellung erfolgreich war - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resultat, falls die Signaturerstellung gescheitert ist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. - - - - - Profilbezeichner für einen Transformationsweg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. - - - - Der Transformationsparameter explizit angegeben. - - - - - Der Hashwert des Transformationsparameters. - - - - - - - - - - - - - - - - - - - - - - Explizite Angabe des Transformationswegs - - - - - - - Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/MOA-SPSS-config-1.3.xsd b/common/res/resources/schemas/MOA-SPSS-config-1.3.xsd deleted file mode 100644 index 8ab3d62aa..000000000 --- a/common/res/resources/schemas/MOA-SPSS-config-1.3.xsd +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/MOAIdentities.xsd b/common/res/resources/schemas/MOAIdentities.xsd deleted file mode 100644 index de9d9d4e4..000000000 --- a/common/res/resources/schemas/MOAIdentities.xsd +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - MOAIdentities provides a mapping from identities to parameters used in the XMLLoginParameterResolver of MOA-ID - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/PersonData.xsd b/common/res/resources/schemas/PersonData.xsd deleted file mode 100644 index 0e3bc6b3b..000000000 --- a/common/res/resources/schemas/PersonData.xsd +++ /dev/null @@ -1,426 +0,0 @@ - - - - - - - - - - - - - unique identifier - - - - - actual value of the identifier. - - - - - - - - - - - - type of value (eg 'ZMR', 'SV-Nummer', 'Martrikelnummer', database identification, ...) - - - - - authority, which is reponsible for generation of the identifier (eg university in case of 'MatrikelNummer') - - - - - any additional properties - - - - - - - - - - element of person type - - - - - main structure of person data - - - - - unique identification entities - - - - - - - - - - element of physical person type - - - - - physical person - - - - - - - data related to the person's name - - - - - Former name, Artist name, changes of Given name ... - - - - - - - - - - - - status of a person in the cycle of life - - - - - gender - - - - - date of birth - - - - - place of birth - - - - - country of birth - - - - - nationality of Person (Staatsbürgerschaft) - - - - - confession (religion) of Person - - - - - relatives (parents, ...) - - - - - - type of the relationship - - - - - - - - - any additional properties - - - - - - - - - element of corporate body type - - - - - juridical person, organisation - - - - - - - category (eg organisation, function, sector, ...) - - - - - name of corporate body (whole name) - - - - - alternative names of corporate body (abbreviations, short name, synonyms, ...) - - - - - type of company (eg AG, OHG, ...) - - - - - part of an organisation, see also X.500 ou (eg departement, section, branch, ...) - - - - - any additional properties - - - - - - - - - - element of signed person datastructure type - - - - - signed person datastructure. The first Identification elements (from the base type) denote the record as such (e.g. database key for this record) - not to be mistaken for identifiers of the person or of an address (they have their own Identification elements). - - - - - - - - - one or more electronic signatures applied on fields above - - - - - - - - any additional properties - - - - - - - - - - - - - simple type for sex (gender) of person - - - - - - - - - - simple type for dates (union), which may omit day and/or month - - - - - - simple type for marital status of a person - - - - - - - - - - - pattern type for enlargement of type definitions - - - - - - - - known relations (family + functional) - - - - - - - - - - - - - - - - known + any other relation - - - - - - known types of alternative names - - - - - - - - - - - - known + any other alternative name types - - - - - - - element of address type - - - - - main structure of address data - - - - - unique identification entities - - - - - - - - - element of postal address type - - - - - postal address - - - - - - - type of address - category (eg 'Wohnsitz', 'Zentrale', ...) - - - - - - any additional properties - - - - - - - - - element of telephone address type - - - - - phone numbers - - - - - - - type of phononumber - category (eg 'Festnetz', 'Mobile', 'fax', ...) - - - - - phonenumber - - - - - any additional properties - - - - - - - - - element of internet address type - - - - - internet based communication - - - - - - - certificate for secure communication - - - - - email-Address, Web, FTP, LDAP, ... - - - - - any additional properties - - - - - - - diff --git a/common/res/resources/schemas/PersonData_20_en_moaWID.xsd b/common/res/resources/schemas/PersonData_20_en_moaWID.xsd deleted file mode 100644 index cf8f796db..000000000 --- a/common/res/resources/schemas/PersonData_20_en_moaWID.xsd +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - - - - - This version of person deploys only global elements. All types derived from abstract types have been replaced by substitution groups - - - - - dummy abstract Peson Data element needed for bi-lingual schema (substitution groups) - - - - - element of signed person datastructure type - - - - - element of signed person datastructure type - - - - - - - - - - - - - - - - - - - element of person type, essential abstract, subsitute PhysicalPerson or CorporateBody instead or use with xsi:type="..." - - - - - - element of physical person type, dreived from Person (abstract) - - - - - element of physical person type, dreived from Person (abstract) - - - - - element of corporate body type, derived from Person - - - - - element of corporate body type, derived from Person - - - - - - data related to the person's name - - - - - data related to the person's name - - - - - Former name, Artist name, changes of Given name ..., compare AlternativName - - - - - - - - - - - - relatives (parents, ...), compare Verwandter - - - - - - type of the relationship, compare Verwandschftsgrad - - - - - - - - - - element of address type, essentially abstract. Use InternetAddress, TelephoneAddress, PostalAddress, TypedPostalAddress instead, or use Address with xsi:type Attribute - - - - - Postal or ZMR Address, compare PostAdresse - - - - - Postal or ZMR Address, compare PostAdresse - - - - - Typed Postal or ZMR Address, compare TypisiertePostAdresse - - - - - InternetAdress such as e-mail or website, compare InternetAdresse - - - - - Typed TelephoneAddress, compare TelefonAdresse - - - - - National or international bank connection, compare Bankverbindung - - - - - - possibility to include common austrian primary keys in human readable way, english translation not available - - - - - - - - - - - - - - - - - - - - - - - - Ergänzungsregister für nicht-natürliche Personen (CorporateBody) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - teletyper or telephone for the hearing impaired - - - - - - status of a person in the cycle of life, compare Familienstand - - - - - gender, comapre Geschlecht - - - - - date of birth, compare Geburtsdatum - - - - - date of death, compare Sterbedatum - - - - - place of birth, compare Geburtsort - - - - - country of birth, compare Geburtsland - - - - - state of birth, comapre Geburtsbundesland - - - - - nationality of Person, compare Staatsangehoerigkeit. attention! New Fomrat is complex, string value accepted for compatibility only - - - - - confession (religion) of Person - xs:token? gibt es wirklich keine Staaten mit Leerzeichen im Namen? - - - - - occupation, compare Beruf - - - - - - compare InternationalerLaendercode - - - - - compare NationalNummer - - - - - compare Vorwahl - - - - - compare Anschlussnummer - - - - - Complete number, ready formated - e.g. +43 1 5131345 4664 compare FormatierteNummer - - - - - compare Klappe - - - - - unique identifier - - - - - - signed person datastructure. The first Identification elements (from the base type) denote the record as such (e.g. database key for this record) - not to be mistaken for identifiers of the person or of an address (they have their own Identification elements). - - - - - - - - - one or more electronic signatures applied on fields above - - - - - container for your Information needs. Contained Elements must reside in a different Namespace - - - - - - any additional properties - - - - - - - - - - - - signed person datastructure. The first Identification elements (from the base type) denote the record as such (e.g. database key for this record) - not to be mistaken for identifiers of the person or of an address (they have their own Identification elements). - - - - - - - - - one or more electronic signatures applied on fields above - - - - - container for your Information needs. Contained Elements must reside in a different Namespace - - - - - - any additional properties - - - - - - - - - - - - - - - - - unique identifier - - - - - actual value of the identifier. - - - - - - - - - - - - type of value (eg 'ZMR', 'SV-Nummer', 'Martrikelnummer', database identification, ...) - - - - - authority, which is reponsible for generation of the identifier (eg university in case of 'MatrikelNummer') - - - - - any additional properties - - - - - - - - - main structure of person data - - - - - unique identification entities - - - - - - - - - - physical person, compare NatuerlichePersonTyp - - - - - - - - - - - - - - - - - - - - - any additional properties - - - - - - - - - physical person, compare NatuerlichePersonTyp - - - - - - - - - - - - - any additional properties - - - - - - - - - juridical person, organisation, compare NichtNatuerlichePersonTyp - - - - - - - URI pointing to a predefined Class of CorporateBodies, compare Typ - - - - - name of corporate body (whole name), compare VollerName - - - - - alternative names of corporate body (abbreviations, short name, synonyms, ...), comapre AlternativName - - - - - type of company (eg AG, OHG, ...), URI pointing to predefined LegalForm, compare Rechtsform - - - - - part of an organisation, see also X.500 ou (eg departement, section, branch, ...) , compare Organisation - - - - - - any additional properties - - - - - - - - - juridical person, organisation, compare NichtNatuerlichePersonTyp - - - - - - - URI pointing to a predefined Class of CorporateBodies, compare Typ - - - - - name of corporate body (whole name), compare VollerName - - - - - type of company (eg AG, OHG, ...), URI pointing to predefined LegalForm, compare Rechtsform - - - - - part of an organisation, see also X.500 ou (eg departement, section, branch, ...) , compare Organisation - - - - - any additional properties - - - - - - - - - container for parts of a name, comapre PersonenNameTyp - - - - - Complete Name (including Affixes) of the Person, especially useful for names from different cultural environments - - - - - - - - - - - - - - - - - - - - - Every given name should be contained inside a GivenName Tag. If that is not possible due to dabase contraints, ... putting several given names inside one GivenName Element is acceptable - - - - - A Person in possesion of more than one GivenName frequently preferrs the use of a Name other than the first GivenName - - - - - MiddleNames are not commonly found in central Europe. The field is mainly for compatibility reasons - - - - - Every family name should be contained inside a FamilyName Tag. If that is not possible due to dabase contraints, ... putting several family names inside one FamilyName Element is acceptable - - - - - - - - - - - - - - - - - - - - - Inlcudes all Information that is not exactly a name: academic or aristocratic titles, ... the new position attribute can contain a suffx or prefix value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - container for parts of a name, comapre PersonenNameTyp - - - - - Every given name should be contained inside a GivenName Tag. If that is not possible due to dabase contraints, ... putting several given names inside one GivenName Element is acceptable - - - - - Every family name should be contained inside a FamilyName Tag. If that is not possible due to dabase contraints, ... putting several family names inside one FamilyName Element is acceptable - - - - - - - - - - - - - - - - - - - - - Inlcudes all Information that is not exactly a name: academic or aristocratic titles, ... the new position attribute can contain a suffx or prefix value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - comapre, StaatsangehoerigkeitTyp - - - - - - - - - - - - - - - - - - compare BankverbindungTyp - - - - - Account holder, compare Inhaber - - - - - compare BankName - - - - - - compare NationaleBankverbindung - - - - - - compare Kontonummer - - - - - compare BLZ - - - - - - - - compare InternationaleBankverbindung - - - - - - compare IBAN - - - - - comapre BIC - - - - - - - - - - - main structure of address data - - - - - unique identification entities - - - - - - - - - postal address with type information, compare TypisiertePostAdresseTyp - - - - - - - type of address - category (eg 'Wohnsitz', 'Zentrale', ...) - - - - - - any additional properties - - - - - - - - - compare PostAdresseTyp - - - - - - - Code for the country, use ISO or internatinal Postalstandard, compare Staatscode - - - - - - - - - - Name of the country, use ISO Name, or international Postal Standard, compare Staatsname - - - - - ZIP, compare Postleitzahl - - - - - compare Region - - - - - compare Bundesland - - - - - compare Gemeinde - - - - - compare Gemeindekennzahl - - - - - ZMR use, compare Ortschaft - - - - - ZMR use, comapre OrtschaftZweisprachig - - - - - - - - - - - - - - zmr use only - - - - - zmr use only - - - - - - Addressregister database keys used to identify Addresses - - - - - - - - - - - - - - - If Addressis used outside of PersonData a recipient can be specified - - - - - - - - rather OrganizationUnit e.G Sales Departement - - - - - e.g. Smith Ltd - - - - - - - - - - - - - - - - - - - - - - compare PostAdresseTyp - - - - - - - Code for the country, use ISO or internatinal Postalstandard, compare Staatscode - - - - - - - - - - Name of the country, use ISO Name, or international Postal Standard, compare Staatsname - - - - - ZIP, compare Postleitzahl - - - - - compare Gemeinde - - - - - - - - if streetname not available use name of Ortschaft - - - - - - - - - - - - - - - - - - - - - - - - - e.g. e-mail, webiste, compare InternetAdresseTyp - - - - - - - certificate for secure communication - - - - - URI: email-Address, Web, FTP, LDAP, ..., comapre Adress - - - - - any additional properties - - - - - - - - - phone numbers, conmpare TelephoneAdresseTyp - - - - - - - type of phononumber - category (eg 'Festnetz', 'Mobile', 'fax', ...) - - - - - phonenumber - - - - - any additional properties - - - - - - - - - like TelephoneAddresseType but with additional smsEnabled attribute - - - - - - - - - - formated number or set of telephone number parts - - - - - - - - - set of telephone number parts - - - - - - - - - - - - - simple type for sex (gender) of person - - - - - - - - - - simple type for dates (union), which may omit day and/or month - - - - - - simple type for dates (union), which may omit day and/or month - - - - - - simple type for marital status of a person - - - - - - - - - - - pattern type for enlargement of type definitions. Contents as follows -x:sometext or 12345 or _ or other symbols - - - - - - - - - known relations (family + functional) - - - - - - - - - - - - - - - - known + any other relation - - - - - - known types of alternative names - - - - - - - - - - - - known + any other alternative name types - - - - - - - zmr use only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/PersonName-1_2.xsd b/common/res/resources/schemas/PersonName-1_2.xsd deleted file mode 100644 index 347ed3d7f..000000000 --- a/common/res/resources/schemas/PersonName-1_2.xsd +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/PostalAddress-1_2.xsd b/common/res/resources/schemas/PostalAddress-1_2.xsd deleted file mode 100644 index b3d89abbb..000000000 --- a/common/res/resources/schemas/PostalAddress-1_2.xsd +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/TelcomNumber-1_0.xsd b/common/res/resources/schemas/TelcomNumber-1_0.xsd deleted file mode 100644 index f89702aeb..000000000 --- a/common/res/resources/schemas/TelcomNumber-1_0.xsd +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/XMLSchema-instance.xsd b/common/res/resources/schemas/XMLSchema-instance.xsd deleted file mode 100644 index f47577b8a..000000000 --- a/common/res/resources/schemas/XMLSchema-instance.xsd +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - -]> - - - -

XML Schema instance namespace

-

See the XML Schema - Recommendation for an introduction

- - -
- $Date: 2001/03/16 20:25:57 $
- $Id: XMLSchema-instance.xsd,v 1.4 2001/03/16 20:25:57 ht Exp $ -
-
- -

This schema should never be used as such: - the XML - Schema Recommendation forbids the declaration of - attributes in this namespace

-
-
- - - - - -
diff --git a/common/res/resources/schemas/XMLSchema.dtd b/common/res/resources/schemas/XMLSchema.dtd deleted file mode 100644 index e8e8f7625..000000000 --- a/common/res/resources/schemas/XMLSchema.dtd +++ /dev/null @@ -1,402 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%xs-datatypes; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/cs-sstc-schema-assertion-01.xsd b/common/res/resources/schemas/cs-sstc-schema-assertion-01.xsd deleted file mode 100644 index 8bc5af147..000000000 --- a/common/res/resources/schemas/cs-sstc-schema-assertion-01.xsd +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - Document identifier: cs-sstc-schema-assertion-01 - Location: http://www.oasis-open.org/committees/security/docs/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/cs-sstc-schema-protocol-01.xsd b/common/res/resources/schemas/cs-sstc-schema-protocol-01.xsd deleted file mode 100644 index ecad05b0f..000000000 --- a/common/res/resources/schemas/cs-sstc-schema-protocol-01.xsd +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - Document identifier: cs-sstc-schema-protocol-01 - Location: http://www.oasis-open.org/committees/security/docs/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/datatypes.dtd b/common/res/resources/schemas/datatypes.dtd deleted file mode 100644 index 8e48553be..000000000 --- a/common/res/resources/schemas/datatypes.dtd +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/exclusive-canonicalization.xsd b/common/res/resources/schemas/exclusive-canonicalization.xsd deleted file mode 100644 index d4a2d82ec..000000000 --- a/common/res/resources/schemas/exclusive-canonicalization.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/common/res/resources/schemas/xml.xsd b/common/res/resources/schemas/xml.xsd deleted file mode 100644 index 79dbc02ba..000000000 --- a/common/res/resources/schemas/xml.xsd +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - See http://www.w3.org/XML/1998/namespace.html and - http://www.w3.org/TR/REC-xml for information about this namespace. - - - - - This schema defines attributes and an attribute group - suitable for use by - schemas wishing to allow xml:base, xml:lang or xml:space attributes - on elements they define. - - To enable this, such a schema must import this schema - for the XML namespace, e.g. as follows: - <schema . . .> - . . . - <import namespace="http://www.w3.org/XML/1998/namespace" - schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> - - Subsequently, qualified reference to any of the attributes - or the group defined below will have the desired effect, e.g. - - <type . . .> - . . . - <attributeGroup ref="xml:specialAttrs"/> - - will define a type which will schema-validate an instance - element with any of those attributes - - - - In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - http://www.w3.org/2001/03/xml.xsd. - At the date of issue it can also be found at - http://www.w3.org/2001/xml.xsd. - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML Schema - itself. In other words, if the XML Schema namespace changes, the version - of this document at - http://www.w3.org/2001/xml.xsd will change - accordingly; the version at - http://www.w3.org/2001/03/xml.xsd will not change. - - - - - - In due course, we should install the relevant ISO 2- and 3-letter - codes as the enumerated possible values . . . - - - - - - - - - - - - - - - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. - - - - - - - - - - diff --git a/common/res/resources/schemas/xmldsig-core-schema.xsd b/common/res/resources/schemas/xmldsig-core-schema.xsd deleted file mode 100644 index a7e302373..000000000 --- a/common/res/resources/schemas/xmldsig-core-schema.xsd +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/res/resources/schemas/xmldsig-filter2.xsd b/common/res/resources/schemas/xmldsig-filter2.xsd deleted file mode 100644 index 330eafd19..000000000 --- a/common/res/resources/schemas/xmldsig-filter2.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/common/src/at/gv/egovernment/moa/logging/LogMsg.java b/common/src/at/gv/egovernment/moa/logging/LogMsg.java deleted file mode 100644 index 4d04fc72d..000000000 --- a/common/src/at/gv/egovernment/moa/logging/LogMsg.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.logging; - -/** - * A unified message type to log messages from inside the MOA subsystem. - * - * @author Patrick Peck - * @version $Id$ - */ -public class LogMsg { - /** The message to log. */ - private Object message; - - /** - * Create a LogMsg object. - * - * @param message The actual message to log. May be null. - */ - public LogMsg(Object message) { - this.message = message; - } - - /** - * Convert this log message to a String. - * - * @return The String representation of this log message. - */ - public String toString() { - StringBuffer msg = new StringBuffer(); - LoggingContext ctx = - LoggingContextManager.getInstance().getLoggingContext(); - String tid = ctx != null ? ctx.getTransactionID() : null; - String nodeId = ctx != null ? ctx.getNodeID() : null; - - msg.append("TID="); - msg.append(tid != null ? tid : ""); - msg.append(" NID="); - msg.append(nodeId != null ? nodeId : ""); - msg.append(" MSG="); - msg.append(message != null ? message.toString() : ""); - - return msg.toString(); - } -} diff --git a/common/src/at/gv/egovernment/moa/logging/Logger.java b/common/src/at/gv/egovernment/moa/logging/Logger.java deleted file mode 100644 index eb7aa5634..000000000 --- a/common/src/at/gv/egovernment/moa/logging/Logger.java +++ /dev/null @@ -1,175 +0,0 @@ -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. - * - * Configure the logging defaultHierarchy that the Logger uses by - * calling setHierarchy once before calling any of the logging - * output functions. - * - * @author Patrick Peck - * @version $Id$ - */ -public class Logger { - - /** The default logging hierarchy. */ - private static String defaultHierarchy = ""; - - /** - * Get the Log object for the default hierarchy. - * - * @return The Log object to write log messages to. - */ - private static Log getLog() { - return LogFactory.getLog(defaultHierarchy); - } - - /** - * Get the Log object for a given hierarchy. - * - * @param hierarchy The logging hierarchy for which to return the logger. - * @return The Log object to write log messages to. - */ - private static Log getLog(String hierarchy) { - return LogFactory.getLog(hierarchy); - } - - /** - * Set the default hierarchy to which the Logger should send its - * logging output. - * @param hierarchy The logging defaultHierarchy. - */ - public static void setHierarchy(String hierarchy) { - defaultHierarchy = hierarchy; - } - - /** - * Test, if the trace log level is enabled. - * - * @return boolean true, if tracing output is enabled - * false otherwise. - */ - public static boolean isTraceEnabled() { - return getLog().isTraceEnabled(); - } - - /** - * Test, if the trace log level is enabled for a given hierarchy. - * - * @param hierarchy requested log hierarchy - * @return boolean true, if tracing output is enabled - * false otherwise. - */ - public static boolean isTraceEnabled(String hierarchy) { - return getLog(hierarchy).isTraceEnabled(); - } - - /** - * Trace a message. - * - * @param message The message to trace. - */ - public static void trace(Object message) { - getLog().trace(message); - } - - /** - * Test, if the debug log level is enabled. - * - * @return boolean true, if debug output is enabled - * false otherwise. - */ - public static boolean isDebugEnabled() { - return getLog().isDebugEnabled(); - } - - /** - * Test, if the debug log level is enabled for a given hierarchy. - * - * @param hierarchy requested log hierarchy - * @return boolean true, if debug output is enabled - * false otherwise. - */ - public static boolean isDebugEnabled(String hierarchy) { - return getLog(hierarchy).isDebugEnabled(); - } - - /** - * Log a debug message. - * - * @param message The message to log. - */ - public static void debug(Object message) { - getLog().debug(message); - } - - /** - * Log an info message. - * - * @param message The message to log. - */ - public static void info(Object message) { - getLog().info(message); - } - - /** - * Log a warning message. - * - * @param message The message to log. - */ - public static void warn(Object message) { - getLog().warn(message); - } - - /** - * Log a warning message. - * - * @param message The message to log. - * @param t An exception that may be the cause of the warning. - */ - public static void warn(Object message, Throwable t) { - getLog().warn(message, t); - } - - /** - * Log an error message. - * - * @param message The message to log. - */ - public static void error(Object message) { - getLog().error(message); - } - - /** - * Log an error message. - * - * @param message The message to log. - * @param t An exception that may be the cause of the error. - */ - public static void error(Object message, Throwable t) { - getLog().error(message, t); - } - - /** - * Log a fatal error message. - * - * @param message The message to log. - */ - public static void fatal(Object message) { - getLog().fatal(message); - } - - /** - * Log a fatal error message. - * - * @param message The message to log. - * @param t An exception that may be the cause of the error. - */ - public static void fatal(Object message, Throwable t) { - getLog().fatal(message, t); - } - -} diff --git a/common/src/at/gv/egovernment/moa/logging/LoggingContext.java b/common/src/at/gv/egovernment/moa/logging/LoggingContext.java deleted file mode 100644 index 42d8db06e..000000000 --- a/common/src/at/gv/egovernment/moa/logging/LoggingContext.java +++ /dev/null @@ -1,46 +0,0 @@ -package at.gv.egovernment.moa.logging; - -/** - * Encapsulates contextual information (i.e. per request information) for - * logging purposes. - * - * @author Patrick Peck - * @version $Id$ - */ -public class LoggingContext { - /** The name of the node ID system property. */ - public static final String NODE_ID_PROPERTY = "moa.node-id"; - - /** The current transaction ID. */ - private String transactionID; - /** The node ID. */ - private String nodeID; - - /** - * Create a new LoggingContext. - * - * @param transactionID The transaction ID. May be null. - */ - public LoggingContext(String transactionID) { - this.transactionID = transactionID; - this.nodeID = System.getProperty(NODE_ID_PROPERTY); - } - - /** - * Return the transaction ID. - * - * @return The transaction ID. - */ - public String getTransactionID() { - return transactionID; - } - - /** - * Return the node ID. - * - * @return The node ID. - */ - public String getNodeID() { - return nodeID; - } -} diff --git a/common/src/at/gv/egovernment/moa/logging/LoggingContextManager.java b/common/src/at/gv/egovernment/moa/logging/LoggingContextManager.java deleted file mode 100644 index 2bbe6caa1..000000000 --- a/common/src/at/gv/egovernment/moa/logging/LoggingContextManager.java +++ /dev/null @@ -1,56 +0,0 @@ -package at.gv.egovernment.moa.logging; - -/** - * Provides each thread with a single instance of LoggingContext. - * - * @author Patrick Peck - * @version $Id$ - */ -public class LoggingContextManager { - /** The single instance of this class. */ - private static LoggingContextManager instance = null; - - /** The LoggingContext for each thread. */ - private ThreadLocal context; - - /** - * Get the single instance of the LoggingContextManager class. - * - * @return LoggingContextManager The single instance. - */ - public static synchronized LoggingContextManager getInstance() { - if (instance == null) { - instance = new LoggingContextManager(); - } - return instance; - } - - /** - * Creates a new LoggingContextManager. - * - * Protected to disallow direct instantiation. - */ - protected LoggingContextManager() { - context = new ThreadLocal(); - } - - /** - * Set the LoggingContext context for the current thread. - * - * @param ctx The LoggingContext for the current thread. - */ - public void setLoggingContext(LoggingContext ctx) { - context.set(ctx); - } - - /** - * Return the LoggingContext for the current thread. - * - * @return LoggingContext The LoggingContext for the current - * thread, or null if none has been set. - */ - public LoggingContext getLoggingContext() { - return (LoggingContext) context.get(); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/Base64Utils.java b/common/src/at/gv/egovernment/moa/util/Base64Utils.java deleted file mode 100644 index ad29180a6..000000000 --- a/common/src/at/gv/egovernment/moa/util/Base64Utils.java +++ /dev/null @@ -1,109 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import iaik.utils.Base64InputStream; -import iaik.utils.Base64OutputStream; - -/** - * Utitility functions for encoding/decoding Base64 strings. - * - * @author Patrick Peck - * @version $Id$ - */ -public class Base64Utils { - - /** - * Read the bytes encoded in a Base64 encoded String. - * - * @param base64String The String containing the Base64 encoded - * bytes. - * @param ignoreInvalidChars Whether to ignore invalid Base64 characters. - * @return byte[] The raw bytes contained in the base64String. - * @throws IOException Failed to read the Base64 data. - */ - public static byte[] decode(String base64String, boolean ignoreInvalidChars) - throws IOException { - - Base64InputStream in = - new Base64InputStream( - new ByteArrayInputStream(base64String.getBytes("UTF-8")), - ignoreInvalidChars); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte[] bytes = new byte[256]; - int bytesRead; - - while ((bytesRead = in.read(bytes)) > 0) { - out.write(bytes, 0, bytesRead); - } - - return out.toByteArray(); - } - - /** - * Read the bytes encoded in a Base64 encoded String and provide - * them via an InputStream. - * - * @param base64String The String containing the Base64 encoded - * bytes. - * @param ignoreInvalidChars Whether to ignore invalid Base64 characters. - * @return The InputStream from which the binary content of the - * base64String can be read. - */ - public static InputStream decodeToStream( - String base64String, - boolean ignoreInvalidChars) { - - try { - ByteArrayInputStream bin = - new ByteArrayInputStream(base64String.getBytes("UTF-8")); - Base64InputStream in = new Base64InputStream(bin, ignoreInvalidChars); - - return in; - } catch (UnsupportedEncodingException e) { - // cannot occur, since UTF-8 is required to be supported by every JRE - return null; - } - } - - /** - * Convert a byte array to a Base64 encoded String. - * - * @param bytes The bytes to encode. - * @return String The Base64 encoded representation of the bytes. - * @throws IOException Failed to write the bytes as Base64 data. - */ - public static String encode(byte[] bytes) throws IOException { - return encode(new ByteArrayInputStream(bytes)); - } - - /** - * Convert the data contained in the given stream to a Base64 encoded - * String. - * - * @param inputStream The stream containing the data to encode. - * @return The Base64 encoded data of inputStream, as a - * String. - * @throws IOException Failed to convert the data in the stream. - */ - public static String encode(InputStream inputStream) throws IOException { - ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); - Base64OutputStream base64Stream = new Base64OutputStream(byteStream, "\n".getBytes()); - byte[] bytes = new byte[256]; - int bytesRead; - - while ((bytesRead = inputStream.read(bytes)) > 0) { - base64Stream.write(bytes, 0, bytesRead); - } - base64Stream.flush(); - base64Stream.close(); - inputStream.close(); - - return byteStream.toString("UTF-8"); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/BoolUtils.java b/common/src/at/gv/egovernment/moa/util/BoolUtils.java deleted file mode 100644 index fcd39b4dd..000000000 --- a/common/src/at/gv/egovernment/moa/util/BoolUtils.java +++ /dev/null @@ -1,24 +0,0 @@ -package at.gv.egovernment.moa.util; - -/** - * Utility class for parsing XML schema boolean values. - * - * @author Patrick Peck - * @version $Id$ - */ -public class BoolUtils { - - /** - * Return the boolean value of an xsd:boolean type of DOM - * element/attribute. - * - * @param boolStr The value of the xsd:boolean element/attribute. - * @return true, if boolStr equals - * "true" or "1;". Otherwise, - * false is returned. - */ - public static boolean valueOf(String boolStr) { - return "true".equals(boolStr) || "1".equals(boolStr); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/CollectionUtils.java b/common/src/at/gv/egovernment/moa/util/CollectionUtils.java deleted file mode 100644 index 5329dcbd2..000000000 --- a/common/src/at/gv/egovernment/moa/util/CollectionUtils.java +++ /dev/null @@ -1,36 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.Iterator; -import java.util.List; - -/** - * Various utility methods for dealing with java.util.Collection - * classes. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CollectionUtils { - - /** - * Convert a List of Number objects to an - * int array. - * - * @param nums The List containing the numbers whose integer - * value to put into the result. - * @return The int values of the Numbers contained - * in nums. - */ - public static int[] toIntArray(List nums) { - int[] result = new int[nums.size()]; - Iterator iter; - int i; - - for (i = 0, iter = nums.iterator(); iter.hasNext(); i++) { - Number num = (Number) iter.next(); - result[i] = num.intValue(); - } - - return result; - } -} diff --git a/common/src/at/gv/egovernment/moa/util/Constants.java b/common/src/at/gv/egovernment/moa/util/Constants.java deleted file mode 100644 index 5c1314296..000000000 --- a/common/src/at/gv/egovernment/moa/util/Constants.java +++ /dev/null @@ -1,318 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.HashMap; - -/** - * Contains various constants used throughout the system. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface Constants { - /** Root location of the schema files. */ - public static final String SCHEMA_ROOT = "/resources/schemas/"; - - /** URI of the Widerrufregister XML namespace. */ - public static final String WRR_NS_URI = - "http://reference.e-government.gv.at/namespace/moavv/20041223"; - - /** Prefix used for the Widerrufregister XML namespace */ - public static final String WRR_PREFIX = "wrr"; - - /** URI of the StandardTextBlock XML namespace. */ - public static final String STB_NS_URI = - "http://reference.e-government.gv.at/namespace/standardtextblock/20041105#"; - - /** Prefix used for the Mandate XML namespace */ - public static final String STB_PREFIX = "stb"; - - /** URI of the MOA XML namespace. */ - public static final String MOA_NS_URI = - "http://reference.e-government.gv.at/namespace/moa/20020822#"; - - /** Prefix used for the Mandate XML namespace */ - public static final String MD_PREFIX = "md"; - - /** URI of the Mandate XML namespace. */ - public static final String MD_NS_URI = - "http://reference.e-government.gv.at/namespace/mandates/20040701#"; - - /** Prefix used for the Mandate XML namespace */ - public static final String MVV_PREFIX = "mvv"; - - /** URI of the Mandate XML namespace. */ - public static final String MVV_NS_URI = - "http://reference.e-government.gv.at/namespace/moavv/app2mvv/20041125"; - - /** Prefix used for the MandateCheckProfile XML namespace */ - public static final String MDP_PREFIX = "mdp"; - - /** URI of the Mandate XML namespace. */ - public static final String MDP_NS_URI = - "http://reference.e-government.gv.at/namespace/mandateprofile/20041105#"; - - /** Prefix used for the MOA XML namespace */ - public static final String MOA_PREFIX = "moa"; - - /** Local location of the MOA XML schema definition. */ - public static final String MOA_SCHEMA_LOCATION = - SCHEMA_ROOT + "MOA-SPSS-1.3.xsd"; - - /** URI of the MOA configuration XML namespace. */ - public static final String MOA_CONFIG_NS_URI = - "http://reference.e-government.gv.at/namespace/moaconfig/20021122#"; - - /** URI of the MOA ID configuration XML namespace. */ - public static final String MOA_ID_CONFIG_NS_URI = - "http://www.buergerkarte.at/namespaces/moaconfig#"; - - /** Prefix used for the MOA configuration XML namespace */ - public static final String MOA_CONFIG_PREFIX = "conf"; - - /** Prefix used for the MOA configuration XML namespace */ - public static final String MOA_ID_CONFIG_PREFIX = "confID"; - - /** Local location of the MOA configuration XML schema definition. */ - public static final String MOA_CONFIG_SCHEMA_LOCATION = - SCHEMA_ROOT + "MOA-SPSS-config-1.3.xsd"; - - /** Local location of the MOA ID configuration XML schema definition. */ - public static final String MOA_ID_CONFIG_SCHEMA_LOCATION = - SCHEMA_ROOT + "MOA-ID-Configuration-1.4.xsd"; - - /** URI of the Security Layer 1.0 namespace. */ - public static final String SL10_NS_URI = - "http://www.buergerkarte.at/namespaces/securitylayer/20020225#"; - - /** Prefix used for the Security Layer 1.0 XML namespace */ - public static final String SL10_PREFIX = "sl10"; - - /** Local location of the Security Layer 1.0 XML schema definition */ - public static final String SL10_SCHEMA_LOCATION = - SCHEMA_ROOT + "Core.20020225.xsd"; - - /** URI of the Security Layer 1.1 XML namespace */ - public static final String SL11_NS_URI = - "http://www.buergerkarte.at/namespaces/securitylayer/20020831#"; - - /** Prefix used for the Security Layer 1.1 XML namespace */ - public static final String SL11_PREFIX = "sl11"; - - /** Local location of the Security Layer 1.1 XML schema definition */ - public static final String SL11_SCHEMA_LOCATION = - SCHEMA_ROOT + "Core.20020831.xsd"; - - /** URI of the Security Layer 1.2 XML namespace */ - public static final String SL12_NS_URI = - "http://www.buergerkarte.at/namespaces/securitylayer/1.2#"; - - /** Prefix used for the Security Layer 1.2 XML namespace */ - public static final String SL12_PREFIX = "sl"; - - /** Local location of the Security Layer 1.2 XML schema definition */ - public static final String SL12_SCHEMA_LOCATION = - SCHEMA_ROOT + "Core-1.2.xsd"; - - /** URI of the ECDSA XML namespace */ - public static final String ECDSA_NS_URI = - "http://www.w3.org/2001/04/xmldsig-more#"; - - /** Prefix used for ECDSA namespace */ - public static final String ECDSA_PREFIX = "ecdsa"; - - /** Local location of ECDSA XML schema definition */ - public static final String ECDSA_SCHEMA_LOCATION = - SCHEMA_ROOT + "ECDSAKeyValue.xsd"; - - /** URI of the PersonData XML namespace. */ - public static final String PD_NS_URI = - "http://reference.e-government.gv.at/namespace/persondata/20020228#"; - - /** Prefix used for the PersonData XML namespace */ - public static final String PD_PREFIX = "pr"; - -// /** Local location of the PersonData XML schema definition */ -// public static final String PD_SCHEMA_LOCATION = -// SCHEMA_ROOT + "PersonData.xsd"; - - /** Local location of the PersonData XML schema definition */ - public static final String PD_SCHEMA_LOCATION = - SCHEMA_ROOT + "PersonData_20_en_moaWID.xsd"; - - /** URI of the SAML namespace. */ - public static final String SAML_NS_URI = - "urn:oasis:names:tc:SAML:1.0:assertion"; - - /** Prefix used for the SAML XML namespace */ - public static final String SAML_PREFIX = "saml"; - - /** Local location of the SAML XML schema definition. */ - public static final String SAML_SCHEMA_LOCATION = - SCHEMA_ROOT + "cs-sstc-schema-assertion-01.xsd"; - - /** URI of the SAML request-response protocol namespace. */ - public static final String SAMLP_NS_URI = - "urn:oasis:names:tc:SAML:1.0:protocol"; - - /** Prefix used for the SAML request-response protocol namespace */ - public static final String SAMLP_PREFIX = "samlp"; - - /** Local location of the SAML request-response protocol schema definition. */ - public static final String SAMLP_SCHEMA_LOCATION = - SCHEMA_ROOT + "cs-sstc-schema-protocol-01.xsd"; - - /** URI of the XML namespace. */ - public static final String XML_NS_URI = - "http://www.w3.org/XML/1998/namespace"; - - /** Prefix used for the XML namespace */ - public static final String XML_PREFIX = "xml"; - - /** Local location of the XML schema definition. */ - public static final String XML_SCHEMA_LOCATION = SCHEMA_ROOT + "xml.xsd"; - - /** URI of the XMLNS namespace */ - public static final String XMLNS_NS_URI = "http://www.w3.org/2000/xmlns/"; - - /** Prefix used for the XSI namespace */ - public static final String XSI_PREFIX = "xsi"; - - /** Local location of the XSI schema definition. */ - public static final String XSI_SCHEMA_LOCATION = - SCHEMA_ROOT + "XMLSchema-instance.xsd"; - - /** URI of the XSI XMLNS namespace */ - public static final String XSI_NS_URI = - "http://www.w3.org/2001/XMLSchema-instance"; - - /** URI of the XSLT XML namespace */ - public static final String XSLT_NS_URI = - "http://www.w3.org/1999/XSL/Transform"; - - /** Prefix used for the XSLT XML namespace */ - public static final String XSLT_PREFIX = "xsl"; - - /** URI of the XMLDSig XML namespace. */ - public static final String DSIG_NS_URI = "http://www.w3.org/2000/09/xmldsig#"; - - /** Prefix used for the XMLDSig XML namespace */ - public static final String DSIG_PREFIX = "dsig"; - - /** Local location of the XMLDSig XML schema. */ - public static final String DSIG_SCHEMA_LOCATION = - SCHEMA_ROOT + "xmldsig-core-schema.xsd"; - - /** URI of the XMLDSig XPath Filter XML namespace. */ - public static final String DSIG_FILTER2_NS_URI = - "http://www.w3.org/2002/06/xmldsig-filter2"; - - /** Prefix used for the XMLDSig XPath Filter XML namespace */ - public static final String DSIG_FILTER2_PREFIX = "dsig-filter2"; - - /** Local location of the XMLDSig XPath Filter XML schema definition. */ - public static final String DSIG_FILTER2_SCHEMA_LOCATION = - SCHEMA_ROOT + "xmldsig-filter2.xsd"; - - /** URI of the Exclusive Canonicalization XML namespace */ - public static final String DSIG_EC_NS_URI = - "http://www.w3.org/2001/10/xml-exc-c14n#"; - - /** Prefix used for the Exclusive Canonicalization XML namespace */ - public static final String DSIG_EC_PREFIX = "ec"; - - /** Local location of the Exclusive Canonicalizaion XML schema definition */ - public static final String DSIG_EC_SCHEMA_LOCATION = - SCHEMA_ROOT + "exclusive-canonicalization.xsd"; - - /** URI of the XMLLoginParameterResolver Configuration XML namespace */ - public static final String XMLLPR_NS_URI="http://reference.e-government.gv.at/namespace/moa/20020822#/xmllpr20030814"; - - /** Local location of the XMLLoginParameterResolver Configuration XML schema definition */ - public static final String XMLLPR_SCHEMA_LOCATION = - SCHEMA_ROOT + "MOAIdentities.xsd"; - - - /** - * Contains all namespaces and local schema locations for XML schema - * definitions relevant for MOA. For use in validating XML parsers. - */ - public static final String ALL_SCHEMA_LOCATIONS = - (MOA_NS_URI + " " + MOA_SCHEMA_LOCATION + " ") - + (MOA_CONFIG_NS_URI + " " + MOA_CONFIG_SCHEMA_LOCATION + " ") - + (MOA_ID_CONFIG_NS_URI + " " + MOA_ID_CONFIG_SCHEMA_LOCATION + " ") - + (SL10_NS_URI + " " + SL10_SCHEMA_LOCATION + " ") - + (SL11_NS_URI + " " + SL11_SCHEMA_LOCATION + " ") - + (SL12_NS_URI + " " + SL12_SCHEMA_LOCATION + " ") - + (ECDSA_NS_URI + " " + ECDSA_SCHEMA_LOCATION + " ") - + (PD_NS_URI + " " + PD_SCHEMA_LOCATION + " ") - + (SAML_NS_URI + " " + SAML_SCHEMA_LOCATION + " ") - + (SAMLP_NS_URI + " " + SAMLP_SCHEMA_LOCATION + " ") - + (XML_NS_URI + " " + XML_SCHEMA_LOCATION + " ") - + (XSI_NS_URI + " " + XSI_SCHEMA_LOCATION + " ") - + (DSIG_NS_URI + " " + DSIG_SCHEMA_LOCATION + " ") - + (DSIG_FILTER2_NS_URI + " " + DSIG_FILTER2_SCHEMA_LOCATION + " ") - + (DSIG_EC_NS_URI + " " + DSIG_EC_SCHEMA_LOCATION + " ") - + (XMLLPR_NS_URI + " " + XMLLPR_SCHEMA_LOCATION); - - /** URN prefix for bPK and wbPK. */ - public static final String URN_PREFIX = "urn:publicid:gv.at"; - - /** URN prefix for context dependent id. */ - public static final String URN_PREFIX_CDID = URN_PREFIX + ":cdid"; - - /** URN prefix for context dependent id (bPK). */ - public static final String URN_PREFIX_BPK = URN_PREFIX_CDID + "+bpk"; - - /** URN prefix for context dependent id (HPI). */ - public static final String URN_PREFIX_HPI = URN_PREFIX_CDID + "+EHSP"; - - /** URN prefix for context dependent id (wbPK). */ - public static final String URN_PREFIX_WBPK = URN_PREFIX + ":wbpk"; - - /** URN prefix for context dependent id. */ - public static final String URN_PREFIX_BASEID = URN_PREFIX + ":baseid"; - - /** Security Layer manifest type URI. */ - public static final String SL_MANIFEST_TYPE_URI = - "http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest"; - - /** URI of the SHA1 digest algorithm */ - public static final String SHA1_URI = - "http://www.w3.org/2000/09/xmldsig#sha1"; - - /** URI of the Canonical XML algorithm */ - public static final String C14N_URI = - "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"; - - /** URI of the Canoncial XML with comments algorithm */ - public static final String C14N_WITH_COMMENTS_URI = - "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; - - /** URI of the Exclusive Canonical XML algorithm */ - public static final String EXC_C14N_URI = - "http://www.w3.org/2001/10/xml-exc-c14n#"; - - /** URI of the Exclusive Canonical XML with commments algorithm */ - public static final String EXC_C14N_WITH_COMMENTS_URI = - "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"; - - // - // Local names for elements of the MOA SPSS schema - // - - /** - * Local name of request for creating an XML signature. - */ - public static final String MOA_SPSS_CREATE_XML_REQUEST = "CreateXMLSignatureRequest"; - - /** - * Local name of request for verifying an XML signature. - */ - public static final String MOA_SPSS_VERIFY_XML_REQUEST = "VerifiyXMLSignatureRequest"; - - /** - * A map used to map namespace prefixes to namespace URIs - */ - public static HashMap nSMap = new HashMap(5); - -} diff --git a/common/src/at/gv/egovernment/moa/util/DOMUtils.java b/common/src/at/gv/egovernment/moa/util/DOMUtils.java deleted file mode 100644 index 5be0bb500..000000000 --- a/common/src/at/gv/egovernment/moa/util/DOMUtils.java +++ /dev/null @@ -1,971 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Vector; - -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.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentFragment; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import org.apache.xerces.parsers.DOMParser; -import org.apache.xerces.parsers.SAXParser; -import org.apache.xerces.parsers.XMLGrammarPreparser; -import org.apache.xerces.util.SymbolTable; -import org.apache.xerces.util.XMLGrammarPoolImpl; -import org.apache.xerces.xni.grammars.XMLGrammarDescription; -import org.apache.xerces.xni.grammars.XMLGrammarPool; -import org.apache.xerces.xni.parser.XMLInputSource; -import org.xml.sax.EntityResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - - -import at.gv.egovernment.moa.logging.Logger; - -/** - * Various utility functions for handling XML DOM trees. - * - * The parsing methods in this class make use of some features internal to the - * Xerces DOM parser, mainly for performance reasons. As soon as JAXP - * (currently at version 1.2) is better at schema handling, it should be used as - * the parser interface. - * - * @author Patrick Peck - * @version $Id$ - */ -public class DOMUtils { - - /** Feature URI for namespace aware parsing. */ - private static final String NAMESPACES_FEATURE = - "http://xml.org/sax/features/namespaces"; - /** Feature URI for validating parsing. */ - private static final String VALIDATION_FEATURE = - "http://xml.org/sax/features/validation"; - /** Feature URI for schema validating parsing. */ - private static final String SCHEMA_VALIDATION_FEATURE = - "http://apache.org/xml/features/validation/schema"; - /** Feature URI for normalization of element/attribute values. */ - private static final String NORMALIZED_VALUE_FEATURE = - "http://apache.org/xml/features/validation/schema/normalized-value"; - /** Feature URI for parsing ignorable whitespace. */ - private static final String INCLUDE_IGNORABLE_WHITESPACE_FEATURE = - "http://apache.org/xml/features/dom/include-ignorable-whitespace"; - /** Feature URI for creating EntityReference nodes in the DOM tree. */ - private static final String CREATE_ENTITY_REF_NODES_FEATURE = - "http://apache.org/xml/features/dom/create-entity-ref-nodes"; - /** Property URI for providing external schema locations. */ - private static final String EXTERNAL_SCHEMA_LOCATION_PROPERTY = - "http://apache.org/xml/properties/schema/external-schemaLocation"; - /** Property URI for providing the external schema location for elements - * without a namespace. */ - private static final String EXTERNAL_NO_NAMESPACE_SCHEMA_LOCATION_PROPERTY = - "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"; - /** Property URI for the Xerces grammar pool. */ - private static final String GRAMMAR_POOL = - org.apache.xerces.impl.Constants.XERCES_PROPERTY_PREFIX - + org.apache.xerces.impl.Constants.XMLGRAMMAR_POOL_PROPERTY; - /** A prime number for initializing the symbol table. */ - private static final int BIG_PRIME = 2039; - /** Symbol table for the grammar pool. */ - private static SymbolTable symbolTable = new SymbolTable(BIG_PRIME); - /** Xerces schema grammar pool. */ - private static XMLGrammarPool grammarPool = new XMLGrammarPoolImpl(); - /** Set holding the NamespaceURIs of the grammarPool, to prevent multiple - * entries of same grammars to the pool */ - private static Set grammarNamespaces; - - static { - grammarPool.lockPool(); - grammarNamespaces = new HashSet(); - } - - /** - * Preparse a schema and add it to the schema pool. - * The method only adds the schema to the pool if a schema having the same - * systemId (namespace URI) is not already present in the pool. - * - * @param inputStream An InputStream providing the contents of - * the schema. - * @param systemId The systemId (namespace URI) to use for the schema. - * @throws IOException An error occurred reading the schema. - */ - public static void addSchemaToPool(InputStream inputStream, String systemId) - throws IOException { - XMLGrammarPreparser preparser; - - if (!grammarNamespaces.contains(systemId)) { - - grammarNamespaces.add(systemId); - - // unlock the pool so that we can add another grammar - grammarPool.unlockPool(); - - // prepare the preparser - preparser = new XMLGrammarPreparser(symbolTable); - preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null); - preparser.setProperty(GRAMMAR_POOL, grammarPool); - preparser.setFeature(NAMESPACES_FEATURE, true); - preparser.setFeature(VALIDATION_FEATURE, true); - - // add the grammar to the pool - preparser.preparseGrammar( - XMLGrammarDescription.XML_SCHEMA, - new XMLInputSource(null, systemId, null, inputStream, null)); - - // lock the pool again so that schemas are not added automatically - grammarPool.lockPool(); - } - } - - /** - * Parse an XML document from an InputStream. - * - * @param inputStream The InputStream containing the XML - * document. - * @param validating If true, parse validating. - * @param externalSchemaLocations A String containing namespace - * URI to schema location pairs, the same way it is accepted by the xsi: - * schemaLocation attribute. - * @param externalNoNamespaceSchemaLocation The schema location of the - * schema for elements without a namespace, the same way it is accepted by the - * xsi:noNamespaceSchemaLocation attribute. - * @param entityResolver An EntityResolver to resolve external - * entities (schemas and DTDs). If null, it will not be set. - * @param errorHandler An ErrorHandler to decide what to do - * with parsing errors. If null, it will not be set. - * @return The parsed XML document as a DOM tree. - * @throws SAXException An error occurred parsing the document. - * @throws IOException An error occurred reading the document. - * @throws ParserConfigurationException An error occurred configuring the XML - * parser. - */ - public static Document parseDocument( - InputStream inputStream, - boolean validating, - String externalSchemaLocations, - String externalNoNamespaceSchemaLocation, - EntityResolver entityResolver, - ErrorHandler errorHandler) - throws SAXException, IOException, ParserConfigurationException { - - DOMParser parser; - - - - //if Debug is enabled make a copy of inputStream to enable debug output in case of SAXException - byte buffer [] = null; - ByteArrayInputStream baStream = null; - if(true == Logger.isDebugEnabled()) { - int len = inputStream.available(); - buffer = new byte[len]; - inputStream.read(buffer); - baStream = new ByteArrayInputStream(buffer); - } - - // create the DOM parser - if (symbolTable != null) { - parser = new DOMParser(symbolTable, grammarPool); - } else { - parser = new DOMParser(); - } - - // set parser features and properties - try { - parser.setFeature(NAMESPACES_FEATURE, true); - parser.setFeature(VALIDATION_FEATURE, validating); - parser.setFeature(SCHEMA_VALIDATION_FEATURE, validating); - parser.setFeature(NORMALIZED_VALUE_FEATURE, false); - parser.setFeature(INCLUDE_IGNORABLE_WHITESPACE_FEATURE, true); - parser.setFeature(CREATE_ENTITY_REF_NODES_FEATURE, false); - - if (validating) { - if (externalSchemaLocations != null) { - parser.setProperty( - EXTERNAL_SCHEMA_LOCATION_PROPERTY, - externalSchemaLocations); - } - if (externalNoNamespaceSchemaLocation != null) { - parser.setProperty( - EXTERNAL_NO_NAMESPACE_SCHEMA_LOCATION_PROPERTY, - externalNoNamespaceSchemaLocation); - } - } - - // set entity resolver and error handler - if (entityResolver != null) { - parser.setEntityResolver(entityResolver); - } - if (errorHandler != null) { - parser.setErrorHandler(errorHandler); - } - - // parse the document and return it - // if debug is enabled: use copy of strem (baStream) else use orig stream - if(null != baStream) - parser.parse(new InputSource(baStream)); - else - parser.parse(new InputSource(inputStream)); - } catch(SAXException e) { - if(true == Logger.isDebugEnabled() && null != buffer) { - String xmlContent = new String(buffer); - Logger.debug("SAXException in:\n" + xmlContent); - } - throw(e); - } - - return parser.getDocument(); - } - - /** - * Parse an XML document from an InputStream. - * - * It uses a MOAEntityResolver as the EntityResolver - * and a MOAErrorHandler as the ErrorHandler. - * - * @param inputStream The InputStream containing the XML - * document. - * @param validating If true, parse validating. - * @param externalSchemaLocations A String containing namespace - * URI to schema location pairs, the same way it is accepted by the xsi: - * schemaLocation attribute. - * @param externalNoNamespaceSchemaLocation The schema location of the - * schema for elements without a namespace, the same way it is accepted by the - * xsi:noNamespaceSchemaLocation attribute. - * @return The parsed XML document as a DOM tree. - * @throws SAXException An error occurred parsing the document. - * @throws IOException An error occurred reading the document. - * @throws ParserConfigurationException An error occurred configuring the XML - * parser. - */ - public static Document parseDocument( - InputStream inputStream, - boolean validating, - String externalSchemaLocations, - String externalNoNamespaceSchemaLocation) - throws SAXException, IOException, ParserConfigurationException { - - return parseDocument( - inputStream, - validating, - externalSchemaLocations, - externalNoNamespaceSchemaLocation, - new MOAEntityResolver(), - new MOAErrorHandler()); - } - - /** - * Parse an XML document from a String. - * - * It uses a MOAEntityResolver as the EntityResolver - * and a MOAErrorHandler as the ErrorHandler. - * - * @param xmlString The String containing the XML document. - * @param encoding The encoding of the XML document. - * @param validating If true, parse validating. - * @param externalSchemaLocations A String containing namespace - * URI to schema location pairs, the same way it is accepted by the xsi: - * schemaLocation attribute. - * @param externalNoNamespaceSchemaLocation The schema location of the - * schema for elements without a namespace, the same way it is accepted by the - * xsi:noNamespaceSchemaLocation attribute. - * @return The parsed XML document as a DOM tree. - * @throws SAXException An error occurred parsing the document. - * @throws IOException An error occurred reading the document. - * @throws ParserConfigurationException An error occurred configuring the XML - * parser. - */ - public static Document parseDocument( - String xmlString, - String encoding, - boolean validating, - String externalSchemaLocations, - String externalNoNamespaceSchemaLocation) - throws SAXException, IOException, ParserConfigurationException { - - InputStream in = new ByteArrayInputStream(xmlString.getBytes(encoding)); - return parseDocument( - in, - validating, - externalSchemaLocations, - externalNoNamespaceSchemaLocation); - } - - /** - * Parse an UTF-8 encoded XML document from a String. - * - * @param xmlString The String containing the XML document. - * @param validating If true, parse validating. - * @param externalSchemaLocations A String containing namespace - * URI to schema location pairs, the same way it is accepted by the xsi: - * schemaLocation attribute. - * @param externalNoNamespaceSchemaLocation The schema location of the - * schema for elements without a namespace, the same way it is accepted by the - * xsi:noNamespaceSchemaLocation attribute. - * @return The parsed XML document as a DOM tree. - * @throws SAXException An error occurred parsing the document. - * @throws IOException An error occurred reading the document. - * @throws ParserConfigurationException An error occurred configuring the XML - * parser. - */ - public static Document parseDocument( - String xmlString, - boolean validating, - String externalSchemaLocations, - String externalNoNamespaceSchemaLocation) - throws SAXException, IOException, ParserConfigurationException { - - return parseDocument( - xmlString, - "UTF-8", - validating, - externalSchemaLocations, - externalNoNamespaceSchemaLocation); - } - - /** - * A convenience method to parse an XML document validating. - * - * @param inputStream The InputStream containing the XML - * document. - * @return The root element of the parsed XML document. - * @throws SAXException An error occurred parsing the document. - * @throws IOException An error occurred reading the document. - * @throws ParserConfigurationException An error occurred configuring the XML - * parser. - */ - public static Element parseXmlValidating(InputStream inputStream) - throws ParserConfigurationException, SAXException, IOException { - return DOMUtils - .parseDocument(inputStream, true, Constants.ALL_SCHEMA_LOCATIONS, null) - .getDocumentElement(); - } - - /** - * Schema validate a given DOM element. - * - * @param element The element to validate. - * @param externalSchemaLocations A String containing namespace - * URI to schema location pairs, the same way it is accepted by the xsi: - * schemaLocation attribute. - * @param externalNoNamespaceSchemaLocation The schema location of the - * schema for elements without a namespace, the same way it is accepted by the - * xsi:noNamespaceSchemaLocation attribute. - * @return true, if the element validates against - * the schemas declared in it. - * @throws SAXException An error occurred parsing the document. - * @throws IOException An error occurred reading the document from its - * serialized representation. - * @throws ParserConfigurationException An error occurred configuring the XML - * @throws TransformerException An error occurred serializing the element. - */ - public static boolean validateElement( - Element element, - String externalSchemaLocations, - String externalNoNamespaceSchemaLocation) - throws - ParserConfigurationException, - IOException, - SAXException, - TransformerException { - - byte[] docBytes; - SAXParser parser; - - // create the SAX parser - if (symbolTable != null) { - parser = new SAXParser(symbolTable, grammarPool); - } else { - parser = new SAXParser(); - } - - // serialize the document - docBytes = serializeNode(element, "UTF-8"); - - // set up parser features and attributes - parser.setFeature(NAMESPACES_FEATURE, true); - parser.setFeature(VALIDATION_FEATURE, true); - parser.setFeature(SCHEMA_VALIDATION_FEATURE, true); - if (externalSchemaLocations != null) { - parser.setProperty( - EXTERNAL_SCHEMA_LOCATION_PROPERTY, - externalSchemaLocations); - } - if (externalNoNamespaceSchemaLocation != null) { - parser.setProperty( - EXTERNAL_NO_NAMESPACE_SCHEMA_LOCATION_PROPERTY, - "externalNoNamespaceSchemaLocation"); - } - - // set up entity resolver and error handler - parser.setEntityResolver(new MOAEntityResolver()); - parser.setErrorHandler(new MOAErrorHandler()); - - // parse validating - parser.parse(new InputSource(new ByteArrayInputStream(docBytes))); - return true; - } - - /** - * Serialize the given DOM node. - * - * The node will be serialized using the UTF-8 encoding. - * - * @param node The node to serialize. - * @return String The String representation of the given DOM - * node. - * @throws TransformerException An error occurred transforming the - * node to a String. - * @throws IOException An IO error occurred writing the node to a byte array. - */ - public static String serializeNode(Node node) - throws TransformerException, IOException { - return new String(serializeNode(node, "UTF-8", false), "UTF-8"); - } - - - /** - * Serialize the given DOM node. - * - * The node will be serialized using the UTF-8 encoding. - * - * @param node The node to serialize. - * @param omitXmlDeclaration The boolean value for omitting the XML Declaration. - * @return String The String representation of the given DOM - * node. - * @throws TransformerException An error occurred transforming the - * node to a String. - * @throws IOException An IO error occurred writing the node to a byte array. - */ - public static String serializeNode(Node node, boolean omitXmlDeclaration) - throws TransformerException, IOException { - return new String(serializeNode(node, "UTF-8", omitXmlDeclaration), "UTF-8"); - } - - /** - * Serialize the given DOM node. - * - * The node will be serialized using the UTF-8 encoding. - * - * @param node The node to serialize. - * @param omitXmlDeclaration The boolean value for omitting the XML Declaration. - * @param lineSeperator Sets the line seperator String of the parser - * @return String The String representation of the given DOM - * node. - * @throws TransformerException An error occurred transforming the - * node to a String. - * @throws IOException An IO error occurred writing the node to a byte array. - */ - public static String serializeNode(Node node, boolean omitXmlDeclaration, String lineSeperator) - throws TransformerException, IOException { - return new String(serializeNode(node, "UTF-8", omitXmlDeclaration, lineSeperator), "UTF-8"); - } - - /** - * Serialize the given DOM node to a byte array. - * - * @param node The node to serialize. - * @param xmlEncoding The XML encoding to use. - * @return The serialized node, as a byte array. Using a compatible encoding - * this can easily be converted into a String. - * @throws TransformerException An error occurred transforming the node to a - * byte array. - * @throws IOException An IO error occurred writing the node to a byte array. - */ - public static byte[] serializeNode(Node node, String xmlEncoding) - throws TransformerException, IOException { - return serializeNode(node, xmlEncoding, false); - } - - /** - * Serialize the given DOM node to a byte array. - * - * @param node The node to serialize. - * @param xmlEncoding The XML encoding to use. - * @param omitDeclaration The boolean value for omitting the XML Declaration. - * @return The serialized node, as a byte array. Using a compatible encoding - * this can easily be converted into a String. - * @throws TransformerException An error occurred transforming the node to a - * byte array. - * @throws IOException An IO error occurred writing the node to a byte array. - */ - public static byte[] serializeNode(Node node, String xmlEncoding, boolean omitDeclaration) - throws TransformerException, IOException { - return serializeNode(node, xmlEncoding, omitDeclaration, null); - } - - - /** - * Serialize the given DOM node to a byte array. - * - * @param node The node to serialize. - * @param xmlEncoding The XML encoding to use. - * @param omitDeclaration The boolean value for omitting the XML Declaration. - * @param lineSeperator Sets the line seperator String of the parser - * @return The serialized node, as a byte array. Using a compatible encoding - * this can easily be converted into a String. - * @throws TransformerException An error occurred transforming the node to a - * byte array. - * @throws IOException An IO error occurred writing the node to a byte array. - */ - public static byte[] serializeNode(Node node, String xmlEncoding, boolean omitDeclaration, String lineSeperator) - throws TransformerException, IOException { - - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - ByteArrayOutputStream bos = new ByteArrayOutputStream(16384); - - transformer.setOutputProperty(OutputKeys.METHOD, "xml"); - transformer.setOutputProperty(OutputKeys.ENCODING, xmlEncoding); - String omit = omitDeclaration ? "yes" : "no"; - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omit); - if (null!=lineSeperator) { - transformer.setOutputProperty("{http://xml.apache.org/xalan}line-separator", lineSeperator);//does not work for xalan <= 2.5.1 - } - transformer.transform(new DOMSource(node), new StreamResult(bos)); - - bos.flush(); - bos.close(); - - return bos.toByteArray(); - } - - /** - * Return the text that a node contains. - * - * This routine: - *
    - *
  • Ignores comments and processing instructions.
  • - *
  • Concatenates TEXT nodes, CDATA nodes, and the results recursively - * processing EntityRef nodes.
  • - *
  • Ignores any element nodes in the sublist. (Other possible options are - * to recurse into element sublists or throw an exception.)
  • - *
- * - * @param node A DOM node from which to extract text. - * @return A String representing its contents. - */ - 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(); - } - - /** - * Build the namespace prefix to namespace URL mapping in effect for a given - * node. - * - * @param node The context node for which build the map. - * @return The namespace prefix to namespace URL mapping ( - * a String value to String value mapping). - */ - public static Map getNamespaceDeclarations(Node node) { - Map nsDecls = new HashMap(); - int i; - - do { - if (node.hasAttributes()) { - NamedNodeMap attrs = node.getAttributes(); - - for (i = 0; i < attrs.getLength(); i++) { - Attr attr = (Attr) attrs.item(i); - - // add prefix mapping if none exists - if ("xmlns".equals(attr.getPrefix()) - || "xmlns".equals(attr.getName())) { - - String nsPrefix = - attr.getPrefix() != null ? attr.getLocalName() : ""; - - if (nsDecls.get(nsPrefix) == null) { - nsDecls.put(nsPrefix, attr.getValue()); - } - } - } - } - } while ((node = node.getParentNode()) != null); - - return nsDecls; - } - - /** - * Add all namespace declarations declared in the parent(s) of a given - * element and used in the subtree of the given element to the given element. - * - * @param context The element to which to add the namespaces. - */ - public static void localizeNamespaceDeclarations(Element context) { - Node parent = context.getParentNode(); - - if (parent != null) { - Map namespaces = getNamespaceDeclarations(context.getParentNode()); - Set nsUris = collectNamespaceURIs(context); - Iterator iter; - - for (iter = namespaces.entrySet().iterator(); iter.hasNext();) { - Map.Entry e = (Map.Entry) iter.next(); - - if (nsUris.contains(e.getValue())) { - String prefix = (String) e.getKey(); - String nsUri = (String) e.getValue(); - String nsAttrName = "".equals(prefix) ? "xmlns" : "xmlns:" + prefix; - - context.setAttributeNS(Constants.XMLNS_NS_URI, nsAttrName, nsUri); - } - } - } - } - - /** - * Collect all the namespace URIs used in the subtree of a given element. - * - * @param context The element that should be searched for namespace URIs. - * @return All namespace URIs used in the subtree of context, - * including the ones used in context itself. - */ - public static Set collectNamespaceURIs(Element context) { - Set result = new HashSet(); - - collectNamespaceURIsImpl(context, result); - return result; - } - - /** - * A recursive method to do the work of collectNamespaceURIs. - * - * @param context The context element to evaluate. - * @param result The result, passed as a parameter to avoid unnecessary - * instantiations of Set. - */ - private static void collectNamespaceURIsImpl(Element context, Set result) { - NamedNodeMap attrs = context.getAttributes(); - NodeList childNodes = context.getChildNodes(); - String nsUri; - int i; - - // add the namespace of the context element - nsUri = context.getNamespaceURI(); - if (nsUri != null && nsUri != Constants.XMLNS_NS_URI) { - result.add(nsUri); - } - - // add all namespace URIs from attributes - for (i = 0; i < attrs.getLength(); i++) { - nsUri = attrs.item(i).getNamespaceURI(); - if (nsUri != null && nsUri != Constants.XMLNS_NS_URI) { - result.add(nsUri); - } - } - - // add all namespaces from subelements - for (i = 0; i < childNodes.getLength(); i++) { - Node node = childNodes.item(i); - - if (node.getNodeType() == Node.ELEMENT_NODE) { - collectNamespaceURIsImpl((Element) node, result); - } - } - } - - /** - * Check, that each attribute node in the given NodeList has its - * parent in the NodeList as well. - * - * @param nodes The NodeList to check. - * @return true, if each attribute node in nodes - * has its parent in nodes as well. - */ - public static boolean checkAttributeParentsInNodeList(NodeList nodes) { - Set nodeSet = new HashSet(); - int i; - - // put the nodes into the nodeSet - for (i = 0; i < nodes.getLength(); i++) { - nodeSet.add(nodes.item(i)); - } - - // check that each attribute node's parent is in the node list - for (i = 0; i < nodes.getLength(); i++) { - Node n = nodes.item(i); - - if (n.getNodeType() == Node.ATTRIBUTE_NODE) { - Attr attr = (Attr) n; - Element owner = attr.getOwnerElement(); - - if (owner == null) { - if (!isNamespaceDeclaration(attr)) { - return false; - } - } - - if (!nodeSet.contains(owner) && !isNamespaceDeclaration(attr)) { - return false; - } - } - } - - return true; - } - - /** - * Convert an unstructured NodeList into a - * DocumentFragment. - * - * @param nodeList Contains the node list to be converted into a DOM - * DocumentFragment. - * @return the resulting DocumentFragment. The DocumentFragment will be - * backed by a new DOM Document, i.e. all noded of the node list will be - * cloned. - * @throws ParserConfigurationException An error occurred creating the - * DocumentFragment. - * @precondition The nodes in the node list appear in document order - * @precondition for each Attr node in the node list, the owning Element is - * in the node list as well. - * @precondition each Element or Attr node in the node list is namespace - * aware. - */ - public static DocumentFragment nodeList2DocumentFragment(NodeList nodeList) - throws ParserConfigurationException { - - DocumentBuilder builder = - DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document doc = builder.newDocument(); - DocumentFragment result = doc.createDocumentFragment(); - - if (null == nodeList || nodeList.getLength() == 0) { - return result; - } - - int currPos = 0; - currPos = - nodeList2DocumentFragment(nodeList, currPos, result, null, null) + 1; - - while (currPos < nodeList.getLength()) { - currPos = - nodeList2DocumentFragment(nodeList, currPos, result, null, null) + 1; - } - return result; - } - - /** - * Helper method for the nodeList2DocumentFragment. - * - * @param nodeList The NodeList to convert. - * @param currPos The current position in the nodeList. - * @param result The resulting DocumentFragment. - * @param currOrgElem The current original element. - * @param currClonedElem The current cloned element. - * @return The current position. - */ - private static int nodeList2DocumentFragment( - NodeList nodeList, - int currPos, - DocumentFragment result, - Element currOrgElem, - Element currClonedElem) { - - while (currPos < nodeList.getLength()) { - Node currentNode = nodeList.item(currPos); - switch (currentNode.getNodeType()) { - case Node.COMMENT_NODE : - case Node.PROCESSING_INSTRUCTION_NODE : - case Node.TEXT_NODE : - { - // Append current node either to resulting DocumentFragment or to - // current cloned Element - if (null == currClonedElem) { - result.appendChild( - result.getOwnerDocument().importNode(currentNode, false)); - } else { - // Stop processing if current Node is not a descendant of - // current Element - if (!isAncestor(currOrgElem, currentNode)) { - return --currPos; - } - - currClonedElem.appendChild( - result.getOwnerDocument().importNode(currentNode, false)); - } - break; - } - - case Node.ELEMENT_NODE : - { - Element nextCurrOrgElem = (Element) currentNode; - Element nextCurrClonedElem = - result.getOwnerDocument().createElementNS( - nextCurrOrgElem.getNamespaceURI(), - nextCurrOrgElem.getNodeName()); - - // Append current Node either to resulting DocumentFragment or to - // current cloned Element - if (null == currClonedElem) { - result.appendChild(nextCurrClonedElem); - currOrgElem = nextCurrOrgElem; - currClonedElem = nextCurrClonedElem; - } else { - // Stop processing if current Node is not a descendant of - // current Element - if (!isAncestor(currOrgElem, currentNode)) { - return --currPos; - } - - currClonedElem.appendChild(nextCurrClonedElem); - } - - // Process current Node (of type Element) recursively - currPos = - nodeList2DocumentFragment( - nodeList, - ++currPos, - result, - nextCurrOrgElem, - nextCurrClonedElem); - - break; - } - - case Node.ATTRIBUTE_NODE : - { - Attr currAttr = (Attr) currentNode; - - // GK 20030411: Hack to overcome problems with IAIK IXSIL - if (currAttr.getOwnerElement() == null) - break; - if (currClonedElem == null) - break; - - // currClonedElem must be the owner Element of currAttr if - // preconditions are met - currClonedElem.setAttributeNS( - currAttr.getNamespaceURI(), - currAttr.getNodeName(), - currAttr.getValue()); - break; - } - - default : - { - // All other nodes will be ignored - } - } - - currPos++; - } - - return currPos; - } - - /** - * Check, if the given attribute is a namespace declaration. - * - * @param attr The attribute to check. - * @return true, if the attribute is a namespace declaration, - * false otherwise. - */ - private static boolean isNamespaceDeclaration(Attr attr) { - return Constants.XMLNS_NS_URI.equals(attr.getNamespaceURI()); - } - - /** - * Check, if a given DOM element is an ancestor of a given node. - * - * @param candAnc The DOM element to check for being the ancestor. - * @param cand The node to check for being the child. - * @return true, if candAnc is an (indirect) - * ancestor of cand; false otherwise. - */ - public static boolean isAncestor(Element candAnc, Node cand) { - Node currPar = cand.getParentNode(); - - while (currPar != null) { - if (candAnc == currPar) - return true; - currPar = currPar.getParentNode(); - } - return false; - } - - /** - * Selects the (first) element from a node list and returns it. - * - * @param nl The NodeList to get the element from. - * @return The (first) element included in the node list or null - * if the node list is null or empty or no element is - * included in the list. - */ - public static Element getElementFromNodeList (NodeList nl) { - if ((nl == null) || (nl.getLength() == 0)) { - return null; - } - for (int i=0; idateTime, - * according to ISO 8601. - * - * @author Patrick Peck - * @version $Id$ - * @see http://www.w3.org/2001/XMLSchema-datatypes" - */ -public class DateTimeUtils { - /** Error messages. */ - private static MessageProvider msg = MessageProvider.getInstance(); - - /** - * Builds a dateTime value from a Calendar value. - * @param cal the Calendar value - * @return the dateTime value - */ - public static String buildDateTime(Calendar cal) { - StringWriter out = new StringWriter(); - out.write("" + cal.get(Calendar.YEAR)); - out.write("-"); - out.write(to2DigitString(cal.get(Calendar.MONTH) + 1)); - out.write("-"); - out.write(to2DigitString(cal.get(Calendar.DAY_OF_MONTH))); - out.write("T"); - out.write(to2DigitString(cal.get(Calendar.HOUR_OF_DAY))); - out.write(":"); - out.write(to2DigitString(cal.get(Calendar.MINUTE))); - out.write(":"); - out.write(to2DigitString(cal.get(Calendar.SECOND))); - int tzOffsetMilliseconds = - cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET); - if (tzOffsetMilliseconds != 0) { - int tzOffsetMinutes = tzOffsetMilliseconds / (1000 * 60); - int tzOffsetHours = tzOffsetMinutes / 60; - tzOffsetMinutes -= tzOffsetHours * 60; - if (tzOffsetMilliseconds > 0) { - out.write("+"); - out.write(to2DigitString(tzOffsetHours)); - out.write(":"); - out.write(to2DigitString(tzOffsetMinutes)); - } else { - out.write("-"); - out.write(to2DigitString(-tzOffsetHours)); - out.write(":"); - out.write(to2DigitString(-tzOffsetMinutes)); - } - } - return out.toString(); - } - - /** - * Converts month, day, hour, minute, or second value - * to a 2 digit String. - * @param number the month, day, hour, minute, or second value - * @return 2 digit String - */ - private static String to2DigitString(int number) { - if (number < 10) - return "0" + number; - else - return "" + number; - } - - /** - * Parse a String containing a date and time instant, given in - * ISO 8601 format. - * - * @param dateTime The String to parse. - * @return The Date representation of the contents of - * dateTime. - * @throws ParseException Parsing the dateTime failed. - */ - public static Date parseDateTime(String dateTime) throws ParseException { - GregorianCalendar calendar; - long time; - int yearSign = 1, year, month, day; - int hour, minute, second; - double fraction = 0.0; - int tzSign = 1, tzHour = 0, tzMinute = 0; - int curPos = 0; - String fractStr; - boolean localTime = false; - char c; - - // parse year sign - ensureChars(dateTime, curPos, 1); - c = dateTime.charAt(curPos); - if (c == '+' || c == '-') { - yearSign = c == '+' ? 1 : -1; - curPos++; - } - - // parse year - year = parseInt(dateTime, curPos, 4); - curPos += 4; - - // parse '-' - ensureChar(dateTime, curPos, '-'); - curPos++; - - // parse month - month = parseInt(dateTime, curPos, 2); - ensureValue(month, 1, 12, curPos); - curPos += 2; - - // parse '-' - ensureChar(dateTime, curPos, '-'); - curPos++; - - // parse day - day = parseInt(dateTime, curPos, 2); - ensureValue(day, 1, 31, curPos); - curPos += 2; - - // parse 'T' - ensureChar(dateTime, curPos, 'T'); - curPos++; - - // parse hour - hour = parseInt(dateTime, curPos, 2); - ensureValue(hour, 0, 23, curPos); - curPos += 2; - - // parse ':' - ensureChar(dateTime, curPos, ':'); - curPos++; - - // parse minute - minute = parseInt(dateTime, curPos, 2); - ensureValue(minute, 0, 59, curPos); - curPos += 2; - - // parse ':' - ensureChar(dateTime, curPos, ':'); - curPos++; - - // parse second - second = parseInt(dateTime, curPos, 2); - ensureValue(second, 0, 59, curPos); - curPos += 2; - - // parse a fraction - if (dateTime.length() > curPos && dateTime.charAt(curPos) == '.') { - curPos++; - ensureDigits(dateTime, curPos, 1); - fractStr = "0."; - fractStr - += dateTime.substring(curPos, curPos + countDigits(dateTime, curPos)); - fraction = Double.parseDouble(fractStr); - curPos += countDigits(dateTime, curPos); - } - - // parse a time zone - if (dateTime.length() > curPos) { - c = dateTime.charAt(curPos); - if (c == 'Z') { - curPos++; - } else if (c == '+' || c == '-') { - // parse time zone sign - tzSign = c == '+' ? 1 : -1; - curPos++; - - // parse time zone hour - tzHour = parseInt(dateTime, curPos, 2); - ensureValue(tzHour, 0, 14, curPos); - curPos += 2; - - // parse ':' - ensureChar(dateTime, curPos, ':'); - curPos++; - - // parse time zone minute - tzMinute = parseInt(dateTime, curPos, 2); - ensureValue(tzMinute, 0, 59, curPos); - curPos += 2; - } - } else { - localTime = true; - } - - // if we have characters left, it's an error - if (dateTime.length() != curPos) { - throw new ParseException(msg.getMessage("datetime.00", null), curPos); - } - - // build the Date object - year = year * yearSign; - try { - calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT")); - calendar.set(year, month - 1, day, hour, minute, second); - calendar.set(Calendar.MILLISECOND, 0); - time = calendar.getTime().getTime(); - time += (long) (fraction * 1000.0); - time -= tzSign * ((tzHour * 60) + tzMinute) * 60 * 1000; - if (localTime) { - time -= TimeZone.getDefault().getRawOffset(); - } - return new Date(time); - } catch (IllegalArgumentException e) { - throw new ParseException(msg.getMessage("datetime.00", null), curPos); - } - - } - - /** - * Parse an integer value. - * - * @param str The String containing the digits. - * @param curPos The starting position. - * @param digits The number of digist making up the integer value. - * @return int The integer representation of the digits contained in - * str. - * @throws ParseException Parsing the integer value failed. - */ - private static int parseInt(String str, int curPos, int digits) - throws ParseException { - - ensureDigits(str, curPos, digits); - return Integer.parseInt(str.substring(curPos, curPos + digits)); - } - - /** - * Count the number of digits following curPos. - * - * @param str The String in which to count digits. - * @param curPos The starting position. - * @return int The number of digits. - */ - private static int countDigits(String str, int curPos) { - int i; - - for (i = curPos; i < str.length() && Character.isDigit(str.charAt(i)); i++); - return i - curPos; - } - - /** - * Ensure that a value falls in a given min/max range. - * - * @param value The value to check. - * @param min The minimum allowed value. - * @param max The maximum allowed value. - * @param curPos To indicate the parsing position in the - * ParseException. - * @throws ParseException Thrown, if value < min || value > - * max - */ - private static void ensureValue(int value, int min, int max, int curPos) - throws ParseException { - - if (value < min || value > max) { - throw new ParseException(msg.getMessage("datetime.00", null), curPos); - } - } - - /** - * Ensure that the given String has a number of characters left. - * - * @param str The String to check for its length. - * @param curPos The starting position. - * @param count The minimum number of characters that str must - * contain, starting at from curPos. - * @throws ParseException Thrown, if - * curPos + count > str.length(). - */ - private static void ensureChars(String str, int curPos, int count) - throws ParseException { - if (curPos + count > str.length()) { - throw new ParseException(msg.getMessage("datetime.00", null), curPos); - } - } - - /** - * Ensure that a given String contains a certain character at a - * certain position. - * - * @param str The String in which to look up the character. - * @param curPos The position in str that must contain the - * character. - * @param c The character value that must be contained at position - * curPos. - * @throws ParseException Thrown, if the characters do not match or - * curPos is out of range. - */ - private static void ensureChar(String str, int curPos, char c) - throws ParseException { - - ensureChars(str, curPos, 1); - if (str.charAt(curPos) != c) { - throw new ParseException(msg.getMessage("datetime.00", null), curPos); - } - } - - /** - * Ensure that a given String contains a number of digits, - * starting at a given position. - * - * @param str The String to scan for digits. - * @param curPos The starting postion. - * @param count The number of digits that must be contained in - * str, starting at curPos. - * @throws ParseException Thrown, if str is not long enough, or - * one of the characters following curPos in str is - * not a digit. - */ - private static void ensureDigits(String str, int curPos, int count) - throws ParseException { - - ensureChars(str, curPos, count); - for (int i = curPos; i < curPos + count; i++) { - if (!Character.isDigit(str.charAt(i))) { - throw new ParseException(msg.getMessage("datetime.00", null), curPos); - } - } - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/EntityResolverChain.java b/common/src/at/gv/egovernment/moa/util/EntityResolverChain.java deleted file mode 100644 index e7008a701..000000000 --- a/common/src/at/gv/egovernment/moa/util/EntityResolverChain.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Implementation of the org.xml.sax.EntityResolver, - * for use by a org.apache.xerces.parsers.DOMParser. - * - * @author Patrick Peck - * @version $Id$ - */ -public class EntityResolverChain implements EntityResolver { - /** The EntityResolvers in the chain. */ - private List resolvers = new ArrayList(); - - /** - * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) - */ - public InputSource resolveEntity(String publicId, String systemId) - throws SAXException, IOException { - - Iterator iter; - - for (iter = resolvers.iterator(); iter.hasNext(); ) { - EntityResolver resolver = (EntityResolver) iter.next(); - InputSource is = resolver.resolveEntity(publicId, systemId); - - if (is != null) { - return is; - } - } - - return null; - } - - /** - * Add an EntityResolver to the chain. - * - * @param entityResolver The EntityResolver to add. - */ - public void addEntityResolver(EntityResolver entityResolver) { - resolvers.add(entityResolver); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/FileUtils.java b/common/src/at/gv/egovernment/moa/util/FileUtils.java deleted file mode 100644 index a5e777c2d..000000000 --- a/common/src/at/gv/egovernment/moa/util/FileUtils.java +++ /dev/null @@ -1,116 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -/** - * Utility for accessing files on the file system, and for reading from input streams. - * @author Paul Ivancsics - * @version $Id$ - */ -public class FileUtils { - - /** - * Reads a file, given by URL, into a byte array. - * @param urlString file URL - * @return file content - * @throws IOException on any exception thrown - */ - public static byte[] readURL(String urlString) throws IOException { - URL url = new URL(urlString); - InputStream in = new BufferedInputStream(url.openStream()); - byte[] content = StreamUtils.readStream(in); - in.close(); - return content; - } - /** - * Reads a file, given by URL, into a String. - * @param urlString file URL - * @param encoding character encoding - * @return file content - * @throws IOException on any exception thrown - */ - public static String readURL(String urlString, String encoding) throws IOException { - byte[] content = readURL(urlString); - return new String(content, encoding); - } - /** - * Reads a file, given by filename, into a byte array. - * @param filename filename - * @return file content - * @throws IOException on any exception thrown - */ - public static byte[] readFile(String filename) throws IOException { - BufferedInputStream in = new BufferedInputStream(new FileInputStream(filename)); - byte[] content = StreamUtils.readStream(in); - in.close(); - return content; - } - /** - * Reads a file, given by filename, into a String. - * @param filename filename - * @param encoding character encoding - * @return file content - * @throws IOException on any exception thrown - */ - public static String readFile(String filename, String encoding) throws IOException { - byte[] content = readFile(filename); - return new String(content, encoding); - } - /** - * Reads a file from a resource. - * @param name resource name - * @return file content as a byte array - * @throws IOException on any exception thrown - */ - public static byte[] readResource(String name) throws IOException { - ClassLoader cl = FileUtils.class.getClassLoader(); - BufferedInputStream in = new BufferedInputStream(cl.getResourceAsStream(name)); - byte[] content = StreamUtils.readStream(in); - in.close(); - return content; - } - /** - * Reads a file from a resource. - * @param name filename - * @param encoding character encoding - * @return file content - * @throws IOException on any exception thrown - */ - public static String readResource(String name, String encoding) throws IOException { - byte[] content = readResource(name); - return new String(content, encoding); - } - - /** - * Returns the absolute URL of a given url which is relative to the parameter root - * @param url - * @param root - * @return String - */ - public static String makeAbsoluteURL(String url, String root) { - //if url is relative to rootConfigFileDirName make it absolute - - File keyFile; - String newURL = url; - - if(null == url) return null; - - if (url.startsWith("http:/") || url.startsWith("https:/") || url.startsWith("file:/") || url.startsWith("ftp:/")) { - return url; - } else { - // check if absolute - if not make it absolute - keyFile = new File(url); - if (!keyFile.isAbsolute()) { - keyFile = new File(root, url); - newURL = keyFile.getPath(); - } - return newURL; - } - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/KeyStoreUtils.java b/common/src/at/gv/egovernment/moa/util/KeyStoreUtils.java deleted file mode 100644 index d6a34a7b2..000000000 --- a/common/src/at/gv/egovernment/moa/util/KeyStoreUtils.java +++ /dev/null @@ -1,134 +0,0 @@ -package at.gv.egovernment.moa.util; - -import iaik.x509.X509Certificate; - -import java.io.File; -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.cert.Certificate; - -/** - * Utility for creating and loading key stores. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class KeyStoreUtils { - - /** - * Loads a key store from file. - * - * @param keystoreType key store type - * @param urlString URL of key store - * @param password password protecting the key store - * @return key store loaded - * @throws IOException thrown while reading the key store from file - * @throws GeneralSecurityException thrown while creating the key store - */ - public static KeyStore loadKeyStore( - String keystoreType, - String urlString, - String password) - throws IOException, GeneralSecurityException { - - URL keystoreURL = new URL(urlString); - InputStream in = keystoreURL.openStream(); - return loadKeyStore(keystoreType, in, password); - } - /** - * Loads a key store from an InputStream, and - * closes the InputStream. - * - * @param keystoreType key store type - * @param in input stream - * @param password password protecting the key store - * @return key store loaded - * @throws IOException thrown while reading the key store from the stream - * @throws GeneralSecurityException thrown while creating the key store - */ - public static KeyStore loadKeyStore( - String keystoreType, - InputStream in, - String password) - throws IOException, GeneralSecurityException { - - char[] chPassword = null; - if (password != null) - chPassword = password.toCharArray(); - KeyStore ks = KeyStore.getInstance(keystoreType); - ks.load(in, chPassword); - in.close(); - return ks; - } - /** - * Creates a key store from X509 certificate files, aliasing them with - * the index in the String[], starting with "0". - * - * @param keyStoreType key store type - * @param certFilenames certificate filenames - * @return key store created - * @throws IOException thrown while reading the certificates from file - * @throws GeneralSecurityException thrown while creating the key store - */ - public static KeyStore createKeyStore( - String keyStoreType, - String[] certFilenames) - throws IOException, GeneralSecurityException { - - KeyStore ks = KeyStore.getInstance(keyStoreType); - ks.load(null, null); - for (int i = 0; i < certFilenames.length; i++) { - Certificate cert = loadCertificate(certFilenames[i]); - ks.setCertificateEntry("" + i, cert); - } - return ks; - } - /** - * Creates a key store from a directory containg X509 certificate files, - * aliasing them with the index in the String[], starting with "0". - * All the files in the directory are considered to be certificates. - * - * @param keyStoreType key store type - * @param certDirURLString file URL of directory containing certificate filenames - * @return key store created - * @throws IOException thrown while reading the certificates from file - * @throws GeneralSecurityException thrown while creating the key store - */ - public static KeyStore createKeyStoreFromCertificateDirectory( - String keyStoreType, - String certDirURLString) - throws IOException, GeneralSecurityException { - - URL certDirURL = new URL(certDirURLString); - String certDirname = certDirURL.getFile(); - File certDir = new File(certDirname); - String[] certFilenames = certDir.list(); - String separator = - (certDirname.endsWith(File.separator) ? "" : File.separator); - for (int i = 0; i < certFilenames.length; i++) { - certFilenames[i] = certDirname + separator + certFilenames[i]; - } - return createKeyStore(keyStoreType, certFilenames); - } - - /** - * Loads an X509 certificate from file. - * @param certFilename filename - * @return the certificate loaded - * @throws IOException thrown while reading the certificate from file - * @throws GeneralSecurityException thrown while creating the certificate - */ - private static Certificate loadCertificate(String certFilename) - throws IOException, GeneralSecurityException { - - FileInputStream in = new FileInputStream(certFilename); - Certificate cert = new X509Certificate(in); - in.close(); - return cert; - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/MOADefaultHandler.java b/common/src/at/gv/egovernment/moa/util/MOADefaultHandler.java deleted file mode 100644 index 0474d92cd..000000000 --- a/common/src/at/gv/egovernment/moa/util/MOADefaultHandler.java +++ /dev/null @@ -1,82 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.IOException; - -import org.xml.sax.EntityResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.helpers.DefaultHandler; - -/** - * A DefaultHandler that uses a MOAEntityResolver and - * a MOAErrorHandler. - * - * @author Patrick Peck - * @version $Id$ - */ -public class MOADefaultHandler extends DefaultHandler { - /** The EntityResolver to use. */ - private EntityResolver entityResolver; - /** The ErrorHandler to use. */ - private ErrorHandler errorHandler; - - /** - * Create a new MOADefaultHandler. - */ - public MOADefaultHandler() { - entityResolver = new MOAEntityResolver(); - errorHandler = new MOAErrorHandler(); - } - - /** - * Create a new MOADefaultHandler. - * - * @param entityResolver The EntityResolver to use for resolving - * external entities. - * @param errorHandler The ErrorHandler to use for reporting - * parsing errors. - */ - public MOADefaultHandler( - EntityResolver entityResolver, - ErrorHandler errorHandler) { - - this.entityResolver = entityResolver; - this.errorHandler = errorHandler; - } - - /** - * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) - */ - public InputSource resolveEntity(String publicId, String systemId) - throws SAXException { - try { - return entityResolver.resolveEntity(publicId, systemId); - } catch (IOException e) { - return null; - } - } - - /** - * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException) - */ - public void warning(SAXParseException exception) throws SAXException { - errorHandler.warning(exception); - } - - /** - * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException) - */ - public void error(SAXParseException exception) throws SAXException { - errorHandler.error(exception); - } - - /** - * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException) - */ - public void fatalError(SAXParseException exception) throws SAXException { - errorHandler.fatalError(exception); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/MOAEntityResolver.java b/common/src/at/gv/egovernment/moa/util/MOAEntityResolver.java deleted file mode 100644 index 9406612e2..000000000 --- a/common/src/at/gv/egovernment/moa/util/MOAEntityResolver.java +++ /dev/null @@ -1,103 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.InputStream; - -import org.apache.xerces.util.URI; -import org.apache.xerces.util.URI.MalformedURIException; -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; - -/** - * An EntityResolver that looks up entities stored as - * local resources. - * - *

The following DTDs are mapped to local resources: - *

    - *
  • The XMLSchema.dtd
  • - *
  • The datatypes.dtd
  • - *
- *

- *

For all other resources, an attempt is made to resolve them as resources, - * either absolute or relative to Constants.SCHEMA_ROOT. - * - * @author Patrick Peck - * @author Sven Aigner - */ -public class MOAEntityResolver implements EntityResolver { - - /** - * Resolve an entity. - * - * The systemId parameter is used to perform the lookup of the - * entity as a resource, either by interpreting the systemId as - * an absolute resource path, or by appending the last path component of - * systemId to Constants.SCHEMA_ROOT. - * - * @param publicId The public ID of the resource. - * @param systemId The system ID of the resource. - * @return An InputSource from which the entity can be read, or - * null, if the entity could not be found. - * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) - */ - public InputSource resolveEntity(String publicId, String systemId) { - InputStream stream; - int slashPos; - - if (Logger.isDebugEnabled()) { - Logger.debug( - new LogMsg("resolveEntity: p=" + publicId + " s=" + systemId)); - } - - if (publicId != null) { - // check if we can resolve some standard dtd's - if (publicId.equalsIgnoreCase("-//W3C//DTD XMLSchema 200102//EN")) { - return new InputSource( - getClass().getResourceAsStream( - Constants.SCHEMA_ROOT + "XMLSchema.dtd")); - } else if (publicId.equalsIgnoreCase("datatypes")) { - return new InputSource( - getClass().getResourceAsStream( - Constants.SCHEMA_ROOT + "datatypes.dtd")); - } - } else if (systemId != null) { - // get the URI path - try { - URI uri = new URI(systemId); - systemId = uri.getPath(); - if (!"file".equals(uri.getScheme()) || "".equals(systemId.trim())) { - return null; - } - } catch (MalformedURIException e) { - return null; - } - - // try to get the resource from the full path - stream = getClass().getResourceAsStream(systemId); - if (stream != null) { - InputSource source = new InputSource(stream); - - source.setSystemId(systemId); - return source; - } - - // try to get the resource from the last path component - slashPos = systemId.lastIndexOf('/'); - if (slashPos >= 0 && systemId.length() > slashPos) { - systemId = systemId.substring(slashPos + 1, systemId.length()); - stream = - getClass().getResourceAsStream(Constants.SCHEMA_ROOT + systemId); - if (stream != null) { - InputSource source = new InputSource(stream); - - source.setSystemId(systemId); - return source; - } - } - } - - return null; // nothing found - let the parser handle the entity - } -} \ No newline at end of file diff --git a/common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java b/common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java deleted file mode 100644 index 1f7757c8f..000000000 --- a/common/src/at/gv/egovernment/moa/util/MOAErrorHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -package at.gv.egovernment.moa.util; - -import org.apache.xml.utils.DefaultErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; - -/** - * An ErrorHandler that logs a message and throws a - * SAXException upon error and fatal - * parsing errors. - * - * @author Patrick Peck - * @author Sven Aigner - */ -public class MOAErrorHandler extends DefaultErrorHandler { - - /** - * Logs a warning message. - * - * @see org.xml.sax.ErrorHandler#warning(SAXParseException) - */ - public void warning(SAXParseException exception) throws SAXException { - warn("parser.00", messageParams(exception), null); - } - - /** - * Logs a warning and rethrows the exception. - * - * @see org.xml.sax.ErrorHandler#error(SAXParseException) - */ - public void error(SAXParseException exception) throws SAXException { - warn("parser.01", messageParams(exception), null); - throw exception; - } - - /** - * Logs a warning and rethrows the exception. - * - * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException) - */ - public void fatalError(SAXParseException exception) throws SAXException { - warn("parser.02", messageParams(exception), null); - throw exception; - } - - /** - * Log a warning message. - * - * @param messageId The message ID to log. - * @param parameters Additional message parameters. - * @param t The Throwable to log; usually the cause of this - * warning. - */ - private static void warn( - String messageId, - Object[] parameters, - Throwable t) { - - MessageProvider msg = MessageProvider.getInstance(); - Logger.warn(new LogMsg(msg.getMessage(messageId, parameters)), t); - } - - /** - * Put the system id, line and column number information from the exception - * into an Object array, to provide it as a - * MessageFormat parameter. - * - * @param e The SAXParseException containing the - * source system id and line/column numbers. - * @return An array containing the system id (a String) as well - * as line/column numbers (2 Integer objects) from the - * SAXParseException. - */ - private static Object[] messageParams(SAXParseException e) { - return new Object[] { - e.getMessage(), - e.getSystemId(), - new Integer(e.getLineNumber()), - new Integer(e.getColumnNumber())}; - } - -} \ No newline at end of file diff --git a/common/src/at/gv/egovernment/moa/util/MOATimer.java b/common/src/at/gv/egovernment/moa/util/MOATimer.java deleted file mode 100644 index d8bf64fc3..000000000 --- a/common/src/at/gv/egovernment/moa/util/MOATimer.java +++ /dev/null @@ -1,110 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.Map; -import java.util.WeakHashMap; - -/** - * A timer utility for named timers. - * - * @author Sven Aigner - */ -public class MOATimer { - - /** The single instance of this class. */ - private static MOATimer instance = null; - /** The starting points of single timings. */ - private static Map timemapstart = new WeakHashMap(); - /** The end points of single timings. */ - private static Map timemapend = new WeakHashMap(); - - /** - * Return the single instance of this class. - * - * @return The single instance of this class. - */ - public static MOATimer getInstance() { - if (instance == null) { - instance = new MOATimer(); - } - return instance; - } - - /** - * Create a new MOATimer. - * - * Protected to disallow multiple instances. - */ - protected MOATimer() { - super(); - } - - /** - * Start timing a certain action. - * - * The timing belonging to the action ID is garbage collected as soon as there - * exists no other reference to the action ID. - * - * @param id The action ID. - */ - public void startTiming(Object id) { - timemapstart.put(id, new Long(System.currentTimeMillis())); - } - - /** - * Stop timing an action. - * - * @param id The action ID. - */ - public void stopTiming(Object id) { - timemapend.put(id, new Long(System.currentTimeMillis())); - } - - /** - * Get the duration of an action. - * - * @param id The action ID for which to compute the duration. - * @return long The duration in milliseconds between calls to - * startTiming() and stopTiming(). If - * only startTiming() has been called for the action, then - * current difference to the system time is returned. If no timing exists for - * the action, - 1 is returned. - */ - public long duration(Object id) { - if (timemapstart.containsKey(id)) { - long start = ((Long) timemapstart.get(id)).longValue(); - if (timemapend.containsKey(id)) { - long end = ((Long) timemapend.get(id)).longValue(); - return end - start; - } else { - return System.currentTimeMillis() - start; - } - } else - return -1; - } - - /** - * Get the duration of an action, as a nicely formatted String. - * - * @param id The action ID. - * @return String The duration() as a String. - */ - public String durationAsString(Object id) { - long dur = duration(id); - long second = dur / 1000; - long mil = (dur) - (second * 1000); - return "Duration: " + second + "." + mil + " seconds"; - } - - /** - * Remove a timing. - * - * @param id The action ID. - */ - public void clearTiming(String id) { - if (timemapstart.containsKey(id)) - timemapstart.remove(id); - if (timemapend.containsKey(id)) - timemapend.remove(id); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/MessageProvider.java b/common/src/at/gv/egovernment/moa/util/MessageProvider.java deleted file mode 100644 index f5117e390..000000000 --- a/common/src/at/gv/egovernment/moa/util/MessageProvider.java +++ /dev/null @@ -1,63 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.Locale; - -/** - * A singleton wrapper around a Message object. - * - * Provides the messages used in the common project. - * - * @author Patrick Peck - * @version $Id$ - */ -public class MessageProvider { - /** The location of the default message resources. */ - private static final String[] DEFAULT_MESSAGE_RESOURCES = - { "resources/properties/common_messages" }; - /** The locale of the default message resources. */ - private static final Locale[] DEFAULT_MESSAGE_LOCALES = - new Locale[] { new Locale("de", "AT") }; - /** The single instance of this class. */ - private static MessageProvider instance; - - /** The messages provided by this MessageProvider. */ - private Messages messages; - - /** - * Return the single instance of the MessageProvider. - * - * Intialilizes the MessageProvider with the default message - * locations: /resources/properties/common_messages. - * - * @return The single MessageProvider. - */ - public static synchronized MessageProvider getInstance() { - if (instance == null) { - instance = - new MessageProvider(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); - } - return instance; - } - - /** - * Create a MessageProvider. - * - * @param resourceNames The names of the resources containing the messages. - * @param locales The corresponding locales. - */ - protected MessageProvider(String[] resourceNames, Locale[] locales) { - this.messages = new Messages(resourceNames, locales); - } - - /** - * Get the message corresponding to a given message ID. - * - * @param messageId The ID of the message. - * @param parameters The parameters to fill in into the message arguments. - * @return The formatted message. - */ - public String getMessage(String messageId, Object[] parameters) { - return messages.getMessage(messageId, parameters); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/Messages.java b/common/src/at/gv/egovernment/moa/util/Messages.java deleted file mode 100644 index a0139ae93..000000000 --- a/common/src/at/gv/egovernment/moa/util/Messages.java +++ /dev/null @@ -1,117 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.text.MessageFormat; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.PropertyResourceBundle; - -import at.gv.egovernment.moa.logging.Logger; - -/** - * Provides access to the system messages resource used for exception handling - * and logging messages. - * - * Messages must be provided as a resource bundle at the path. - * - * @author Patrick Peck - * @version $Id$ - */ -public class Messages { - /** Error message indicating that no messages are avaiable. */ - private static final String ERROR_MESSAGES_UNAVAILABLE = - "Fehler in der Server-Konfiguration. " - + "Die Fehlertexte konnten nicht geladen werden."; - /** Error message indicating that the message is not available. */ - private static final String ERROR_NO_MESSAGE = - "Keine Fehlermeldung für Fehler-Nr.={0}"; - - /** The names of the resources containing the messages. */ - private String[] resourceNames; - /** The corresponding Locales of the resources. */ - private Locale[] locales; - /** The ResourceBundles containing the messages. */ - private ResourceBundleChain messages; - - /** - * Create a new Message object containing the messages - * in the given resources. - * - * @param resourceNames The names of the resources containing the messages. - * @param locales The corresponding locales. - */ - public Messages(String[] resourceNames, Locale[] locales) { - this.resourceNames = resourceNames; - this.locales = locales; - this.messages = null; - } - - /** - * Get the message corresponding to a given message ID. - * - * @param messageId The ID of the message. - * @param parameters The parameters to fill in into the message arguments. - * @return The formatted message. - */ - public String getMessage(String messageId, Object[] parameters) { - // initialize messages - if (messages == null) { - initMessages(); - } - - // create the message - if (messages == null) { - return ERROR_MESSAGES_UNAVAILABLE; - } else { - try { - String rawMessage = messages.getString(messageId); - return MessageFormat.format(rawMessage, parameters); - } catch (MissingResourceException e2) { - // couldn't find any message -> set to default error message - return MessageFormat.format( - ERROR_NO_MESSAGE, - new Object[] { messageId }); - } - } - } - - /** - * Return the names of the resources containing the messages. - * - * @return String[] The names of the resource bundles containing the messages. - */ - private String[] getResourceNames() { - return resourceNames; - } - - /** - * Return the Locales of the resources containing the messages. - * - * @return Locale[] The Locales of the resource bundles - * containing the messages. - */ - private Locale[] getLocales() { - return locales; - } - - /** - * Initialize the messages ResourceBundle containing - * the MOA error messages. - */ - private void initMessages() { - messages = new ResourceBundleChain(); - int i; - - // initialize the message resources - for (i = 0; i < resourceNames.length; i++) { - try { - messages.addResourceBundle( - PropertyResourceBundle.getBundle( - getResourceNames()[i], - getLocales()[i])); - } catch (MissingResourceException e) { - Logger.error(ERROR_MESSAGES_UNAVAILABLE, e); - } - } - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/NodeIteratorAdapter.java b/common/src/at/gv/egovernment/moa/util/NodeIteratorAdapter.java deleted file mode 100644 index f71aa472d..000000000 --- a/common/src/at/gv/egovernment/moa/util/NodeIteratorAdapter.java +++ /dev/null @@ -1,87 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.ListIterator; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; -import org.w3c.dom.traversal.NodeFilter; -import org.w3c.dom.traversal.NodeIterator; - -/** - * A NodeIterator implementation based on a - * ListIterator. - * - * @see java.util.ListIterator - * @see org.w3c.dom.traversal.NodeIterator - * - * @author Patrick Peck - * @version $Id$ - */ -public class NodeIteratorAdapter implements NodeIterator { - - /** The ListIterator to wrap. */ - private ListIterator nodeIterator; - - /** - * Create a new NodeIteratorAdapter. - * @param nodeIterator The ListIterator to iterate over. - */ - public NodeIteratorAdapter(ListIterator nodeIterator) { - this.nodeIterator = nodeIterator; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#getRoot() - */ - public Node getRoot() { - return null; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#getWhatToShow() - */ - public int getWhatToShow() { - return NodeFilter.SHOW_ALL; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#getFilter() - */ - public NodeFilter getFilter() { - return null; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#getExpandEntityReferences() - */ - public boolean getExpandEntityReferences() { - return false; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#nextNode() - */ - public Node nextNode() throws DOMException { - if (nodeIterator.hasNext()) { - return (Node) nodeIterator.next(); - } - return null; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#previousNode() - */ - public Node previousNode() throws DOMException { - if (nodeIterator.hasPrevious()) { - return (Node) nodeIterator.previous(); - } - return null; - } - - /** - * @see org.w3c.dom.traversal.NodeIterator#detach() - */ - public void detach() { - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java b/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java deleted file mode 100644 index 7102cadca..000000000 --- a/common/src/at/gv/egovernment/moa/util/NodeListAdapter.java +++ /dev/null @@ -1,44 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.List; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * A NodeList implementation based on a List. - * - * @see java.util.List - * @see org.w3c.dom.NodeList - * - * @author Patrick Peck - * @version $Id$ - */ -public class NodeListAdapter implements NodeList { - /** The List to wrap. */ - private List nodeList; - - /** - * Create a new NodeListAdapter. - * - * @param nodeList The List containing the nodes. - */ - public NodeListAdapter(List nodeList) { - this.nodeList = nodeList; - } - - /** - * @see org.w3c.dom.NodeList#item(int) - */ - public Node item(int index) { - return (Node) nodeList.get(index); - } - - /** - * @see org.w3c.dom.NodeList#getLength() - */ - public int getLength() { - return nodeList.size(); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/OutputXML2File.java b/common/src/at/gv/egovernment/moa/util/OutputXML2File.java deleted file mode 100644 index f9d330d41..000000000 --- a/common/src/at/gv/egovernment/moa/util/OutputXML2File.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Created on 26.04.2004 - * - * @author rschamberger - * $ID$ - */ -package at.gv.egovernment.moa.util; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.logging.Logger; - -/** - * utility functions to write XML data to files - * @author rschamberger - * @version $Id$ - */ -public class OutputXML2File { - - /** - * writes an XML structure to file if debug is enabled in hierarchy (Encoding: UTF-8) - * - * @param filename file name - * @param rootElem root element in DOM tree - * @param hierarchy of the Logger - */ - public static void debugOutputXML2File(String filename, Element rootElem, String hierarchy) { - if (Logger.isDebugEnabled(hierarchy)) { - outputXML2File(filename, rootElem); - } - } - - /** - * writes an XML structure to file if debug is enabled in hierarchy (Encoding: UTF-8) - * - * @param filename file name - * @param xmlString XML string - * @param hierarchy of the Logger - */ - public static void debugOutputXML2File(String filename, String xmlString, String hierarchy) { - if (Logger.isDebugEnabled(hierarchy)) { - outputXML2File(filename, xmlString); - } - } - - /** - * writes an XML structure to file (Encoding: UTF-8) - * - * @param filename file name - * @param rootElem root element in DOM tree - */ - public static void outputXML2File(String filename, Element rootElem) { - try { - String xmlString = new String(DOMUtils.serializeNode(rootElem)); - outputXML2File(filename, xmlString); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - - /** - * writes an XML structure to file (Encoding: UTF-8) - * - * @param filename file name - * @param xmlString XML string - */ - public static void outputXML2File(String filename, String xmlString) { - try { - java.io.OutputStream fout = new java.io.FileOutputStream(filename); - byte[] xmlData = xmlString.getBytes("UTF-8"); - fout.write(xmlData); - fout.close(); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/ResourceBundleChain.java b/common/src/at/gv/egovernment/moa/util/ResourceBundleChain.java deleted file mode 100644 index 90b28548a..000000000 --- a/common/src/at/gv/egovernment/moa/util/ResourceBundleChain.java +++ /dev/null @@ -1,66 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * A class to chain ResourceBundles. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ResourceBundleChain { - /** Error message indicating the resource is not available. */ - private static final String ERROR_MISSING_RESOURCE = "Missing resource"; - /** The ResourceBundles contained in this chain. */ - private List resourceBundles = new ArrayList(); - - /** - * Add a ResourceBundle to the chain. - * - * @param resourceBundle The ResourceBundle to add. - */ - public void addResourceBundle(ResourceBundle resourceBundle) { - resourceBundles.add(resourceBundle); - } - - /** - * Return the value of the resource. - * - * @param key The key to access the String resource. - * @return The resource value. All the registered ResourceBundles - * are searched in the order in which they have previously been added to this - * ResourceBundleChain. - * @throws MissingResourceException The resource coult not be found in any of - * the bundles. - */ - public String getString(String key) throws MissingResourceException { - MissingResourceException lastException = null; - Iterator iter; - - // handle case where no resource bundles have been added - if (resourceBundles.size() == 0) { - throw new MissingResourceException( - ERROR_MISSING_RESOURCE, - this.getClass().getName(), - key); - } - - // try to find the resource in one of the bundles; if it cannot be found, - // return the exception thrown by the last bundle in the list - for (iter = resourceBundles.iterator(); iter.hasNext();) { - ResourceBundle resourceBundle = (ResourceBundle) iter.next(); - try { - String value = resourceBundle.getString(key); - return value; - } catch (MissingResourceException e) { - lastException = e; - } - } - throw lastException; - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/SSLUtils.java b/common/src/at/gv/egovernment/moa/util/SSLUtils.java deleted file mode 100644 index ada21b412..000000000 --- a/common/src/at/gv/egovernment/moa/util/SSLUtils.java +++ /dev/null @@ -1,221 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.IOException; -import java.io.InputStream; -import java.security.GeneralSecurityException; -import java.security.KeyStore; - -import javax.net.ssl.KeyManager; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; - -/** - * Utility for connecting to server applications via SSL. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SSLUtils { - - /** - * Creates an SSLSocketFactory which utilizes the given trust store. - * - * @param trustStoreType key store type of trust store - * @param trustStoreInputStream input stream for reading JKS trust store containing - * trusted server certificates; if null, the default - * trust store will be utilized - * @param trustStorePassword if provided, it will be used to check - * the integrity of the trust store; if omitted, it will not be checked - * @return SSLSocketFactory to be used by an HttpsURLConnection - * @throws IOException thrown while reading from the input stream - * @throws GeneralSecurityException thrown while creating the socket factory - */ - public static SSLSocketFactory getSSLSocketFactory( - String trustStoreType, - InputStream trustStoreInputStream, - String trustStorePassword) - throws IOException, GeneralSecurityException { - - TrustManager[] tms = getTrustManagers(trustStoreType, trustStoreInputStream, trustStorePassword); - SSLContext ctx = SSLContext.getInstance("TLS"); - ctx.init(null, tms, null); - - SSLSocketFactory sf = ctx.getSocketFactory(); - return sf; - } - /** - * Creates an SSLSocketFactory which utilizes the - * given trust store and keystore. - * - * @param trustStore trust store containing trusted server certificates; - * if null, the default trust store will be utilized - * @param clientKeyStoreType key store type of clientKeyStore - * @param clientKeyStoreURL URL of key store containing keys to be used for - * client authentication; if null, the default key store will be utilized - * @param clientKeyStorePassword if provided, it will be used to check - * the integrity of the client key store; if omitted, it will not be checked - * @return SSLSocketFactory to be used by an HttpsURLConnection - * @throws IOException thrown while reading key store file - * @throws GeneralSecurityException thrown while creating the socket factory - */ - public static SSLSocketFactory getSSLSocketFactory( - KeyStore trustStore, - String clientKeyStoreType, - String clientKeyStoreURL, - String clientKeyStorePassword) - throws IOException, GeneralSecurityException { - - SSLContext ctx = getSSLContext( - trustStore, clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword); - SSLSocketFactory sf = ctx.getSocketFactory(); - return sf; - } - /** - * Creates an SSLContext initialized for the - * given trust store and keystore. - * - * @param trustStore trust store containing trusted server certificates; - * if null, the default trust store will be utilized - * @param clientKeyStoreType key store type of clientKeyStore - * @param clientKeyStoreURL URL of key store containing keys to be used for - * client authentication; if null, the default key store will be utilized - * @param clientKeyStorePassword if provided, it will be used to check - * the integrity of the client key store; if omitted, it will not be checked - * @return SSLContext to be used for creating an SSLSocketFactory - * @throws IOException thrown while reading key store file - * @throws GeneralSecurityException thrown while creating the SSL context - */ - public static SSLContext getSSLContext( - KeyStore trustStore, - String clientKeyStoreType, - String clientKeyStoreURL, - String clientKeyStorePassword) - throws IOException, GeneralSecurityException { - - //System.setProperty("javax.net.debug", "all"); - TrustManager[] tms = getTrustManagers(trustStore); - KeyManager[] kms = getKeyManagers(clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword); - SSLContext ctx = SSLContext.getInstance("TLS"); - ctx.init(kms, tms, null); - return ctx; - } - /** - * Loads the trust store from an input stream and gets the - * TrustManagers from a default TrustManagerFactory, - * initialized from the given trust store. - * @param trustStoreType key store type of trust store - * @param trustStoreInputStream input stream for reading JKS trust store containing - * trusted server certificates; if null, the default - * trust store will be utilized - * @param trustStorePassword if provided, it will be used to check - * the integrity of the trust store; if omitted, it will not be checked - * @return TrustManagers to be used for creating an - * SSLSocketFactory utilizing the given trust store - * @throws IOException thrown while reading from the input stream - * @throws GeneralSecurityException thrown while initializing the - * default TrustManagerFactory - */ - protected static TrustManager[] getTrustManagers( - String trustStoreType, - InputStream trustStoreInputStream, - String trustStorePassword) - throws IOException, GeneralSecurityException { - - if (trustStoreInputStream == null) - return null; - - // Set up the TrustStore to use. We need to load the file into - // a KeyStore instance. - KeyStore trustStore = KeyStoreUtils.loadKeyStore(trustStoreType, trustStoreInputStream, trustStorePassword); - return getTrustManagers(trustStore); - } - /** - * Gets the TrustManagers from a default TrustManagerFactory, - * initialized from the given trust store. - * - * @param trustStore the trust store to use - * @return TrustManagers to be used for creating an - * SSLSocketFactory utilizing the given trust store - * @throws GeneralSecurityException thrown while initializing the - * default TrustManagerFactory - */ - protected static TrustManager[] getTrustManagers(KeyStore trustStore) - throws GeneralSecurityException { - - if (trustStore == null) - return null; - - // Initialize the default TrustManagerFactory with this KeyStore - String alg=TrustManagerFactory.getDefaultAlgorithm(); - TrustManagerFactory tmFact=TrustManagerFactory.getInstance(alg); - tmFact.init(trustStore); - - // And now get the TrustManagers - TrustManager[] tms=tmFact.getTrustManagers(); - return tms; - } - /** - * Loads the client key store from file and gets the - * KeyManagers from a default KeyManagerFactory, - * initialized from the given client key store. - * @param clientKeyStoreType key store type of clientKeyStore - * @param clientKeyStoreURL URL of key store containing keys to be used for - * client authentication; if null, the default key store will be utilized - * @param clientKeyStorePassword password used to check the integrity of the client key store; - * if null, it will not be checked - * @return KeyManagers to be used for creating an - * SSLSocketFactory utilizing the given client key store - * @throws IOException thrown while reading from the key store file - * @throws GeneralSecurityException thrown while initializing the - * default KeyManagerFactory - */ - public static KeyManager[] getKeyManagers ( - String clientKeyStoreType, - String clientKeyStoreURL, - String clientKeyStorePassword) - throws IOException, GeneralSecurityException { - - if (clientKeyStoreURL == null) - return null; - - // Set up the KeyStore to use. We need to load the file into - // a KeyStore instance. - KeyStore clientKeyStore = KeyStoreUtils.loadKeyStore( - clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword); - return getKeyManagers(clientKeyStore, clientKeyStorePassword); - } - /** - * Gets the KeyManagers from a default KeyManagerFactory, - * initialized from the given client key store. - * @param clientKeyStore client key store - * @param clientKeyStorePassword if provided, it will be used to check - * the integrity of the client key store; if omitted, it will not be checked - * @return KeyManagers to be used for creating an - * SSLSocketFactory utilizing the given client key store - * @throws GeneralSecurityException thrown while initializing the - * default KeyManagerFactory - */ - public static KeyManager[] getKeyManagers ( - KeyStore clientKeyStore, - String clientKeyStorePassword) - throws GeneralSecurityException { - - if (clientKeyStore == null) - return null; - - // Now we initialize the default KeyManagerFactory with this KeyStore - String alg=KeyManagerFactory.getDefaultAlgorithm(); - KeyManagerFactory kmFact=KeyManagerFactory.getInstance(alg); - char[] password = null; - if (clientKeyStorePassword != null) - password = clientKeyStorePassword.toCharArray(); - kmFact.init(clientKeyStore, password); - - // And now get the KeyManagers - KeyManager[] kms=kmFact.getKeyManagers(); - return kms; - } -} diff --git a/common/src/at/gv/egovernment/moa/util/StreamEntityResolver.java b/common/src/at/gv/egovernment/moa/util/StreamEntityResolver.java deleted file mode 100644 index 38c4e863c..000000000 --- a/common/src/at/gv/egovernment/moa/util/StreamEntityResolver.java +++ /dev/null @@ -1,64 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; - -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * An EntityResolver that maps system IDs to - * InputStreams. - * - * @author Patrick Peck - * @version $Id$ - */ -public class StreamEntityResolver implements EntityResolver { - - /** A mapping from Public ID or System ID to an InputStream - * containing the entity. */ - private Map mappedEntities; - - /** - * Create a StreamEntityResolver. - * - * @param mappedEntities A mapping from public or system IDs - * (String objects) to InputStreams. - */ - public StreamEntityResolver(Map mappedEntities) { - this.mappedEntities = mappedEntities; - } - - /** - * Resolve an entity by looking it up in the mapped entities. - * - * First, the public ID is looked up in the mapping, then the system ID. - * - * @param publicId The public ID of the entity. - * @param systemId The system ID of the entity. - * @return An InputStream containing the entity or - * null if no entity could be found. - * @throws SAXException Signalling a parsing exception. - * @throws IOException Error reading the entity. - */ - public InputSource resolveEntity(String publicId, String systemId) - throws SAXException, IOException { - - InputSource src = null; - - if (publicId != null && mappedEntities.get(publicId) != null) { - src = new InputSource((InputStream) mappedEntities.get(publicId)); - } else if (systemId != null && mappedEntities.get(systemId) != null) { - src = new InputSource((InputStream) mappedEntities.get(systemId)); - } - - if (src != null) { - src.setPublicId(publicId); - src.setSystemId(systemId); - } - - return src; - } -} diff --git a/common/src/at/gv/egovernment/moa/util/StreamUtils.java b/common/src/at/gv/egovernment/moa/util/StreamUtils.java deleted file mode 100644 index a22f1c2a8..000000000 --- a/common/src/at/gv/egovernment/moa/util/StreamUtils.java +++ /dev/null @@ -1,128 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; - -/** - * Utility methods for streams. - * - * @author Patrick Peck - * @version $Id$ - */ -public class StreamUtils { - - /** - * Compare the contents of two InputStreams. - * - * @param is1 The 1st InputStream to compare. - * @param is2 The 2nd InputStream to compare. - * @return boolean true, if both streams contain the exactly the - * same content, false otherwise. - * @throws IOException An error occurred reading one of the streams. - */ - public static boolean compareStreams(InputStream is1, InputStream is2) - throws IOException { - - byte[] buf1 = new byte[256]; - byte[] buf2 = new byte[256]; - int length1; - int length2; - - try { - while (true) { - length1 = is1.read(buf1); - length2 = is2.read(buf2); - - if (length1 != length2) { - return false; - } - if (length1 <= 0) { - return true; - } - if (!compareBytes(buf1, buf2, length1)) { - return false; - } - } - } catch (IOException e) { - throw e; - } finally { - // close both streams - try { - is1.close(); - is2.close(); - } catch (IOException e) { - // ignore this - } - } - } - - /** - * Compare two byte arrays, up to a given maximum length. - * - * @param b1 1st byte array to compare. - * @param b2 2nd byte array to compare. - * @param length The maximum number of bytes to compare. - * @return true, if the byte arrays are equal, false - * otherwise. - */ - private static boolean compareBytes(byte[] b1, byte[] b2, int length) { - if (b1.length != b2.length) { - return false; - } - - for (int i = 0; i < b1.length && i < length; i++) { - if (b1[i] != b2[i]) { - return false; - } - } - - return true; - } - - /** - * Reads a byte array from a stream. - * @param in The InputStream to read. - * @return The bytes contained in the given InputStream. - * @throws IOException on any exception thrown - */ - public static byte[] readStream(InputStream in) throws IOException { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - int b; - while ((b = in.read()) >= 0) - out.write(b); - in.close(); - return out.toByteArray(); - } - - /** - * Reads a String from a stream, using given encoding. - * @param in The InputStream to read. - * @param encoding The character encoding to use for converting the bytes - * of the InputStream into a String. - * @return The content of the given InputStream converted into - * a String. - * @throws IOException on any exception thrown - */ - public static String readStream(InputStream in, String encoding) throws IOException { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - int b; - while ((b = in.read()) >= 0) - out.write(b); - in.close(); - return out.toString(encoding); - } - - /** - * Gets the stack trace of the Throwable passed in as a string. - * @param t The Throwable. - * @return a String representing the stack trace of the Throwable. - */ - public static String getStackTraceAsString(Throwable t) - { - ByteArrayOutputStream stackTraceBIS = new ByteArrayOutputStream(); - t.printStackTrace(new PrintStream(stackTraceBIS)); - return new String(stackTraceBIS.toByteArray()); - } -} diff --git a/common/src/at/gv/egovernment/moa/util/StringUtils.java b/common/src/at/gv/egovernment/moa/util/StringUtils.java deleted file mode 100644 index 61b1a18ea..000000000 --- a/common/src/at/gv/egovernment/moa/util/StringUtils.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (C) 2002 IAIK -// email: jce-info@iaik.tu-graz.ac.at -// -// All rights reserved. -// -// This source is provided for inspection purposes and recompilation only, -// unless specified differently in a contract with IAIK. This source has to -// be kept in strict confidence and must not be disclosed to any third party -// under any circumstances. Redistribution in source and binary forms, with -// or without modification, are permitted in any case! -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -// SUCH DAMAGE. -// - -package at.gv.egovernment.moa.util; - -import java.util.StringTokenizer; - -/** - * Utitility functions for string manipulations. - * - * @author Harald Bratko - */ -public class StringUtils { - - /** - * Removes all blanks and tabs from the given string. - * - * @param s The string to remove all blanks and tabs from. - * @return The input string with all blanks and tabs removed from. - */ - public static String removeBlanks(String s) { - StringTokenizer st = new StringTokenizer(s); - StringBuffer sb = new StringBuffer(s.length()); - while (st.hasMoreTokens()) { - sb.append(st.nextToken()); - } - return sb.toString(); - } - - /** - * Removes all occurences of the specified token from the the given string. - * - * @param s The string to remove all occurences of the specified token from. - * @return The input string with all occurences of the specified token removed from. - */ - public static String removeToken(String s, String token) { - StringTokenizer st = new StringTokenizer(s, token); - StringBuffer sb = new StringBuffer(s.length()); - while (st.hasMoreTokens()) { - sb.append(st.nextToken()); - } - return sb.toString(); - } - - /** - * Removes all leading zeros from the input string. - * - * @param s The string remove the leading zeros from. - * @return The input string with the leading zeros removed from. - */ - public static String deleteLeadingZeros(String s) { - StringBuffer sb = new StringBuffer(s); - int l = sb.length(); - int j = 0; - for (int i=0; is that matches the given - * search string by the given replace string. - * - * @param s The string where the replacment should take place. - * @param search The pattern that should be replaced. - * @param replace The string that should replace all each search - * string within s. - * @return A string whrer all occurrence of search are - * replaced with replace. - */ - public static String replaceAll (String s, String search, String replace) - { - StringBuffer sb = new StringBuffer(); - int i = 0, j = 0; - int len = search.length(); - while (j > -1) - { - j = s.indexOf(search, i); - - if (j > -1) - { - sb.append(s.substring(i,j)); - sb.append(replace); - i = j + len; - } - } - - sb.append(s.substring(i, s.length())); - - return sb.toString(); - } - - /** - * Changes the SecurityLayer version in the given string. - * This method usually takes as input an XML structure represented in a string - * format and changes the SecurityLayer namespaces prefixes and URIs from - * one SecurityLayer version to another. - * e.g.: code>sl10 to sl and - * http://www.buergerkarte.at/namespaces/securitylayer/20020225# - * to - * http://www.buergerkarte.at/namespaces/securitylayer/1.2# - * - * @param s The string (usally an XML structure) where the - * SecurityLayer version should be changed. - * @param slPrefixOld The SecurityLayer namespace prefix that should be - * replaced by the new one. - * @param slPrefixNew The new SecurityLayer namespace prefix that should - * replace the old one. - * @param slNSUriOld The SecurityLayer namespace URI that should be - * replaced by the new one. - * @param slNSUriNew The new SecurityLayer namespace URI that should - * replace the old one. - * @return A string where the SecurityLayer namespace prefixes - * and URIs are replaced by new ones. - */ - public static String changeSLVersion(String s, String slPrefixOld, String slPrefixNew, String slNSUriOld, String slNSUriNew) { - String retString = replaceAll(s, slPrefixOld, slPrefixNew); - retString = replaceAll(retString, slNSUriOld, slNSUriNew); - return retString ; - } - - /** - * Removes the XML declaration from an XML expression. - * - * @param xmlString XML expression as String - * - * @return XML expression, XML declaration removed - */ - public static String removeXMLDeclaration(String xmlString) { - if (xmlString.startsWith("application/x-www-form-urlencoded string using a specific encoding scheme. - * @param s the string to decode - * @param encoding name of character encoding - * @return the newly decoded string - * @throws UnsupportedEncodingException if the encoding is not supported - */ - public static String decode(String s, String encoding) throws UnsupportedEncodingException { - StringReader in = new StringReader(s); - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - for (int b = read(in); b >= 0; b = read(in)) - bout.write(b); - return bout.toString(encoding); - } - /** - * Decodes the next byte from the string reader. - * @param in string reader - * @return the next byte decoded; - * -1 upon end of string, on erroneous data, and on any exception caught - * @todo syntax check on string - */ - private static int read(StringReader in) { - try { - int b = in.read(); - if (b == '+') - return ' '; - if (b == '%') { - char[] hex = new char[2]; - if (in.read(hex, 0, 2) >= 0) { - String hexString = new String(hex); - return Integer.valueOf(hexString, 16).intValue(); - } - else - return -1; - } - return b; - } - catch (IOException ex) { - return -1; - } - catch (NumberFormatException ex) { - return -1; - } - } -} diff --git a/common/src/at/gv/egovernment/moa/util/URLEncoder.java b/common/src/at/gv/egovernment/moa/util/URLEncoder.java deleted file mode 100644 index 840c0c3bc..000000000 --- a/common/src/at/gv/egovernment/moa/util/URLEncoder.java +++ /dev/null @@ -1,63 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.ByteArrayInputStream; -import java.io.StringWriter; -import java.io.UnsupportedEncodingException; - -/** - * Translates a string into mime format "x-www-form-urlencoded". - * Provides a function missing in JDK 1.3. - * @author Paul Ivancsics - * @version $Id$ - */ -public class URLEncoder { - - /** - * Translates a string into x-www-form-urlencoded format. - * @param s the string to be translated - * @param encoding the encoding to use - * @return the translated string - * @throws UnsupportedEncodingException when the desired encoding is not supported - */ - public static String encode(String s, String encoding) throws UnsupportedEncodingException { - byte[] barr = s.getBytes(encoding); - ByteArrayInputStream bin = new ByteArrayInputStream(barr); - StringWriter out = new StringWriter(); - for (int b = bin.read(); b >= 0; b = bin.read()) - encode(b, out); - return out.toString(); - } - - /** - * Encode a character. - * @param ch The character to encode. - * @param out The StringWriter containing the result. - */ - private static void encode(int ch, StringWriter out) { - if ((ch >= 'a' && ch <= 'z') - || (ch >= 'A' && ch <= 'Z') - || (ch >= '0' && ch <= '9') - || ch == '.' || ch == '-' || ch == '*' || ch == '_') - out.write(ch); - else if (ch == ' ') - out.write('+'); - else - encodeHex(ch, out); - } - - /** - * Encode a character as an escaped hex value. - * @param ch The character to encode. - * @param out The StringWriter containing the result. - */ - private static void encodeHex(int ch, StringWriter out) { - out.write('%'); - String hex = Integer.toHexString(ch).toUpperCase(); - if (hex.length() < 2) - out.write('0'); - else - out.write(hex.charAt(hex.length() - 2)); - out.write(hex.charAt(hex.length() - 1)); - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/XPathException.java b/common/src/at/gv/egovernment/moa/util/XPathException.java deleted file mode 100644 index e10c882e5..000000000 --- a/common/src/at/gv/egovernment/moa/util/XPathException.java +++ /dev/null @@ -1,58 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * An exception occurred evaluating an XPath. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XPathException extends RuntimeException { - /** The wrapped exception. */ - private Throwable wrapped; - - /** - * Create a XPathException. - * - * @param message The exception message. - * @param wrapped The exception being the likely cause of this exception. - */ - public XPathException(String message, Throwable wrapped) { - super(message); - this.wrapped = wrapped; - } - - /** - * Return the wrapped exception. - * - * @return The wrapped exception being the likely cause of this exception. - */ - public Throwable getWrapped() { - return wrapped; - } - - /** - * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) - */ - public void printStackTrace(PrintStream s) { - super.printStackTrace(s); - if (getWrapped() != null) { - s.print("Caused by: "); - getWrapped().printStackTrace(s); - } - } - - /** - * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) - */ - public void printStackTrace(PrintWriter s) { - super.printStackTrace(s); - if (getWrapped() != null) { - s.print("Caused by: "); - getWrapped().printStackTrace(s); - } - } - -} diff --git a/common/src/at/gv/egovernment/moa/util/XPathUtils.java b/common/src/at/gv/egovernment/moa/util/XPathUtils.java deleted file mode 100644 index 5212ed13e..000000000 --- a/common/src/at/gv/egovernment/moa/util/XPathUtils.java +++ /dev/null @@ -1,526 +0,0 @@ -package at.gv.egovernment.moa.util; - -import java.util.List; -import java.util.Map; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.NodeIterator; - -import org.jaxen.JaxenException; -import org.jaxen.NamespaceContext; -import org.jaxen.SimpleNamespaceContext; -import org.jaxen.dom.DOMXPath; -import org.jaxen.dom.DocumentNavigator; - -/** - * Utility methods to evaluate XPath expressions on DOM nodes. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XPathUtils { - - /** - * The XPath expression selecting all nodes under a given root (including the - * root node itself). - */ - public static final String ALL_NODES_XPATH = - "(.//. | .//@* | .//namespace::*)"; - - /** The DocumentNavigator to use for navigating the document. */ - private static DocumentNavigator documentNavigator = - DocumentNavigator.getInstance(); - /** The default namespace prefix to namespace URI mappings. */ - private static NamespaceContext NS_CONTEXT; - - static { - SimpleNamespaceContext ctx = new SimpleNamespaceContext(); - ctx.addNamespace(Constants.MOA_PREFIX, Constants.MOA_NS_URI); - ctx.addNamespace(Constants.MOA_CONFIG_PREFIX, Constants.MOA_CONFIG_NS_URI); - ctx.addNamespace(Constants.MOA_ID_CONFIG_PREFIX, Constants.MOA_ID_CONFIG_NS_URI); - ctx.addNamespace(Constants.SL10_PREFIX, Constants.SL10_NS_URI); - ctx.addNamespace(Constants.SL11_PREFIX, Constants.SL11_NS_URI); - ctx.addNamespace(Constants.SL12_PREFIX, Constants.SL12_NS_URI); - ctx.addNamespace(Constants.ECDSA_PREFIX, Constants.ECDSA_NS_URI); - ctx.addNamespace(Constants.PD_PREFIX, Constants.PD_NS_URI); - ctx.addNamespace(Constants.SAML_PREFIX, Constants.SAML_NS_URI); - ctx.addNamespace(Constants.SAMLP_PREFIX, Constants.SAMLP_NS_URI); - ctx.addNamespace(Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); - ctx.addNamespace(Constants.XSLT_PREFIX, Constants.XSLT_NS_URI); - ctx.addNamespace(Constants.XSI_PREFIX, Constants.XSI_NS_URI); - ctx.addNamespace(Constants.DSIG_FILTER2_PREFIX, Constants.DSIG_FILTER2_NS_URI); - ctx.addNamespace(Constants.DSIG_EC_PREFIX, Constants.DSIG_EC_NS_URI); - ctx.addNamespace(Constants.MD_PREFIX, Constants.MD_NS_URI); - ctx.addNamespace(Constants.MDP_PREFIX, Constants.MDP_NS_URI); - ctx.addNamespace(Constants.MVV_PREFIX, Constants.MVV_NS_URI); - ctx.addNamespace(Constants.STB_PREFIX, Constants.STB_NS_URI); - ctx.addNamespace(Constants.WRR_PREFIX, Constants.WRR_NS_URI); - NS_CONTEXT = ctx; - } - - /** - * Return a NodeIterator over the nodes matching the XPath - * expression. - * - * All namespace URIs and prefixes declared in the Constants - * interface are used for resolving namespaces. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param exp The XPath expression to evaluate. - * @return An iterator over the resulting nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static NodeIterator selectNodeIterator(Node contextNode, String exp) - throws XPathException { - - return selectNodeIterator(contextNode, NS_CONTEXT, exp); - } - - /** - * Return a NodeIterator over the nodes matching the XPath - * expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param namespaceElement An element from which to build the - * namespace mapping for evaluating the XPath expression - * @param exp The XPath expression to evaluate. - * @return An iterator over the resulting nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static NodeIterator selectNodeIterator( - Node contextNode, - Element namespaceElement, - String exp) - throws XPathException { - - try { - SimpleNamespaceContext ctx = new SimpleNamespaceContext(); - ctx.addElementNamespaces(documentNavigator, namespaceElement); - return selectNodeIterator(contextNode, ctx, exp); - } catch (JaxenException e) { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { exp }); - throw new XPathException(message, e); - } - } - - /** - * Return a NodeIterator over the nodes matching the XPath - * expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param namespaceMapping A namespace prefix to namespace URI mapping - * (String to String) for evaluating the XPath - * expression. - * @param exp The XPath expression to evaluate. - * @return An iterator over the resulting nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static NodeIterator selectNodeIterator( - Node contextNode, - Map namespaceMapping, - String exp) - throws XPathException { - - SimpleNamespaceContext ctx = new SimpleNamespaceContext(namespaceMapping); - - return selectNodeIterator(contextNode, ctx, exp); - } - - /** - * Return a NodeIterator over the nodes matching the XPath - * expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param nsContext The NamespaceContext for resolving namespace - * prefixes to namespace URIs for evaluating the XPath expression. - * @param exp The XPath expression to evaluate. - * @return An iterator over the resulting nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - private static NodeIterator selectNodeIterator( - Node contextNode, - NamespaceContext nsContext, - String exp) - throws XPathException { - - try { - DOMXPath xpath = new DOMXPath(exp); - List nodes; - - xpath.setNamespaceContext(nsContext); - nodes = xpath.selectNodes(contextNode); - return new NodeIteratorAdapter(nodes.listIterator()); - } catch (JaxenException e) { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { exp }); - throw new XPathException(message, e); - } - } - - /** - * Return a NodeList of all the nodes matching the XPath - * expression. - * - * All namespace URIs and prefixes declared in the Constants - * interface are used for resolving namespaces. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param exp The XPath expression to evaluate. - * @return A NodeList containing the matching nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static NodeList selectNodeList(Node contextNode, String exp) - throws XPathException { - - return selectNodeList(contextNode, NS_CONTEXT, exp); - } - - /** - * Return a NodeList of all the nodes matching the XPath - * expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param namespaceElement An element from which to build the - * namespace mapping for evaluating the XPath expression - * @param exp The XPath expression to evaluate. - * @return A NodeList containing the matching nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static NodeList selectNodeList( - Node contextNode, - Element namespaceElement, - String exp) - throws XPathException { - - try { - SimpleNamespaceContext ctx = new SimpleNamespaceContext(); - - ctx.addElementNamespaces(documentNavigator, namespaceElement); - return selectNodeList(contextNode, ctx, exp); - } catch (JaxenException e) { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { exp }); - throw new XPathException(message, e); - } - } - - /** - * Return a NodeList of all the nodes matching the XPath - * expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param namespaceMapping A namespace prefix to namespace URI mapping - * (String to String) for evaluating the XPath - * expression. - * @param exp The XPath expression to evaluate. - * @return A NodeList containing the matching nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static NodeList selectNodeList( - Node contextNode, - Map namespaceMapping, - String exp) - throws XPathException { - - SimpleNamespaceContext ctx = new SimpleNamespaceContext(namespaceMapping); - - return selectNodeList(contextNode, ctx, exp); - } - - /** - * Return a NodeList of all the nodes matching the XPath - * expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param nsContext The NamespaceContext for resolving namespace - * prefixes to namespace URIs for evaluating the XPath expression. - * @param exp The XPath expression to evaluate. - * @return A NodeList containing the matching nodes. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - private static NodeList selectNodeList( - Node contextNode, - NamespaceContext nsContext, - String exp) - throws XPathException { - - try { - DOMXPath xpath = new DOMXPath(exp); - List nodes; - - xpath.setNamespaceContext(nsContext); - nodes = xpath.selectNodes(contextNode); - return new NodeListAdapter(nodes); - } catch (JaxenException e) { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { exp }); - throw new XPathException(message, e); - } - } - - /** - * Select the first node matching an XPath expression. - * - * All namespace URIs and prefixes declared in the Constants - * interface are used for resolving namespaces. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param exp The XPath expression to evaluate. - * @return Node The first node matching the XPath expression, or - * null, if no node matched. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static Node selectSingleNode(Node contextNode, String exp) - throws XPathException { - - return selectSingleNode(contextNode, NS_CONTEXT, exp); - } - - /** - * Select the first node matching an XPath expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param namespaceElement An element from which to build the - * namespace mapping for evaluating the XPath expression - * @param exp The XPath expression to evaluate. - * @return Node The first node matching the XPath expression, or - * null, if no node matched. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static Node selectSingleNode( - Node contextNode, - Element namespaceElement, - String exp) - throws XPathException { - - try { - SimpleNamespaceContext ctx = new SimpleNamespaceContext(); - ctx.addElementNamespaces(documentNavigator, namespaceElement); - - return selectSingleNode(contextNode, ctx, exp); - } catch (JaxenException e) { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { exp }); - throw new XPathException(message, e); - } - } - - /** - * Select the first node matching an XPath expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param namespaceMapping A namespace prefix to namespace URI mapping - * (String to String) for evaluating the XPath - * expression. - * @param exp The XPath expression to evaluate. - * @return Node The first node matching the XPath expression, or - * null, if no node matched. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - public static Node selectSingleNode( - Node contextNode, - Map namespaceMapping, - String exp) - throws XPathException { - - SimpleNamespaceContext ctx = new SimpleNamespaceContext(namespaceMapping); - - return selectSingleNode(contextNode, ctx, exp); - } - - /** - * Select the first node matching an XPath expression. - * - * @param contextNode The root node from which to evaluate the XPath - * expression. - * @param nsContext The NamespaceContext for resolving namespace - * prefixes to namespace URIs for evaluating the XPath expression. - * @param exp The XPath expression to evaluate. - * @return Node The first node matching the XPath expression, or - * null, if no node matched. - * @throws XPathException An error occurred evaluating the XPath expression. - */ - private static Node selectSingleNode( - Node contextNode, - NamespaceContext nsContext, - String exp) - throws XPathException { - - try { - DOMXPath xpath = new DOMXPath(exp); - xpath.setNamespaceContext(nsContext); - return (Node) xpath.selectSingleNode(contextNode); - } catch (JaxenException e) { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { exp }); - throw new XPathException(message, e); - } - } - - /** - * Return the value of a DOM element whose location is given by an XPath - * expression. - * - * @param root The root element from which to evaluate the XPath. - * @param xpath The XPath expression pointing to the element whose value - * to return. - * @param def The default value to return, if no element can be found using - * the given xpath. - * @return The element value, if it can be located using the - * xpath. Otherwise, def is returned. - */ - public static String getElementValue( - Element root, - String xpath, - String def) { - - Element elem = (Element) XPathUtils.selectSingleNode(root, xpath); - return elem != null ? DOMUtils.getText(elem) : def; - } - - /** - * Return the value of a DOM attribute whose location is given by an XPath - * expression. - * - * @param root The root element from which to evaluate the XPath. - * @param xpath The XPath expression pointing to the attribute whose value to - * return. - * @param def The default value to return, if no attribute can be found using - * the given xpath. - * @return The element value, if it can be located using the - * xpath. Otherwise, def is returned. - */ - public static String getAttributeValue( - Element root, - String xpath, - String def) { - - Attr attr = (Attr) XPathUtils.selectSingleNode(root, xpath); - return attr != null ? attr.getValue() : def; - } - - /** - * Returns the namespace prefix used within XPathUtils for referring to - * the namespace of the specified (Security Layer command) element. - * - * This namespace prefix can be used in various XPath expression evaluation methods - * within XPathUtils without explicitely binding it to the particular - * namespace. - * - * @param contextElement The (Security Layer command) element. - * - * @return the namespace prefix used within XPathUtils for referring to - * the namespace of the specified (Security Layer command) element. - * - * throws XpathException If the specified element has a namespace other than the ones - * known by this implementation as valid Security Layer namespaces (cf. - * @link Constants#SL10_NS_URI, @link Constants#SL11_NS_URI, @link Constants#SL12_NS_URI). - */ - public static String getSlPrefix (Element contextElement) throws XPathException - { - String sLNamespace = contextElement.getNamespaceURI(); - String sLPrefix = null; - - if (sLNamespace.equals(Constants.SL10_NS_URI)) - { - sLPrefix = Constants.SL10_PREFIX; - } - else if (sLNamespace.equals(Constants.SL12_NS_URI)) - { - sLPrefix = Constants.SL12_PREFIX; - } - else if (sLNamespace.equals(Constants.SL11_NS_URI)) - { - sLPrefix = Constants.SL11_PREFIX; - } - else - { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { "Ungültiger Security Layer Namespace: \"" + sLNamespace + "\"."}); - throw new XPathException(message, null); - } - - return sLPrefix; - } - - - /** - * Return the SecurityLayer namespace prefix of the context element. - * If the context element is not the element that lies within the - * SecurityLayer namespace. The Securitylayer namespace is derived from - * the xmlns:sl10, sl11 or sl - * attribute of the context element. - * - * The returned prefix is needed for evaluating XPATH expressions. - * - * @param contextElement The element to get a prefix for the Securitylayer namespace, - * that is used within the corresponding document. - * - * @return The string sl10, sl11 or sl, - * depending on the SecurityLayer namespace of the contextElement. - * - * throws XPathException If no (vlalid) SecurityLayer namespace prefix or namespace - * is defined. - */ - public static String getSlPrefixFromNoRoot (Element contextElement) throws XPathException { - - String slPrefix = checkSLnsDeclaration(contextElement, Constants.SL10_PREFIX, Constants.SL10_NS_URI); - if (slPrefix == null) { - slPrefix = checkSLnsDeclaration(contextElement, Constants.SL11_PREFIX, Constants.SL11_NS_URI); - } - if (slPrefix == null) { - slPrefix = checkSLnsDeclaration(contextElement, Constants.SL12_PREFIX, Constants.SL12_NS_URI); - } - - return slPrefix; - - } - - /** - * Checks if the context element has an attribute xmlns:slPrefix and - * if the prefix of that attribute corresponds with a valid SecurityLayer namespace. - * - * @param contextElement The element to be checked. - * @param slPrefix The prefix which should be checked. Must be a valid SecurityLayer - * namespace prefix. - * @param slNameSpace The SecurityLayer namespace that corresponds to the specified prefix. - * - * @return The valid SecurityLayer prefix or null if this prefix is - * not used. - * @throws XPathException - */ - private static String checkSLnsDeclaration(Element contextElement, String slPrefix, String slNameSpace) - throws XPathException - { - String nsAtt = "xmlns:" + slPrefix; - String nameSpace = contextElement.getAttribute(nsAtt); - if (nameSpace == "") { - return null; - } else { - // check if namespace is correct - if (nameSpace.equals(slNameSpace)) { - return slPrefix; - } else { - MessageProvider msg = MessageProvider.getInstance(); - String message = msg.getMessage("xpath.00", new Object[] { "Ungültiger SecurityLayer Namespace: \"" + nameSpace + "\"."}); - throw new XPathException(message, null); - } - } - } - -} diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/LogMsg.java b/common/src/main/java/at/gv/egovernment/moa/logging/LogMsg.java new file mode 100644 index 000000000..4d04fc72d --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/logging/LogMsg.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.logging; + +/** + * A unified message type to log messages from inside the MOA subsystem. + * + * @author Patrick Peck + * @version $Id$ + */ +public class LogMsg { + /** The message to log. */ + private Object message; + + /** + * Create a LogMsg object. + * + * @param message The actual message to log. May be null. + */ + public LogMsg(Object message) { + this.message = message; + } + + /** + * Convert this log message to a String. + * + * @return The String representation of this log message. + */ + public String toString() { + StringBuffer msg = new StringBuffer(); + LoggingContext ctx = + LoggingContextManager.getInstance().getLoggingContext(); + String tid = ctx != null ? ctx.getTransactionID() : null; + String nodeId = ctx != null ? ctx.getNodeID() : null; + + msg.append("TID="); + msg.append(tid != null ? tid : ""); + msg.append(" NID="); + msg.append(nodeId != null ? nodeId : ""); + msg.append(" MSG="); + msg.append(message != null ? message.toString() : ""); + + return msg.toString(); + } +} 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 new file mode 100644 index 000000000..eb7aa5634 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java @@ -0,0 +1,175 @@ +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. + * + * Configure the logging defaultHierarchy that the Logger uses by + * calling setHierarchy once before calling any of the logging + * output functions. + * + * @author Patrick Peck + * @version $Id$ + */ +public class Logger { + + /** The default logging hierarchy. */ + private static String defaultHierarchy = ""; + + /** + * Get the Log object for the default hierarchy. + * + * @return The Log object to write log messages to. + */ + private static Log getLog() { + return LogFactory.getLog(defaultHierarchy); + } + + /** + * Get the Log object for a given hierarchy. + * + * @param hierarchy The logging hierarchy for which to return the logger. + * @return The Log object to write log messages to. + */ + private static Log getLog(String hierarchy) { + return LogFactory.getLog(hierarchy); + } + + /** + * Set the default hierarchy to which the Logger should send its + * logging output. + * @param hierarchy The logging defaultHierarchy. + */ + public static void setHierarchy(String hierarchy) { + defaultHierarchy = hierarchy; + } + + /** + * Test, if the trace log level is enabled. + * + * @return boolean true, if tracing output is enabled + * false otherwise. + */ + public static boolean isTraceEnabled() { + return getLog().isTraceEnabled(); + } + + /** + * Test, if the trace log level is enabled for a given hierarchy. + * + * @param hierarchy requested log hierarchy + * @return boolean true, if tracing output is enabled + * false otherwise. + */ + public static boolean isTraceEnabled(String hierarchy) { + return getLog(hierarchy).isTraceEnabled(); + } + + /** + * Trace a message. + * + * @param message The message to trace. + */ + public static void trace(Object message) { + getLog().trace(message); + } + + /** + * Test, if the debug log level is enabled. + * + * @return boolean true, if debug output is enabled + * false otherwise. + */ + public static boolean isDebugEnabled() { + return getLog().isDebugEnabled(); + } + + /** + * Test, if the debug log level is enabled for a given hierarchy. + * + * @param hierarchy requested log hierarchy + * @return boolean true, if debug output is enabled + * false otherwise. + */ + public static boolean isDebugEnabled(String hierarchy) { + return getLog(hierarchy).isDebugEnabled(); + } + + /** + * Log a debug message. + * + * @param message The message to log. + */ + public static void debug(Object message) { + getLog().debug(message); + } + + /** + * Log an info message. + * + * @param message The message to log. + */ + public static void info(Object message) { + getLog().info(message); + } + + /** + * Log a warning message. + * + * @param message The message to log. + */ + public static void warn(Object message) { + getLog().warn(message); + } + + /** + * Log a warning message. + * + * @param message The message to log. + * @param t An exception that may be the cause of the warning. + */ + public static void warn(Object message, Throwable t) { + getLog().warn(message, t); + } + + /** + * Log an error message. + * + * @param message The message to log. + */ + public static void error(Object message) { + getLog().error(message); + } + + /** + * Log an error message. + * + * @param message The message to log. + * @param t An exception that may be the cause of the error. + */ + public static void error(Object message, Throwable t) { + getLog().error(message, t); + } + + /** + * Log a fatal error message. + * + * @param message The message to log. + */ + public static void fatal(Object message) { + getLog().fatal(message); + } + + /** + * Log a fatal error message. + * + * @param message The message to log. + * @param t An exception that may be the cause of the error. + */ + public static void fatal(Object message, Throwable t) { + getLog().fatal(message, t); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/LoggingContext.java b/common/src/main/java/at/gv/egovernment/moa/logging/LoggingContext.java new file mode 100644 index 000000000..42d8db06e --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/logging/LoggingContext.java @@ -0,0 +1,46 @@ +package at.gv.egovernment.moa.logging; + +/** + * Encapsulates contextual information (i.e. per request information) for + * logging purposes. + * + * @author Patrick Peck + * @version $Id$ + */ +public class LoggingContext { + /** The name of the node ID system property. */ + public static final String NODE_ID_PROPERTY = "moa.node-id"; + + /** The current transaction ID. */ + private String transactionID; + /** The node ID. */ + private String nodeID; + + /** + * Create a new LoggingContext. + * + * @param transactionID The transaction ID. May be null. + */ + public LoggingContext(String transactionID) { + this.transactionID = transactionID; + this.nodeID = System.getProperty(NODE_ID_PROPERTY); + } + + /** + * Return the transaction ID. + * + * @return The transaction ID. + */ + public String getTransactionID() { + return transactionID; + } + + /** + * Return the node ID. + * + * @return The node ID. + */ + public String getNodeID() { + return nodeID; + } +} diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/LoggingContextManager.java b/common/src/main/java/at/gv/egovernment/moa/logging/LoggingContextManager.java new file mode 100644 index 000000000..2bbe6caa1 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/logging/LoggingContextManager.java @@ -0,0 +1,56 @@ +package at.gv.egovernment.moa.logging; + +/** + * Provides each thread with a single instance of LoggingContext. + * + * @author Patrick Peck + * @version $Id$ + */ +public class LoggingContextManager { + /** The single instance of this class. */ + private static LoggingContextManager instance = null; + + /** The LoggingContext for each thread. */ + private ThreadLocal context; + + /** + * Get the single instance of the LoggingContextManager class. + * + * @return LoggingContextManager The single instance. + */ + public static synchronized LoggingContextManager getInstance() { + if (instance == null) { + instance = new LoggingContextManager(); + } + return instance; + } + + /** + * Creates a new LoggingContextManager. + * + * Protected to disallow direct instantiation. + */ + protected LoggingContextManager() { + context = new ThreadLocal(); + } + + /** + * Set the LoggingContext context for the current thread. + * + * @param ctx The LoggingContext for the current thread. + */ + public void setLoggingContext(LoggingContext ctx) { + context.set(ctx); + } + + /** + * Return the LoggingContext for the current thread. + * + * @return LoggingContext The LoggingContext for the current + * thread, or null if none has been set. + */ + public LoggingContext getLoggingContext() { + return (LoggingContext) context.get(); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/Base64Utils.java b/common/src/main/java/at/gv/egovernment/moa/util/Base64Utils.java new file mode 100644 index 000000000..ad29180a6 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/Base64Utils.java @@ -0,0 +1,109 @@ +package at.gv.egovernment.moa.util; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; + +import iaik.utils.Base64InputStream; +import iaik.utils.Base64OutputStream; + +/** + * Utitility functions for encoding/decoding Base64 strings. + * + * @author Patrick Peck + * @version $Id$ + */ +public class Base64Utils { + + /** + * Read the bytes encoded in a Base64 encoded String. + * + * @param base64String The String containing the Base64 encoded + * bytes. + * @param ignoreInvalidChars Whether to ignore invalid Base64 characters. + * @return byte[] The raw bytes contained in the base64String. + * @throws IOException Failed to read the Base64 data. + */ + public static byte[] decode(String base64String, boolean ignoreInvalidChars) + throws IOException { + + Base64InputStream in = + new Base64InputStream( + new ByteArrayInputStream(base64String.getBytes("UTF-8")), + ignoreInvalidChars); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] bytes = new byte[256]; + int bytesRead; + + while ((bytesRead = in.read(bytes)) > 0) { + out.write(bytes, 0, bytesRead); + } + + return out.toByteArray(); + } + + /** + * Read the bytes encoded in a Base64 encoded String and provide + * them via an InputStream. + * + * @param base64String The String containing the Base64 encoded + * bytes. + * @param ignoreInvalidChars Whether to ignore invalid Base64 characters. + * @return The InputStream from which the binary content of the + * base64String can be read. + */ + public static InputStream decodeToStream( + String base64String, + boolean ignoreInvalidChars) { + + try { + ByteArrayInputStream bin = + new ByteArrayInputStream(base64String.getBytes("UTF-8")); + Base64InputStream in = new Base64InputStream(bin, ignoreInvalidChars); + + return in; + } catch (UnsupportedEncodingException e) { + // cannot occur, since UTF-8 is required to be supported by every JRE + return null; + } + } + + /** + * Convert a byte array to a Base64 encoded String. + * + * @param bytes The bytes to encode. + * @return String The Base64 encoded representation of the bytes. + * @throws IOException Failed to write the bytes as Base64 data. + */ + public static String encode(byte[] bytes) throws IOException { + return encode(new ByteArrayInputStream(bytes)); + } + + /** + * Convert the data contained in the given stream to a Base64 encoded + * String. + * + * @param inputStream The stream containing the data to encode. + * @return The Base64 encoded data of inputStream, as a + * String. + * @throws IOException Failed to convert the data in the stream. + */ + public static String encode(InputStream inputStream) throws IOException { + ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); + Base64OutputStream base64Stream = new Base64OutputStream(byteStream, "\n".getBytes()); + byte[] bytes = new byte[256]; + int bytesRead; + + while ((bytesRead = inputStream.read(bytes)) > 0) { + base64Stream.write(bytes, 0, bytesRead); + } + base64Stream.flush(); + base64Stream.close(); + inputStream.close(); + + return byteStream.toString("UTF-8"); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/BoolUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/BoolUtils.java new file mode 100644 index 000000000..fcd39b4dd --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/BoolUtils.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.util; + +/** + * Utility class for parsing XML schema boolean values. + * + * @author Patrick Peck + * @version $Id$ + */ +public class BoolUtils { + + /** + * Return the boolean value of an xsd:boolean type of DOM + * element/attribute. + * + * @param boolStr The value of the xsd:boolean element/attribute. + * @return true, if boolStr equals + * "true" or "1;". Otherwise, + * false is returned. + */ + public static boolean valueOf(String boolStr) { + return "true".equals(boolStr) || "1".equals(boolStr); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/CollectionUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/CollectionUtils.java new file mode 100644 index 000000000..5329dcbd2 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/CollectionUtils.java @@ -0,0 +1,36 @@ +package at.gv.egovernment.moa.util; + +import java.util.Iterator; +import java.util.List; + +/** + * Various utility methods for dealing with java.util.Collection + * classes. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CollectionUtils { + + /** + * Convert a List of Number objects to an + * int array. + * + * @param nums The List containing the numbers whose integer + * value to put into the result. + * @return The int values of the Numbers contained + * in nums. + */ + public static int[] toIntArray(List nums) { + int[] result = new int[nums.size()]; + Iterator iter; + int i; + + for (i = 0, iter = nums.iterator(); iter.hasNext(); i++) { + Number num = (Number) iter.next(); + result[i] = num.intValue(); + } + + return result; + } +} 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 new file mode 100644 index 000000000..5c1314296 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java @@ -0,0 +1,318 @@ +package at.gv.egovernment.moa.util; + +import java.util.HashMap; + +/** + * Contains various constants used throughout the system. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface Constants { + /** Root location of the schema files. */ + public static final String SCHEMA_ROOT = "/resources/schemas/"; + + /** URI of the Widerrufregister XML namespace. */ + public static final String WRR_NS_URI = + "http://reference.e-government.gv.at/namespace/moavv/20041223"; + + /** Prefix used for the Widerrufregister XML namespace */ + public static final String WRR_PREFIX = "wrr"; + + /** URI of the StandardTextBlock XML namespace. */ + public static final String STB_NS_URI = + "http://reference.e-government.gv.at/namespace/standardtextblock/20041105#"; + + /** Prefix used for the Mandate XML namespace */ + public static final String STB_PREFIX = "stb"; + + /** URI of the MOA XML namespace. */ + public static final String MOA_NS_URI = + "http://reference.e-government.gv.at/namespace/moa/20020822#"; + + /** Prefix used for the Mandate XML namespace */ + public static final String MD_PREFIX = "md"; + + /** URI of the Mandate XML namespace. */ + public static final String MD_NS_URI = + "http://reference.e-government.gv.at/namespace/mandates/20040701#"; + + /** Prefix used for the Mandate XML namespace */ + public static final String MVV_PREFIX = "mvv"; + + /** URI of the Mandate XML namespace. */ + public static final String MVV_NS_URI = + "http://reference.e-government.gv.at/namespace/moavv/app2mvv/20041125"; + + /** Prefix used for the MandateCheckProfile XML namespace */ + public static final String MDP_PREFIX = "mdp"; + + /** URI of the Mandate XML namespace. */ + public static final String MDP_NS_URI = + "http://reference.e-government.gv.at/namespace/mandateprofile/20041105#"; + + /** Prefix used for the MOA XML namespace */ + public static final String MOA_PREFIX = "moa"; + + /** Local location of the MOA XML schema definition. */ + public static final String MOA_SCHEMA_LOCATION = + SCHEMA_ROOT + "MOA-SPSS-1.3.xsd"; + + /** URI of the MOA configuration XML namespace. */ + public static final String MOA_CONFIG_NS_URI = + "http://reference.e-government.gv.at/namespace/moaconfig/20021122#"; + + /** URI of the MOA ID configuration XML namespace. */ + public static final String MOA_ID_CONFIG_NS_URI = + "http://www.buergerkarte.at/namespaces/moaconfig#"; + + /** Prefix used for the MOA configuration XML namespace */ + public static final String MOA_CONFIG_PREFIX = "conf"; + + /** Prefix used for the MOA configuration XML namespace */ + public static final String MOA_ID_CONFIG_PREFIX = "confID"; + + /** Local location of the MOA configuration XML schema definition. */ + public static final String MOA_CONFIG_SCHEMA_LOCATION = + SCHEMA_ROOT + "MOA-SPSS-config-1.3.xsd"; + + /** Local location of the MOA ID configuration XML schema definition. */ + public static final String MOA_ID_CONFIG_SCHEMA_LOCATION = + SCHEMA_ROOT + "MOA-ID-Configuration-1.4.xsd"; + + /** URI of the Security Layer 1.0 namespace. */ + public static final String SL10_NS_URI = + "http://www.buergerkarte.at/namespaces/securitylayer/20020225#"; + + /** Prefix used for the Security Layer 1.0 XML namespace */ + public static final String SL10_PREFIX = "sl10"; + + /** Local location of the Security Layer 1.0 XML schema definition */ + public static final String SL10_SCHEMA_LOCATION = + SCHEMA_ROOT + "Core.20020225.xsd"; + + /** URI of the Security Layer 1.1 XML namespace */ + public static final String SL11_NS_URI = + "http://www.buergerkarte.at/namespaces/securitylayer/20020831#"; + + /** Prefix used for the Security Layer 1.1 XML namespace */ + public static final String SL11_PREFIX = "sl11"; + + /** Local location of the Security Layer 1.1 XML schema definition */ + public static final String SL11_SCHEMA_LOCATION = + SCHEMA_ROOT + "Core.20020831.xsd"; + + /** URI of the Security Layer 1.2 XML namespace */ + public static final String SL12_NS_URI = + "http://www.buergerkarte.at/namespaces/securitylayer/1.2#"; + + /** Prefix used for the Security Layer 1.2 XML namespace */ + public static final String SL12_PREFIX = "sl"; + + /** Local location of the Security Layer 1.2 XML schema definition */ + public static final String SL12_SCHEMA_LOCATION = + SCHEMA_ROOT + "Core-1.2.xsd"; + + /** URI of the ECDSA XML namespace */ + public static final String ECDSA_NS_URI = + "http://www.w3.org/2001/04/xmldsig-more#"; + + /** Prefix used for ECDSA namespace */ + public static final String ECDSA_PREFIX = "ecdsa"; + + /** Local location of ECDSA XML schema definition */ + public static final String ECDSA_SCHEMA_LOCATION = + SCHEMA_ROOT + "ECDSAKeyValue.xsd"; + + /** URI of the PersonData XML namespace. */ + public static final String PD_NS_URI = + "http://reference.e-government.gv.at/namespace/persondata/20020228#"; + + /** Prefix used for the PersonData XML namespace */ + public static final String PD_PREFIX = "pr"; + +// /** Local location of the PersonData XML schema definition */ +// public static final String PD_SCHEMA_LOCATION = +// SCHEMA_ROOT + "PersonData.xsd"; + + /** Local location of the PersonData XML schema definition */ + public static final String PD_SCHEMA_LOCATION = + SCHEMA_ROOT + "PersonData_20_en_moaWID.xsd"; + + /** URI of the SAML namespace. */ + public static final String SAML_NS_URI = + "urn:oasis:names:tc:SAML:1.0:assertion"; + + /** Prefix used for the SAML XML namespace */ + public static final String SAML_PREFIX = "saml"; + + /** Local location of the SAML XML schema definition. */ + public static final String SAML_SCHEMA_LOCATION = + SCHEMA_ROOT + "cs-sstc-schema-assertion-01.xsd"; + + /** URI of the SAML request-response protocol namespace. */ + public static final String SAMLP_NS_URI = + "urn:oasis:names:tc:SAML:1.0:protocol"; + + /** Prefix used for the SAML request-response protocol namespace */ + public static final String SAMLP_PREFIX = "samlp"; + + /** Local location of the SAML request-response protocol schema definition. */ + public static final String SAMLP_SCHEMA_LOCATION = + SCHEMA_ROOT + "cs-sstc-schema-protocol-01.xsd"; + + /** URI of the XML namespace. */ + public static final String XML_NS_URI = + "http://www.w3.org/XML/1998/namespace"; + + /** Prefix used for the XML namespace */ + public static final String XML_PREFIX = "xml"; + + /** Local location of the XML schema definition. */ + public static final String XML_SCHEMA_LOCATION = SCHEMA_ROOT + "xml.xsd"; + + /** URI of the XMLNS namespace */ + public static final String XMLNS_NS_URI = "http://www.w3.org/2000/xmlns/"; + + /** Prefix used for the XSI namespace */ + public static final String XSI_PREFIX = "xsi"; + + /** Local location of the XSI schema definition. */ + public static final String XSI_SCHEMA_LOCATION = + SCHEMA_ROOT + "XMLSchema-instance.xsd"; + + /** URI of the XSI XMLNS namespace */ + public static final String XSI_NS_URI = + "http://www.w3.org/2001/XMLSchema-instance"; + + /** URI of the XSLT XML namespace */ + public static final String XSLT_NS_URI = + "http://www.w3.org/1999/XSL/Transform"; + + /** Prefix used for the XSLT XML namespace */ + public static final String XSLT_PREFIX = "xsl"; + + /** URI of the XMLDSig XML namespace. */ + public static final String DSIG_NS_URI = "http://www.w3.org/2000/09/xmldsig#"; + + /** Prefix used for the XMLDSig XML namespace */ + public static final String DSIG_PREFIX = "dsig"; + + /** Local location of the XMLDSig XML schema. */ + public static final String DSIG_SCHEMA_LOCATION = + SCHEMA_ROOT + "xmldsig-core-schema.xsd"; + + /** URI of the XMLDSig XPath Filter XML namespace. */ + public static final String DSIG_FILTER2_NS_URI = + "http://www.w3.org/2002/06/xmldsig-filter2"; + + /** Prefix used for the XMLDSig XPath Filter XML namespace */ + public static final String DSIG_FILTER2_PREFIX = "dsig-filter2"; + + /** Local location of the XMLDSig XPath Filter XML schema definition. */ + public static final String DSIG_FILTER2_SCHEMA_LOCATION = + SCHEMA_ROOT + "xmldsig-filter2.xsd"; + + /** URI of the Exclusive Canonicalization XML namespace */ + public static final String DSIG_EC_NS_URI = + "http://www.w3.org/2001/10/xml-exc-c14n#"; + + /** Prefix used for the Exclusive Canonicalization XML namespace */ + public static final String DSIG_EC_PREFIX = "ec"; + + /** Local location of the Exclusive Canonicalizaion XML schema definition */ + public static final String DSIG_EC_SCHEMA_LOCATION = + SCHEMA_ROOT + "exclusive-canonicalization.xsd"; + + /** URI of the XMLLoginParameterResolver Configuration XML namespace */ + public static final String XMLLPR_NS_URI="http://reference.e-government.gv.at/namespace/moa/20020822#/xmllpr20030814"; + + /** Local location of the XMLLoginParameterResolver Configuration XML schema definition */ + public static final String XMLLPR_SCHEMA_LOCATION = + SCHEMA_ROOT + "MOAIdentities.xsd"; + + + /** + * Contains all namespaces and local schema locations for XML schema + * definitions relevant for MOA. For use in validating XML parsers. + */ + public static final String ALL_SCHEMA_LOCATIONS = + (MOA_NS_URI + " " + MOA_SCHEMA_LOCATION + " ") + + (MOA_CONFIG_NS_URI + " " + MOA_CONFIG_SCHEMA_LOCATION + " ") + + (MOA_ID_CONFIG_NS_URI + " " + MOA_ID_CONFIG_SCHEMA_LOCATION + " ") + + (SL10_NS_URI + " " + SL10_SCHEMA_LOCATION + " ") + + (SL11_NS_URI + " " + SL11_SCHEMA_LOCATION + " ") + + (SL12_NS_URI + " " + SL12_SCHEMA_LOCATION + " ") + + (ECDSA_NS_URI + " " + ECDSA_SCHEMA_LOCATION + " ") + + (PD_NS_URI + " " + PD_SCHEMA_LOCATION + " ") + + (SAML_NS_URI + " " + SAML_SCHEMA_LOCATION + " ") + + (SAMLP_NS_URI + " " + SAMLP_SCHEMA_LOCATION + " ") + + (XML_NS_URI + " " + XML_SCHEMA_LOCATION + " ") + + (XSI_NS_URI + " " + XSI_SCHEMA_LOCATION + " ") + + (DSIG_NS_URI + " " + DSIG_SCHEMA_LOCATION + " ") + + (DSIG_FILTER2_NS_URI + " " + DSIG_FILTER2_SCHEMA_LOCATION + " ") + + (DSIG_EC_NS_URI + " " + DSIG_EC_SCHEMA_LOCATION + " ") + + (XMLLPR_NS_URI + " " + XMLLPR_SCHEMA_LOCATION); + + /** URN prefix for bPK and wbPK. */ + public static final String URN_PREFIX = "urn:publicid:gv.at"; + + /** URN prefix for context dependent id. */ + public static final String URN_PREFIX_CDID = URN_PREFIX + ":cdid"; + + /** URN prefix for context dependent id (bPK). */ + public static final String URN_PREFIX_BPK = URN_PREFIX_CDID + "+bpk"; + + /** URN prefix for context dependent id (HPI). */ + public static final String URN_PREFIX_HPI = URN_PREFIX_CDID + "+EHSP"; + + /** URN prefix for context dependent id (wbPK). */ + public static final String URN_PREFIX_WBPK = URN_PREFIX + ":wbpk"; + + /** URN prefix for context dependent id. */ + public static final String URN_PREFIX_BASEID = URN_PREFIX + ":baseid"; + + /** Security Layer manifest type URI. */ + public static final String SL_MANIFEST_TYPE_URI = + "http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest"; + + /** URI of the SHA1 digest algorithm */ + public static final String SHA1_URI = + "http://www.w3.org/2000/09/xmldsig#sha1"; + + /** URI of the Canonical XML algorithm */ + public static final String C14N_URI = + "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"; + + /** URI of the Canoncial XML with comments algorithm */ + public static final String C14N_WITH_COMMENTS_URI = + "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; + + /** URI of the Exclusive Canonical XML algorithm */ + public static final String EXC_C14N_URI = + "http://www.w3.org/2001/10/xml-exc-c14n#"; + + /** URI of the Exclusive Canonical XML with commments algorithm */ + public static final String EXC_C14N_WITH_COMMENTS_URI = + "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"; + + // + // Local names for elements of the MOA SPSS schema + // + + /** + * Local name of request for creating an XML signature. + */ + public static final String MOA_SPSS_CREATE_XML_REQUEST = "CreateXMLSignatureRequest"; + + /** + * Local name of request for verifying an XML signature. + */ + public static final String MOA_SPSS_VERIFY_XML_REQUEST = "VerifiyXMLSignatureRequest"; + + /** + * A map used to map namespace prefixes to namespace URIs + */ + public static HashMap nSMap = new HashMap(5); + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java new file mode 100644 index 000000000..5be0bb500 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java @@ -0,0 +1,971 @@ +package at.gv.egovernment.moa.util; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; + +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.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import org.apache.xerces.parsers.DOMParser; +import org.apache.xerces.parsers.SAXParser; +import org.apache.xerces.parsers.XMLGrammarPreparser; +import org.apache.xerces.util.SymbolTable; +import org.apache.xerces.util.XMLGrammarPoolImpl; +import org.apache.xerces.xni.grammars.XMLGrammarDescription; +import org.apache.xerces.xni.grammars.XMLGrammarPool; +import org.apache.xerces.xni.parser.XMLInputSource; +import org.xml.sax.EntityResolver; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + + +import at.gv.egovernment.moa.logging.Logger; + +/** + * Various utility functions for handling XML DOM trees. + * + * The parsing methods in this class make use of some features internal to the + * Xerces DOM parser, mainly for performance reasons. As soon as JAXP + * (currently at version 1.2) is better at schema handling, it should be used as + * the parser interface. + * + * @author Patrick Peck + * @version $Id$ + */ +public class DOMUtils { + + /** Feature URI for namespace aware parsing. */ + private static final String NAMESPACES_FEATURE = + "http://xml.org/sax/features/namespaces"; + /** Feature URI for validating parsing. */ + private static final String VALIDATION_FEATURE = + "http://xml.org/sax/features/validation"; + /** Feature URI for schema validating parsing. */ + private static final String SCHEMA_VALIDATION_FEATURE = + "http://apache.org/xml/features/validation/schema"; + /** Feature URI for normalization of element/attribute values. */ + private static final String NORMALIZED_VALUE_FEATURE = + "http://apache.org/xml/features/validation/schema/normalized-value"; + /** Feature URI for parsing ignorable whitespace. */ + private static final String INCLUDE_IGNORABLE_WHITESPACE_FEATURE = + "http://apache.org/xml/features/dom/include-ignorable-whitespace"; + /** Feature URI for creating EntityReference nodes in the DOM tree. */ + private static final String CREATE_ENTITY_REF_NODES_FEATURE = + "http://apache.org/xml/features/dom/create-entity-ref-nodes"; + /** Property URI for providing external schema locations. */ + private static final String EXTERNAL_SCHEMA_LOCATION_PROPERTY = + "http://apache.org/xml/properties/schema/external-schemaLocation"; + /** Property URI for providing the external schema location for elements + * without a namespace. */ + private static final String EXTERNAL_NO_NAMESPACE_SCHEMA_LOCATION_PROPERTY = + "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"; + /** Property URI for the Xerces grammar pool. */ + private static final String GRAMMAR_POOL = + org.apache.xerces.impl.Constants.XERCES_PROPERTY_PREFIX + + org.apache.xerces.impl.Constants.XMLGRAMMAR_POOL_PROPERTY; + /** A prime number for initializing the symbol table. */ + private static final int BIG_PRIME = 2039; + /** Symbol table for the grammar pool. */ + private static SymbolTable symbolTable = new SymbolTable(BIG_PRIME); + /** Xerces schema grammar pool. */ + private static XMLGrammarPool grammarPool = new XMLGrammarPoolImpl(); + /** Set holding the NamespaceURIs of the grammarPool, to prevent multiple + * entries of same grammars to the pool */ + private static Set grammarNamespaces; + + static { + grammarPool.lockPool(); + grammarNamespaces = new HashSet(); + } + + /** + * Preparse a schema and add it to the schema pool. + * The method only adds the schema to the pool if a schema having the same + * systemId (namespace URI) is not already present in the pool. + * + * @param inputStream An InputStream providing the contents of + * the schema. + * @param systemId The systemId (namespace URI) to use for the schema. + * @throws IOException An error occurred reading the schema. + */ + public static void addSchemaToPool(InputStream inputStream, String systemId) + throws IOException { + XMLGrammarPreparser preparser; + + if (!grammarNamespaces.contains(systemId)) { + + grammarNamespaces.add(systemId); + + // unlock the pool so that we can add another grammar + grammarPool.unlockPool(); + + // prepare the preparser + preparser = new XMLGrammarPreparser(symbolTable); + preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null); + preparser.setProperty(GRAMMAR_POOL, grammarPool); + preparser.setFeature(NAMESPACES_FEATURE, true); + preparser.setFeature(VALIDATION_FEATURE, true); + + // add the grammar to the pool + preparser.preparseGrammar( + XMLGrammarDescription.XML_SCHEMA, + new XMLInputSource(null, systemId, null, inputStream, null)); + + // lock the pool again so that schemas are not added automatically + grammarPool.lockPool(); + } + } + + /** + * Parse an XML document from an InputStream. + * + * @param inputStream The InputStream containing the XML + * document. + * @param validating If true, parse validating. + * @param externalSchemaLocations A String containing namespace + * URI to schema location pairs, the same way it is accepted by the xsi: + * schemaLocation attribute. + * @param externalNoNamespaceSchemaLocation The schema location of the + * schema for elements without a namespace, the same way it is accepted by the + * xsi:noNamespaceSchemaLocation attribute. + * @param entityResolver An EntityResolver to resolve external + * entities (schemas and DTDs). If null, it will not be set. + * @param errorHandler An ErrorHandler to decide what to do + * with parsing errors. If null, it will not be set. + * @return The parsed XML document as a DOM tree. + * @throws SAXException An error occurred parsing the document. + * @throws IOException An error occurred reading the document. + * @throws ParserConfigurationException An error occurred configuring the XML + * parser. + */ + public static Document parseDocument( + InputStream inputStream, + boolean validating, + String externalSchemaLocations, + String externalNoNamespaceSchemaLocation, + EntityResolver entityResolver, + ErrorHandler errorHandler) + throws SAXException, IOException, ParserConfigurationException { + + DOMParser parser; + + + + //if Debug is enabled make a copy of inputStream to enable debug output in case of SAXException + byte buffer [] = null; + ByteArrayInputStream baStream = null; + if(true == Logger.isDebugEnabled()) { + int len = inputStream.available(); + buffer = new byte[len]; + inputStream.read(buffer); + baStream = new ByteArrayInputStream(buffer); + } + + // create the DOM parser + if (symbolTable != null) { + parser = new DOMParser(symbolTable, grammarPool); + } else { + parser = new DOMParser(); + } + + // set parser features and properties + try { + parser.setFeature(NAMESPACES_FEATURE, true); + parser.setFeature(VALIDATION_FEATURE, validating); + parser.setFeature(SCHEMA_VALIDATION_FEATURE, validating); + parser.setFeature(NORMALIZED_VALUE_FEATURE, false); + parser.setFeature(INCLUDE_IGNORABLE_WHITESPACE_FEATURE, true); + parser.setFeature(CREATE_ENTITY_REF_NODES_FEATURE, false); + + if (validating) { + if (externalSchemaLocations != null) { + parser.setProperty( + EXTERNAL_SCHEMA_LOCATION_PROPERTY, + externalSchemaLocations); + } + if (externalNoNamespaceSchemaLocation != null) { + parser.setProperty( + EXTERNAL_NO_NAMESPACE_SCHEMA_LOCATION_PROPERTY, + externalNoNamespaceSchemaLocation); + } + } + + // set entity resolver and error handler + if (entityResolver != null) { + parser.setEntityResolver(entityResolver); + } + if (errorHandler != null) { + parser.setErrorHandler(errorHandler); + } + + // parse the document and return it + // if debug is enabled: use copy of strem (baStream) else use orig stream + if(null != baStream) + parser.parse(new InputSource(baStream)); + else + parser.parse(new InputSource(inputStream)); + } catch(SAXException e) { + if(true == Logger.isDebugEnabled() && null != buffer) { + String xmlContent = new String(buffer); + Logger.debug("SAXException in:\n" + xmlContent); + } + throw(e); + } + + return parser.getDocument(); + } + + /** + * Parse an XML document from an InputStream. + * + * It uses a MOAEntityResolver as the EntityResolver + * and a MOAErrorHandler as the ErrorHandler. + * + * @param inputStream The InputStream containing the XML + * document. + * @param validating If true, parse validating. + * @param externalSchemaLocations A String containing namespace + * URI to schema location pairs, the same way it is accepted by the xsi: + * schemaLocation attribute. + * @param externalNoNamespaceSchemaLocation The schema location of the + * schema for elements without a namespace, the same way it is accepted by the + * xsi:noNamespaceSchemaLocation attribute. + * @return The parsed XML document as a DOM tree. + * @throws SAXException An error occurred parsing the document. + * @throws IOException An error occurred reading the document. + * @throws ParserConfigurationException An error occurred configuring the XML + * parser. + */ + public static Document parseDocument( + InputStream inputStream, + boolean validating, + String externalSchemaLocations, + String externalNoNamespaceSchemaLocation) + throws SAXException, IOException, ParserConfigurationException { + + return parseDocument( + inputStream, + validating, + externalSchemaLocations, + externalNoNamespaceSchemaLocation, + new MOAEntityResolver(), + new MOAErrorHandler()); + } + + /** + * Parse an XML document from a String. + * + * It uses a MOAEntityResolver as the EntityResolver + * and a MOAErrorHandler as the ErrorHandler. + * + * @param xmlString The String containing the XML document. + * @param encoding The encoding of the XML document. + * @param validating If true, parse validating. + * @param externalSchemaLocations A String containing namespace + * URI to schema location pairs, the same way it is accepted by the xsi: + * schemaLocation attribute. + * @param externalNoNamespaceSchemaLocation The schema location of the + * schema for elements without a namespace, the same way it is accepted by the + * xsi:noNamespaceSchemaLocation attribute. + * @return The parsed XML document as a DOM tree. + * @throws SAXException An error occurred parsing the document. + * @throws IOException An error occurred reading the document. + * @throws ParserConfigurationException An error occurred configuring the XML + * parser. + */ + public static Document parseDocument( + String xmlString, + String encoding, + boolean validating, + String externalSchemaLocations, + String externalNoNamespaceSchemaLocation) + throws SAXException, IOException, ParserConfigurationException { + + InputStream in = new ByteArrayInputStream(xmlString.getBytes(encoding)); + return parseDocument( + in, + validating, + externalSchemaLocations, + externalNoNamespaceSchemaLocation); + } + + /** + * Parse an UTF-8 encoded XML document from a String. + * + * @param xmlString The String containing the XML document. + * @param validating If true, parse validating. + * @param externalSchemaLocations A String containing namespace + * URI to schema location pairs, the same way it is accepted by the xsi: + * schemaLocation attribute. + * @param externalNoNamespaceSchemaLocation The schema location of the + * schema for elements without a namespace, the same way it is accepted by the + * xsi:noNamespaceSchemaLocation attribute. + * @return The parsed XML document as a DOM tree. + * @throws SAXException An error occurred parsing the document. + * @throws IOException An error occurred reading the document. + * @throws ParserConfigurationException An error occurred configuring the XML + * parser. + */ + public static Document parseDocument( + String xmlString, + boolean validating, + String externalSchemaLocations, + String externalNoNamespaceSchemaLocation) + throws SAXException, IOException, ParserConfigurationException { + + return parseDocument( + xmlString, + "UTF-8", + validating, + externalSchemaLocations, + externalNoNamespaceSchemaLocation); + } + + /** + * A convenience method to parse an XML document validating. + * + * @param inputStream The InputStream containing the XML + * document. + * @return The root element of the parsed XML document. + * @throws SAXException An error occurred parsing the document. + * @throws IOException An error occurred reading the document. + * @throws ParserConfigurationException An error occurred configuring the XML + * parser. + */ + public static Element parseXmlValidating(InputStream inputStream) + throws ParserConfigurationException, SAXException, IOException { + return DOMUtils + .parseDocument(inputStream, true, Constants.ALL_SCHEMA_LOCATIONS, null) + .getDocumentElement(); + } + + /** + * Schema validate a given DOM element. + * + * @param element The element to validate. + * @param externalSchemaLocations A String containing namespace + * URI to schema location pairs, the same way it is accepted by the xsi: + * schemaLocation attribute. + * @param externalNoNamespaceSchemaLocation The schema location of the + * schema for elements without a namespace, the same way it is accepted by the + * xsi:noNamespaceSchemaLocation attribute. + * @return true, if the element validates against + * the schemas declared in it. + * @throws SAXException An error occurred parsing the document. + * @throws IOException An error occurred reading the document from its + * serialized representation. + * @throws ParserConfigurationException An error occurred configuring the XML + * @throws TransformerException An error occurred serializing the element. + */ + public static boolean validateElement( + Element element, + String externalSchemaLocations, + String externalNoNamespaceSchemaLocation) + throws + ParserConfigurationException, + IOException, + SAXException, + TransformerException { + + byte[] docBytes; + SAXParser parser; + + // create the SAX parser + if (symbolTable != null) { + parser = new SAXParser(symbolTable, grammarPool); + } else { + parser = new SAXParser(); + } + + // serialize the document + docBytes = serializeNode(element, "UTF-8"); + + // set up parser features and attributes + parser.setFeature(NAMESPACES_FEATURE, true); + parser.setFeature(VALIDATION_FEATURE, true); + parser.setFeature(SCHEMA_VALIDATION_FEATURE, true); + if (externalSchemaLocations != null) { + parser.setProperty( + EXTERNAL_SCHEMA_LOCATION_PROPERTY, + externalSchemaLocations); + } + if (externalNoNamespaceSchemaLocation != null) { + parser.setProperty( + EXTERNAL_NO_NAMESPACE_SCHEMA_LOCATION_PROPERTY, + "externalNoNamespaceSchemaLocation"); + } + + // set up entity resolver and error handler + parser.setEntityResolver(new MOAEntityResolver()); + parser.setErrorHandler(new MOAErrorHandler()); + + // parse validating + parser.parse(new InputSource(new ByteArrayInputStream(docBytes))); + return true; + } + + /** + * Serialize the given DOM node. + * + * The node will be serialized using the UTF-8 encoding. + * + * @param node The node to serialize. + * @return String The String representation of the given DOM + * node. + * @throws TransformerException An error occurred transforming the + * node to a String. + * @throws IOException An IO error occurred writing the node to a byte array. + */ + public static String serializeNode(Node node) + throws TransformerException, IOException { + return new String(serializeNode(node, "UTF-8", false), "UTF-8"); + } + + + /** + * Serialize the given DOM node. + * + * The node will be serialized using the UTF-8 encoding. + * + * @param node The node to serialize. + * @param omitXmlDeclaration The boolean value for omitting the XML Declaration. + * @return String The String representation of the given DOM + * node. + * @throws TransformerException An error occurred transforming the + * node to a String. + * @throws IOException An IO error occurred writing the node to a byte array. + */ + public static String serializeNode(Node node, boolean omitXmlDeclaration) + throws TransformerException, IOException { + return new String(serializeNode(node, "UTF-8", omitXmlDeclaration), "UTF-8"); + } + + /** + * Serialize the given DOM node. + * + * The node will be serialized using the UTF-8 encoding. + * + * @param node The node to serialize. + * @param omitXmlDeclaration The boolean value for omitting the XML Declaration. + * @param lineSeperator Sets the line seperator String of the parser + * @return String The String representation of the given DOM + * node. + * @throws TransformerException An error occurred transforming the + * node to a String. + * @throws IOException An IO error occurred writing the node to a byte array. + */ + public static String serializeNode(Node node, boolean omitXmlDeclaration, String lineSeperator) + throws TransformerException, IOException { + return new String(serializeNode(node, "UTF-8", omitXmlDeclaration, lineSeperator), "UTF-8"); + } + + /** + * Serialize the given DOM node to a byte array. + * + * @param node The node to serialize. + * @param xmlEncoding The XML encoding to use. + * @return The serialized node, as a byte array. Using a compatible encoding + * this can easily be converted into a String. + * @throws TransformerException An error occurred transforming the node to a + * byte array. + * @throws IOException An IO error occurred writing the node to a byte array. + */ + public static byte[] serializeNode(Node node, String xmlEncoding) + throws TransformerException, IOException { + return serializeNode(node, xmlEncoding, false); + } + + /** + * Serialize the given DOM node to a byte array. + * + * @param node The node to serialize. + * @param xmlEncoding The XML encoding to use. + * @param omitDeclaration The boolean value for omitting the XML Declaration. + * @return The serialized node, as a byte array. Using a compatible encoding + * this can easily be converted into a String. + * @throws TransformerException An error occurred transforming the node to a + * byte array. + * @throws IOException An IO error occurred writing the node to a byte array. + */ + public static byte[] serializeNode(Node node, String xmlEncoding, boolean omitDeclaration) + throws TransformerException, IOException { + return serializeNode(node, xmlEncoding, omitDeclaration, null); + } + + + /** + * Serialize the given DOM node to a byte array. + * + * @param node The node to serialize. + * @param xmlEncoding The XML encoding to use. + * @param omitDeclaration The boolean value for omitting the XML Declaration. + * @param lineSeperator Sets the line seperator String of the parser + * @return The serialized node, as a byte array. Using a compatible encoding + * this can easily be converted into a String. + * @throws TransformerException An error occurred transforming the node to a + * byte array. + * @throws IOException An IO error occurred writing the node to a byte array. + */ + public static byte[] serializeNode(Node node, String xmlEncoding, boolean omitDeclaration, String lineSeperator) + throws TransformerException, IOException { + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + ByteArrayOutputStream bos = new ByteArrayOutputStream(16384); + + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.ENCODING, xmlEncoding); + String omit = omitDeclaration ? "yes" : "no"; + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omit); + if (null!=lineSeperator) { + transformer.setOutputProperty("{http://xml.apache.org/xalan}line-separator", lineSeperator);//does not work for xalan <= 2.5.1 + } + transformer.transform(new DOMSource(node), new StreamResult(bos)); + + bos.flush(); + bos.close(); + + return bos.toByteArray(); + } + + /** + * Return the text that a node contains. + * + * This routine: + *

    + *
  • Ignores comments and processing instructions.
  • + *
  • Concatenates TEXT nodes, CDATA nodes, and the results recursively + * processing EntityRef nodes.
  • + *
  • Ignores any element nodes in the sublist. (Other possible options are + * to recurse into element sublists or throw an exception.)
  • + *
+ * + * @param node A DOM node from which to extract text. + * @return A String representing its contents. + */ + 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(); + } + + /** + * Build the namespace prefix to namespace URL mapping in effect for a given + * node. + * + * @param node The context node for which build the map. + * @return The namespace prefix to namespace URL mapping ( + * a String value to String value mapping). + */ + public static Map getNamespaceDeclarations(Node node) { + Map nsDecls = new HashMap(); + int i; + + do { + if (node.hasAttributes()) { + NamedNodeMap attrs = node.getAttributes(); + + for (i = 0; i < attrs.getLength(); i++) { + Attr attr = (Attr) attrs.item(i); + + // add prefix mapping if none exists + if ("xmlns".equals(attr.getPrefix()) + || "xmlns".equals(attr.getName())) { + + String nsPrefix = + attr.getPrefix() != null ? attr.getLocalName() : ""; + + if (nsDecls.get(nsPrefix) == null) { + nsDecls.put(nsPrefix, attr.getValue()); + } + } + } + } + } while ((node = node.getParentNode()) != null); + + return nsDecls; + } + + /** + * Add all namespace declarations declared in the parent(s) of a given + * element and used in the subtree of the given element to the given element. + * + * @param context The element to which to add the namespaces. + */ + public static void localizeNamespaceDeclarations(Element context) { + Node parent = context.getParentNode(); + + if (parent != null) { + Map namespaces = getNamespaceDeclarations(context.getParentNode()); + Set nsUris = collectNamespaceURIs(context); + Iterator iter; + + for (iter = namespaces.entrySet().iterator(); iter.hasNext();) { + Map.Entry e = (Map.Entry) iter.next(); + + if (nsUris.contains(e.getValue())) { + String prefix = (String) e.getKey(); + String nsUri = (String) e.getValue(); + String nsAttrName = "".equals(prefix) ? "xmlns" : "xmlns:" + prefix; + + context.setAttributeNS(Constants.XMLNS_NS_URI, nsAttrName, nsUri); + } + } + } + } + + /** + * Collect all the namespace URIs used in the subtree of a given element. + * + * @param context The element that should be searched for namespace URIs. + * @return All namespace URIs used in the subtree of context, + * including the ones used in context itself. + */ + public static Set collectNamespaceURIs(Element context) { + Set result = new HashSet(); + + collectNamespaceURIsImpl(context, result); + return result; + } + + /** + * A recursive method to do the work of collectNamespaceURIs. + * + * @param context The context element to evaluate. + * @param result The result, passed as a parameter to avoid unnecessary + * instantiations of Set. + */ + private static void collectNamespaceURIsImpl(Element context, Set result) { + NamedNodeMap attrs = context.getAttributes(); + NodeList childNodes = context.getChildNodes(); + String nsUri; + int i; + + // add the namespace of the context element + nsUri = context.getNamespaceURI(); + if (nsUri != null && nsUri != Constants.XMLNS_NS_URI) { + result.add(nsUri); + } + + // add all namespace URIs from attributes + for (i = 0; i < attrs.getLength(); i++) { + nsUri = attrs.item(i).getNamespaceURI(); + if (nsUri != null && nsUri != Constants.XMLNS_NS_URI) { + result.add(nsUri); + } + } + + // add all namespaces from subelements + for (i = 0; i < childNodes.getLength(); i++) { + Node node = childNodes.item(i); + + if (node.getNodeType() == Node.ELEMENT_NODE) { + collectNamespaceURIsImpl((Element) node, result); + } + } + } + + /** + * Check, that each attribute node in the given NodeList has its + * parent in the NodeList as well. + * + * @param nodes The NodeList to check. + * @return true, if each attribute node in nodes + * has its parent in nodes as well. + */ + public static boolean checkAttributeParentsInNodeList(NodeList nodes) { + Set nodeSet = new HashSet(); + int i; + + // put the nodes into the nodeSet + for (i = 0; i < nodes.getLength(); i++) { + nodeSet.add(nodes.item(i)); + } + + // check that each attribute node's parent is in the node list + for (i = 0; i < nodes.getLength(); i++) { + Node n = nodes.item(i); + + if (n.getNodeType() == Node.ATTRIBUTE_NODE) { + Attr attr = (Attr) n; + Element owner = attr.getOwnerElement(); + + if (owner == null) { + if (!isNamespaceDeclaration(attr)) { + return false; + } + } + + if (!nodeSet.contains(owner) && !isNamespaceDeclaration(attr)) { + return false; + } + } + } + + return true; + } + + /** + * Convert an unstructured NodeList into a + * DocumentFragment. + * + * @param nodeList Contains the node list to be converted into a DOM + * DocumentFragment. + * @return the resulting DocumentFragment. The DocumentFragment will be + * backed by a new DOM Document, i.e. all noded of the node list will be + * cloned. + * @throws ParserConfigurationException An error occurred creating the + * DocumentFragment. + * @precondition The nodes in the node list appear in document order + * @precondition for each Attr node in the node list, the owning Element is + * in the node list as well. + * @precondition each Element or Attr node in the node list is namespace + * aware. + */ + public static DocumentFragment nodeList2DocumentFragment(NodeList nodeList) + throws ParserConfigurationException { + + DocumentBuilder builder = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document doc = builder.newDocument(); + DocumentFragment result = doc.createDocumentFragment(); + + if (null == nodeList || nodeList.getLength() == 0) { + return result; + } + + int currPos = 0; + currPos = + nodeList2DocumentFragment(nodeList, currPos, result, null, null) + 1; + + while (currPos < nodeList.getLength()) { + currPos = + nodeList2DocumentFragment(nodeList, currPos, result, null, null) + 1; + } + return result; + } + + /** + * Helper method for the nodeList2DocumentFragment. + * + * @param nodeList The NodeList to convert. + * @param currPos The current position in the nodeList. + * @param result The resulting DocumentFragment. + * @param currOrgElem The current original element. + * @param currClonedElem The current cloned element. + * @return The current position. + */ + private static int nodeList2DocumentFragment( + NodeList nodeList, + int currPos, + DocumentFragment result, + Element currOrgElem, + Element currClonedElem) { + + while (currPos < nodeList.getLength()) { + Node currentNode = nodeList.item(currPos); + switch (currentNode.getNodeType()) { + case Node.COMMENT_NODE : + case Node.PROCESSING_INSTRUCTION_NODE : + case Node.TEXT_NODE : + { + // Append current node either to resulting DocumentFragment or to + // current cloned Element + if (null == currClonedElem) { + result.appendChild( + result.getOwnerDocument().importNode(currentNode, false)); + } else { + // Stop processing if current Node is not a descendant of + // current Element + if (!isAncestor(currOrgElem, currentNode)) { + return --currPos; + } + + currClonedElem.appendChild( + result.getOwnerDocument().importNode(currentNode, false)); + } + break; + } + + case Node.ELEMENT_NODE : + { + Element nextCurrOrgElem = (Element) currentNode; + Element nextCurrClonedElem = + result.getOwnerDocument().createElementNS( + nextCurrOrgElem.getNamespaceURI(), + nextCurrOrgElem.getNodeName()); + + // Append current Node either to resulting DocumentFragment or to + // current cloned Element + if (null == currClonedElem) { + result.appendChild(nextCurrClonedElem); + currOrgElem = nextCurrOrgElem; + currClonedElem = nextCurrClonedElem; + } else { + // Stop processing if current Node is not a descendant of + // current Element + if (!isAncestor(currOrgElem, currentNode)) { + return --currPos; + } + + currClonedElem.appendChild(nextCurrClonedElem); + } + + // Process current Node (of type Element) recursively + currPos = + nodeList2DocumentFragment( + nodeList, + ++currPos, + result, + nextCurrOrgElem, + nextCurrClonedElem); + + break; + } + + case Node.ATTRIBUTE_NODE : + { + Attr currAttr = (Attr) currentNode; + + // GK 20030411: Hack to overcome problems with IAIK IXSIL + if (currAttr.getOwnerElement() == null) + break; + if (currClonedElem == null) + break; + + // currClonedElem must be the owner Element of currAttr if + // preconditions are met + currClonedElem.setAttributeNS( + currAttr.getNamespaceURI(), + currAttr.getNodeName(), + currAttr.getValue()); + break; + } + + default : + { + // All other nodes will be ignored + } + } + + currPos++; + } + + return currPos; + } + + /** + * Check, if the given attribute is a namespace declaration. + * + * @param attr The attribute to check. + * @return true, if the attribute is a namespace declaration, + * false otherwise. + */ + private static boolean isNamespaceDeclaration(Attr attr) { + return Constants.XMLNS_NS_URI.equals(attr.getNamespaceURI()); + } + + /** + * Check, if a given DOM element is an ancestor of a given node. + * + * @param candAnc The DOM element to check for being the ancestor. + * @param cand The node to check for being the child. + * @return true, if candAnc is an (indirect) + * ancestor of cand; false otherwise. + */ + public static boolean isAncestor(Element candAnc, Node cand) { + Node currPar = cand.getParentNode(); + + while (currPar != null) { + if (candAnc == currPar) + return true; + currPar = currPar.getParentNode(); + } + return false; + } + + /** + * Selects the (first) element from a node list and returns it. + * + * @param nl The NodeList to get the element from. + * @return The (first) element included in the node list or null + * if the node list is null or empty or no element is + * included in the list. + */ + public static Element getElementFromNodeList (NodeList nl) { + if ((nl == null) || (nl.getLength() == 0)) { + return null; + } + for (int i=0; idateTime, + * according to ISO 8601. + * + * @author Patrick Peck + * @version $Id$ + * @see http://www.w3.org/2001/XMLSchema-datatypes" + */ +public class DateTimeUtils { + /** Error messages. */ + private static MessageProvider msg = MessageProvider.getInstance(); + + /** + * Builds a dateTime value from a Calendar value. + * @param cal the Calendar value + * @return the dateTime value + */ + public static String buildDateTime(Calendar cal) { + StringWriter out = new StringWriter(); + out.write("" + cal.get(Calendar.YEAR)); + out.write("-"); + out.write(to2DigitString(cal.get(Calendar.MONTH) + 1)); + out.write("-"); + out.write(to2DigitString(cal.get(Calendar.DAY_OF_MONTH))); + out.write("T"); + out.write(to2DigitString(cal.get(Calendar.HOUR_OF_DAY))); + out.write(":"); + out.write(to2DigitString(cal.get(Calendar.MINUTE))); + out.write(":"); + out.write(to2DigitString(cal.get(Calendar.SECOND))); + int tzOffsetMilliseconds = + cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET); + if (tzOffsetMilliseconds != 0) { + int tzOffsetMinutes = tzOffsetMilliseconds / (1000 * 60); + int tzOffsetHours = tzOffsetMinutes / 60; + tzOffsetMinutes -= tzOffsetHours * 60; + if (tzOffsetMilliseconds > 0) { + out.write("+"); + out.write(to2DigitString(tzOffsetHours)); + out.write(":"); + out.write(to2DigitString(tzOffsetMinutes)); + } else { + out.write("-"); + out.write(to2DigitString(-tzOffsetHours)); + out.write(":"); + out.write(to2DigitString(-tzOffsetMinutes)); + } + } + return out.toString(); + } + + /** + * Converts month, day, hour, minute, or second value + * to a 2 digit String. + * @param number the month, day, hour, minute, or second value + * @return 2 digit String + */ + private static String to2DigitString(int number) { + if (number < 10) + return "0" + number; + else + return "" + number; + } + + /** + * Parse a String containing a date and time instant, given in + * ISO 8601 format. + * + * @param dateTime The String to parse. + * @return The Date representation of the contents of + * dateTime. + * @throws ParseException Parsing the dateTime failed. + */ + public static Date parseDateTime(String dateTime) throws ParseException { + GregorianCalendar calendar; + long time; + int yearSign = 1, year, month, day; + int hour, minute, second; + double fraction = 0.0; + int tzSign = 1, tzHour = 0, tzMinute = 0; + int curPos = 0; + String fractStr; + boolean localTime = false; + char c; + + // parse year sign + ensureChars(dateTime, curPos, 1); + c = dateTime.charAt(curPos); + if (c == '+' || c == '-') { + yearSign = c == '+' ? 1 : -1; + curPos++; + } + + // parse year + year = parseInt(dateTime, curPos, 4); + curPos += 4; + + // parse '-' + ensureChar(dateTime, curPos, '-'); + curPos++; + + // parse month + month = parseInt(dateTime, curPos, 2); + ensureValue(month, 1, 12, curPos); + curPos += 2; + + // parse '-' + ensureChar(dateTime, curPos, '-'); + curPos++; + + // parse day + day = parseInt(dateTime, curPos, 2); + ensureValue(day, 1, 31, curPos); + curPos += 2; + + // parse 'T' + ensureChar(dateTime, curPos, 'T'); + curPos++; + + // parse hour + hour = parseInt(dateTime, curPos, 2); + ensureValue(hour, 0, 23, curPos); + curPos += 2; + + // parse ':' + ensureChar(dateTime, curPos, ':'); + curPos++; + + // parse minute + minute = parseInt(dateTime, curPos, 2); + ensureValue(minute, 0, 59, curPos); + curPos += 2; + + // parse ':' + ensureChar(dateTime, curPos, ':'); + curPos++; + + // parse second + second = parseInt(dateTime, curPos, 2); + ensureValue(second, 0, 59, curPos); + curPos += 2; + + // parse a fraction + if (dateTime.length() > curPos && dateTime.charAt(curPos) == '.') { + curPos++; + ensureDigits(dateTime, curPos, 1); + fractStr = "0."; + fractStr + += dateTime.substring(curPos, curPos + countDigits(dateTime, curPos)); + fraction = Double.parseDouble(fractStr); + curPos += countDigits(dateTime, curPos); + } + + // parse a time zone + if (dateTime.length() > curPos) { + c = dateTime.charAt(curPos); + if (c == 'Z') { + curPos++; + } else if (c == '+' || c == '-') { + // parse time zone sign + tzSign = c == '+' ? 1 : -1; + curPos++; + + // parse time zone hour + tzHour = parseInt(dateTime, curPos, 2); + ensureValue(tzHour, 0, 14, curPos); + curPos += 2; + + // parse ':' + ensureChar(dateTime, curPos, ':'); + curPos++; + + // parse time zone minute + tzMinute = parseInt(dateTime, curPos, 2); + ensureValue(tzMinute, 0, 59, curPos); + curPos += 2; + } + } else { + localTime = true; + } + + // if we have characters left, it's an error + if (dateTime.length() != curPos) { + throw new ParseException(msg.getMessage("datetime.00", null), curPos); + } + + // build the Date object + year = year * yearSign; + try { + calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT")); + calendar.set(year, month - 1, day, hour, minute, second); + calendar.set(Calendar.MILLISECOND, 0); + time = calendar.getTime().getTime(); + time += (long) (fraction * 1000.0); + time -= tzSign * ((tzHour * 60) + tzMinute) * 60 * 1000; + if (localTime) { + time -= TimeZone.getDefault().getRawOffset(); + } + return new Date(time); + } catch (IllegalArgumentException e) { + throw new ParseException(msg.getMessage("datetime.00", null), curPos); + } + + } + + /** + * Parse an integer value. + * + * @param str The String containing the digits. + * @param curPos The starting position. + * @param digits The number of digist making up the integer value. + * @return int The integer representation of the digits contained in + * str. + * @throws ParseException Parsing the integer value failed. + */ + private static int parseInt(String str, int curPos, int digits) + throws ParseException { + + ensureDigits(str, curPos, digits); + return Integer.parseInt(str.substring(curPos, curPos + digits)); + } + + /** + * Count the number of digits following curPos. + * + * @param str The String in which to count digits. + * @param curPos The starting position. + * @return int The number of digits. + */ + private static int countDigits(String str, int curPos) { + int i; + + for (i = curPos; i < str.length() && Character.isDigit(str.charAt(i)); i++); + return i - curPos; + } + + /** + * Ensure that a value falls in a given min/max range. + * + * @param value The value to check. + * @param min The minimum allowed value. + * @param max The maximum allowed value. + * @param curPos To indicate the parsing position in the + * ParseException. + * @throws ParseException Thrown, if value < min || value > + * max + */ + private static void ensureValue(int value, int min, int max, int curPos) + throws ParseException { + + if (value < min || value > max) { + throw new ParseException(msg.getMessage("datetime.00", null), curPos); + } + } + + /** + * Ensure that the given String has a number of characters left. + * + * @param str The String to check for its length. + * @param curPos The starting position. + * @param count The minimum number of characters that str must + * contain, starting at from curPos. + * @throws ParseException Thrown, if + * curPos + count > str.length(). + */ + private static void ensureChars(String str, int curPos, int count) + throws ParseException { + if (curPos + count > str.length()) { + throw new ParseException(msg.getMessage("datetime.00", null), curPos); + } + } + + /** + * Ensure that a given String contains a certain character at a + * certain position. + * + * @param str The String in which to look up the character. + * @param curPos The position in str that must contain the + * character. + * @param c The character value that must be contained at position + * curPos. + * @throws ParseException Thrown, if the characters do not match or + * curPos is out of range. + */ + private static void ensureChar(String str, int curPos, char c) + throws ParseException { + + ensureChars(str, curPos, 1); + if (str.charAt(curPos) != c) { + throw new ParseException(msg.getMessage("datetime.00", null), curPos); + } + } + + /** + * Ensure that a given String contains a number of digits, + * starting at a given position. + * + * @param str The String to scan for digits. + * @param curPos The starting postion. + * @param count The number of digits that must be contained in + * str, starting at curPos. + * @throws ParseException Thrown, if str is not long enough, or + * one of the characters following curPos in str is + * not a digit. + */ + private static void ensureDigits(String str, int curPos, int count) + throws ParseException { + + ensureChars(str, curPos, count); + for (int i = curPos; i < curPos + count; i++) { + if (!Character.isDigit(str.charAt(i))) { + throw new ParseException(msg.getMessage("datetime.00", null), curPos); + } + } + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/EntityResolverChain.java b/common/src/main/java/at/gv/egovernment/moa/util/EntityResolverChain.java new file mode 100644 index 000000000..e7008a701 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/EntityResolverChain.java @@ -0,0 +1,52 @@ +package at.gv.egovernment.moa.util; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Implementation of the org.xml.sax.EntityResolver, + * for use by a org.apache.xerces.parsers.DOMParser. + * + * @author Patrick Peck + * @version $Id$ + */ +public class EntityResolverChain implements EntityResolver { + /** The EntityResolvers in the chain. */ + private List resolvers = new ArrayList(); + + /** + * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) + */ + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + + Iterator iter; + + for (iter = resolvers.iterator(); iter.hasNext(); ) { + EntityResolver resolver = (EntityResolver) iter.next(); + InputSource is = resolver.resolveEntity(publicId, systemId); + + if (is != null) { + return is; + } + } + + return null; + } + + /** + * Add an EntityResolver to the chain. + * + * @param entityResolver The EntityResolver to add. + */ + public void addEntityResolver(EntityResolver entityResolver) { + resolvers.add(entityResolver); + } + +} 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 new file mode 100644 index 000000000..a5e777c2d --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java @@ -0,0 +1,116 @@ +package at.gv.egovernment.moa.util; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +/** + * Utility for accessing files on the file system, and for reading from input streams. + * @author Paul Ivancsics + * @version $Id$ + */ +public class FileUtils { + + /** + * Reads a file, given by URL, into a byte array. + * @param urlString file URL + * @return file content + * @throws IOException on any exception thrown + */ + public static byte[] readURL(String urlString) throws IOException { + URL url = new URL(urlString); + InputStream in = new BufferedInputStream(url.openStream()); + byte[] content = StreamUtils.readStream(in); + in.close(); + return content; + } + /** + * Reads a file, given by URL, into a String. + * @param urlString file URL + * @param encoding character encoding + * @return file content + * @throws IOException on any exception thrown + */ + public static String readURL(String urlString, String encoding) throws IOException { + byte[] content = readURL(urlString); + return new String(content, encoding); + } + /** + * Reads a file, given by filename, into a byte array. + * @param filename filename + * @return file content + * @throws IOException on any exception thrown + */ + public static byte[] readFile(String filename) throws IOException { + BufferedInputStream in = new BufferedInputStream(new FileInputStream(filename)); + byte[] content = StreamUtils.readStream(in); + in.close(); + return content; + } + /** + * Reads a file, given by filename, into a String. + * @param filename filename + * @param encoding character encoding + * @return file content + * @throws IOException on any exception thrown + */ + public static String readFile(String filename, String encoding) throws IOException { + byte[] content = readFile(filename); + return new String(content, encoding); + } + /** + * Reads a file from a resource. + * @param name resource name + * @return file content as a byte array + * @throws IOException on any exception thrown + */ + public static byte[] readResource(String name) throws IOException { + ClassLoader cl = FileUtils.class.getClassLoader(); + BufferedInputStream in = new BufferedInputStream(cl.getResourceAsStream(name)); + byte[] content = StreamUtils.readStream(in); + in.close(); + return content; + } + /** + * Reads a file from a resource. + * @param name filename + * @param encoding character encoding + * @return file content + * @throws IOException on any exception thrown + */ + public static String readResource(String name, String encoding) throws IOException { + byte[] content = readResource(name); + return new String(content, encoding); + } + + /** + * Returns the absolute URL of a given url which is relative to the parameter root + * @param url + * @param root + * @return String + */ + public static String makeAbsoluteURL(String url, String root) { + //if url is relative to rootConfigFileDirName make it absolute + + File keyFile; + String newURL = url; + + if(null == url) return null; + + if (url.startsWith("http:/") || url.startsWith("https:/") || url.startsWith("file:/") || url.startsWith("ftp:/")) { + return url; + } else { + // check if absolute - if not make it absolute + keyFile = new File(url); + if (!keyFile.isAbsolute()) { + keyFile = new File(root, url); + newURL = keyFile.getPath(); + } + return newURL; + } + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/KeyStoreUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/KeyStoreUtils.java new file mode 100644 index 000000000..d6a34a7b2 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/KeyStoreUtils.java @@ -0,0 +1,134 @@ +package at.gv.egovernment.moa.util; + +import iaik.x509.X509Certificate; + +import java.io.File; +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.cert.Certificate; + +/** + * Utility for creating and loading key stores. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class KeyStoreUtils { + + /** + * Loads a key store from file. + * + * @param keystoreType key store type + * @param urlString URL of key store + * @param password password protecting the key store + * @return key store loaded + * @throws IOException thrown while reading the key store from file + * @throws GeneralSecurityException thrown while creating the key store + */ + public static KeyStore loadKeyStore( + String keystoreType, + String urlString, + String password) + throws IOException, GeneralSecurityException { + + URL keystoreURL = new URL(urlString); + InputStream in = keystoreURL.openStream(); + return loadKeyStore(keystoreType, in, password); + } + /** + * Loads a key store from an InputStream, and + * closes the InputStream. + * + * @param keystoreType key store type + * @param in input stream + * @param password password protecting the key store + * @return key store loaded + * @throws IOException thrown while reading the key store from the stream + * @throws GeneralSecurityException thrown while creating the key store + */ + public static KeyStore loadKeyStore( + String keystoreType, + InputStream in, + String password) + throws IOException, GeneralSecurityException { + + char[] chPassword = null; + if (password != null) + chPassword = password.toCharArray(); + KeyStore ks = KeyStore.getInstance(keystoreType); + ks.load(in, chPassword); + in.close(); + return ks; + } + /** + * Creates a key store from X509 certificate files, aliasing them with + * the index in the String[], starting with "0". + * + * @param keyStoreType key store type + * @param certFilenames certificate filenames + * @return key store created + * @throws IOException thrown while reading the certificates from file + * @throws GeneralSecurityException thrown while creating the key store + */ + public static KeyStore createKeyStore( + String keyStoreType, + String[] certFilenames) + throws IOException, GeneralSecurityException { + + KeyStore ks = KeyStore.getInstance(keyStoreType); + ks.load(null, null); + for (int i = 0; i < certFilenames.length; i++) { + Certificate cert = loadCertificate(certFilenames[i]); + ks.setCertificateEntry("" + i, cert); + } + return ks; + } + /** + * Creates a key store from a directory containg X509 certificate files, + * aliasing them with the index in the String[], starting with "0". + * All the files in the directory are considered to be certificates. + * + * @param keyStoreType key store type + * @param certDirURLString file URL of directory containing certificate filenames + * @return key store created + * @throws IOException thrown while reading the certificates from file + * @throws GeneralSecurityException thrown while creating the key store + */ + public static KeyStore createKeyStoreFromCertificateDirectory( + String keyStoreType, + String certDirURLString) + throws IOException, GeneralSecurityException { + + URL certDirURL = new URL(certDirURLString); + String certDirname = certDirURL.getFile(); + File certDir = new File(certDirname); + String[] certFilenames = certDir.list(); + String separator = + (certDirname.endsWith(File.separator) ? "" : File.separator); + for (int i = 0; i < certFilenames.length; i++) { + certFilenames[i] = certDirname + separator + certFilenames[i]; + } + return createKeyStore(keyStoreType, certFilenames); + } + + /** + * Loads an X509 certificate from file. + * @param certFilename filename + * @return the certificate loaded + * @throws IOException thrown while reading the certificate from file + * @throws GeneralSecurityException thrown while creating the certificate + */ + private static Certificate loadCertificate(String certFilename) + throws IOException, GeneralSecurityException { + + FileInputStream in = new FileInputStream(certFilename); + Certificate cert = new X509Certificate(in); + in.close(); + return cert; + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MOADefaultHandler.java b/common/src/main/java/at/gv/egovernment/moa/util/MOADefaultHandler.java new file mode 100644 index 000000000..0474d92cd --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/MOADefaultHandler.java @@ -0,0 +1,82 @@ +package at.gv.egovernment.moa.util; + +import java.io.IOException; + +import org.xml.sax.EntityResolver; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * A DefaultHandler that uses a MOAEntityResolver and + * a MOAErrorHandler. + * + * @author Patrick Peck + * @version $Id$ + */ +public class MOADefaultHandler extends DefaultHandler { + /** The EntityResolver to use. */ + private EntityResolver entityResolver; + /** The ErrorHandler to use. */ + private ErrorHandler errorHandler; + + /** + * Create a new MOADefaultHandler. + */ + public MOADefaultHandler() { + entityResolver = new MOAEntityResolver(); + errorHandler = new MOAErrorHandler(); + } + + /** + * Create a new MOADefaultHandler. + * + * @param entityResolver The EntityResolver to use for resolving + * external entities. + * @param errorHandler The ErrorHandler to use for reporting + * parsing errors. + */ + public MOADefaultHandler( + EntityResolver entityResolver, + ErrorHandler errorHandler) { + + this.entityResolver = entityResolver; + this.errorHandler = errorHandler; + } + + /** + * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) + */ + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException { + try { + return entityResolver.resolveEntity(publicId, systemId); + } catch (IOException e) { + return null; + } + } + + /** + * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException) + */ + public void warning(SAXParseException exception) throws SAXException { + errorHandler.warning(exception); + } + + /** + * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException) + */ + public void error(SAXParseException exception) throws SAXException { + errorHandler.error(exception); + } + + /** + * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException) + */ + public void fatalError(SAXParseException exception) throws SAXException { + errorHandler.fatalError(exception); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MOAEntityResolver.java b/common/src/main/java/at/gv/egovernment/moa/util/MOAEntityResolver.java new file mode 100644 index 000000000..9406612e2 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/MOAEntityResolver.java @@ -0,0 +1,103 @@ +package at.gv.egovernment.moa.util; + +import java.io.InputStream; + +import org.apache.xerces.util.URI; +import org.apache.xerces.util.URI.MalformedURIException; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; + +/** + * An EntityResolver that looks up entities stored as + * local resources. + * + *

The following DTDs are mapped to local resources: + *

    + *
  • The XMLSchema.dtd
  • + *
  • The datatypes.dtd
  • + *
+ *

+ *

For all other resources, an attempt is made to resolve them as resources, + * either absolute or relative to Constants.SCHEMA_ROOT. + * + * @author Patrick Peck + * @author Sven Aigner + */ +public class MOAEntityResolver implements EntityResolver { + + /** + * Resolve an entity. + * + * The systemId parameter is used to perform the lookup of the + * entity as a resource, either by interpreting the systemId as + * an absolute resource path, or by appending the last path component of + * systemId to Constants.SCHEMA_ROOT. + * + * @param publicId The public ID of the resource. + * @param systemId The system ID of the resource. + * @return An InputSource from which the entity can be read, or + * null, if the entity could not be found. + * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) + */ + public InputSource resolveEntity(String publicId, String systemId) { + InputStream stream; + int slashPos; + + if (Logger.isDebugEnabled()) { + Logger.debug( + new LogMsg("resolveEntity: p=" + publicId + " s=" + systemId)); + } + + if (publicId != null) { + // check if we can resolve some standard dtd's + if (publicId.equalsIgnoreCase("-//W3C//DTD XMLSchema 200102//EN")) { + return new InputSource( + getClass().getResourceAsStream( + Constants.SCHEMA_ROOT + "XMLSchema.dtd")); + } else if (publicId.equalsIgnoreCase("datatypes")) { + return new InputSource( + getClass().getResourceAsStream( + Constants.SCHEMA_ROOT + "datatypes.dtd")); + } + } else if (systemId != null) { + // get the URI path + try { + URI uri = new URI(systemId); + systemId = uri.getPath(); + if (!"file".equals(uri.getScheme()) || "".equals(systemId.trim())) { + return null; + } + } catch (MalformedURIException e) { + return null; + } + + // try to get the resource from the full path + stream = getClass().getResourceAsStream(systemId); + if (stream != null) { + InputSource source = new InputSource(stream); + + source.setSystemId(systemId); + return source; + } + + // try to get the resource from the last path component + slashPos = systemId.lastIndexOf('/'); + if (slashPos >= 0 && systemId.length() > slashPos) { + systemId = systemId.substring(slashPos + 1, systemId.length()); + stream = + getClass().getResourceAsStream(Constants.SCHEMA_ROOT + systemId); + if (stream != null) { + InputSource source = new InputSource(stream); + + source.setSystemId(systemId); + return source; + } + } + } + + return null; // nothing found - let the parser handle the entity + } +} \ No newline at end of file diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java b/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java new file mode 100644 index 000000000..1f7757c8f --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/MOAErrorHandler.java @@ -0,0 +1,85 @@ +package at.gv.egovernment.moa.util; + +import org.apache.xml.utils.DefaultErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; + +/** + * An ErrorHandler that logs a message and throws a + * SAXException upon error and fatal + * parsing errors. + * + * @author Patrick Peck + * @author Sven Aigner + */ +public class MOAErrorHandler extends DefaultErrorHandler { + + /** + * Logs a warning message. + * + * @see org.xml.sax.ErrorHandler#warning(SAXParseException) + */ + public void warning(SAXParseException exception) throws SAXException { + warn("parser.00", messageParams(exception), null); + } + + /** + * Logs a warning and rethrows the exception. + * + * @see org.xml.sax.ErrorHandler#error(SAXParseException) + */ + public void error(SAXParseException exception) throws SAXException { + warn("parser.01", messageParams(exception), null); + throw exception; + } + + /** + * Logs a warning and rethrows the exception. + * + * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException) + */ + public void fatalError(SAXParseException exception) throws SAXException { + warn("parser.02", messageParams(exception), null); + throw exception; + } + + /** + * Log a warning message. + * + * @param messageId The message ID to log. + * @param parameters Additional message parameters. + * @param t The Throwable to log; usually the cause of this + * warning. + */ + private static void warn( + String messageId, + Object[] parameters, + Throwable t) { + + MessageProvider msg = MessageProvider.getInstance(); + Logger.warn(new LogMsg(msg.getMessage(messageId, parameters)), t); + } + + /** + * Put the system id, line and column number information from the exception + * into an Object array, to provide it as a + * MessageFormat parameter. + * + * @param e The SAXParseException containing the + * source system id and line/column numbers. + * @return An array containing the system id (a String) as well + * as line/column numbers (2 Integer objects) from the + * SAXParseException. + */ + private static Object[] messageParams(SAXParseException e) { + return new Object[] { + e.getMessage(), + e.getSystemId(), + new Integer(e.getLineNumber()), + new Integer(e.getColumnNumber())}; + } + +} \ No newline at end of file diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MOATimer.java b/common/src/main/java/at/gv/egovernment/moa/util/MOATimer.java new file mode 100644 index 000000000..d8bf64fc3 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/MOATimer.java @@ -0,0 +1,110 @@ +package at.gv.egovernment.moa.util; + +import java.util.Map; +import java.util.WeakHashMap; + +/** + * A timer utility for named timers. + * + * @author Sven Aigner + */ +public class MOATimer { + + /** The single instance of this class. */ + private static MOATimer instance = null; + /** The starting points of single timings. */ + private static Map timemapstart = new WeakHashMap(); + /** The end points of single timings. */ + private static Map timemapend = new WeakHashMap(); + + /** + * Return the single instance of this class. + * + * @return The single instance of this class. + */ + public static MOATimer getInstance() { + if (instance == null) { + instance = new MOATimer(); + } + return instance; + } + + /** + * Create a new MOATimer. + * + * Protected to disallow multiple instances. + */ + protected MOATimer() { + super(); + } + + /** + * Start timing a certain action. + * + * The timing belonging to the action ID is garbage collected as soon as there + * exists no other reference to the action ID. + * + * @param id The action ID. + */ + public void startTiming(Object id) { + timemapstart.put(id, new Long(System.currentTimeMillis())); + } + + /** + * Stop timing an action. + * + * @param id The action ID. + */ + public void stopTiming(Object id) { + timemapend.put(id, new Long(System.currentTimeMillis())); + } + + /** + * Get the duration of an action. + * + * @param id The action ID for which to compute the duration. + * @return long The duration in milliseconds between calls to + * startTiming() and stopTiming(). If + * only startTiming() has been called for the action, then + * current difference to the system time is returned. If no timing exists for + * the action, - 1 is returned. + */ + public long duration(Object id) { + if (timemapstart.containsKey(id)) { + long start = ((Long) timemapstart.get(id)).longValue(); + if (timemapend.containsKey(id)) { + long end = ((Long) timemapend.get(id)).longValue(); + return end - start; + } else { + return System.currentTimeMillis() - start; + } + } else + return -1; + } + + /** + * Get the duration of an action, as a nicely formatted String. + * + * @param id The action ID. + * @return String The duration() as a String. + */ + public String durationAsString(Object id) { + long dur = duration(id); + long second = dur / 1000; + long mil = (dur) - (second * 1000); + return "Duration: " + second + "." + mil + " seconds"; + } + + /** + * Remove a timing. + * + * @param id The action ID. + */ + public void clearTiming(String id) { + if (timemapstart.containsKey(id)) + timemapstart.remove(id); + if (timemapend.containsKey(id)) + timemapend.remove(id); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MessageProvider.java b/common/src/main/java/at/gv/egovernment/moa/util/MessageProvider.java new file mode 100644 index 000000000..f5117e390 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/MessageProvider.java @@ -0,0 +1,63 @@ +package at.gv.egovernment.moa.util; + +import java.util.Locale; + +/** + * A singleton wrapper around a Message object. + * + * Provides the messages used in the common project. + * + * @author Patrick Peck + * @version $Id$ + */ +public class MessageProvider { + /** The location of the default message resources. */ + private static final String[] DEFAULT_MESSAGE_RESOURCES = + { "resources/properties/common_messages" }; + /** The locale of the default message resources. */ + private static final Locale[] DEFAULT_MESSAGE_LOCALES = + new Locale[] { new Locale("de", "AT") }; + /** The single instance of this class. */ + private static MessageProvider instance; + + /** The messages provided by this MessageProvider. */ + private Messages messages; + + /** + * Return the single instance of the MessageProvider. + * + * Intialilizes the MessageProvider with the default message + * locations: /resources/properties/common_messages. + * + * @return The single MessageProvider. + */ + public static synchronized MessageProvider getInstance() { + if (instance == null) { + instance = + new MessageProvider(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); + } + return instance; + } + + /** + * Create a MessageProvider. + * + * @param resourceNames The names of the resources containing the messages. + * @param locales The corresponding locales. + */ + protected MessageProvider(String[] resourceNames, Locale[] locales) { + this.messages = new Messages(resourceNames, locales); + } + + /** + * Get the message corresponding to a given message ID. + * + * @param messageId The ID of the message. + * @param parameters The parameters to fill in into the message arguments. + * @return The formatted message. + */ + public String getMessage(String messageId, Object[] parameters) { + return messages.getMessage(messageId, parameters); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/Messages.java b/common/src/main/java/at/gv/egovernment/moa/util/Messages.java new file mode 100644 index 000000000..a0139ae93 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/Messages.java @@ -0,0 +1,117 @@ +package at.gv.egovernment.moa.util; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.PropertyResourceBundle; + +import at.gv.egovernment.moa.logging.Logger; + +/** + * Provides access to the system messages resource used for exception handling + * and logging messages. + * + * Messages must be provided as a resource bundle at the path. + * + * @author Patrick Peck + * @version $Id$ + */ +public class Messages { + /** Error message indicating that no messages are avaiable. */ + private static final String ERROR_MESSAGES_UNAVAILABLE = + "Fehler in der Server-Konfiguration. " + + "Die Fehlertexte konnten nicht geladen werden."; + /** Error message indicating that the message is not available. */ + private static final String ERROR_NO_MESSAGE = + "Keine Fehlermeldung für Fehler-Nr.={0}"; + + /** The names of the resources containing the messages. */ + private String[] resourceNames; + /** The corresponding Locales of the resources. */ + private Locale[] locales; + /** The ResourceBundles containing the messages. */ + private ResourceBundleChain messages; + + /** + * Create a new Message object containing the messages + * in the given resources. + * + * @param resourceNames The names of the resources containing the messages. + * @param locales The corresponding locales. + */ + public Messages(String[] resourceNames, Locale[] locales) { + this.resourceNames = resourceNames; + this.locales = locales; + this.messages = null; + } + + /** + * Get the message corresponding to a given message ID. + * + * @param messageId The ID of the message. + * @param parameters The parameters to fill in into the message arguments. + * @return The formatted message. + */ + public String getMessage(String messageId, Object[] parameters) { + // initialize messages + if (messages == null) { + initMessages(); + } + + // create the message + if (messages == null) { + return ERROR_MESSAGES_UNAVAILABLE; + } else { + try { + String rawMessage = messages.getString(messageId); + return MessageFormat.format(rawMessage, parameters); + } catch (MissingResourceException e2) { + // couldn't find any message -> set to default error message + return MessageFormat.format( + ERROR_NO_MESSAGE, + new Object[] { messageId }); + } + } + } + + /** + * Return the names of the resources containing the messages. + * + * @return String[] The names of the resource bundles containing the messages. + */ + private String[] getResourceNames() { + return resourceNames; + } + + /** + * Return the Locales of the resources containing the messages. + * + * @return Locale[] The Locales of the resource bundles + * containing the messages. + */ + private Locale[] getLocales() { + return locales; + } + + /** + * Initialize the messages ResourceBundle containing + * the MOA error messages. + */ + private void initMessages() { + messages = new ResourceBundleChain(); + int i; + + // initialize the message resources + for (i = 0; i < resourceNames.length; i++) { + try { + messages.addResourceBundle( + PropertyResourceBundle.getBundle( + getResourceNames()[i], + getLocales()[i])); + } catch (MissingResourceException e) { + Logger.error(ERROR_MESSAGES_UNAVAILABLE, e); + } + } + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/NodeIteratorAdapter.java b/common/src/main/java/at/gv/egovernment/moa/util/NodeIteratorAdapter.java new file mode 100644 index 000000000..f71aa472d --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/NodeIteratorAdapter.java @@ -0,0 +1,87 @@ +package at.gv.egovernment.moa.util; + +import java.util.ListIterator; + +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; +import org.w3c.dom.traversal.NodeFilter; +import org.w3c.dom.traversal.NodeIterator; + +/** + * A NodeIterator implementation based on a + * ListIterator. + * + * @see java.util.ListIterator + * @see org.w3c.dom.traversal.NodeIterator + * + * @author Patrick Peck + * @version $Id$ + */ +public class NodeIteratorAdapter implements NodeIterator { + + /** The ListIterator to wrap. */ + private ListIterator nodeIterator; + + /** + * Create a new NodeIteratorAdapter. + * @param nodeIterator The ListIterator to iterate over. + */ + public NodeIteratorAdapter(ListIterator nodeIterator) { + this.nodeIterator = nodeIterator; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#getRoot() + */ + public Node getRoot() { + return null; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#getWhatToShow() + */ + public int getWhatToShow() { + return NodeFilter.SHOW_ALL; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#getFilter() + */ + public NodeFilter getFilter() { + return null; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#getExpandEntityReferences() + */ + public boolean getExpandEntityReferences() { + return false; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#nextNode() + */ + public Node nextNode() throws DOMException { + if (nodeIterator.hasNext()) { + return (Node) nodeIterator.next(); + } + return null; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#previousNode() + */ + public Node previousNode() throws DOMException { + if (nodeIterator.hasPrevious()) { + return (Node) nodeIterator.previous(); + } + return null; + } + + /** + * @see org.w3c.dom.traversal.NodeIterator#detach() + */ + public void detach() { + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/NodeListAdapter.java b/common/src/main/java/at/gv/egovernment/moa/util/NodeListAdapter.java new file mode 100644 index 000000000..7102cadca --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/NodeListAdapter.java @@ -0,0 +1,44 @@ +package at.gv.egovernment.moa.util; + +import java.util.List; + +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * A NodeList implementation based on a List. + * + * @see java.util.List + * @see org.w3c.dom.NodeList + * + * @author Patrick Peck + * @version $Id$ + */ +public class NodeListAdapter implements NodeList { + /** The List to wrap. */ + private List nodeList; + + /** + * Create a new NodeListAdapter. + * + * @param nodeList The List containing the nodes. + */ + public NodeListAdapter(List nodeList) { + this.nodeList = nodeList; + } + + /** + * @see org.w3c.dom.NodeList#item(int) + */ + public Node item(int index) { + return (Node) nodeList.get(index); + } + + /** + * @see org.w3c.dom.NodeList#getLength() + */ + public int getLength() { + return nodeList.size(); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/OutputXML2File.java b/common/src/main/java/at/gv/egovernment/moa/util/OutputXML2File.java new file mode 100644 index 000000000..f9d330d41 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/OutputXML2File.java @@ -0,0 +1,78 @@ +/* + * Created on 26.04.2004 + * + * @author rschamberger + * $ID$ + */ +package at.gv.egovernment.moa.util; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.logging.Logger; + +/** + * utility functions to write XML data to files + * @author rschamberger + * @version $Id$ + */ +public class OutputXML2File { + + /** + * writes an XML structure to file if debug is enabled in hierarchy (Encoding: UTF-8) + * + * @param filename file name + * @param rootElem root element in DOM tree + * @param hierarchy of the Logger + */ + public static void debugOutputXML2File(String filename, Element rootElem, String hierarchy) { + if (Logger.isDebugEnabled(hierarchy)) { + outputXML2File(filename, rootElem); + } + } + + /** + * writes an XML structure to file if debug is enabled in hierarchy (Encoding: UTF-8) + * + * @param filename file name + * @param xmlString XML string + * @param hierarchy of the Logger + */ + public static void debugOutputXML2File(String filename, String xmlString, String hierarchy) { + if (Logger.isDebugEnabled(hierarchy)) { + outputXML2File(filename, xmlString); + } + } + + /** + * writes an XML structure to file (Encoding: UTF-8) + * + * @param filename file name + * @param rootElem root element in DOM tree + */ + public static void outputXML2File(String filename, Element rootElem) { + try { + String xmlString = new String(DOMUtils.serializeNode(rootElem)); + outputXML2File(filename, xmlString); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * writes an XML structure to file (Encoding: UTF-8) + * + * @param filename file name + * @param xmlString XML string + */ + public static void outputXML2File(String filename, String xmlString) { + try { + java.io.OutputStream fout = new java.io.FileOutputStream(filename); + byte[] xmlData = xmlString.getBytes("UTF-8"); + fout.write(xmlData); + fout.close(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/ResourceBundleChain.java b/common/src/main/java/at/gv/egovernment/moa/util/ResourceBundleChain.java new file mode 100644 index 000000000..90b28548a --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/ResourceBundleChain.java @@ -0,0 +1,66 @@ +package at.gv.egovernment.moa.util; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * A class to chain ResourceBundles. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ResourceBundleChain { + /** Error message indicating the resource is not available. */ + private static final String ERROR_MISSING_RESOURCE = "Missing resource"; + /** The ResourceBundles contained in this chain. */ + private List resourceBundles = new ArrayList(); + + /** + * Add a ResourceBundle to the chain. + * + * @param resourceBundle The ResourceBundle to add. + */ + public void addResourceBundle(ResourceBundle resourceBundle) { + resourceBundles.add(resourceBundle); + } + + /** + * Return the value of the resource. + * + * @param key The key to access the String resource. + * @return The resource value. All the registered ResourceBundles + * are searched in the order in which they have previously been added to this + * ResourceBundleChain. + * @throws MissingResourceException The resource coult not be found in any of + * the bundles. + */ + public String getString(String key) throws MissingResourceException { + MissingResourceException lastException = null; + Iterator iter; + + // handle case where no resource bundles have been added + if (resourceBundles.size() == 0) { + throw new MissingResourceException( + ERROR_MISSING_RESOURCE, + this.getClass().getName(), + key); + } + + // try to find the resource in one of the bundles; if it cannot be found, + // return the exception thrown by the last bundle in the list + for (iter = resourceBundles.iterator(); iter.hasNext();) { + ResourceBundle resourceBundle = (ResourceBundle) iter.next(); + try { + String value = resourceBundle.getString(key); + return value; + } catch (MissingResourceException e) { + lastException = e; + } + } + throw lastException; + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java new file mode 100644 index 000000000..ada21b412 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/SSLUtils.java @@ -0,0 +1,221 @@ +package at.gv.egovernment.moa.util; + +import java.io.IOException; +import java.io.InputStream; +import java.security.GeneralSecurityException; +import java.security.KeyStore; + +import javax.net.ssl.KeyManager; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; + +/** + * Utility for connecting to server applications via SSL. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SSLUtils { + + /** + * Creates an SSLSocketFactory which utilizes the given trust store. + * + * @param trustStoreType key store type of trust store + * @param trustStoreInputStream input stream for reading JKS trust store containing + * trusted server certificates; if null, the default + * trust store will be utilized + * @param trustStorePassword if provided, it will be used to check + * the integrity of the trust store; if omitted, it will not be checked + * @return SSLSocketFactory to be used by an HttpsURLConnection + * @throws IOException thrown while reading from the input stream + * @throws GeneralSecurityException thrown while creating the socket factory + */ + public static SSLSocketFactory getSSLSocketFactory( + String trustStoreType, + InputStream trustStoreInputStream, + String trustStorePassword) + throws IOException, GeneralSecurityException { + + TrustManager[] tms = getTrustManagers(trustStoreType, trustStoreInputStream, trustStorePassword); + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(null, tms, null); + + SSLSocketFactory sf = ctx.getSocketFactory(); + return sf; + } + /** + * Creates an SSLSocketFactory which utilizes the + * given trust store and keystore. + * + * @param trustStore trust store containing trusted server certificates; + * if null, the default trust store will be utilized + * @param clientKeyStoreType key store type of clientKeyStore + * @param clientKeyStoreURL URL of key store containing keys to be used for + * client authentication; if null, the default key store will be utilized + * @param clientKeyStorePassword if provided, it will be used to check + * the integrity of the client key store; if omitted, it will not be checked + * @return SSLSocketFactory to be used by an HttpsURLConnection + * @throws IOException thrown while reading key store file + * @throws GeneralSecurityException thrown while creating the socket factory + */ + public static SSLSocketFactory getSSLSocketFactory( + KeyStore trustStore, + String clientKeyStoreType, + String clientKeyStoreURL, + String clientKeyStorePassword) + throws IOException, GeneralSecurityException { + + SSLContext ctx = getSSLContext( + trustStore, clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword); + SSLSocketFactory sf = ctx.getSocketFactory(); + return sf; + } + /** + * Creates an SSLContext initialized for the + * given trust store and keystore. + * + * @param trustStore trust store containing trusted server certificates; + * if null, the default trust store will be utilized + * @param clientKeyStoreType key store type of clientKeyStore + * @param clientKeyStoreURL URL of key store containing keys to be used for + * client authentication; if null, the default key store will be utilized + * @param clientKeyStorePassword if provided, it will be used to check + * the integrity of the client key store; if omitted, it will not be checked + * @return SSLContext to be used for creating an SSLSocketFactory + * @throws IOException thrown while reading key store file + * @throws GeneralSecurityException thrown while creating the SSL context + */ + public static SSLContext getSSLContext( + KeyStore trustStore, + String clientKeyStoreType, + String clientKeyStoreURL, + String clientKeyStorePassword) + throws IOException, GeneralSecurityException { + + //System.setProperty("javax.net.debug", "all"); + TrustManager[] tms = getTrustManagers(trustStore); + KeyManager[] kms = getKeyManagers(clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword); + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kms, tms, null); + return ctx; + } + /** + * Loads the trust store from an input stream and gets the + * TrustManagers from a default TrustManagerFactory, + * initialized from the given trust store. + * @param trustStoreType key store type of trust store + * @param trustStoreInputStream input stream for reading JKS trust store containing + * trusted server certificates; if null, the default + * trust store will be utilized + * @param trustStorePassword if provided, it will be used to check + * the integrity of the trust store; if omitted, it will not be checked + * @return TrustManagers to be used for creating an + * SSLSocketFactory utilizing the given trust store + * @throws IOException thrown while reading from the input stream + * @throws GeneralSecurityException thrown while initializing the + * default TrustManagerFactory + */ + protected static TrustManager[] getTrustManagers( + String trustStoreType, + InputStream trustStoreInputStream, + String trustStorePassword) + throws IOException, GeneralSecurityException { + + if (trustStoreInputStream == null) + return null; + + // Set up the TrustStore to use. We need to load the file into + // a KeyStore instance. + KeyStore trustStore = KeyStoreUtils.loadKeyStore(trustStoreType, trustStoreInputStream, trustStorePassword); + return getTrustManagers(trustStore); + } + /** + * Gets the TrustManagers from a default TrustManagerFactory, + * initialized from the given trust store. + * + * @param trustStore the trust store to use + * @return TrustManagers to be used for creating an + * SSLSocketFactory utilizing the given trust store + * @throws GeneralSecurityException thrown while initializing the + * default TrustManagerFactory + */ + protected static TrustManager[] getTrustManagers(KeyStore trustStore) + throws GeneralSecurityException { + + if (trustStore == null) + return null; + + // Initialize the default TrustManagerFactory with this KeyStore + String alg=TrustManagerFactory.getDefaultAlgorithm(); + TrustManagerFactory tmFact=TrustManagerFactory.getInstance(alg); + tmFact.init(trustStore); + + // And now get the TrustManagers + TrustManager[] tms=tmFact.getTrustManagers(); + return tms; + } + /** + * Loads the client key store from file and gets the + * KeyManagers from a default KeyManagerFactory, + * initialized from the given client key store. + * @param clientKeyStoreType key store type of clientKeyStore + * @param clientKeyStoreURL URL of key store containing keys to be used for + * client authentication; if null, the default key store will be utilized + * @param clientKeyStorePassword password used to check the integrity of the client key store; + * if null, it will not be checked + * @return KeyManagers to be used for creating an + * SSLSocketFactory utilizing the given client key store + * @throws IOException thrown while reading from the key store file + * @throws GeneralSecurityException thrown while initializing the + * default KeyManagerFactory + */ + public static KeyManager[] getKeyManagers ( + String clientKeyStoreType, + String clientKeyStoreURL, + String clientKeyStorePassword) + throws IOException, GeneralSecurityException { + + if (clientKeyStoreURL == null) + return null; + + // Set up the KeyStore to use. We need to load the file into + // a KeyStore instance. + KeyStore clientKeyStore = KeyStoreUtils.loadKeyStore( + clientKeyStoreType, clientKeyStoreURL, clientKeyStorePassword); + return getKeyManagers(clientKeyStore, clientKeyStorePassword); + } + /** + * Gets the KeyManagers from a default KeyManagerFactory, + * initialized from the given client key store. + * @param clientKeyStore client key store + * @param clientKeyStorePassword if provided, it will be used to check + * the integrity of the client key store; if omitted, it will not be checked + * @return KeyManagers to be used for creating an + * SSLSocketFactory utilizing the given client key store + * @throws GeneralSecurityException thrown while initializing the + * default KeyManagerFactory + */ + public static KeyManager[] getKeyManagers ( + KeyStore clientKeyStore, + String clientKeyStorePassword) + throws GeneralSecurityException { + + if (clientKeyStore == null) + return null; + + // Now we initialize the default KeyManagerFactory with this KeyStore + String alg=KeyManagerFactory.getDefaultAlgorithm(); + KeyManagerFactory kmFact=KeyManagerFactory.getInstance(alg); + char[] password = null; + if (clientKeyStorePassword != null) + password = clientKeyStorePassword.toCharArray(); + kmFact.init(clientKeyStore, password); + + // And now get the KeyManagers + KeyManager[] kms=kmFact.getKeyManagers(); + return kms; + } +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/StreamEntityResolver.java b/common/src/main/java/at/gv/egovernment/moa/util/StreamEntityResolver.java new file mode 100644 index 000000000..38c4e863c --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/StreamEntityResolver.java @@ -0,0 +1,64 @@ +package at.gv.egovernment.moa.util; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; + +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * An EntityResolver that maps system IDs to + * InputStreams. + * + * @author Patrick Peck + * @version $Id$ + */ +public class StreamEntityResolver implements EntityResolver { + + /** A mapping from Public ID or System ID to an InputStream + * containing the entity. */ + private Map mappedEntities; + + /** + * Create a StreamEntityResolver. + * + * @param mappedEntities A mapping from public or system IDs + * (String objects) to InputStreams. + */ + public StreamEntityResolver(Map mappedEntities) { + this.mappedEntities = mappedEntities; + } + + /** + * Resolve an entity by looking it up in the mapped entities. + * + * First, the public ID is looked up in the mapping, then the system ID. + * + * @param publicId The public ID of the entity. + * @param systemId The system ID of the entity. + * @return An InputStream containing the entity or + * null if no entity could be found. + * @throws SAXException Signalling a parsing exception. + * @throws IOException Error reading the entity. + */ + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + + InputSource src = null; + + if (publicId != null && mappedEntities.get(publicId) != null) { + src = new InputSource((InputStream) mappedEntities.get(publicId)); + } else if (systemId != null && mappedEntities.get(systemId) != null) { + src = new InputSource((InputStream) mappedEntities.get(systemId)); + } + + if (src != null) { + src.setPublicId(publicId); + src.setSystemId(systemId); + } + + return src; + } +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/StreamUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/StreamUtils.java new file mode 100644 index 000000000..a22f1c2a8 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/StreamUtils.java @@ -0,0 +1,128 @@ +package at.gv.egovernment.moa.util; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; + +/** + * Utility methods for streams. + * + * @author Patrick Peck + * @version $Id$ + */ +public class StreamUtils { + + /** + * Compare the contents of two InputStreams. + * + * @param is1 The 1st InputStream to compare. + * @param is2 The 2nd InputStream to compare. + * @return boolean true, if both streams contain the exactly the + * same content, false otherwise. + * @throws IOException An error occurred reading one of the streams. + */ + public static boolean compareStreams(InputStream is1, InputStream is2) + throws IOException { + + byte[] buf1 = new byte[256]; + byte[] buf2 = new byte[256]; + int length1; + int length2; + + try { + while (true) { + length1 = is1.read(buf1); + length2 = is2.read(buf2); + + if (length1 != length2) { + return false; + } + if (length1 <= 0) { + return true; + } + if (!compareBytes(buf1, buf2, length1)) { + return false; + } + } + } catch (IOException e) { + throw e; + } finally { + // close both streams + try { + is1.close(); + is2.close(); + } catch (IOException e) { + // ignore this + } + } + } + + /** + * Compare two byte arrays, up to a given maximum length. + * + * @param b1 1st byte array to compare. + * @param b2 2nd byte array to compare. + * @param length The maximum number of bytes to compare. + * @return true, if the byte arrays are equal, false + * otherwise. + */ + private static boolean compareBytes(byte[] b1, byte[] b2, int length) { + if (b1.length != b2.length) { + return false; + } + + for (int i = 0; i < b1.length && i < length; i++) { + if (b1[i] != b2[i]) { + return false; + } + } + + return true; + } + + /** + * Reads a byte array from a stream. + * @param in The InputStream to read. + * @return The bytes contained in the given InputStream. + * @throws IOException on any exception thrown + */ + public static byte[] readStream(InputStream in) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int b; + while ((b = in.read()) >= 0) + out.write(b); + in.close(); + return out.toByteArray(); + } + + /** + * Reads a String from a stream, using given encoding. + * @param in The InputStream to read. + * @param encoding The character encoding to use for converting the bytes + * of the InputStream into a String. + * @return The content of the given InputStream converted into + * a String. + * @throws IOException on any exception thrown + */ + public static String readStream(InputStream in, String encoding) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int b; + while ((b = in.read()) >= 0) + out.write(b); + in.close(); + return out.toString(encoding); + } + + /** + * Gets the stack trace of the Throwable passed in as a string. + * @param t The Throwable. + * @return a String representing the stack trace of the Throwable. + */ + public static String getStackTraceAsString(Throwable t) + { + ByteArrayOutputStream stackTraceBIS = new ByteArrayOutputStream(); + t.printStackTrace(new PrintStream(stackTraceBIS)); + return new String(stackTraceBIS.toByteArray()); + } +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java new file mode 100644 index 000000000..61b1a18ea --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/StringUtils.java @@ -0,0 +1,164 @@ +// Copyright (C) 2002 IAIK +// email: jce-info@iaik.tu-graz.ac.at +// +// All rights reserved. +// +// This source is provided for inspection purposes and recompilation only, +// unless specified differently in a contract with IAIK. This source has to +// be kept in strict confidence and must not be disclosed to any third party +// under any circumstances. Redistribution in source and binary forms, with +// or without modification, are permitted in any case! +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. +// + +package at.gv.egovernment.moa.util; + +import java.util.StringTokenizer; + +/** + * Utitility functions for string manipulations. + * + * @author Harald Bratko + */ +public class StringUtils { + + /** + * Removes all blanks and tabs from the given string. + * + * @param s The string to remove all blanks and tabs from. + * @return The input string with all blanks and tabs removed from. + */ + public static String removeBlanks(String s) { + StringTokenizer st = new StringTokenizer(s); + StringBuffer sb = new StringBuffer(s.length()); + while (st.hasMoreTokens()) { + sb.append(st.nextToken()); + } + return sb.toString(); + } + + /** + * Removes all occurences of the specified token from the the given string. + * + * @param s The string to remove all occurences of the specified token from. + * @return The input string with all occurences of the specified token removed from. + */ + public static String removeToken(String s, String token) { + StringTokenizer st = new StringTokenizer(s, token); + StringBuffer sb = new StringBuffer(s.length()); + while (st.hasMoreTokens()) { + sb.append(st.nextToken()); + } + return sb.toString(); + } + + /** + * Removes all leading zeros from the input string. + * + * @param s The string remove the leading zeros from. + * @return The input string with the leading zeros removed from. + */ + public static String deleteLeadingZeros(String s) { + StringBuffer sb = new StringBuffer(s); + int l = sb.length(); + int j = 0; + for (int i=0; is that matches the given + * search string by the given replace string. + * + * @param s The string where the replacment should take place. + * @param search The pattern that should be replaced. + * @param replace The string that should replace all each search + * string within s. + * @return A string whrer all occurrence of search are + * replaced with replace. + */ + public static String replaceAll (String s, String search, String replace) + { + StringBuffer sb = new StringBuffer(); + int i = 0, j = 0; + int len = search.length(); + while (j > -1) + { + j = s.indexOf(search, i); + + if (j > -1) + { + sb.append(s.substring(i,j)); + sb.append(replace); + i = j + len; + } + } + + sb.append(s.substring(i, s.length())); + + return sb.toString(); + } + + /** + * Changes the SecurityLayer version in the given string. + * This method usually takes as input an XML structure represented in a string + * format and changes the SecurityLayer namespaces prefixes and URIs from + * one SecurityLayer version to another. + * e.g.: code>sl10 to sl and + * http://www.buergerkarte.at/namespaces/securitylayer/20020225# + * to + * http://www.buergerkarte.at/namespaces/securitylayer/1.2# + * + * @param s The string (usally an XML structure) where the + * SecurityLayer version should be changed. + * @param slPrefixOld The SecurityLayer namespace prefix that should be + * replaced by the new one. + * @param slPrefixNew The new SecurityLayer namespace prefix that should + * replace the old one. + * @param slNSUriOld The SecurityLayer namespace URI that should be + * replaced by the new one. + * @param slNSUriNew The new SecurityLayer namespace URI that should + * replace the old one. + * @return A string where the SecurityLayer namespace prefixes + * and URIs are replaced by new ones. + */ + public static String changeSLVersion(String s, String slPrefixOld, String slPrefixNew, String slNSUriOld, String slNSUriNew) { + String retString = replaceAll(s, slPrefixOld, slPrefixNew); + retString = replaceAll(retString, slNSUriOld, slNSUriNew); + return retString ; + } + + /** + * Removes the XML declaration from an XML expression. + * + * @param xmlString XML expression as String + * + * @return XML expression, XML declaration removed + */ + public static String removeXMLDeclaration(String xmlString) { + if (xmlString.startsWith("application/x-www-form-urlencoded string using a specific encoding scheme. + * @param s the string to decode + * @param encoding name of character encoding + * @return the newly decoded string + * @throws UnsupportedEncodingException if the encoding is not supported + */ + public static String decode(String s, String encoding) throws UnsupportedEncodingException { + StringReader in = new StringReader(s); + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + for (int b = read(in); b >= 0; b = read(in)) + bout.write(b); + return bout.toString(encoding); + } + /** + * Decodes the next byte from the string reader. + * @param in string reader + * @return the next byte decoded; + * -1 upon end of string, on erroneous data, and on any exception caught + * @todo syntax check on string + */ + private static int read(StringReader in) { + try { + int b = in.read(); + if (b == '+') + return ' '; + if (b == '%') { + char[] hex = new char[2]; + if (in.read(hex, 0, 2) >= 0) { + String hexString = new String(hex); + return Integer.valueOf(hexString, 16).intValue(); + } + else + return -1; + } + return b; + } + catch (IOException ex) { + return -1; + } + catch (NumberFormatException ex) { + return -1; + } + } +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java b/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java new file mode 100644 index 000000000..840c0c3bc --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/URLEncoder.java @@ -0,0 +1,63 @@ +package at.gv.egovernment.moa.util; + +import java.io.ByteArrayInputStream; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; + +/** + * Translates a string into mime format "x-www-form-urlencoded". + * Provides a function missing in JDK 1.3. + * @author Paul Ivancsics + * @version $Id$ + */ +public class URLEncoder { + + /** + * Translates a string into x-www-form-urlencoded format. + * @param s the string to be translated + * @param encoding the encoding to use + * @return the translated string + * @throws UnsupportedEncodingException when the desired encoding is not supported + */ + public static String encode(String s, String encoding) throws UnsupportedEncodingException { + byte[] barr = s.getBytes(encoding); + ByteArrayInputStream bin = new ByteArrayInputStream(barr); + StringWriter out = new StringWriter(); + for (int b = bin.read(); b >= 0; b = bin.read()) + encode(b, out); + return out.toString(); + } + + /** + * Encode a character. + * @param ch The character to encode. + * @param out The StringWriter containing the result. + */ + private static void encode(int ch, StringWriter out) { + if ((ch >= 'a' && ch <= 'z') + || (ch >= 'A' && ch <= 'Z') + || (ch >= '0' && ch <= '9') + || ch == '.' || ch == '-' || ch == '*' || ch == '_') + out.write(ch); + else if (ch == ' ') + out.write('+'); + else + encodeHex(ch, out); + } + + /** + * Encode a character as an escaped hex value. + * @param ch The character to encode. + * @param out The StringWriter containing the result. + */ + private static void encodeHex(int ch, StringWriter out) { + out.write('%'); + String hex = Integer.toHexString(ch).toUpperCase(); + if (hex.length() < 2) + out.write('0'); + else + out.write(hex.charAt(hex.length() - 2)); + out.write(hex.charAt(hex.length() - 1)); + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/XPathException.java b/common/src/main/java/at/gv/egovernment/moa/util/XPathException.java new file mode 100644 index 000000000..e10c882e5 --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/XPathException.java @@ -0,0 +1,58 @@ +package at.gv.egovernment.moa.util; + +import java.io.PrintStream; +import java.io.PrintWriter; + +/** + * An exception occurred evaluating an XPath. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XPathException extends RuntimeException { + /** The wrapped exception. */ + private Throwable wrapped; + + /** + * Create a XPathException. + * + * @param message The exception message. + * @param wrapped The exception being the likely cause of this exception. + */ + public XPathException(String message, Throwable wrapped) { + super(message); + this.wrapped = wrapped; + } + + /** + * Return the wrapped exception. + * + * @return The wrapped exception being the likely cause of this exception. + */ + public Throwable getWrapped() { + return wrapped; + } + + /** + * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) + */ + public void printStackTrace(PrintStream s) { + super.printStackTrace(s); + if (getWrapped() != null) { + s.print("Caused by: "); + getWrapped().printStackTrace(s); + } + } + + /** + * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) + */ + public void printStackTrace(PrintWriter s) { + super.printStackTrace(s); + if (getWrapped() != null) { + s.print("Caused by: "); + getWrapped().printStackTrace(s); + } + } + +} diff --git a/common/src/main/java/at/gv/egovernment/moa/util/XPathUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/XPathUtils.java new file mode 100644 index 000000000..5212ed13e --- /dev/null +++ b/common/src/main/java/at/gv/egovernment/moa/util/XPathUtils.java @@ -0,0 +1,526 @@ +package at.gv.egovernment.moa.util; + +import java.util.List; +import java.util.Map; + +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.traversal.NodeIterator; + +import org.jaxen.JaxenException; +import org.jaxen.NamespaceContext; +import org.jaxen.SimpleNamespaceContext; +import org.jaxen.dom.DOMXPath; +import org.jaxen.dom.DocumentNavigator; + +/** + * Utility methods to evaluate XPath expressions on DOM nodes. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XPathUtils { + + /** + * The XPath expression selecting all nodes under a given root (including the + * root node itself). + */ + public static final String ALL_NODES_XPATH = + "(.//. | .//@* | .//namespace::*)"; + + /** The DocumentNavigator to use for navigating the document. */ + private static DocumentNavigator documentNavigator = + DocumentNavigator.getInstance(); + /** The default namespace prefix to namespace URI mappings. */ + private static NamespaceContext NS_CONTEXT; + + static { + SimpleNamespaceContext ctx = new SimpleNamespaceContext(); + ctx.addNamespace(Constants.MOA_PREFIX, Constants.MOA_NS_URI); + ctx.addNamespace(Constants.MOA_CONFIG_PREFIX, Constants.MOA_CONFIG_NS_URI); + ctx.addNamespace(Constants.MOA_ID_CONFIG_PREFIX, Constants.MOA_ID_CONFIG_NS_URI); + ctx.addNamespace(Constants.SL10_PREFIX, Constants.SL10_NS_URI); + ctx.addNamespace(Constants.SL11_PREFIX, Constants.SL11_NS_URI); + ctx.addNamespace(Constants.SL12_PREFIX, Constants.SL12_NS_URI); + ctx.addNamespace(Constants.ECDSA_PREFIX, Constants.ECDSA_NS_URI); + ctx.addNamespace(Constants.PD_PREFIX, Constants.PD_NS_URI); + ctx.addNamespace(Constants.SAML_PREFIX, Constants.SAML_NS_URI); + ctx.addNamespace(Constants.SAMLP_PREFIX, Constants.SAMLP_NS_URI); + ctx.addNamespace(Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); + ctx.addNamespace(Constants.XSLT_PREFIX, Constants.XSLT_NS_URI); + ctx.addNamespace(Constants.XSI_PREFIX, Constants.XSI_NS_URI); + ctx.addNamespace(Constants.DSIG_FILTER2_PREFIX, Constants.DSIG_FILTER2_NS_URI); + ctx.addNamespace(Constants.DSIG_EC_PREFIX, Constants.DSIG_EC_NS_URI); + ctx.addNamespace(Constants.MD_PREFIX, Constants.MD_NS_URI); + ctx.addNamespace(Constants.MDP_PREFIX, Constants.MDP_NS_URI); + ctx.addNamespace(Constants.MVV_PREFIX, Constants.MVV_NS_URI); + ctx.addNamespace(Constants.STB_PREFIX, Constants.STB_NS_URI); + ctx.addNamespace(Constants.WRR_PREFIX, Constants.WRR_NS_URI); + NS_CONTEXT = ctx; + } + + /** + * Return a NodeIterator over the nodes matching the XPath + * expression. + * + * All namespace URIs and prefixes declared in the Constants + * interface are used for resolving namespaces. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param exp The XPath expression to evaluate. + * @return An iterator over the resulting nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static NodeIterator selectNodeIterator(Node contextNode, String exp) + throws XPathException { + + return selectNodeIterator(contextNode, NS_CONTEXT, exp); + } + + /** + * Return a NodeIterator over the nodes matching the XPath + * expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param namespaceElement An element from which to build the + * namespace mapping for evaluating the XPath expression + * @param exp The XPath expression to evaluate. + * @return An iterator over the resulting nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static NodeIterator selectNodeIterator( + Node contextNode, + Element namespaceElement, + String exp) + throws XPathException { + + try { + SimpleNamespaceContext ctx = new SimpleNamespaceContext(); + ctx.addElementNamespaces(documentNavigator, namespaceElement); + return selectNodeIterator(contextNode, ctx, exp); + } catch (JaxenException e) { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { exp }); + throw new XPathException(message, e); + } + } + + /** + * Return a NodeIterator over the nodes matching the XPath + * expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param namespaceMapping A namespace prefix to namespace URI mapping + * (String to String) for evaluating the XPath + * expression. + * @param exp The XPath expression to evaluate. + * @return An iterator over the resulting nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static NodeIterator selectNodeIterator( + Node contextNode, + Map namespaceMapping, + String exp) + throws XPathException { + + SimpleNamespaceContext ctx = new SimpleNamespaceContext(namespaceMapping); + + return selectNodeIterator(contextNode, ctx, exp); + } + + /** + * Return a NodeIterator over the nodes matching the XPath + * expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param nsContext The NamespaceContext for resolving namespace + * prefixes to namespace URIs for evaluating the XPath expression. + * @param exp The XPath expression to evaluate. + * @return An iterator over the resulting nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + private static NodeIterator selectNodeIterator( + Node contextNode, + NamespaceContext nsContext, + String exp) + throws XPathException { + + try { + DOMXPath xpath = new DOMXPath(exp); + List nodes; + + xpath.setNamespaceContext(nsContext); + nodes = xpath.selectNodes(contextNode); + return new NodeIteratorAdapter(nodes.listIterator()); + } catch (JaxenException e) { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { exp }); + throw new XPathException(message, e); + } + } + + /** + * Return a NodeList of all the nodes matching the XPath + * expression. + * + * All namespace URIs and prefixes declared in the Constants + * interface are used for resolving namespaces. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param exp The XPath expression to evaluate. + * @return A NodeList containing the matching nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static NodeList selectNodeList(Node contextNode, String exp) + throws XPathException { + + return selectNodeList(contextNode, NS_CONTEXT, exp); + } + + /** + * Return a NodeList of all the nodes matching the XPath + * expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param namespaceElement An element from which to build the + * namespace mapping for evaluating the XPath expression + * @param exp The XPath expression to evaluate. + * @return A NodeList containing the matching nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static NodeList selectNodeList( + Node contextNode, + Element namespaceElement, + String exp) + throws XPathException { + + try { + SimpleNamespaceContext ctx = new SimpleNamespaceContext(); + + ctx.addElementNamespaces(documentNavigator, namespaceElement); + return selectNodeList(contextNode, ctx, exp); + } catch (JaxenException e) { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { exp }); + throw new XPathException(message, e); + } + } + + /** + * Return a NodeList of all the nodes matching the XPath + * expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param namespaceMapping A namespace prefix to namespace URI mapping + * (String to String) for evaluating the XPath + * expression. + * @param exp The XPath expression to evaluate. + * @return A NodeList containing the matching nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static NodeList selectNodeList( + Node contextNode, + Map namespaceMapping, + String exp) + throws XPathException { + + SimpleNamespaceContext ctx = new SimpleNamespaceContext(namespaceMapping); + + return selectNodeList(contextNode, ctx, exp); + } + + /** + * Return a NodeList of all the nodes matching the XPath + * expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param nsContext The NamespaceContext for resolving namespace + * prefixes to namespace URIs for evaluating the XPath expression. + * @param exp The XPath expression to evaluate. + * @return A NodeList containing the matching nodes. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + private static NodeList selectNodeList( + Node contextNode, + NamespaceContext nsContext, + String exp) + throws XPathException { + + try { + DOMXPath xpath = new DOMXPath(exp); + List nodes; + + xpath.setNamespaceContext(nsContext); + nodes = xpath.selectNodes(contextNode); + return new NodeListAdapter(nodes); + } catch (JaxenException e) { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { exp }); + throw new XPathException(message, e); + } + } + + /** + * Select the first node matching an XPath expression. + * + * All namespace URIs and prefixes declared in the Constants + * interface are used for resolving namespaces. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param exp The XPath expression to evaluate. + * @return Node The first node matching the XPath expression, or + * null, if no node matched. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static Node selectSingleNode(Node contextNode, String exp) + throws XPathException { + + return selectSingleNode(contextNode, NS_CONTEXT, exp); + } + + /** + * Select the first node matching an XPath expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param namespaceElement An element from which to build the + * namespace mapping for evaluating the XPath expression + * @param exp The XPath expression to evaluate. + * @return Node The first node matching the XPath expression, or + * null, if no node matched. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static Node selectSingleNode( + Node contextNode, + Element namespaceElement, + String exp) + throws XPathException { + + try { + SimpleNamespaceContext ctx = new SimpleNamespaceContext(); + ctx.addElementNamespaces(documentNavigator, namespaceElement); + + return selectSingleNode(contextNode, ctx, exp); + } catch (JaxenException e) { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { exp }); + throw new XPathException(message, e); + } + } + + /** + * Select the first node matching an XPath expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param namespaceMapping A namespace prefix to namespace URI mapping + * (String to String) for evaluating the XPath + * expression. + * @param exp The XPath expression to evaluate. + * @return Node The first node matching the XPath expression, or + * null, if no node matched. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + public static Node selectSingleNode( + Node contextNode, + Map namespaceMapping, + String exp) + throws XPathException { + + SimpleNamespaceContext ctx = new SimpleNamespaceContext(namespaceMapping); + + return selectSingleNode(contextNode, ctx, exp); + } + + /** + * Select the first node matching an XPath expression. + * + * @param contextNode The root node from which to evaluate the XPath + * expression. + * @param nsContext The NamespaceContext for resolving namespace + * prefixes to namespace URIs for evaluating the XPath expression. + * @param exp The XPath expression to evaluate. + * @return Node The first node matching the XPath expression, or + * null, if no node matched. + * @throws XPathException An error occurred evaluating the XPath expression. + */ + private static Node selectSingleNode( + Node contextNode, + NamespaceContext nsContext, + String exp) + throws XPathException { + + try { + DOMXPath xpath = new DOMXPath(exp); + xpath.setNamespaceContext(nsContext); + return (Node) xpath.selectSingleNode(contextNode); + } catch (JaxenException e) { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { exp }); + throw new XPathException(message, e); + } + } + + /** + * Return the value of a DOM element whose location is given by an XPath + * expression. + * + * @param root The root element from which to evaluate the XPath. + * @param xpath The XPath expression pointing to the element whose value + * to return. + * @param def The default value to return, if no element can be found using + * the given xpath. + * @return The element value, if it can be located using the + * xpath. Otherwise, def is returned. + */ + public static String getElementValue( + Element root, + String xpath, + String def) { + + Element elem = (Element) XPathUtils.selectSingleNode(root, xpath); + return elem != null ? DOMUtils.getText(elem) : def; + } + + /** + * Return the value of a DOM attribute whose location is given by an XPath + * expression. + * + * @param root The root element from which to evaluate the XPath. + * @param xpath The XPath expression pointing to the attribute whose value to + * return. + * @param def The default value to return, if no attribute can be found using + * the given xpath. + * @return The element value, if it can be located using the + * xpath. Otherwise, def is returned. + */ + public static String getAttributeValue( + Element root, + String xpath, + String def) { + + Attr attr = (Attr) XPathUtils.selectSingleNode(root, xpath); + return attr != null ? attr.getValue() : def; + } + + /** + * Returns the namespace prefix used within XPathUtils for referring to + * the namespace of the specified (Security Layer command) element. + * + * This namespace prefix can be used in various XPath expression evaluation methods + * within XPathUtils without explicitely binding it to the particular + * namespace. + * + * @param contextElement The (Security Layer command) element. + * + * @return the namespace prefix used within XPathUtils for referring to + * the namespace of the specified (Security Layer command) element. + * + * throws XpathException If the specified element has a namespace other than the ones + * known by this implementation as valid Security Layer namespaces (cf. + * @link Constants#SL10_NS_URI, @link Constants#SL11_NS_URI, @link Constants#SL12_NS_URI). + */ + public static String getSlPrefix (Element contextElement) throws XPathException + { + String sLNamespace = contextElement.getNamespaceURI(); + String sLPrefix = null; + + if (sLNamespace.equals(Constants.SL10_NS_URI)) + { + sLPrefix = Constants.SL10_PREFIX; + } + else if (sLNamespace.equals(Constants.SL12_NS_URI)) + { + sLPrefix = Constants.SL12_PREFIX; + } + else if (sLNamespace.equals(Constants.SL11_NS_URI)) + { + sLPrefix = Constants.SL11_PREFIX; + } + else + { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { "Ungültiger Security Layer Namespace: \"" + sLNamespace + "\"."}); + throw new XPathException(message, null); + } + + return sLPrefix; + } + + + /** + * Return the SecurityLayer namespace prefix of the context element. + * If the context element is not the element that lies within the + * SecurityLayer namespace. The Securitylayer namespace is derived from + * the xmlns:sl10, sl11 or sl + * attribute of the context element. + * + * The returned prefix is needed for evaluating XPATH expressions. + * + * @param contextElement The element to get a prefix for the Securitylayer namespace, + * that is used within the corresponding document. + * + * @return The string sl10, sl11 or sl, + * depending on the SecurityLayer namespace of the contextElement. + * + * throws XPathException If no (vlalid) SecurityLayer namespace prefix or namespace + * is defined. + */ + public static String getSlPrefixFromNoRoot (Element contextElement) throws XPathException { + + String slPrefix = checkSLnsDeclaration(contextElement, Constants.SL10_PREFIX, Constants.SL10_NS_URI); + if (slPrefix == null) { + slPrefix = checkSLnsDeclaration(contextElement, Constants.SL11_PREFIX, Constants.SL11_NS_URI); + } + if (slPrefix == null) { + slPrefix = checkSLnsDeclaration(contextElement, Constants.SL12_PREFIX, Constants.SL12_NS_URI); + } + + return slPrefix; + + } + + /** + * Checks if the context element has an attribute xmlns:slPrefix and + * if the prefix of that attribute corresponds with a valid SecurityLayer namespace. + * + * @param contextElement The element to be checked. + * @param slPrefix The prefix which should be checked. Must be a valid SecurityLayer + * namespace prefix. + * @param slNameSpace The SecurityLayer namespace that corresponds to the specified prefix. + * + * @return The valid SecurityLayer prefix or null if this prefix is + * not used. + * @throws XPathException + */ + private static String checkSLnsDeclaration(Element contextElement, String slPrefix, String slNameSpace) + throws XPathException + { + String nsAtt = "xmlns:" + slPrefix; + String nameSpace = contextElement.getAttribute(nsAtt); + if (nameSpace == "") { + return null; + } else { + // check if namespace is correct + if (nameSpace.equals(slNameSpace)) { + return slPrefix; + } else { + MessageProvider msg = MessageProvider.getInstance(); + String message = msg.getMessage("xpath.00", new Object[] { "Ungültiger SecurityLayer Namespace: \"" + nameSpace + "\"."}); + throw new XPathException(message, null); + } + } + } + +} diff --git a/common/src/test/at/gv/egovernment/moa/AllTests.java b/common/src/test/at/gv/egovernment/moa/AllTests.java deleted file mode 100644 index 00e2c505f..000000000 --- a/common/src/test/at/gv/egovernment/moa/AllTests.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.at.gv.egovernment.moa; - -import test.at.gv.egovernment.moa.util.DOMUtilsTest; -import test.at.gv.egovernment.moa.util.DateTimeUtilsTest; -import test.at.gv.egovernment.moa.util.KeyStoreUtilsTest; -import test.at.gv.egovernment.moa.util.SSLUtilsTest; -import test.at.gv.egovernment.moa.util.XPathUtilsTest; - -import junit.awtui.TestRunner; -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author patrick - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(DOMUtilsTest.class); - suite.addTestSuite(DateTimeUtilsTest.class); - suite.addTestSuite(XPathUtilsTest.class); - suite.addTestSuite(KeyStoreUtilsTest.class); - suite.addTestSuite(SSLUtilsTest.class); - - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/common/src/test/at/gv/egovernment/moa/MOATestCase.java b/common/src/test/at/gv/egovernment/moa/MOATestCase.java deleted file mode 100644 index 86ea2ee6c..000000000 --- a/common/src/test/at/gv/egovernment/moa/MOATestCase.java +++ /dev/null @@ -1,75 +0,0 @@ -package test.at.gv.egovernment.moa; - -import java.io.FileInputStream; -import java.io.StringReader; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; - -import org.xml.sax.InputSource; - -import junit.framework.TestCase; - -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * Base class for MOA test cases. - * - * Provides some utility functions. - * - * @author Patrick Peck - * @version $Id$ - */ -public class MOATestCase extends TestCase { - - protected static final String TESTDATA_ROOT = "data/test/"; - - /** - * Constructor for MOATestCase. - * @param arg0 - */ - public MOATestCase(String name) { - super(name); - } - - /** - * Parse an XML file non-validating. - */ - public static Document parseXml(String fileName) throws Exception { - return DOMUtils.parseDocument( - new FileInputStream(fileName), - false, - null, - null); - } - - /** - * Parse an XML validating with a given file name. - * - * Uses the local schema resources. - */ - public static Document parseXmlValidating(String fileName) throws Exception { - return DOMUtils.parseDocument( - new FileInputStream(fileName), - true, - Constants.ALL_SCHEMA_LOCATIONS, - null); - } - - /** - * Parse an XML from a String. - */ - public static Document parseXmlString(String xml) throws Exception { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; - - factory.setNamespaceAware(true); - builder = factory.newDocumentBuilder(); - - return builder.parse(new InputSource(new StringReader(xml))); - } - -} diff --git a/common/src/test/at/gv/egovernment/moa/util/DOMUtilsTest.java b/common/src/test/at/gv/egovernment/moa/util/DOMUtilsTest.java deleted file mode 100644 index eb3ad1a5c..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/DOMUtilsTest.java +++ /dev/null @@ -1,137 +0,0 @@ -package test.at.gv.egovernment.moa.util; -import java.io.FileInputStream; -import java.util.Map; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import test.at.gv.egovernment.moa.*; - -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * @author Patrick Peck - * @version $Id$ - */ -public class DOMUtilsTest extends MOATestCase { - private static final String TESTDATA_BASE = TESTDATA_ROOT + "xml/"; - private static boolean grammarsInitialized = false; - - /** - * Constructor for DOMUtilsTest. - * @param name - */ - public DOMUtilsTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - if (!grammarsInitialized) { - // preparse XML schema - DOMUtils.addSchemaToPool( - getClass().getResourceAsStream(Constants.XML_SCHEMA_LOCATION), - Constants.XML_NS_URI); - // preparse XMLDsig Filter2 schema - DOMUtils.addSchemaToPool( - getClass().getResourceAsStream(Constants.DSIG_FILTER2_SCHEMA_LOCATION), - Constants.DSIG_FILTER2_NS_URI); - // preparse XMLDsig schema - DOMUtils.addSchemaToPool( - getClass().getResourceAsStream(Constants.DSIG_SCHEMA_LOCATION), - Constants.DSIG_NS_URI); - // preparse MOA schema - DOMUtils.addSchemaToPool( - getClass().getResourceAsStream(Constants.MOA_SCHEMA_LOCATION), - Constants.MOA_NS_URI); - grammarsInitialized = true; - } - } - - private Document parse(String fileName) throws Exception { - return DOMUtils.parseDocument( - new FileInputStream(fileName), - true, - Constants.ALL_SCHEMA_LOCATIONS, - null); - } - - public void testParseCreateXMLSignature() throws Exception { - parse(TESTDATA_BASE + "CreateXMLSignature/TestGeneratorCX2.005.Req.xml"); - parse(TESTDATA_BASE + "CreateXMLSignature/Req000.xml"); - parse(TESTDATA_BASE + "CreateXMLSignature/Req001.xml"); - parse(TESTDATA_BASE + "CreateXMLSignature/Req002.xml"); - parse(TESTDATA_BASE + "CreateXMLSignature/Req004.xml"); - } - - public void testParseVerifyCMSSignature() throws Exception { - parse(TESTDATA_BASE + "VerifyCMSSignature/Req000.xml"); - } - - public void testParseVerifyXMLSignature() throws Exception { - parse(TESTDATA_BASE + "VerifyXMLSignature/Req000.xml"); - parse(TESTDATA_BASE + "VerifyXMLSignature/Req001.xml"); - parse(TESTDATA_BASE + "VerifyXMLSignature/Req002.xml"); - parse(TESTDATA_BASE + "VerifyXMLSignature/TestGeneratorVX.002.Req.xml"); - //parse(TESTDATA_BASE + "VerifyXMLSignature/TestGeneratorVX.006.Req.xml"); - parse(TESTDATA_BASE + "VerifyXMLSignature/VerifySAMLRequest.xml"); - } - - public void testParseInfobox() throws Exception { - parse(TESTDATA_BASE + "Infobox/InfoboxReadResponseMOA4.xml"); - parse(TESTDATA_BASE + "Infobox/InfoboxReadResponse.xml"); - } - - - private Document parsePlain(String fileName) throws Exception { - return DOMUtils.parseDocument( - new FileInputStream(fileName), - false, - null, - null); - } - - public void testValidateCreateXMLSignature() throws Exception { - Document doc; - boolean valid; - - // test a valid request - doc = parsePlain(TESTDATA_BASE + "CreateXMLSignature/Req000.xml"); - valid = - DOMUtils.validateElement( - doc.getDocumentElement(), - Constants.ALL_SCHEMA_LOCATIONS, - null); - assertTrue(valid); - - // test an invalid request - doc = parsePlain(TESTDATA_BASE + "CreateXMLSignature/invalid.xml"); - try { - valid = - DOMUtils.validateElement( - doc.getDocumentElement(), - Constants.ALL_SCHEMA_LOCATIONS, - null); - fail(); - } catch (Exception e) { - } - } - - public void testGetNamespaceDeclarations() throws Exception { - Document doc; - NodeList nl; - Element elem; - Map nsDecls; - - doc = parse(TESTDATA_BASE + "VerifyXMLSignature/Req002.xml"); - nl = doc.getElementsByTagNameNS(Constants.DSIG_NS_URI, "Reference"); - elem = (Element) nl.item(0); - nsDecls = DOMUtils.getNamespaceDeclarations(elem); - - assertEquals(2, nsDecls.size()); - assertEquals(Constants.DSIG_NS_URI, nsDecls.get("dsig")); - assertEquals(Constants.MOA_NS_URI, nsDecls.get("")); - } - -} diff --git a/common/src/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java b/common/src/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java deleted file mode 100644 index da6b29b1c..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package test.at.gv.egovernment.moa.util; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import junit.framework.TestCase; - -import at.gv.egovernment.moa.util.DateTimeUtils; - -/** - * @author Patrick Peck - * @version $Id$ - */ -public class DateTimeUtilsTest extends TestCase { - - /** - * Constructor for DateTimeUtilsTest. - * @param arg0 - */ - public DateTimeUtilsTest(String arg0) { - super(arg0); - } - - public void testParseDateTimeValid() throws Exception { - Date date; - DateFormat format = SimpleDateFormat.getDateTimeInstance(); - String dateStr; - - format.setTimeZone(TimeZone.getTimeZone("GMT")); - date = DateTimeUtils.parseDateTime("+1971-12-12T06:30:15"); - date.setTime(date.getTime() + TimeZone.getDefault().getRawOffset()); - dateStr = format.format(date); - assertEquals("12.12.1971 06:30:15", dateStr); - - date = DateTimeUtils.parseDateTime("2000-01-01T23:59:59.012Z"); - dateStr = format.format(date); - assertEquals("01.01.2000 23:59:59", dateStr); - - date = DateTimeUtils.parseDateTime("2003-05-20T12:17:30-05:00"); - dateStr = format.format(date); - assertEquals("20.05.2003 17:17:30", dateStr); - - - date = DateTimeUtils.parseDateTime("2002-02-02T02:02:02.33+04:30"); - dateStr = format.format(date); - assertEquals("01.02.2002 21:32:02", dateStr); - } - - public void testParseDateTimeInvalid() { - try { - DateTimeUtils.parseDateTime("+1971-12-12T6:30:15"); - fail(); - } catch (ParseException e) { - } - - try { - DateTimeUtils.parseDateTime("2000-01-0123:59:59.999999Z"); - fail(); - } catch (ParseException e) { - } - - try { - DateTimeUtils.parseDateTime("2003-05-20T12:17:3005:00"); - fail(); - } catch (ParseException e) { - } - - try { - DateTimeUtils.parseDateTime(" 2002-02-02T02:02:02.33+04:00"); - fail(); - } catch (ParseException e) { - } - - } - - public void testBuildDateTimeGMTMinus3() { - String should = "2002-01-01T01:01:01-03:00"; - doTestBuildDateTime(2002, 1, 1, 1, 1, 1, "GMT-03:00", should); - } - public void testBuildDateTimeMEZSommerzeit() { - String should = "2002-07-31T23:59:59+02:00"; - doTestBuildDateTime(2002, 7, 31, 23, 59, 59, "GMT+01:00", should); - } - public void testBuildDateTimeGMT() { - String should = "2002-01-01T01:01:01"; - doTestBuildDateTime(2002, 1, 1, 1, 1, 1, "GMT+00:00", should); - } - private void doTestBuildDateTime( - int year, int month, int day, - int hour, int min, int sec, - String timeZone, String dateTimeShould) { - - Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(timeZone)); - cal.set(year,month, day, hour, min, sec); - cal.set(Calendar.MILLISECOND, 0); - String dateTimeBuilt = DateTimeUtils.buildDateTime(cal); - assertEquals(dateTimeShould, dateTimeBuilt); - } - -} diff --git a/common/src/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java b/common/src/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java deleted file mode 100644 index a6d1847ce..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/KeyStoreUtilsTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package test.at.gv.egovernment.moa.util; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.math.BigInteger; -import java.security.KeyStore; -import java.security.Security; -import java.security.cert.X509Certificate; -import java.util.Enumeration; - -import at.gv.egovernment.moa.util.KeyStoreUtils; - -import junit.framework.TestCase; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class KeyStoreUtilsTest extends TestCase { - private String tmpDir = "tmp/KeyStoreUtilsTest"; - private String tmpDirURL = "file:" + tmpDir; - - public KeyStoreUtilsTest(String arg0) { - super(arg0); - } - - protected void setUp() throws Exception { - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - new File(tmpDir).mkdirs(); - } - protected void tearDown() throws Exception { - new File(tmpDir).delete(); - } - public void testCreateKeyStoreJKS() throws Exception { - String[] certFilenames = new String[] { - "data/test/security/server-certs/baltimore.cer" - }; - KeyStore ks = KeyStoreUtils.createKeyStore("jks", certFilenames); - assertEquals(1, ks.size()); - X509Certificate cert = (X509Certificate)ks.getCertificate("0"); - assertEquals(3424, cert.getSerialNumber().intValue()); - } - public void testCreateKeyStorePKCS12() throws Exception { - String[] certFilenames = new String[] { - "data/test/security/server-certs/baltimore.cer" - }; - KeyStore ks = KeyStoreUtils.createKeyStore("pkcs12", certFilenames); - assertEquals(1, ks.size()); - X509Certificate cert = (X509Certificate)ks.getCertificate("0"); - assertEquals(3424, cert.getSerialNumber().intValue()); - } - public void testCreateKeyStoreFromCertificateDirectory() throws Exception { - // copy certificate files to a temporary directory, - // omitting the "CVS" directory in the source directory - copyCertificates("data/test/security/server-certs", tmpDir); - KeyStore ks = KeyStoreUtils.createKeyStoreFromCertificateDirectory("jks", tmpDirURL); - assertEquals(2, ks.size()); - X509Certificate cert0 = (X509Certificate)ks.getCertificate("0"); - X509Certificate cert1 = (X509Certificate)ks.getCertificate("1"); - assertTrue(3424 == cert0.getSerialNumber().intValue() || 3424 == cert1.getSerialNumber().intValue()); - } - private void copyCertificates(String from, String to) throws IOException { - String[] fromList = new File(from).list(); - for (int i = 0; i < fromList.length; i++) { - File fromFile = new File(from + File.separator + fromList[i]); - if (fromFile.isFile()) { - String toFile = to + "/" + fromList[i]; - FileInputStream in = new FileInputStream(fromFile); - FileOutputStream out = new FileOutputStream(toFile); - for (int ch = in.read(); ch >= 0; ch = in.read()) - out.write(ch); - out.close(); - in.close(); - } - } - - } - public void testLoadKeyStore() throws Exception { - String keyStoreURL = "file:data/test/security/client-certs/sicher-demo(buergerkarte).p12"; - KeyStore ks = KeyStoreUtils.loadKeyStore("pkcs12", keyStoreURL, "buergerkarte"); - assertEquals(1, ks.size()); - Enumeration aliases = ks.aliases(); - String alias = (String)aliases.nextElement(); - X509Certificate cert = (X509Certificate)ks.getCertificate(alias); - assertEquals(new BigInteger("1044289238331").intValue(), cert.getSerialNumber().intValue()); - } - -} diff --git a/common/src/test/at/gv/egovernment/moa/util/SSLUtilsTest.java b/common/src/test/at/gv/egovernment/moa/util/SSLUtilsTest.java deleted file mode 100644 index 7e55cb7d0..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/SSLUtilsTest.java +++ /dev/null @@ -1,160 +0,0 @@ -package test.at.gv.egovernment.moa.util; - -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URL; -import java.security.KeyStore; -import java.security.Security; - -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLSocketFactory; - -import com.sun.net.ssl.HostnameVerifier; -import com.sun.net.ssl.HttpsURLConnection; - -import at.gv.egovernment.moa.util.KeyStoreUtils; -import at.gv.egovernment.moa.util.SSLUtils; - -import junit.framework.TestCase; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class SSLUtilsTest extends TestCase { - - public SSLUtilsTest(String arg0) { - super(arg0); - } - - - protected void setUp() throws Exception { - //System.setProperty("javax.net.debug", "all"); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - System.setProperty("https.cipherSuites", "SSL_DHE_DSS_WITH_DES_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,SSL_RSA_WITH_DES_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_EXPORT_WITH_RC4_40_MD5"); - } - - public void testGetSSLSocketFactoryBaltimoreOK() throws Exception { - doTestGetSSLSocketFactory( - "GET", - "https://www.baltimore.com/", - false, - "file:data/test/security/cacerts+gt_cybertrust_root", - "changeit", - true); - } - public void testGetSSLSocketFactoryBaltimoreNOK() throws Exception { - doTestGetSSLSocketFactory( - "GET", - "https://www.baltimore.com/", - false, - "file:data/test/security/cacerts", - "changeit", - false); - } - public void testGetSSLSocketFactoryVerisignOK() throws Exception { - doTestGetSSLSocketFactory( - "GET", - "https://www.verisign.com/", - false, - "file:data/test/security/cacerts", - "changeit", - true); - } - public void testGetSSLSocketFactoryVerisignNoTruststoreOK() throws Exception { - doTestGetSSLSocketFactory( - "GET", - "https://www.verisign.com/", - false, - null, - null, - true); - } - public void testGetSSLSocketFactoryLocalhostOK() throws Exception { - String urlString = "https://localhost:8443/moa-id-auth/index.jsp"; - doTestGetSSLSocketFactory( - "GET", - urlString, - true, - "file:data/test/security/server.keystore.tomcat", - "changeit", - true); - } - public void testGetSSLSocketFactoryLocalhostNOK() throws Exception { - String urlString = "https://localhost:8443/moa-id-auth/index.jsp"; - doTestGetSSLSocketFactory( - "GET", - urlString, - true, - null, - null, - false); - } - - public void doTestGetSSLSocketFactory( - String requestMethod, - String urlString, - boolean useHostnameVerifierHack, - String truststoreurl, - String trustpassword, - boolean shouldOk - ) throws Exception { - - doTestGetSSLSocketFactory( - requestMethod, urlString, useHostnameVerifierHack, truststoreurl, trustpassword, null, null, null, shouldOk); - } - public void doTestGetSSLSocketFactory( - String requestMethod, - String urlString, - boolean useHostnameVerifierHack, - String truststoreurl, - String trustpassword, - String keystoretype, - String keystoreurl, - String keypassword, - boolean shouldOk - ) throws Exception { - - KeyStore truststore = null; - if (truststoreurl != null) - truststore = KeyStoreUtils.loadKeyStore("jks", truststoreurl, trustpassword); - SSLSocketFactory sf = SSLUtils.getSSLSocketFactory( - truststore, keystoretype, keystoreurl, keypassword); - System.out.println(requestMethod + " " + urlString); - - URL url = new URL(urlString); - HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); - conn.setRequestMethod(requestMethod); - conn.setDoInput(true); - conn.setDoOutput(true); - conn.setUseCaches(false); - conn.setAllowUserInteraction(false); - conn.setSSLSocketFactory(sf); - if (useHostnameVerifierHack) - conn.setHostnameVerifier(new HostnameVerifierHack()); - try { - conn.connect(); - assertTrue(shouldOk); - assertEquals(200, conn.getResponseCode()); - conn.disconnect(); - } - catch (SSLException ex) { - assertFalse(shouldOk); - } - } - private byte[] readTruststore(String filename) throws IOException { - if (filename == null) - return null; - FileInputStream in = new FileInputStream(filename); - byte[] buffer = new byte[in.available()]; - in.read(buffer); - in.close(); - return buffer; - } - private class HostnameVerifierHack implements HostnameVerifier { - public boolean verify(String arg0, String arg1) { - return true; - } - } -} diff --git a/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java b/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java deleted file mode 100644 index b6ea0e152..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/URLDecoderTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.at.gv.egovernment.moa.util; - -import java.net.URLEncoder; - -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.URLDecoder; - -import junit.framework.TestCase; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class URLDecoderTest extends TestCase { - - public void test() throws Exception { - String s = "immerZUA0129<>%==$$%&/()@?{()=} \\\"äöüÄÖÜ?§"; - String senc = URLEncoder.encode(s); - String sdec = URLDecoder.decode(senc, "ISO-8859-1"); - assertEquals(s, sdec); - } - public void testUTF8() throws Exception { - String s = new String(FileUtils.readFile("data/test/xml/CreateXMLSignature/CreateXMLSignatureResponse.xml")); - String senc = URLEncoder.encode(s); - String sdec = URLDecoder.decode(senc, "UTF-8"); - String sutf8 = FileUtils.readFile("data/test/xml/CreateXMLSignature/CreateXMLSignatureResponse.xml", "UTF-8"); - assertEquals(sutf8, sdec); - } -} diff --git a/common/src/test/at/gv/egovernment/moa/util/URLEncoderTest.java b/common/src/test/at/gv/egovernment/moa/util/URLEncoderTest.java deleted file mode 100644 index 43238c51f..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/URLEncoderTest.java +++ /dev/null @@ -1,43 +0,0 @@ -package test.at.gv.egovernment.moa.util; - -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.URLDecoder; -import at.gv.egovernment.moa.util.URLEncoder; -import junit.framework.TestCase; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class URLEncoderTest extends TestCase { - - public void testUnchangedString() throws Exception { - String s = "AZaz0123456789.-*_"; - String senc = URLEncoder.encode(s, "UTF-8"); - assertEquals(s, senc); - } - public void testAumlUTF8() throws Exception { - String s = "ä"; - String senc = URLEncoder.encode(s, "UTF-8"); - assertEquals("%C3%A4", senc); - } - public void testEncodeDecode() throws Exception { - String s = "AZaz09.-*_ <>%=$%&/()@?{}[]\\\"'äöüÄÖÜߧ"; - String senc = URLEncoder.encode(s, "UTF-8"); - String sdec = URLDecoder.decode(senc, "UTF-8"); - assertEquals(s, sdec); - } - public void testCertInfo() throws Exception { - String s = new String(FileUtils.readFile("data/test/xml/VerifyXMLSignature/CertInfoVerifyXMLSignatureRequest.xml", "UTF-8")); - String senc = URLEncoder.encode(s, "UTF-8"); - String sdec = URLDecoder.decode(senc, "UTF-8"); - assertEquals(s, sdec); - } - /*public void testJDK14() throws Exception { - String s = new String(FileUtils.readFile("data/test/xml/VerifyXMLSignature/CertInfoVerifyXMLSignatureRequest.xml", "UTF-8")); - String senc = URLEncoder.encode(s, "UTF-8"); - String senc14 = java.net.URLEncoder.encode(s, "UTF-8"); - assertEquals(senc, senc14); - }*/ - -} diff --git a/common/src/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java b/common/src/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java deleted file mode 100644 index 7986fe540..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/XMLGrammarBuilderTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package test.at.gv.egovernment.moa.util; -import java.io.FileInputStream; -import java.io.InputStream; - -import org.apache.xerces.parsers.DOMParser; -import org.apache.xerces.parsers.XMLGrammarPreparser; -import org.apache.xerces.util.SymbolTable; -import org.apache.xerces.util.XMLGrammarPoolImpl; -import org.apache.xerces.xni.grammars.Grammar; -import org.apache.xerces.xni.grammars.XMLGrammarDescription; -import org.apache.xerces.xni.parser.XMLInputSource; -import org.xml.sax.InputSource; - -import test.at.gv.egovernment.moa.MOATestCase; - -import at.gv.egovernment.moa.util.Constants; - - -/** - * Experimentation with Xerces grammar caching. - * - * Used the Xerces sample 'XMLGrammarBuilder' as a starting point. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLGrammarBuilderTest extends MOATestCase { - - private static final String GRAMMAR_POOL = - org.apache.xerces.impl.Constants.XERCES_PROPERTY_PREFIX - + org.apache.xerces.impl.Constants.XMLGRAMMAR_POOL_PROPERTY; - - protected static final String NAMESPACES_FEATURE_ID = - "http://xml.org/sax/features/namespaces"; - protected static final String VALIDATION_FEATURE_ID = - "http://xml.org/sax/features/validation"; - protected static final String SCHEMA_VALIDATION_FEATURE_ID = - "http://apache.org/xml/features/validation/schema"; - protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = - "http://apache.org/xml/features/validation/schema-full-checking"; - - private static final int BIG_PRIME = 2039; - private SymbolTable symbolTable; - private XMLGrammarPoolImpl grammarPool; - - /** - * Constructor for XMLGrammarBuilderTest. - * @param name - */ - public XMLGrammarBuilderTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - XMLGrammarPreparser preparser; - - // set up symbol table and grammar pool - symbolTable = new SymbolTable(BIG_PRIME); - grammarPool = new XMLGrammarPoolImpl(); - preparser = new XMLGrammarPreparser(symbolTable); - preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null); - preparser.setProperty(GRAMMAR_POOL, grammarPool); - preparser.setFeature(NAMESPACES_FEATURE_ID, true); - preparser.setFeature(VALIDATION_FEATURE_ID, true); - // now we can still do schema features just in case, - // so long as it's our configuraiton...... - preparser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true); - preparseSchemaResource( - preparser, - Constants.DSIG_SCHEMA_LOCATION, - "/resources/schemas/xmldsig-core-schema.xsd"); - } - - private static Grammar preparseSchemaResource( - XMLGrammarPreparser preparser, - String systemId, - String resource) - throws Exception { - - InputStream is = XMLGrammarBuilderTest.class.getResourceAsStream(resource); - return preparser.preparseGrammar( - XMLGrammarDescription.XML_SCHEMA, - new XMLInputSource(null, systemId, null, is, null)); - } - - public void testParseValidating() throws Exception { - DOMParser parser = new DOMParser(symbolTable, grammarPool); - - parser.setFeature(NAMESPACES_FEATURE_ID, true); - parser.setFeature(VALIDATION_FEATURE_ID, true); - parser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true); - - parser.parse( - new InputSource( - new FileInputStream(TESTDATA_ROOT + "xml/dsigTransform/base64.xml"))); - parser.getDocument(); - } - -} diff --git a/common/src/test/at/gv/egovernment/moa/util/XPathUtilsTest.java b/common/src/test/at/gv/egovernment/moa/util/XPathUtilsTest.java deleted file mode 100644 index 559494300..000000000 --- a/common/src/test/at/gv/egovernment/moa/util/XPathUtilsTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package test.at.gv.egovernment.moa.util; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; - -import test.at.gv.egovernment.moa.MOATestCase; - -import at.gv.egovernment.moa.util.XPathUtils; - - -/** - * @author Patrick Peck - * @version $Id$ - */ -public class XPathUtilsTest extends MOATestCase { - - private Document doc1; - - /** - * Constructor for XPathUtilsTest. - * @param name - */ - public XPathUtilsTest(String name) { - super(name); - } - - /** - * @see TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - doc1 = - parseXml(TESTDATA_ROOT + "xml/VerifyXMLSignature/Req000.xml"); - } - - public void testSelectNodeList() throws Exception { - NodeList nodes; - - nodes = - XPathUtils.selectNodeList( - doc1.getDocumentElement(), - doc1.getDocumentElement(), - "/VerifyXMLSignatureRequest"); - assertEquals(1, nodes.getLength()); - nodes = - XPathUtils.selectNodeList( - doc1.getDocumentElement(), - "//dsig:Signature"); - assertEquals(1, nodes.getLength()); - } - -} diff --git a/id.oa/.classpath b/id.oa/.classpath deleted file mode 100644 index 5af765a17..000000000 --- a/id.oa/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/id.oa/.cvsignore b/id.oa/.cvsignore deleted file mode 100644 index a9a5aecf4..000000000 --- a/id.oa/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -tmp diff --git a/id.oa/.project b/id.oa/.project deleted file mode 100644 index e49130a5f..000000000 --- a/id.oa/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - id.oa - - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.ibm.etools.ctc.serviceprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - com.ibm.etools.ctc.javaprojectnature - - diff --git a/id.oa/build.xml b/id.oa/build.xml deleted file mode 100644 index adb191e76..000000000 --- a/id.oa/build.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - Time (hhmm): ${TSTAMP} - - - - - - - - - - - - - - - - diff --git a/id.oa/html/auth.jsp b/id.oa/html/auth.jsp deleted file mode 100644 index 0b563a83e..000000000 --- a/id.oa/html/auth.jsp +++ /dev/null @@ -1,48 +0,0 @@ - - -MOA ID Auth Sample Login - - -<% /** assumes moa-id-auth and oa in the same servlet container, - and moa-id-proxy on a different fixed location */ - String authUrlPath = - request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + "/moa-id-auth/"; - String proxyUrlPath = "http://10.16.126.28:9080/moa-id-proxy/"; - String oaUrlPath = - request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + "/oa/"; - String params = - "Target=gb&" + - "OA=" + proxyUrlPath + "index.jsp"; - String urlStartAuth = - authUrlPath + - "StartAuthentication?" + - params; - String templateParam = - "&Template=" + oaUrlPath + "AuthTemplate.jsp"; - String urlStartAuthCustom = - urlStartAuth + - templateParam; - String urlSelectBKU = - authUrlPath + - "SelectBKU?" + - params; - String urlSelectBKUCustom = - urlSelectBKU + - templateParam + - "&BKUSelectionTemplate=" + oaUrlPath + "BKUSelectionTemplate.jsp"; -%> -Log in to sample application -
-Log in to sample application using custom form -
-Choose BKU (HTMLComplete or HTMLSelect) and log in -
-Choose BKU (HTMLSelect) using custom form and log in -
-">Wrong parameters example - - \ No newline at end of file diff --git a/id.oa/html/chooseBKU.jsp b/id.oa/html/chooseBKU.jsp deleted file mode 100644 index 0135b6fdf..000000000 --- a/id.oa/html/chooseBKU.jsp +++ /dev/null @@ -1,19 +0,0 @@ - - -BKU Auswahl - - -

BKU Auswahl

-

-

"> - - -
-

- - \ No newline at end of file diff --git a/id.oa/html/form.jsp b/id.oa/html/form.jsp deleted file mode 100644 index d439fa84d..000000000 --- a/id.oa/html/form.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%@ page import="java.util.*" %> - - -Sample Online Application - - -

Sample Form

-

-

-<% String param1 = request.getParameter("param1"); - if (param1 == null) param1 = ""; %> -Input some text: - -
Previous text input: <%=param1%>
- -
-

-

Back

- - \ No newline at end of file diff --git a/id.oa/html/getBKUSelectTag.jsp b/id.oa/html/getBKUSelectTag.jsp deleted file mode 100644 index 028dbd348..000000000 --- a/id.oa/html/getBKUSelectTag.jsp +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/id.oa/html/index.jsp b/id.oa/html/index.jsp deleted file mode 100644 index 35e49d743..000000000 --- a/id.oa/html/index.jsp +++ /dev/null @@ -1,60 +0,0 @@ -<%@ page import="java.util.*,javax.servlet.http.*,sun.misc.BASE64Decoder" %> - - -Sample Online Application - - -

Sample Online Application

- -

Request headers: - - <% - /* collect parameters from request */ - for (Enumeration headers = request.getHeaderNames(); headers.hasMoreElements(); ) { - String key = (String) headers.nextElement(); - String value = request.getHeader(key); %> - - <% } %> -
<%=key%><%=value%>
-

- -<% String query=request.getQueryString(); %> -

QueryString: "<%=query%>" -

- -

Request parameters: - - <% - /* collect parameters from request */ - for (Enumeration params = request.getParameterNames(); params.hasMoreElements(); ) { - String name = (String) params.nextElement(); - String value = request.getParameter(name); %> - - <% } %> -
<%=name%><%=value%>
-

- -

Cookies: - - <% - /* collect attributes from request */ - Cookie[] cookies = request.getCookies(); - if (cookies != null) { - for (int i = 0; i < cookies.length; i++) { - Cookie cookie = cookies[i]; %> - - <% } - } %> -
<%=cookie.getName()%><%=cookie.getValue()%>
-

- -<% String authHeader = request.getHeader("Authorization"); - if (authHeader != null) { - authHeader = authHeader.substring(authHeader.indexOf(" ")+1); - String decAuthHeader = new String(new BASE64Decoder().decodeBuffer(authHeader)); -%> -

Basic authentication credentials: <%=decAuthHeader%>

-<% } %> -

Form sample

- - \ No newline at end of file diff --git a/id.oa/html/stateful_login.jsp b/id.oa/html/stateful_login.jsp deleted file mode 100644 index eaede507f..000000000 --- a/id.oa/html/stateful_login.jsp +++ /dev/null @@ -1,29 +0,0 @@ -<%@ page import="javax.servlet.http.*" %> -<% - /* check request's remote IP address - must be moa-id-proxy's address */ - String remoteIPAddress = request.getRemoteAddr(); - if (! "127.0.0.1".equals(remoteIPAddress)) { /* Substitute "127.0.0.1" for moa-id-proxy's IP address */ - response.setStatus(403); - return; - } - - /* store authentication data in cookies */ - String fn = request.getParameter("FamilyName"); - String gn = request.getParameter("GivenName"); - /* set cookie domain and cookie path ! */ - String cookieDomain = ".test.test"; /* Set this to the common domain of moa-id-proxy and of the online application */ - String cookiePath = request.getContextPath(); /* Set this to the context path of the online application */ - - Cookie cfn = new Cookie("familyname", fn); - cfn.setDomain(cookieDomain); - cfn.setPath(cookiePath); - response.addCookie(cfn); - - Cookie cgn = new Cookie("givenname", gn); - cgn.setDomain(cookieDomain); - cgn.setPath(cookiePath); - response.addCookie(cgn); - - /* redirect to online application's start page */ - response.sendRedirect("http://oa.test.test:8080/oa/index.jsp"); /* Substitute for URL in online application */ -%> diff --git a/id.oa/web.xml b/id.oa/web.xml deleted file mode 100644 index 13158fdaa..000000000 --- a/id.oa/web.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - Sample OA - MOA Sample OA - - diff --git a/id.server/data/deploy/conf/Catalina/localhost/proxy.xml b/id.server/data/deploy/conf/Catalina/localhost/proxy.xml deleted file mode 100644 index eef60b953..000000000 --- a/id.server/data/deploy/conf/Catalina/localhost/proxy.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/MOAIdentities.xsd b/id.server/data/deploy/conf/moa-id/MOAIdentities.xsd deleted file mode 100644 index 91c7a6cc0..000000000 --- a/id.server/data/deploy/conf/moa-id/MOAIdentities.xsd +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - MOAIdentities provides a mapping from identities to parameters used in the XMLLoginParameterResolver of MOA-ID - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleIdentities.xml b/id.server/data/deploy/conf/moa-id/SampleIdentities.xml deleted file mode 100644 index fc6dc2ccf..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleIdentities.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - 1 - - - - - - - 1 - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml b/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml deleted file mode 100644 index f8dbd4b13..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindung - - - - MOAIDBuergerkarteAuthentisierungsDaten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - - - - - - - - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml b/id.server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml deleted file mode 100644 index 51d62bd72..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindung - - - - MOAIDBuergerkarteAuthentisierungsDaten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - - - - - - - - - - - - - - - - - - - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml b/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml deleted file mode 100644 index 8a9898792..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindungMitTestkarten - - - - - MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT - - - - - - - - - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml b/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml deleted file mode 100644 index b859fe758..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindungMitTestkarten - - - - - MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT - - - - - - - - - - - - - - - - - - - - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml b/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml deleted file mode 100644 index e5b49bbe1..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindung - - - - MOAIDBuergerkarteAuthentisierungsDaten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - - - - - - - - - - - - 468924i - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml b/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml deleted file mode 100644 index 4e7a8ae54..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindung - - - - MOAIDBuergerkarteAuthentisierungsDaten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - - - - - - - - - - - - - - - - - - - - - - - - 468924i - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml b/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml deleted file mode 100644 index 1d5c410ec..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindungMitTestkarten - - - - - MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT - - - - - - - - - - - - - 468924i - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml b/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml deleted file mode 100644 index 2afa97e77..000000000 --- a/id.server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindungMitTestkarten - - - - - MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten - - - MOAIDTransformAuthBlockText - MOAIDTransformAuthBlockText_deprecated - - - - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT - - - - - - - - - - - - - - - - - - - - - - - - - 468924i - - Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/log4j.properties b/id.server/data/deploy/conf/moa-id/log4j.properties deleted file mode 100644 index debdb146c..000000000 --- a/id.server/data/deploy/conf/moa-id/log4j.properties +++ /dev/null @@ -1,25 +0,0 @@ -# commons-logging setup -org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory - -# define log4j root loggers -log4j.rootLogger=info, stdout, R -log4j.logger.moa=info -log4j.logger.moa.spss.server=info -log4j.logger.iaik.server=info -log4j.logger.moa.id.auth=info -log4j.logger.moa.id.proxy=info - -# configure the stdout appender -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -#log4j.appender.stdout.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n -log4j.appender.stdout.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20.20c | %10t | %m%n - -# configure the rolling file appender (R) -log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=${catalina.home}/logs/moa-id.log -log4j.appender.R.MaxFileSize=10000KB -log4j.appender.R.MaxBackupIndex=1 -log4j.appender.R.layout=org.apache.log4j.PatternLayout -log4j.appender.R.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %t | %m%n - diff --git a/id.server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml b/id.server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml deleted file mode 100644 index fc99cea79..000000000 --- a/id.server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - stateless - - MOAFamilyName - MOAGivenName - - diff --git a/id.server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml b/id.server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml deleted file mode 100644 index 4d34c3646..000000000 --- a/id.server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - stateless - - -
-
-
-
diff --git a/id.server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml b/id.server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml deleted file mode 100644 index 979faca95..000000000 --- a/id.server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - stateless - - - - - - diff --git a/id.server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml b/id.server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml deleted file mode 100644 index edbfe7aa5..000000000 --- a/id.server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - stateless - - MOAFamilyName - MOAGivenName - - diff --git a/id.server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml b/id.server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml deleted file mode 100644 index 2cff3bd67..000000000 --- a/id.server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - stateless - - MOAWBPK - MOAGivenName - - diff --git a/id.server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt b/id.server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt deleted file mode 100644 index 01f724cc4..000000000 --- a/id.server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt +++ /dev/null @@ -1,21 +0,0 @@ -TEMPLATES: -========== -Zweck: ------- -Mithilfe von Templates können Sie das Aussehen der Seiten -"Auswahl der Bürgerkartenumgebung" sowie "Anmeldung mit Bürgerkarte" -anpassen. Damit können Sie zusätzliche Hintergrundinformationen (Wozu -dient die Anmeldung, etc.) zu diesen Seiten hinzufügen und das Layout an -Ihre sonstigen Anwendungen anpassen. - -Wenn Sie in den Beispielkonfigurationsdateien die Elmente -"AuthComponent/Templates" oder "OnlineApplication/AuthComponent/Templates" -aktivieren, dann werden die in diesem Verzeichnis enthaltenen Beispieltemplates -geladen. Es sind dies sehr einfache Templates, die nur das Laden über die -Konfigurationsdatei demonstrieren sollen. (Das Laden der Templates über -die Konfigurationsdatei steht erst ab Version 1.3.1 zur Verfügung). -Etwas aufwendigere Templates (mit CSS) finden Sie als eigene Webapplikation im -Verzeichnis "/auth/templates" der entpackten Distribution. - -Nähere Informationen zu den Templates finden Sie im MOA-ID-Konfigurationshandbuch. - diff --git a/id.server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html b/id.server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html deleted file mode 100644 index 2f2ea6552..000000000 --- a/id.server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -MOA ID - Auswahl der B&uuuml;rgerkartenumgebung - - - - - - - -

Auswahl der Bürgerkartenumgebung

- -

-

Sie haben sich für Anmeldung mit Ihrer Bürgerkarte entschieden. Da es verschiedene Formen der Bürgerkarte gibt, müssen Sie nun wählen, welche Sie bei der Anmeldung verwenden wollen.

-

Auswahl der Bürgerkarte

-
- - - -
-

- - - - -

Hinweise:

-
    -
  • -

    Bei der Anmeldung mit einer A-Trust Bürgerkarte oder Ihrer - E-CARD benötigen Sie - eine funktionsfähige Bürgerkartensoftware sowie einen passenden Kartenleser.

    -
  • -
  • -

    Bei der Anmeldung mit der A1-Signatur über Ihr Handy wird keine Bürgerkartensoftware und - kein Kartenleser benötigt.

    -
  • -
- -

 

- - - - diff --git a/id.server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html b/id.server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html deleted file mode 100644 index 83a6639e6..000000000 --- a/id.server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -MOA ID - Identifizierter Zugang mit Bürgerkarte - - - - - - - -

Sicherer Zugang zur Online-Anwendung mit Bürgerkarte

- -

- -Der identifizierte Zugang erfolgt über die Module für Online Applikationen (MOA) unter Verwendung einer Bürgerkarte und deren Signaturfunktion. - -

-

Wenn Sie in Folge die Schaltfläche "Anmeldung mit Bürgerkarte" -aktivieren, so werden Sie zur Signatur der Anmeldedaten aufgefordert. Wenn Sie diese -signieren, so werden Sie zur Online-Anwendung weitergeleitet und angemeldet.

- - -
-
- - - - -
-
-
- - - - -
-

- - -
- - - diff --git a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml b/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml deleted file mode 100644 index 915a6bf2f..000000000 --- a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - Signatur der Anmeldedaten - - - -

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name: - - -
- Geburtsdatum: - - .. -
- Applikation: - - -
- Geschäftsbereich: - - -
- Anmeldeserver: - - -
- Datum: - - .. -
- Uhrzeit: - - :: -
- wbPK (*): - - -
- -

-


-
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
- - application/xhtml+xml - -
diff --git a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml b/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml deleted file mode 100644 index 5089140b4..000000000 --- a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - Signatur der Anmeldedaten - - - -

Signatur der Anmeldedaten

-

-

Mit meiner elektronischen Signatur beantrage ich, - - , -geboren am -.., den Zugang zur gesicherten Anwendung.

-

-

Datum und Uhrzeit: .., :: -

- -

wbPK(*): -

-

-


-
(*) wbPK: Das wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
- - application/xhtml+xml - -
diff --git a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml b/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml deleted file mode 100644 index 07d926d14..000000000 --- a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - Signatur der Anmeldedaten - - -

Signatur der Anmeldedaten

-

-

Mit meiner elektronischen Signatur beantrage ich, , - geboren am - . - . - , - den Zugang zur gesicherten Anwendung.

-

-

Datum und Uhrzeit: - . - . - , - : - : - -

- -

wbPK(*): -

-

-


-
(*) wbPK: Das wirtschaftsbereichsspezifische - Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens - berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
- - text/html - -
diff --git a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml b/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml deleted file mode 100644 index 05f91750c..000000000 --- a/id.server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - Signatur der Anmeldedaten - - -

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name: - - -
- Geburtsdatum: - - . - . - -
- Applikation: - - -
- Geschäftsbereich: - - -
- Anmeldeserver: - - -
- Datum: - - . - . - -
- Uhrzeit: - - : - : - -
- wbPK (*): - - -
- -

-


-
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen - Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige - Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
- - text/html - -
diff --git a/id.server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml b/id.server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml deleted file mode 100644 index 008a59d8e..000000000 --- a/id.server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - true - true - - - certstore - - - - - - pkix - - - CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT - 536 - - chaining - - - - MOAIDBuergerkartePersonenbindung - trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten - - - MOAIDBuergerkarteAuthentisierungsDaten - trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten - - - MOAIDBuergerkartePersonenbindungMitTestkarten - trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten - - - MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten - trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten - - - - true - 0 - - CRL - OCSP - - - false - 365 - - - jdbc:url - fully.qualified.classname - - - - - - - MOAIDTransformAuthBlock - profiles/MOAIDTransformAuthBlock.xml - - - MOAIDTransformAuthBlock_deprecated - profiles/MOAIDTransformAuthBlock_deprecated.xml - - - MOAIDTransformAuthBlockText - profiles/MOAIDTransformAuthBlockText.xml - - - MOAIDTransformAuthBlockText_deprecated - profiles/MOAIDTransformAuthBlockText_deprecated.xml - - - diff --git a/id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 b/id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 deleted file mode 100644 index 8827ed99c..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der b/id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der deleted file mode 100644 index 332aa817a..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 b/id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 deleted file mode 100644 index 4499ab52b..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der b/id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der deleted file mode 100644 index 63ba5cce5..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 b/id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 deleted file mode 100644 index 5b7631133..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der b/id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der deleted file mode 100644 index 4f87134e7..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 b/id.server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 deleted file mode 100644 index c5a43deca..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml b/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml deleted file mode 100644 index 6ed91ddc3..000000000 --- a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - Signatur der Anmeldedaten - - - -

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name: - - -
- Geburtsdatum: - - .. -
- Applikation: - - -
- Geschäftsbereich: - - -
- Anmeldeserver: - - -
- Datum: - - .. -
- Uhrzeit: - - :: -
- wbPK (*): - - -
- -

-


-
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
-
diff --git a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml b/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml deleted file mode 100644 index b116152c8..000000000 --- a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - Signatur der Anmeldedaten - - - -

Signatur der Anmeldedaten

-

-

Mit meiner elektronischen Signatur beantrage ich, - - , -geboren am -.., den Zugang zur gesicherten Anwendung.

-

-

Datum und Uhrzeit: .., :: -

- -

wbPK(*): -

-

-


-
(*) wbPK: Das wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
-
diff --git a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml b/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml deleted file mode 100644 index 10854242e..000000000 --- a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - Signatur der Anmeldedaten - - -

Signatur der Anmeldedaten

-

-

Mit meiner elektronischen Signatur beantrage ich, , - geboren am - . - . - , - den Zugang zur gesicherten Anwendung.

-

-

Datum und Uhrzeit: - . - . - , - : - : - -

- -

wbPK(*): -

-

-


-
(*) wbPK: Das wirtschaftsbereichsspezifische - Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens - berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
-
diff --git a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml b/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml deleted file mode 100644 index 0c079da71..000000000 --- a/id.server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - Signatur der Anmeldedaten - - -

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name: - - -
- Geburtsdatum: - - . - . - -
- Applikation: - - -
- Geschäftsbereich: - - -
- Anmeldeserver: - - -
- Datum: - - . - . - -
- Uhrzeit: - - : - : - -
- wbPK (*): - - -
- -

-


-
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen - Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige - Zuordnung des Bürgers zum Wirtschaftsunternehmen.
-
- - -
-
-
- -
-
diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 b/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 deleted file mode 100644 index 33f76bf9c..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der b/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der deleted file mode 100644 index b6091332c..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore b/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore deleted file mode 100644 index 9c6c55359..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 b/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 deleted file mode 100644 index ec7bf8e48..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der b/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der deleted file mode 100644 index 20bc38e14..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore b/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore deleted file mode 100644 index d32a22f0f..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 b/id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 deleted file mode 100644 index af524d060..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der b/id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der deleted file mode 100644 index c3b3003d9..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore b/id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore deleted file mode 100644 index 780e58934..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore b/id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore deleted file mode 100644 index 908e00b42..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer deleted file mode 100644 index d361d919f..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer deleted file mode 100644 index ad13d7b28..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer deleted file mode 100644 index f9f27442b..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer deleted file mode 100644 index b6f39e354..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer deleted file mode 100644 index f9fef65fc..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer deleted file mode 100644 index 36a442b89..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer deleted file mode 100644 index 836ba3767..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer deleted file mode 100644 index 28cb48bb0..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer deleted file mode 100644 index 289fc2198..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer deleted file mode 100644 index b7d4b08a6..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer deleted file mode 100644 index 289fc2198..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer deleted file mode 100644 index 69de75609..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer deleted file mode 100644 index 8c434777e..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer deleted file mode 100644 index efa28178e..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer deleted file mode 100644 index 33e776369..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der deleted file mode 100644 index d3c213711..000000000 --- a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDljCCAwOgAwIBAgIBBDAJBgUrDgMCHQUAMHQxCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMRcwFQYDVQQDEw5UZXN0IENBIC0gUm9v -dDAeFw0wNDA1MTgxMzQ1NTdaFw0wOTEyMzEyMjU5MzBaMIGGMQswCQYDVQQGEwJB -VDEsMCoGA1UEChMjU3RhYnN0ZWxsZSBJS1QtU3RyYXRlZ2llIGRlcyBCdW5kZXMx -HjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczEpMCcGA1UEAxQgVGVzdCBD -QSAtIFZlcnNjaGz8c3NlbHVuZyBC/HJnZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0A -MIGJAoGBALmykoSgYUpJiaK5NlC5jTcMQikEIB6kOdS7e82DBbT5G13zQeuiNBA2 -KzLMPMBK62Go+ZV8w94N5cSm2auuempVAHNF80ao9G3wYgK0xOVZXvf/145o8TIw -StPPckmVPL2OPa8/DIB8tqNjblFxy+XcBnTQMLKaxYSzwA/zULoNAgMBAAGjggEr -MIIBJzAOBgNVHQ8BAf8EBAMCAcYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4E -FgQUjRMKvtgH3PngerFS/Rt+vuEDbLMwXQYDVR0gBFYwVDBSBgwrBgEEAZUSAQID -AQEwQjBABggrBgEFBQcCAjA0GjJEaWVzZXMgWmVydGlmaWthdCBpc3QgbnVyIGb8 -ciBUZXN0endlY2tlIGdlZWlnbmV0LjA5BgNVHR8EMjAwMC6gLKAqhihodHRwOi8v -bGFicy5jaW8uZ3YuYXQvdGVtcC9jcmxzL3Jvb3QuY3JsMBQGByooAAoBAQEECQwH -QktBLUlLVDARBglghkgBhvhCAQEEBAMCAQIwHwYDVR0jBBgwFoAUZWxSwiqQLpxu -4vk3Op4dYHG46XswCQYFKw4DAh0FAAOBgQAnuY7RPFXLpO2hb3h1B0cy5p861j6E -eD+c/ZKAGqIh4kh3A65D8Zl90GSv9vV4L03dnN5hc7rm/bwKzDI57/PI2dL0H/S4 -OOl4tt4fZmjN8Xrv3oJxNEa+6AJ8TGCcouc/Eqxnpc0SxkP6UQrA8J8RM/8fk05U -DAyTZbTQ5wPIhA== ------END CERTIFICATE----- diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der deleted file mode 100644 index 807fa786c..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer deleted file mode 100644 index fc5bd433b..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer deleted file mode 100644 index f3cf5e676..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer deleted file mode 100644 index 28fbdf42f..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer deleted file mode 100644 index c9da41583..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer deleted file mode 100644 index 06b40aa67..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer deleted file mode 100644 index da38ce028..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer deleted file mode 100644 index d361d919f..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer deleted file mode 100644 index ad13d7b28..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer deleted file mode 100644 index f9f27442b..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer deleted file mode 100644 index b6f39e354..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer deleted file mode 100644 index f9fef65fc..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer deleted file mode 100644 index 36a442b89..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer deleted file mode 100644 index 289fc2198..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer deleted file mode 100644 index b7d4b08a6..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer deleted file mode 100644 index 289fc2198..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer deleted file mode 100644 index 69de75609..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer deleted file mode 100644 index 8c434777e..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer deleted file mode 100644 index efa28178e..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer deleted file mode 100644 index 33e776369..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer deleted file mode 100644 index 06b40aa67..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer deleted file mode 100644 index da38ce028..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer deleted file mode 100644 index 376d0753f..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer deleted file mode 100644 index 5171276f4..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer deleted file mode 100644 index 376d0753f..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer and /dev/null differ diff --git a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer b/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer deleted file mode 100644 index 5171276f4..000000000 Binary files a/id.server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer and /dev/null differ diff --git a/id.server/data/deploy/templates/LIESMICH_TEMPLATES.txt b/id.server/data/deploy/templates/LIESMICH_TEMPLATES.txt deleted file mode 100644 index e23ebad6e..000000000 --- a/id.server/data/deploy/templates/LIESMICH_TEMPLATES.txt +++ /dev/null @@ -1,39 +0,0 @@ -TEMPLATES: -========== -Zweck: ------- -Mithilfe von Templates können Sie das Aussehen der Seiten -"Auswahl der Bürgerkartenumgebung" sowie "Anmeldung mit Bürgerkarte" -anpassen. Damit können Sie zusätzliche Hintergrundinformationen (Wozu -dient die Anmeldung, etc.) zu diesen Seiten hinzufügen und das Layout an -Ihre sonstigen Anwendungen anpassen. - -Wird kein Template mit den Parametern Template und BKUSelectionTemplate -angegeben, so wird defaultmäßig jew. eine schlichte "neutrale" Variante -angezeigt. - -Bei der Erstellung von Template muss die Form gemäß MOA-ID Dokumentation -Abschnitt: "Aufruf von MOA-ID" (id-anwendung_1.htm) eingehalten werden. - -Templates können Grundsätzlich von jeder HTTP Adresse abgerufen -werden, d.h. sie können auf einen belibigen Webserver abgelegt werden. - - -Anwendung des Beispiels: ------------------------- -Wenn Sie keinen anderen Webserver zum Ablegen der Templates verwenden möchten, -so kann die Webcontainer Fähigkeit von Tomcat für die Ablage der HTML-Templates -genutzt werden. Ein einfaches Beispiel mit den beiden Templates -"SampleBKUSelectionTemplate.html" sowie "SampleTemplate.html" findet sich im -WAR Archiv moaid-templates.war - - -Wenn dieses WAR Archiv in das webapps Verzeichnis von Tomcat gestellt wird, so -wird diese automatisch entpackt und deployed. In Folge können Sie die Template -Dateien per Parameter beim Aufruf von MOA-ID angeben. - -Beispiel Link mit Einsatz von Template: -https://localhost:8443/moa-id-auth/SelectBKU?Target=Test-Bereich&OA=https://localhost:8443/&BKUSelectionTemplate=http://localhost:8080/moaid-templates/SampleBKUSelectionTemplate.html&Template=http://localhost:8080/moaid-templates/SampleTemplate.html - - -Sie können diese beiden Templates als Vorlage für eigene Designs verwenden. \ No newline at end of file diff --git a/id.server/data/deploy/templates/moaid-templates.war b/id.server/data/deploy/templates/moaid-templates.war deleted file mode 100644 index 72b034d5c..000000000 Binary files a/id.server/data/deploy/templates/moaid-templates.war and /dev/null differ diff --git a/id.server/data/deploy/tomcat/server.mod_jk.xml b/id.server/data/deploy/tomcat/server.mod_jk.xml deleted file mode 100644 index b32cf7844..000000000 --- a/id.server/data/deploy/tomcat/server.mod_jk.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/id.server/data/deploy/tomcat/server.xml b/id.server/data/deploy/tomcat/server.xml deleted file mode 100644 index 2fd7b6439..000000000 --- a/id.server/data/deploy/tomcat/server.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/id.server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar b/id.server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar deleted file mode 100644 index 62c7645b9..000000000 Binary files a/id.server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar and /dev/null differ diff --git a/id.server/data/deploy/tomcat/unix/tomcat-start.sh b/id.server/data/deploy/tomcat/unix/tomcat-start.sh deleted file mode 100644 index 6dc0289d5..000000000 --- a/id.server/data/deploy/tomcat/unix/tomcat-start.sh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/bash - -export JAVA_HOME= -export CATALINA_HOME= -export CATALINA_BASE=$CATALINA_HOME - -CONFIG_OPT=-Dmoa.id.configuration=$CATALINA_BASE/conf/moa-id/SampleMOAIDConfiguration.xml -LOGGING_OPT=-Dlog4j.configuration=file:$CATALINA_BASE/conf/moa-id/log4j.properties -SPSS_OPT=-Dmoa.spss.server.configuration=$CATALINA_BASE/conf/moa-spss/SampleMOASPSSConfiguration.xml - -#TRUST_STORE_OPT=-Djavax.net.ssl.trustStore=$CATALINA_BASE/conf/moa-spss/keys/clients/trustedMOAClients-password=changeit.keystore -#TRUST_STORE_PASS_OPT=-Djavax.net.ssl.trustStorePassword=changeit -#TRUST_STORE_TYPE_OPT=-Djavax.net.ssl.trustStoreType=jks - -export CATALINA_OPTS="$CONFIG_OPT $LOGGING_OPT $SPSS_OPT $TRUST_STORE_OPT $TRUST_STORE_PASS_OPT $TRUST_STORE_TYPE_OPT" - -echo CATALINA_HOME: $CATALINA_HOME -echo CATALINA_BASE: $CATALINA_BASE -echo CATALINA_OPTS: $CATALINA_OPTS - -echo -echo Moving old log files to logs\backup -mv logs/*.out logs/backup -mv logs/*.txt logs/backup -mv logs/*.log logs/backup - -cd $CATALINA_HOME -./bin/startup.sh diff --git a/id.server/data/deploy/tomcat/unix/tomcat-stop.sh b/id.server/data/deploy/tomcat/unix/tomcat-stop.sh deleted file mode 100644 index 82e4ffcfe..000000000 --- a/id.server/data/deploy/tomcat/unix/tomcat-stop.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash - -export JAVA_HOME= -export CATALINA_HOME= - -cd $CATALINA_HOME -./bin/shutdown.sh \ No newline at end of file diff --git a/id.server/data/deploy/tomcat/uriworkermap.properties b/id.server/data/deploy/tomcat/uriworkermap.properties deleted file mode 100644 index 32b4c1f50..000000000 --- a/id.server/data/deploy/tomcat/uriworkermap.properties +++ /dev/null @@ -1,9 +0,0 @@ -# a sample mod_jk uriworkermap.properties file for mapping -# MOA-ID-AUTH and MOA-ID-PROXY web service requests to workers -# -# omit the mappings you don't need - -#/moa-id-auth/*=moaworker - -#forward all requests to tomcat (e.g.) -/*=moaworker \ No newline at end of file diff --git a/id.server/data/deploy/tomcat/win32/startTomcat.bat b/id.server/data/deploy/tomcat/win32/startTomcat.bat deleted file mode 100644 index f6ebc3613..000000000 --- a/id.server/data/deploy/tomcat/win32/startTomcat.bat +++ /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= - -rem Tomcat 4.1.x home directory (no trailing path separator) -set CATALINA_HOME= - -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/data/deploy/tomcat/win32/stopTomcat.bat b/id.server/data/deploy/tomcat/win32/stopTomcat.bat deleted file mode 100644 index 09dd83f2d..000000000 --- a/id.server/data/deploy/tomcat/win32/stopTomcat.bat +++ /dev/null @@ -1,13 +0,0 @@ -rem ---------------------------------------------------------------------------------------------- -rem Modify these entries according to your needs - -rem JDK home directory (no trailing path separator) -set JAVA_HOME= - -rem Tomcat 4.1.x home directory (no trailing path separator) -set CATALINA_HOME= - -rem ---------------------------------------------------------------------------------------------- - -cd %CATALINA_HOME% -bin\catalina.bat stop \ No newline at end of file diff --git a/id.server/data/deploy/tomcat/workers.properties b/id.server/data/deploy/tomcat/workers.properties deleted file mode 100644 index 9350ddc77..000000000 --- a/id.server/data/deploy/tomcat/workers.properties +++ /dev/null @@ -1,6 +0,0 @@ -# a sample workers.properties file defining a single mod_jk worker - -worker.list=moaworker -worker.moaworker.type=ajp13 -worker.moaworker.host=localhost -worker.moaworker.port=8009 diff --git a/id.server/doc/Architektur ID.vsd b/id.server/doc/Architektur ID.vsd deleted file mode 100644 index d4678007a..000000000 Binary files a/id.server/doc/Architektur ID.vsd and /dev/null differ diff --git a/id.server/doc/MOA ID 1.x.wsdl b/id.server/doc/MOA ID 1.x.wsdl deleted file mode 100644 index 06daae8f1..000000000 --- a/id.server/doc/MOA ID 1.x.wsdl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/doc/MOA-ID Feinspezifikation.doc b/id.server/doc/MOA-ID Feinspezifikation.doc deleted file mode 100644 index e71ffa8e6..000000000 Binary files a/id.server/doc/MOA-ID Feinspezifikation.doc and /dev/null differ diff --git a/id.server/doc/MOA-ID-Configuration-1.2.xsd b/id.server/doc/MOA-ID-Configuration-1.2.xsd deleted file mode 100644 index 4b018db64..000000000 --- a/id.server/doc/MOA-ID-Configuration-1.2.xsd +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - enthält Konfigurationsparameter der - Proxy-Komponente - - - - - - enthält Parameter für die Kommunikation zw. - Proxykomponente und Authenttisierungskomponente - - - - - - enthält Parameter für die SOAP-Verbindung von der - Proxy-Komponente zur Auth-Komponente (vgl. - AuthComponent/MOA-SP/ConnectionParameter) - - - - - - - - - - - enthält Parameter für die OA - - - - - - - - - - - - - spezifiziert den Algorithmus ("pkix" oder "chaining") für die - Zertifikatspfadvalidierung - - - - - - ein vom SystemDefaultMode abweichender ChiningMode kann - für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das vertrauenswürdige CA - (Zwischen-CA, Wurzel-CA) Zertifikate enthält. - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - das Attribut filename verweist auf eine Datei mit globalem - Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo - werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks - inkludiert - - - - - - - - - - - enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA - SP Modul - - - - - - enthält Parameter für die SOAP-Verbindung von der - AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; - wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; - wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben - werden; wird das Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - enthält Parameter für die Ãœberprüfung der - Personenbindung - - - - - - - - - - enthält Parameter für die Ãœberprüfung des - AUTH-Blocks - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers des - IdentityLinks - - - - - - akzeptierte Signer des IdentityLinks werden per - X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der - TLS-Verbindung enthält (keine CA-Zertifikate) - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel, der für - die TLS-Client-Authentisierung verwendetwird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/doc/MOA-ID-Configuration-1.3.xsd b/id.server/doc/MOA-ID-Configuration-1.3.xsd deleted file mode 100644 index 66c6e1832..000000000 --- a/id.server/doc/MOA-ID-Configuration-1.3.xsd +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - enthält Konfigurationsparameter der - Proxy-Komponente - - - - - - enthält Parameter für die Kommunikation zw. - Proxykomponente und Authenttisierungskomponente - - - - - - enthält Parameter für die SOAP-Verbindung von der - Proxy-Komponente zur Auth-Komponente (vgl. - AuthComponent/MOA-SP/ConnectionParameter) - - - - - - - - - - - enthält Parameter für die OA - - - - - - - - - - - - - - - - - - - - - spezifiziert den Algorithmus ("pkix" oder "chaining") für die - Zertifikatspfadvalidierung - - - - - - ein vom SystemDefaultMode abweichender ChiningMode kann - für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das vertrauenswürdige CA - (Zwischen-CA, Wurzel-CA) Zertifikate enthält. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - - - - - enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA - SP Modul - - - - - - enthält Parameter für die SOAP-Verbindung von der - AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; - wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; - wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben - werden; wird das Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - enthält Parameter für die Ãœberprüfung der - Personenbindung - - - - - - - - - - enthält Parameter für die Ãœberprüfung des - AUTH-Blocks - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers des - IdentityLinks - - - - - - akzeptierte Signer des IdentityLinks werden per - X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - - - das Attribut filename verweist auf eine Datei mit globalem - Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo - werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks - inkludiert - - - - - - - - - - - - das Attribut URL spezifiziert die Lage des Templates - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der - TLS-Verbindung enthält (keine CA-Zertifikate) - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel, der für - die TLS-Client-Authentisierung verwendetwird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/doc/MOA-ID-Configuration-1.4.xsd b/id.server/doc/MOA-ID-Configuration-1.4.xsd deleted file mode 100644 index 66a9c0ed4..000000000 --- a/id.server/doc/MOA-ID-Configuration-1.4.xsd +++ /dev/null @@ -1,505 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - enthält Konfigurationsparameter der - Proxy-Komponente - - - - - - enthält Parameter für die Kommunikation zw. - Proxykomponente und Authenttisierungskomponente - - - - - - enthält Parameter für die SOAP-Verbindung von der - Proxy-Komponente zur Auth-Komponente (vgl. - AuthComponent/MOA-SP/ConnectionParameter) - - - - - - - - - - - enthält Parameter für die OA - - - - - - - - - - - - - - - - - - - - - - spezifiziert den Algorithmus ("pkix" oder "chaining") für die - Zertifikatspfadvalidierung - - - - - - ein vom SystemDefaultMode abweichender ChiningMode kann - für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das vertrauenswürdige CA - (Zwischen-CA, Wurzel-CA) Zertifikate enthält. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - - - - - enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA - SP Modul - - - - - - enthält Parameter für die SOAP-Verbindung von der - AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; - wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; - wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben - werden; wird das Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - enthält Parameter für die Ãœberprüfung der - Personenbindung - - - - - - - - - - enthält Parameter für die Ãœberprüfung des - AUTH-Blocks - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers des - IdentityLinks - - - - - - akzeptierte Signer des IdentityLinks werden per - X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - enthält Defaultparameter für die Ãœberprüfung weiterer Infoboxen - - - - - - - das Attribut filename verweist auf eine Datei mit globalem - Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo - werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks - inkludiert - - - - - - - - - - - - das Attribut URL spezifiziert die Lage des Templates - - - - - - Verifikation zusätzlicher Infoboxen - - - - - Optionales DefaultTrustprofil für die Ãœberprüfung aller weiteren Infoboxen - - - - - - - - - - Parameter für Ãœberprüfung weiterer Infoboxen - - - - - - optionalervName, der für Fehlermeldungen verwendet werden soll; - z.B.: "Stellvertretungen" für "Mandates"; fehlt dieser Parameter, dann wird - das Identifier-Attribut verwendet - - - - - TrustProfil, das für die Ãœberprüfung der Infobox - verwendet werden soll - - - - - Validatorklasse, die für die Prüfung der Infobox - verwendet werden soll; muss gesetzt werden, wenn Package- und Klassenname - vom Default Package- und Klassennamen abweichen - - - - - - Infobox spezifische Parameter, die der jeweiligen Prüfapplikation - übergeben werden - - - - - - - - - - - - - - - - - - - Spezifiziert die Lage von XML Schemas - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - enthält Parameter über die OA, die die Proxy-Komponente - betreffen - - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der - TLS-Verbindung enthält (keine CA-Zertifikate) - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel, der für - die TLS-Client-Authentisierung verwendetwird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/doc/MOA_ID_1.2_20040315.pdf b/id.server/doc/MOA_ID_1.2_20040315.pdf deleted file mode 100644 index 0c89c2730..000000000 Binary files a/id.server/doc/MOA_ID_1.2_20040315.pdf and /dev/null differ diff --git a/id.server/doc/MOA_ID_1.3_20060315.pdf b/id.server/doc/MOA_ID_1.3_20060315.pdf deleted file mode 100644 index c9b0d160c..000000000 Binary files a/id.server/doc/MOA_ID_1.3_20060315.pdf and /dev/null differ diff --git a/id.server/doc/MOA_ID_1.4_20070802.pdf b/id.server/doc/MOA_ID_1.4_20070802.pdf deleted file mode 100644 index a3a2f1177..000000000 Binary files a/id.server/doc/MOA_ID_1.4_20070802.pdf and /dev/null differ diff --git a/id.server/doc/OID-1-0-3.pdf b/id.server/doc/OID-1-0-3.pdf deleted file mode 100644 index 4beab3e41..000000000 Binary files a/id.server/doc/OID-1-0-3.pdf and /dev/null differ diff --git a/id.server/doc/api-doc/allclasses-frame.html b/id.server/doc/api-doc/allclasses-frame.html deleted file mode 100644 index 114c4b426..000000000 --- a/id.server/doc/api-doc/allclasses-frame.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - -All Classes - - - - - -All Classes -
- - - - - -
AuthenticationData -
-AuthenticationException -
-AuthenticationServer -
-ConnectionBuilder -
-LoginParameterResolver -
-OAConfiguration -
-
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html deleted file mode 100644 index 313defcbc..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -MOA ID API: Class AuthenticationException - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -at.gv.egovernment.moa.id -
-Class AuthenticationException

-
-at.gv.egovernment.moa.id.AuthenticationException
-
-
-
-
public class AuthenticationException
- -

-Exception thrown during handling of AuthenticationSession -

-


- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
AuthenticationException(String messageId, - Object[] parameters) - -
-          Constructor for AuthenticationException.
-  - - - -

- - - - - - - - - - - -
-Constructor Detail
- -

-AuthenticationException

-
-public AuthenticationException(String messageId,
-                               Object[] parameters)
-
-
Constructor for AuthenticationException.
-
Parameters:
messageId -  
-
-
- - - - -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html deleted file mode 100644 index 7aaad7c68..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - -MOA ID API: Class AuthenticationServer - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -at.gv.egovernment.moa.id.auth -
-Class AuthenticationServer

-
-java.lang.Object
-  |
-  +--at.gv.egovernment.moa.id.auth.AuthenticationServer
-
-
-
-
public class AuthenticationServer
extends Object
- -

-API for MOA ID Authentication Service.
- AuthenticationSession is stored in a session store and retrieved - by giving the session ID. -

-


- -

- - - - - - - - - - -
-Field Summary
-  - - - - - - - - - - -
-Constructor Summary
AuthenticationServer() - -
-          Constructor for AuthenticationServer.
-  - - - - - - - - - - - - - - - -
-Method Summary
- AuthenticationDatagetAuthenticationData(String samlArtifact) - -
-          Retrieves AuthenticationData indexed by the SAML artifact. -
-static AuthenticationServergetInstance() - -
-          Returns the single instance of AuthenticationServer.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, -equals, -finalize, -getClass, -hashCode, -notify, -notifyAll, -toString, -wait, -wait, -wait
-  -

- - - - - - - - -
-Field Detail
- - - - - - - - -
-Constructor Detail
- -

-AuthenticationServer

-
-public AuthenticationServer()
-
-
Constructor for AuthenticationServer.
- - - - - - - - -
-Method Detail
- -

-getInstance

-
-public static AuthenticationServer getInstance()
-
-
Returns the single instance of AuthenticationServer.
-
Returns:
the single instance of AuthenticationServer
-
-
-
- -

-getAuthenticationData

-
-public AuthenticationData getAuthenticationData(String samlArtifact)
-                                         throws AuthenticationException
-
-
Retrieves AuthenticationData indexed by the SAML artifact. - The AuthenticationData is deleted from the store upon end of this call.
-
Returns:
AuthenticationData
-
-
-
- - -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html deleted file mode 100644 index ece0242d9..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - -MOA ID API: Uses of Class at.gv.egovernment.moa.id.auth.AuthenticationServer - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.auth.AuthenticationServer

-
- - - - - -
-Uses of AuthenticationServer in at.gv.egovernment.moa.id.auth
-  -

- - - - - - - - - -
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationServer
-static AuthenticationServerAuthenticationServer.getInstance() - -
-          Returns the single instance of AuthenticationServer.
-  -

-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html deleted file mode 100644 index 96ff7f4af..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - -MOA ID API: Uses of Class at.gv.egovernment.moa.id.AuthenticationException - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.AuthenticationException

-
- - - - - -
-Uses of AuthenticationException in at.gv.egovernment.moa.id.auth
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.auth that throw AuthenticationException
- StringAuthenticationServer.selectBKU(String authURL, - String target, - String oaURL, - String bkuSelectionTemplateURL, - String templateURL) - -
-          Processes request to select a BKU. -
- StringAuthenticationServer.startAuthentication(String authURL, - String target, - String oaURL, - String templateURL, - String bkuURL, - String sessionID) - -
-          Processes the beginning of an authentication session. -
- StringAuthenticationServer.verifyIdentityLink(String sessionID, - String xmlInfoboxReadResponse) - -
-          Processes an <InfoboxReadResponse> sent by the - security layer implementation.
- - Validates given <InfoboxReadResponse> - Parses identity link enclosed in <InfoboxReadResponse> - Verifies identity link by calling the MOA SP component - Checks certificate authority of identity link - Stores identity link in the session - Creates an authentication block to be signed by the user - Creates and returns a <CreateXMLSignatureRequest> - containg the authentication block, meant to be returned to the - security layer implementation -
- StringAuthenticationServer.verifyAuthenticationBlock(String sessionID, - String xmlCreateXMLSignatureReadResponse) - -
-          Processes a <CreateXMLSignatureResponse> sent by the - security layer implementation.
- - Validates given <CreateXMLSignatureResponse> - Parses <CreateXMLSignatureResponse> for error codes - Parses authentication block enclosed in - <CreateXMLSignatureResponse> - Verifies authentication block by calling the MOA SP component - Creates authentication data - Creates a corresponding SAML artifact - Stores authentication data in the authentication data store - indexed by the SAML artifact - Deletes authentication session - Returns the SAML artifact, encoded BASE64 -
- AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) - -
-          Retrieves AuthenticationData indexed by the SAML artifact. -
-static at.gv.egovernment.moa.id.auth.data.AuthenticationSessionAuthenticationServer.getSession(String id) - -
-          Retrieves a session from the session store.
-  -

-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html deleted file mode 100644 index ec020b79d..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html +++ /dev/null @@ -1,526 +0,0 @@ - - - - - - -MOA ID API: Class OAConfiguration - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -at.gv.egovernment.moa.id.config.proxy -
-Class OAConfiguration

-
-java.lang.Object
-  |
-  +--at.gv.egovernment.moa.id.config.proxy.OAConfiguration
-
-
-
-
public class OAConfiguration
extends Object
- -

-Holds configuration data concerning an online application for use by the MOA-ID Proxy component. - These include the login type (stateful or stateless), the HTTP authentication type, - and information needed to add authentication parameters or headers for a URL connection - to the remote online application. -

-

-
See Also:
MOAIDConfiguration-1.1.xsd, element Configuration
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static StringBASIC_AUTH - -
-           
-static StringHEADER_AUTH - -
-           
-static StringLOGINTYPE_STATEFUL - -
-           
-static StringLOGINTYPE_STATELESS - -
-           
-static StringPARAM_AUTH - -
-           
-  - - - - - - - - - - -
-Constructor Summary
OAConfiguration() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- StringgetAuthType() - -
-          Returns the authType.
- StringgetBasicAuthPasswordMapping() - -
-          Returns the basicAuthPasswordMapping.
- StringgetBasicAuthUserIDMapping() - -
-          Returns the basicAuthUserIDMapping.
- MapgetHeaderAuthMapping() - -
-          Returns the headerAuthMapping.
- StringgetLoginType() - -
-          Returns the loginType.
- MapgetParamAuthMapping() - -
-          Returns the paramAuthMapping.
- voidsetAuthType(String authLoginType) - -
-          Sets the authType.
- voidsetBasicAuthPasswordMapping(String basicAuthPassword) - -
-          Sets the basicAuthPasswordMapping.
- voidsetBasicAuthUserIDMapping(String basicAuthUserID) - -
-          Sets the basicAuthUserIDMapping.
- voidsetHeaderAuthMapping(HashMap headerAuth) - -
-          Sets the headerAuthMapping.
- voidsetLoginType(String loginType) - -
-          Sets the loginType.
- voidsetParamAuthMapping(HashMap paramAuth) - -
-          Sets the paramAuthMapping.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, -equals, -finalize, -getClass, -hashCode, -notify, -notifyAll, -toString, -wait, -wait, -wait
-  -

- - - - - - - - -
-Field Detail
- -

-LOGINTYPE_STATEFUL

-
-public static final String LOGINTYPE_STATEFUL
-
-
-
- -

-LOGINTYPE_STATELESS

-
-public static final String LOGINTYPE_STATELESS
-
-
-
- -

-BASIC_AUTH

-
-public static final String BASIC_AUTH
-
-
-
- -

-HEADER_AUTH

-
-public static final String HEADER_AUTH
-
-
-
- -

-PARAM_AUTH

-
-public static final String PARAM_AUTH
-
-
- - - - - - - - -
-Constructor Detail
- -

-OAConfiguration

-
-public OAConfiguration()
-
-
- - - - - - - - -
-Method Detail
- -

-getBasicAuthPasswordMapping

-
-public String getBasicAuthPasswordMapping()
-
-
Returns the basicAuthPasswordMapping.
-
Returns:
String
-
-
-
- -

-getBasicAuthUserIDMapping

-
-public String getBasicAuthUserIDMapping()
-
-
Returns the basicAuthUserIDMapping.
-
Returns:
String
-
-
-
- -

-getHeaderAuthMapping

-
-public Map getHeaderAuthMapping()
-
-
Returns the headerAuthMapping.
-
Returns:
HashMap
-
-
-
- -

-getLoginType

-
-public String getLoginType()
-
-
Returns the loginType.
-
Returns:
String
-
-
-
- -

-getParamAuthMapping

-
-public Map getParamAuthMapping()
-
-
Returns the paramAuthMapping.
-
Returns:
HashMap
-
-
-
- -

-setBasicAuthPasswordMapping

-
-public void setBasicAuthPasswordMapping(String basicAuthPassword)
-
-
Sets the basicAuthPasswordMapping.
-
Parameters:
basicAuthPasswordMapping - The basicAuthPasswordMapping to set
-
-
-
- -

-setBasicAuthUserIDMapping

-
-public void setBasicAuthUserIDMapping(String basicAuthUserID)
-
-
Sets the basicAuthUserIDMapping.
-
Parameters:
basicAuthUserIDMapping - The basicAuthUserIDMapping to set
-
-
-
- -

-setHeaderAuthMapping

-
-public void setHeaderAuthMapping(HashMap headerAuth)
-
-
Sets the headerAuthMapping.
-
Parameters:
headerAuthMapping - The headerAuthMapping to set
-
-
-
- -

-setLoginType

-
-public void setLoginType(String loginType)
-
-
Sets the loginType.
-
Parameters:
loginType - The loginType to set
-
-
-
- -

-setParamAuthMapping

-
-public void setParamAuthMapping(HashMap paramAuth)
-
-
Sets the paramAuthMapping.
-
Parameters:
paramAuthMapping - The paramAuthMapping to set
-
-
-
- -

-getAuthType

-
-public String getAuthType()
-
-
Returns the authType.
-
Returns:
String
-
-
-
- -

-setAuthType

-
-public void setAuthType(String authLoginType)
-
-
Sets the authType.
-
Parameters:
authType - The authType to set
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html deleted file mode 100644 index c41742f7a..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -MOA ID API: Uses of Class at.gv.egovernment.moa.id.config.proxy.OAConfiguration - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.config.proxy.OAConfiguration

-
- - - - - -
-Uses of OAConfiguration in at.gv.egovernment.moa.id.proxy
-  -

- - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.proxy with parameters of type OAConfiguration
- MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
-  -

-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html deleted file mode 100644 index 0a0906e25..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html +++ /dev/null @@ -1,751 +0,0 @@ - - - - - - -MOA ID API: Class AuthenticationData - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -at.gv.egovernment.moa.id.data -
-Class AuthenticationData

-
-java.lang.Object
-  |
-  +--at.gv.egovernment.moa.id.data.AuthenticationData
-
-
-
-
public class AuthenticationData
extends Object
- -

-Encapsulates authentication data contained in a <saml:Assertion>. -

-


- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
AuthenticationData() - -
-          Constructor for AuthenticationData.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- StringgetAssertionID() - -
-          Returns the assertionID.
- StringgetDateOfBirth() - -
-          Returns the dateOfBirth.
- StringgetFamilyName() - -
-          Returns the familyName.
- StringgetGivenName() - -
-          Returns the givenName.
- StringgetIdentificationValue() - -
-          Returns the identificationValue.
- StringgetIssueInstant() - -
-          Returns the issueInstant.
- StringgetIssuer() - -
-          Returns the issuer.
- intgetMajorVersion() - -
-          Returns the majorVersion.
- intgetMinorVersion() - -
-          Returns the minorVersion.
- StringgetPublicAuthorityCode() - -
-          Returns the publicAuthorityCode.
- StringgetSamlAssertion() - -
-          Returns the samlAssertion.
- DategetTimestamp() - -
-          Returns the timestamp.
- StringgetVPK() - -
-          Returns the vpk.
- booleanisPublicAuthority() - -
-          Returns the publicAuthority.
- booleanisQualifiedCertificate() - -
-          Returns the qualifiedCertificate.
- voidsetAssertionID(String assertionID) - -
-          Sets the assertionID.
- voidsetDateOfBirth(String dateOfBirth) - -
-          Sets the dateOfBirth.
- voidsetFamilyName(String gamilyName) - -
-          Sets the familyName.
- voidsetGivenName(String givenName) - -
-          Sets the givenName.
- voidsetIdentificationValue(String identificationValue) - -
-          Sets the identificationValue.
- voidsetIssueInstant(String issueInstant) - -
-          Sets the issueInstant.
- voidsetIssuer(String issuer) - -
-          Sets the issuer.
- voidsetMajorVersion(int majorVersion) - -
-          Sets the majorVersion.
- voidsetMinorVersion(int minorVersion) - -
-          Sets the minorVersion.
- voidsetPublicAuthority(boolean publicAuthority) - -
-          Sets the publicAuthority.
- voidsetPublicAuthorityCode(String publicAuthorityIdentification) - -
-          Sets the publicAuthorityCode.
- voidsetQualifiedCertificate(boolean qualifiedCertificate) - -
-          Sets the qualifiedCertificate.
- voidsetSamlAssertion(String samlAssertion) - -
-          Sets the samlAssertion.
- voidsetVPK(String vpk) - -
-          Sets the vpk.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, -equals, -finalize, -getClass, -hashCode, -notify, -notifyAll, -toString, -wait, -wait, -wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-AuthenticationData

-
-public AuthenticationData()
-
-
Constructor for AuthenticationData.
- - - - - - - - -
-Method Detail
- -

-getMinorVersion

-
-public int getMinorVersion()
-
-
Returns the minorVersion.
-
Returns:
int
-
-
-
- -

-isPublicAuthority

-
-public boolean isPublicAuthority()
-
-
Returns the publicAuthority.
-
Returns:
boolean
-
-
-
- -

-getPublicAuthorityCode

-
-public String getPublicAuthorityCode()
-
-
Returns the publicAuthorityCode.
-
Returns:
String
-
-
-
- -

-isQualifiedCertificate

-
-public boolean isQualifiedCertificate()
-
-
Returns the qualifiedCertificate.
-
Returns:
boolean
-
-
-
- -

-getVPK

-
-public String getVPK()
-
-
Returns the vpk.
-
Returns:
String
-
-
-
- -

-setMinorVersion

-
-public void setMinorVersion(int minorVersion)
-
-
Sets the minorVersion.
-
Parameters:
minorVersion - The minorVersion to set
-
-
-
- -

-setPublicAuthority

-
-public void setPublicAuthority(boolean publicAuthority)
-
-
Sets the publicAuthority.
-
Parameters:
publicAuthority - The publicAuthority to set
-
-
-
- -

-setPublicAuthorityCode

-
-public void setPublicAuthorityCode(String publicAuthorityIdentification)
-
-
Sets the publicAuthorityCode.
-
Parameters:
publicAuthorityCode - The publicAuthorityCode to set
-
-
-
- -

-setQualifiedCertificate

-
-public void setQualifiedCertificate(boolean qualifiedCertificate)
-
-
Sets the qualifiedCertificate.
-
Parameters:
qualifiedCertificate - The qualifiedCertificate to set
-
-
-
- -

-setVPK

-
-public void setVPK(String vpk)
-
-
Sets the vpk.
-
Parameters:
vpk - The vpk to set
-
-
-
- -

-getAssertionID

-
-public String getAssertionID()
-
-
Returns the assertionID.
-
Returns:
String
-
-
-
- -

-getDateOfBirth

-
-public String getDateOfBirth()
-
-
Returns the dateOfBirth.
-
Returns:
String
-
-
-
- -

-getFamilyName

-
-public String getFamilyName()
-
-
Returns the familyName.
-
Returns:
String
-
-
-
- -

-getGivenName

-
-public String getGivenName()
-
-
Returns the givenName.
-
Returns:
String
-
-
-
- -

-getIdentificationValue

-
-public String getIdentificationValue()
-
-
Returns the identificationValue.
-
Returns:
String
-
-
-
- -

-getIssueInstant

-
-public String getIssueInstant()
-
-
Returns the issueInstant.
-
Returns:
String
-
-
-
- -

-getIssuer

-
-public String getIssuer()
-
-
Returns the issuer.
-
Returns:
String
-
-
-
- -

-getMajorVersion

-
-public int getMajorVersion()
-
-
Returns the majorVersion.
-
Returns:
int
-
-
-
- -

-setAssertionID

-
-public void setAssertionID(String assertionID)
-
-
Sets the assertionID.
-
Parameters:
assertionID - The assertionID to set
-
-
-
- -

-setDateOfBirth

-
-public void setDateOfBirth(String dateOfBirth)
-
-
Sets the dateOfBirth.
-
Parameters:
dateOfBirth - The dateOfBirth to set
-
-
-
- -

-setFamilyName

-
-public void setFamilyName(String gamilyName)
-
-
Sets the familyName.
-
Parameters:
familyName - The familyName to set
-
-
-
- -

-setGivenName

-
-public void setGivenName(String givenName)
-
-
Sets the givenName.
-
Parameters:
givenName - The givenName to set
-
-
-
- -

-setIdentificationValue

-
-public void setIdentificationValue(String identificationValue)
-
-
Sets the identificationValue.
-
Parameters:
identificationValue - The identificationValue to set
-
-
-
- -

-setIssueInstant

-
-public void setIssueInstant(String issueInstant)
-
-
Sets the issueInstant.
-
Parameters:
issueInstant - The issueInstant to set
-
-
-
- -

-setIssuer

-
-public void setIssuer(String issuer)
-
-
Sets the issuer.
-
Parameters:
issuer - The issuer to set
-
-
-
- -

-setMajorVersion

-
-public void setMajorVersion(int majorVersion)
-
-
Sets the majorVersion.
-
Parameters:
majorVersion - The majorVersion to set
-
-
-
- -

-getSamlAssertion

-
-public String getSamlAssertion()
-
-
Returns the samlAssertion.
-
Returns:
String
-
-
-
- -

-setSamlAssertion

-
-public void setSamlAssertion(String samlAssertion)
-
-
Sets the samlAssertion.
-
Parameters:
samlAssertion - The samlAssertion to set
-
-
-
- -

-getTimestamp

-
-public Date getTimestamp()
-
-
Returns the timestamp.
-
Returns:
Date
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html deleted file mode 100644 index 1822504b5..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - -MOA ID API: Uses of Class at.gv.egovernment.moa.id.data.AuthenticationData - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.data.AuthenticationData

-
- - - - - -
-Uses of AuthenticationData in at.gv.egovernment.moa.id.auth
-  -

- - - - - - - - - -
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationData
- AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) - -
-          Retrieves AuthenticationData indexed by the SAML artifact. -
-  -

- - - - - -
-Uses of AuthenticationData in at.gv.egovernment.moa.id.proxy
-  -

- - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.proxy with parameters of type AuthenticationData
- MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
-  -

-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html deleted file mode 100644 index 7d9bcef1d..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - -MOA ID API: Interface ConnectionBuilder - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -at.gv.egovernment.moa.id.proxy -
-Interface ConnectionBuilder

-
-
-
public interface ConnectionBuilder
- -

-Builder for URLConnection objects used to forward requests - to the remote online application. -

-


- -

- - - - - - - - - - - - - - - - - - - - -
-Method Summary
- HttpURLConnectionbuildConnection(javax.servlet.http.HttpServletRequest request, - String publicURLPrefix, - String realURLPrefix, - javax.net.ssl.SSLSocketFactory sslSocketFactory) - -
-          Builds an HttpURLConnection to a URL which is derived - from an HttpServletRequest URL, by substitution of a - public URL prefix for the real URL prefix.
- The HttpURLConnection has been created by URL.openConnection(), but - it has not yet been connected to by URLConnection.connect().
- The field settings of the HttpURLConnection are: - - allowUserInteraction = false - doInput = true - doOutput = true - requestMethod = request.getMethod() - useCaches = false -
-  -

- - - - - - - - - - - - - - -
-Method Detail
- -

-buildConnection

-
-public HttpURLConnection buildConnection(javax.servlet.http.HttpServletRequest request,
-                                         String publicURLPrefix,
-                                         String realURLPrefix,
-                                         javax.net.ssl.SSLSocketFactory sslSocketFactory)
-                                  throws IOException
-
-
Builds an HttpURLConnection to a URL which is derived - from an HttpServletRequest URL, by substitution of a - public URL prefix for the real URL prefix.
- The HttpURLConnection has been created by URL.openConnection(), but - it has not yet been connected to by URLConnection.connect().
- The field settings of the HttpURLConnection are: -
    -
  • allowUserInteraction = false
  • -
  • doInput = true
  • -
  • doOutput = true
  • -
  • requestMethod = request.getMethod()
  • -
  • useCaches = false
  • -
-
Parameters:
request - the incoming request which shall be forwarded
publicURLPrefix - the public URL prefix to be substituted by the real URL prefix
realURLPrefix - the URL prefix to substitute the public URL prefix
sslSocketFactory - factory to be used for creating an SSL socket in case - of a URL for scheme "https:"; -
if null, the default SSL socket factory would be used
Returns:
a URLConnection created by URL.openConnection(), connecting to - the requested URL with publicURLPrefix substituted by realURLPrefix
Throws:
IOException - if an I/O exception occurs during opening the connection
See Also:
URL.openConnection(), -com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory()
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html deleted file mode 100644 index 717ab1ee6..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - -MOA ID API: Interface LoginParameterResolver - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -at.gv.egovernment.moa.id.proxy -
-Interface LoginParameterResolver

-
-
-
public interface LoginParameterResolver
- -

-Determines authentication parameters and headers to be added to a URLConnection - to the remote online application. - Utilizes OAConfiguration and AuthenticationData. -

-


- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static StringMOABKZ - -
-           
-static StringMOADateOfBirth - -
-           
-static StringMOAFamilyName - -
-           
-static StringMOAGivenName - -
-          Constants used in MOAIDConfiguration-1.1.xsd, type MOAAuthDataType, - naming predicates used by the LoginParameterResolver.
-static StringMOAIPAddress - -
-           
-static StringMOAPublicAuthority - -
-           
-static StringMOAQualifiedCertificate - -
-           
-static StringMOAVPK - -
-           
-static StringMOAZMRZahl - -
-           
-  - - - - - - - - - - - - - - - - - - -
-Method Summary
- MapgetAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapgetAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
-  -

- - - - - - - - -
-Field Detail
- -

-MOAGivenName

-
-public static final String MOAGivenName
-
-
Constants used in MOAIDConfiguration-1.1.xsd, type MOAAuthDataType, - naming predicates used by the LoginParameterResolver.
-
- -

-MOAFamilyName

-
-public static final String MOAFamilyName
-
-
-
- -

-MOADateOfBirth

-
-public static final String MOADateOfBirth
-
-
-
- -

-MOAVPK

-
-public static final String MOAVPK
-
-
-
- -

-MOAPublicAuthority

-
-public static final String MOAPublicAuthority
-
-
-
- -

-MOABKZ

-
-public static final String MOABKZ
-
-
-
- -

-MOAQualifiedCertificate

-
-public static final String MOAQualifiedCertificate
-
-
-
- -

-MOAZMRZahl

-
-public static final String MOAZMRZahl
-
-
-
- -

-MOAIPAddress

-
-public static final String MOAIPAddress
-
-
- - - - - - - - - - - -
-Method Detail
- -

-getAuthenticationHeaders

-
-public Map getAuthenticationHeaders(OAConfiguration oaConf,
-                                    AuthenticationData authData,
-                                    String clientIPAddress)
-
-
Returns authentication headers to be added to a URLConnection.
-
Parameters:
authConf - configuration data
authData - authentication data
clientIPAddress - client IP address
Returns:
A map, the keys being header names and values being corresponding header values. -
In case of authentication type "basic-auth", header fields - username and password. -
In case of authentication type "header-auth", header fields - derived from parameter mapping and authentication data provided. -
Otherwise, an empty map.
-
-
-
- -

-getAuthenticationParameters

-
-public Map getAuthenticationParameters(OAConfiguration oaConf,
-                                       AuthenticationData authData,
-                                       String clientIPAddress)
-
-
Returns request parameters to be added to a URLConnection.
-
Parameters:
authConf - configuration data
authData - authentication data
clientIPAddress - client IP address
Returns:
A map, the keys being parameter names and values being corresponding parameter values. -
In case of authentication type "param-auth", parameters - derived from parameter mapping and authentication data provided. -
Otherwise, an empty map.
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html deleted file mode 100644 index c40b34e9f..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - -MOA ID API: Uses of Interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Uses of Interface
at.gv.egovernment.moa.id.proxy.ConnectionBuilder

-
-No usage of at.gv.egovernment.moa.id.proxy.ConnectionBuilder -

-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html b/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html deleted file mode 100644 index 9bad43a2a..000000000 --- a/id.server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - -MOA ID API: Uses of Interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Uses of Interface
at.gv.egovernment.moa.id.proxy.LoginParameterResolver

-
-No usage of at.gv.egovernment.moa.id.proxy.LoginParameterResolver -

-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/deprecated-list.html b/id.server/doc/api-doc/deprecated-list.html deleted file mode 100644 index 78f7d881f..000000000 --- a/id.server/doc/api-doc/deprecated-list.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -MOA ID API: Deprecated List - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Deprecated API

-
-
- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/help-doc.html b/id.server/doc/api-doc/help-doc.html deleted file mode 100644 index 79438069d..000000000 --- a/id.server/doc/api-doc/help-doc.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - -MOA ID API: API Help - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-How This API Document Is Organized

-
-This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

-Package

-
- -

-Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    -
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
-
-

-Class/Interface

-
- -

-Each class, interface, inner class and inner interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    -
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description -

    -

  • Inner Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary -

    -

  • Field Detail
  • Constructor Detail
  • Method Detail
-Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-

-Use

-
-Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-

-Tree (Class Hierarchy)

-
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    -
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
-

-Deprecated API

-
-The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-

-Index

-
-The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-

-Prev/Next

-These links take you to the next or previous class, interface, package, or related page.

-Frames/No Frames

-These links show and hide the HTML frames. All pages are available with or without frames. -

-

-Serialized Form

-Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -

- - -This help file applies to API documentation generated using the standard doclet. - -
-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/index-all.html b/id.server/doc/api-doc/index-all.html deleted file mode 100644 index a66b0252e..000000000 --- a/id.server/doc/api-doc/index-all.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - -MOA ID API: Index - - - - - - - - - - - - - - - - - -
- -
- - -A B C G H I L M O P R S V
-

-A

-
-
AuthenticationData - class at.gv.egovernment.moa.id.data.AuthenticationData.
Encapsulates authentication data contained in a <saml:Assertion>.
AuthenticationData() - -Constructor for class at.gv.egovernment.moa.id.data.AuthenticationData -
Constructor for AuthenticationData. -
AuthenticationException - class at.gv.egovernment.moa.id.AuthenticationException.
Exception thrown during handling of AuthenticationSession
AuthenticationException(String, Object[]) - -Constructor for class at.gv.egovernment.moa.id.AuthenticationException -
Constructor for AuthenticationException. -
AuthenticationServer - class at.gv.egovernment.moa.id.auth.AuthenticationServer.
API for MOA ID Authentication Service.
- AuthenticationSession is stored in a session store and retrieved - by giving the session ID.
AuthenticationServer() - -Constructor for class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Constructor for AuthenticationServer. -
-
-

-B

-
-
BASIC_AUTH - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
buildConnection(HttpServletRequest, String, String, SSLSocketFactory) - -Method in interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder -
Builds an HttpURLConnection to a URL which is derived - from an HttpServletRequest URL, by substitution of a - public URL prefix for the real URL prefix.
- The HttpURLConnection has been created by URL.openConnection(), but - it has not yet been connected to by URLConnection.connect().
- The field settings of the HttpURLConnection are: - - allowUserInteraction = false - doInput = true - doOutput = true - requestMethod = request.getMethod() - useCaches = false - -
-
-

-C

-
-
cleanup() - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Cleans up expired session and authentication data stores. -
ConnectionBuilder - interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder.
Builder for URLConnection objects used to forward requests - to the remote online application.
-
-

-G

-
-
getAssertionID() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the assertionID. -
getAuthenticationData(String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Retrieves AuthenticationData indexed by the SAML artifact. - -
getAuthenticationHeaders(OAConfiguration, AuthenticationData, String) - -Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Returns authentication headers to be added to a URLConnection. -
getAuthenticationParameters(OAConfiguration, AuthenticationData, String) - -Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Returns request parameters to be added to a URLConnection. -
getAuthType() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the authType. -
getBasicAuthPasswordMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the basicAuthPasswordMapping. -
getBasicAuthUserIDMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the basicAuthUserIDMapping. -
getDateOfBirth() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the dateOfBirth. -
getFamilyName() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the familyName. -
getGivenName() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the givenName. -
getHeaderAuthMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the headerAuthMapping. -
getIdentificationValue() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the identificationValue. -
getInstance() - -Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Returns the single instance of AuthenticationServer. -
getIssueInstant() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the issueInstant. -
getIssuer() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the issuer. -
getLoginType() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the loginType. -
getMajorVersion() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the majorVersion. -
getMinorVersion() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the minorVersion. -
getParamAuthMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the paramAuthMapping. -
getPublicAuthorityCode() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the publicAuthorityCode. -
getSamlAssertion() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the samlAssertion. -
getSession(String) - -Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Retrieves a session from the session store. -
getTimestamp() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the timestamp. -
getVPK() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the vpk. -
-
-

-H

-
-
HEADER_AUTH - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
-
-

-I

-
-
isPublicAuthority() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the publicAuthority. -
isQualifiedCertificate() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the qualifiedCertificate. -
-
-

-L

-
-
LoginParameterResolver - interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver.
Determines authentication parameters and headers to be added to a URLConnection - to the remote online application. -
LOGINTYPE_STATEFUL - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
LOGINTYPE_STATELESS - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
-
-

-M

-
-
MOABKZ - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOADateOfBirth - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOAFamilyName - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOAGivenName - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constants used in MOAIDConfiguration-1.1.xsd, type MOAAuthDataType, - naming predicates used by the LoginParameterResolver. -
MOAIPAddress - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOAPublicAuthority - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOAQualifiedCertificate - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOAVPK - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
MOAZMRZahl - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
-
-

-O

-
-
OAConfiguration - class at.gv.egovernment.moa.id.config.proxy.OAConfiguration.
Holds configuration data concerning an online application for use by the MOA-ID Proxy component. -
OAConfiguration() - -Constructor for class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
-
-

-P

-
-
PARAM_AUTH - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
-
-

-R

-
-
REQ_START_AUTHENTICATION - -Static variable in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Request name at.gv.egovernment.moa.id.auth.servlet.StartAuthenticationServlet is mapped to -
REQ_VERIFY_AUTH_BLOCK - -Static variable in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Request name at.gv.egovernment.moa.id.auth.servlet.VerifyAuthenticationBlockServlet is mapped to -
REQ_VERIFY_IDENTITY_LINK - -Static variable in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Request name at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet is mapped to -
-
-

-S

-
-
selectBKU(String, String, String, String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes request to select a BKU. - -
setAssertionID(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the assertionID. -
setAuthType(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the authType. -
setBasicAuthPasswordMapping(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the basicAuthPasswordMapping. -
setBasicAuthUserIDMapping(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the basicAuthUserIDMapping. -
setDateOfBirth(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the dateOfBirth. -
setFamilyName(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the familyName. -
setGivenName(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the givenName. -
setHeaderAuthMapping(HashMap) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the headerAuthMapping. -
setIdentificationValue(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the identificationValue. -
setIssueInstant(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the issueInstant. -
setIssuer(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the issuer. -
setLoginType(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the loginType. -
setMajorVersion(int) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the majorVersion. -
setMinorVersion(int) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the minorVersion. -
setParamAuthMapping(HashMap) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the paramAuthMapping. -
setPublicAuthority(boolean) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the publicAuthority. -
setPublicAuthorityCode(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the publicAuthorityCode. -
setQualifiedCertificate(boolean) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the qualifiedCertificate. -
setSamlAssertion(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the samlAssertion. -
setSecondsAuthDataTimeOut(long) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Sets the authDataTimeOut. -
setSecondsSessionTimeOut(long) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Sets the sessionTimeOut. -
setVPK(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the vpk. -
startAuthentication(String, String, String, String, String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes the beginning of an authentication session. - -
-
-

-V

-
-
verifyAuthenticationBlock(String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes a <CreateXMLSignatureResponse> sent by the - security layer implementation.
- - Validates given <CreateXMLSignatureResponse> - Parses <CreateXMLSignatureResponse> for error codes - Parses authentication block enclosed in - <CreateXMLSignatureResponse> - Verifies authentication block by calling the MOA SP component - Creates authentication data - Creates a corresponding SAML artifact - Stores authentication data in the authentication data store - indexed by the SAML artifact - Deletes authentication session - Returns the SAML artifact, encoded BASE64 - -
verifyIdentityLink(String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes an <InfoboxReadResponse> sent by the - security layer implementation.
- - Validates given <InfoboxReadResponse> - Parses identity link enclosed in <InfoboxReadResponse> - Verifies identity link by calling the MOA SP component - Checks certificate authority of identity link - Stores identity link in the session - Creates an authentication block to be signed by the user - Creates and returns a <CreateXMLSignatureRequest> - containg the authentication block, meant to be returned to the - security layer implementation - -
-
-A B C G H I L M O P R S V - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/index.html b/id.server/doc/api-doc/index.html deleted file mode 100644 index 7eb5deff7..000000000 --- a/id.server/doc/api-doc/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -MOA ID API - - - - - - - -<H2> -Frame Alert</H2> - -<P> -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to <A HREF="at/gv/egovernment/moa/id/data/AuthenticationData.html">Non-frame version.</A> - diff --git a/id.server/doc/api-doc/overview-tree.html b/id.server/doc/api-doc/overview-tree.html deleted file mode 100644 index bcd54df75..000000000 --- a/id.server/doc/api-doc/overview-tree.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - -MOA ID API: Class Hierarchy - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Hierarchy For All Packages

-
-

-Class Hierarchy -

- -

-Interface Hierarchy -

- -
- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/package-list b/id.server/doc/api-doc/package-list deleted file mode 100644 index e69de29bb..000000000 diff --git a/id.server/doc/api-doc/packages.html b/id.server/doc/api-doc/packages.html deleted file mode 100644 index f5dd01736..000000000 --- a/id.server/doc/api-doc/packages.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -MOA ID API - - - - - -
- -
- -
-
-The front page has been renamed.Please see: -
-          Frame version -
-          Non-frame version.
- - - diff --git a/id.server/doc/api-doc/serialized-form.html b/id.server/doc/api-doc/serialized-form.html deleted file mode 100644 index 09311e7c2..000000000 --- a/id.server/doc/api-doc/serialized-form.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -Serialized Form - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Serialized Form

-
-
- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/id.server/doc/api-doc/stylesheet.css b/id.server/doc/api-doc/stylesheet.css deleted file mode 100644 index 74a3534ae..000000000 --- a/id.server/doc/api-doc/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF } - -/* Table colors */ -#TableHeadingColor { background: #CCCCFF } /* Dark mauve */ -#TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ -#TableRowColor { background: #FFFFFF } /* White */ - -/* Font used in left-hand frame lists */ -#FrameTitleFont { font-size: normal; font-family: normal } -#FrameHeadingFont { font-size: normal; font-family: normal } -#FrameItemFont { font-size: normal; font-family: normal } - -/* Example of smaller, sans-serif font in frames */ -/* #FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ - -/* Navigation bar fonts and colors */ -#NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ -#NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ -#NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} -#NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} - -#NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} -#NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} - diff --git a/id.server/doc/bku-auswahl.20030408.pdf b/id.server/doc/bku-auswahl.20030408.pdf deleted file mode 100644 index 39efe315f..000000000 Binary files a/id.server/doc/bku-auswahl.20030408.pdf and /dev/null differ diff --git a/id.server/doc/cs-sstc-schema-assertion-01.xsd b/id.server/doc/cs-sstc-schema-assertion-01.xsd deleted file mode 100644 index 8bc5af147..000000000 --- a/id.server/doc/cs-sstc-schema-assertion-01.xsd +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - Document identifier: cs-sstc-schema-assertion-01 - Location: http://www.oasis-open.org/committees/security/docs/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/doc/cs-sstc-schema-protocol-01.xsd b/id.server/doc/cs-sstc-schema-protocol-01.xsd deleted file mode 100644 index ecad05b0f..000000000 --- a/id.server/doc/cs-sstc-schema-protocol-01.xsd +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - Document identifier: cs-sstc-schema-protocol-01 - Location: http://www.oasis-open.org/committees/security/docs/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/doc/moa-id.htm b/id.server/doc/moa-id.htm deleted file mode 100644 index 82e5adc19..000000000 --- a/id.server/doc/moa-id.htm +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/id.server/doc/moa_id/api-doc/allclasses-frame.html b/id.server/doc/moa_id/api-doc/allclasses-frame.html deleted file mode 100644 index 9e051d7b1..000000000 --- a/id.server/doc/moa_id/api-doc/allclasses-frame.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - -All Classes (MOA ID API) - - - - - - - - - - -All Classes -
- - - - - -
AuthenticationData -
-AuthenticationException -
-AuthenticationServer -
-ConnectionBuilder -
-LoginParameterResolver -
-LoginParameterResolverException -
-NotAllowedException -
-OAConfiguration -
-
- - - diff --git a/id.server/doc/moa_id/api-doc/allclasses-noframe.html b/id.server/doc/moa_id/api-doc/allclasses-noframe.html deleted file mode 100644 index dc5c0fb5f..000000000 --- a/id.server/doc/moa_id/api-doc/allclasses-noframe.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - -All Classes (MOA ID API) - - - - - - - - - - -All Classes -
- - - - - -
AuthenticationData -
-AuthenticationException -
-AuthenticationServer -
-ConnectionBuilder -
-LoginParameterResolver -
-LoginParameterResolverException -
-NotAllowedException -
-OAConfiguration -
-
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html deleted file mode 100644 index a11ad6242..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - -AuthenticationException (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id -
-Class AuthenticationException

-
-java.lang.Object
-  extended byMOAIDException
-      extended byat.gv.egovernment.moa.id.AuthenticationException
-
-
-
-
public class AuthenticationException
extends MOAIDException
- -

-Exception thrown during handling of AuthenticationSession -

- -

-

-
See Also:
Serialized Form
-
- -

- - - - - - - - - - - - - - - - - - - -
-Constructor Summary
AuthenticationException(String messageId, - Object[] parameters) - -
-          Constructor for AuthenticationException.
AuthenticationException(String messageId, - Object[] parameters, - Throwable wrapped) - -
-          Constructor for AuthenticationException.
-  - - - - - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-AuthenticationException

-
-public AuthenticationException(String messageId,
-                               Object[] parameters)
-
-
Constructor for AuthenticationException. -

-

Parameters:
messageId -
-
- -

-AuthenticationException

-
-public AuthenticationException(String messageId,
-                               Object[] parameters,
-                               Throwable wrapped)
-
-
Constructor for AuthenticationException. -

-

Parameters:
messageId -
parameters -
wrapped -
- - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html deleted file mode 100644 index b5be8a054..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html +++ /dev/null @@ -1,631 +0,0 @@ - - - - - - -AuthenticationServer (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.auth -
-Class AuthenticationServer

-
-java.lang.Object
-  extended byat.gv.egovernment.moa.id.auth.AuthenticationServer
-
-
-
-
public class AuthenticationServer
extends Object
- -

-API for MOA ID Authentication Service.
- AuthenticationSession is stored in a session store and retrieved - by giving the session ID. -

- -

-


- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
AuthenticationServer() - -
-          Constructor for AuthenticationServer.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- voidcleanup() - -
-          Cleans up expired session and authentication data stores.
-static voiddebugOutputXMLFile(String filename, - org.w3c.dom.Element rootElem) - -
-          Writes an XML structure to file for debugging purposes, encoding UTF-8.
-static voiddebugOutputXMLFile(String filename, - String xmlString) - -
-          Writes an XML structure to file for debugging purposes, encoding UTF-8.
- AuthenticationDatagetAuthenticationData(String samlArtifact) - -
-          Retrieves AuthenticationData indexed by the SAML artifact. -
-static AuthenticationServergetInstance() - -
-          Returns the single instance of AuthenticationServer.
-static AuthenticationSessiongetSession(String id) - -
-          Retrieves a session from the session store.
- StringselectBKU(String authURL, - String target, - String oaURL, - String bkuSelectionTemplateURL, - String templateURL) - -
-          Processes request to select a BKU. -
- voidsetSecondsAuthDataTimeOut(long seconds) - -
-          Sets the authDataTimeOut.
- voidsetSecondsSessionTimeOut(long seconds) - -
-          Sets the sessionTimeOut.
- StringstartAuthentication(String authURL, - String target, - String oaURL, - String templateURL, - String bkuURL, - String sessionID) - -
-          Processes the beginning of an authentication session. -
- StringverifyAuthenticationBlock(String sessionID, - String xmlCreateXMLSignatureReadResponse) - -
-          Processes a <CreateXMLSignatureResponse> sent by the - security layer implementation.
- StringverifyIdentityLink(String sessionID, - String xmlInfoboxReadResponse) - -
-          Processes an <InfoboxReadResponse> sent by the - security layer implementation.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-AuthenticationServer

-
-public AuthenticationServer()
-
-
Constructor for AuthenticationServer. -

-

- - - - - - - - -
-Method Detail
- -

-getInstance

-
-public static AuthenticationServer getInstance()
-
-
Returns the single instance of AuthenticationServer. -

-

- -
Returns:
the single instance of AuthenticationServer
-
-
-
- -

-selectBKU

-
-public String selectBKU(String authURL,
-                        String target,
-                        String oaURL,
-                        String bkuSelectionTemplateURL,
-                        String templateURL)
-                 throws WrongParametersException,
-                        AuthenticationException,
-                        ConfigurationException,
-                        BuildException
-
-
Processes request to select a BKU. -
Processing depends on value of AuthConfigurationProvider#getBKUSelectionType. -
For bkuSelectionType==HTMLComplete, a returnURI for the - "BKU Auswahl" service is returned. -
For bkuSelectionType==HTMLSelect, an HTML form for BKU selection is returned. -

-

-
Parameters:
authURL - base URL of MOA-ID Auth component
target - "Geschäftsbereich"
oaURL - online application URL requested
bkuSelectionTemplateURL - template for BKU selection form to be used - in case of HTMLSelect; may be null
templateURL - URL providing an HTML template for the HTML form to be used - for call startAuthentication -
Returns:
for bkuSelectionType==HTMLComplete, the returnURI for the - "BKU Auswahl" service; - for bkuSelectionType==HTMLSelect, an HTML form for BKU selection -
Throws: -
WrongParametersException - upon missing parameters -
AuthenticationException - when the configured BKU selection service cannot be reached, - and when the given bkuSelectionTemplateURL cannot be reached -
ConfigurationException - on missing configuration data -
BuildException - while building the HTML form
-
-
-
- -

-startAuthentication

-
-public String startAuthentication(String authURL,
-                                  String target,
-                                  String oaURL,
-                                  String templateURL,
-                                  String bkuURL,
-                                  String sessionID)
-                           throws WrongParametersException,
-                                  AuthenticationException,
-                                  ConfigurationException,
-                                  BuildException
-
-
Processes the beginning of an authentication session. -
    -
  • Starts an authentication session
  • -
  • Creates an <InfoboxReadRequest>
  • -
  • Creates an HTML form for querying the identity link from the - security layer implementation. -
    Form parameters include -
      -
    • the <InfoboxReadRequest>
    • -
    • the data URL where the security layer implementation sends it response to
    • -
    -
-

-

-
Parameters:
authURL - URL of the servlet to be used as data URL
target - "Geschäftsbereich" of the online application requested
oaURL - online application URL requested
bkuURL - URL of the "Bürgerkartenumgebung" to be used; - may be null; in this case, the default location will be used
templateURL - URL providing an HTML template for the HTML form generated -
Returns:
HTML form -
Throws: -
AuthenticationException -
WrongParametersException -
ConfigurationException -
BuildException
See Also:
GetIdentityLinkFormBuilder, -InfoboxReadRequestBuilder
-
-
-
- -

-verifyIdentityLink

-
-public String verifyIdentityLink(String sessionID,
-                                 String xmlInfoboxReadResponse)
-                          throws AuthenticationException,
-                                 ParseException,
-                                 ConfigurationException,
-                                 ValidateException,
-                                 ServiceException
-
-
Processes an <InfoboxReadResponse> sent by the - security layer implementation.
-
    -
  • Validates given <InfoboxReadResponse>
  • -
  • Parses identity link enclosed in <InfoboxReadResponse>
  • -
  • Verifies identity link by calling the MOA SP component
  • -
  • Checks certificate authority of identity link
  • -
  • Stores identity link in the session
  • -
  • Creates an authentication block to be signed by the user
  • -
  • Creates and returns a <CreateXMLSignatureRequest> - containg the authentication block, meant to be returned to the - security layer implementation
  • -
-

-

-
Parameters:
sessionID - ID of associated authentication session data
xmlInfoboxReadResponse - String representation of the - <InfoboxReadResponse> -
Returns:
String representation of the <CreateXMLSignatureRequest> -
Throws: -
AuthenticationException -
ParseException -
ConfigurationException -
ValidateException -
ServiceException
-
-
-
- -

-verifyAuthenticationBlock

-
-public String verifyAuthenticationBlock(String sessionID,
-                                        String xmlCreateXMLSignatureReadResponse)
-                                 throws AuthenticationException,
-                                        BuildException,
-                                        ParseException,
-                                        ConfigurationException,
-                                        ServiceException,
-                                        ValidateException
-
-
Processes a <CreateXMLSignatureResponse> sent by the - security layer implementation.
-
    -
  • Validates given <CreateXMLSignatureResponse>
  • -
  • Parses <CreateXMLSignatureResponse> for error codes
  • -
  • Parses authentication block enclosed in - <CreateXMLSignatureResponse>
  • -
  • Verifies authentication block by calling the MOA SP component
  • -
  • Creates authentication data
  • -
  • Creates a corresponding SAML artifact
  • -
  • Stores authentication data in the authentication data store - indexed by the SAML artifact
  • -
  • Deletes authentication session
  • -
  • Returns the SAML artifact, encoded BASE64
  • -
-

-

-
Parameters:
sessionID - session ID of the running authentication session
xmlCreateXMLSignatureReadResponse - String representation of the - <CreateXMLSignatureResponse> -
Returns:
SAML artifact needed for retrieving authentication data, encoded BASE64 -
Throws: -
AuthenticationException -
BuildException -
ParseException -
ConfigurationException -
ServiceException -
ValidateException
-
-
-
- -

-getAuthenticationData

-
-public AuthenticationData getAuthenticationData(String samlArtifact)
-                                         throws AuthenticationException
-
-
Retrieves AuthenticationData indexed by the SAML artifact. - The AuthenticationData is deleted from the store upon end of this call. -

-

- -
Returns:
AuthenticationData -
Throws: -
AuthenticationException
-
-
-
- -

-getSession

-
-public static AuthenticationSession getSession(String id)
-                                        throws AuthenticationException
-
-
Retrieves a session from the session store. -

-

-
Parameters:
id - session ID -
Returns:
AuthenticationSession stored with given session ID, - null if session ID unknown -
Throws: -
AuthenticationException
-
-
-
- -

-cleanup

-
-public void cleanup()
-
-
Cleans up expired session and authentication data stores. -

-

-
-
-
-
- -

-setSecondsSessionTimeOut

-
-public void setSecondsSessionTimeOut(long seconds)
-
-
Sets the sessionTimeOut. -

-

-
-
-
-
- -

-setSecondsAuthDataTimeOut

-
-public void setSecondsAuthDataTimeOut(long seconds)
-
-
Sets the authDataTimeOut. -

-

-
-
-
-
- -

-debugOutputXMLFile

-
-public static void debugOutputXMLFile(String filename,
-                                      org.w3c.dom.Element rootElem)
-
-
Writes an XML structure to file for debugging purposes, encoding UTF-8. -

-

-
Parameters:
filename - file name
rootElem - root element in DOM tree
-
-
-
- -

-debugOutputXMLFile

-
-public static void debugOutputXMLFile(String filename,
-                                      String xmlString)
-
-
Writes an XML structure to file for debugging purposes, encoding UTF-8. -

-

-
Parameters:
filename - file name
xmlString - XML string
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html deleted file mode 100644 index 53f0912b1..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - -Uses of Class at.gv.egovernment.moa.id.auth.AuthenticationServer (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.auth.AuthenticationServer

-
- - - - - - - - - -
-Packages that use AuthenticationServer
at.gv.egovernment.moa.id.auth  
-  -

- - - - - -
-Uses of AuthenticationServer in at.gv.egovernment.moa.id.auth
-  -

- - - - - - - - - -
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationServer
-static AuthenticationServerAuthenticationServer.getInstance() - -
-          Returns the single instance of AuthenticationServer.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html deleted file mode 100644 index 013ac6e16..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.auth (MOA ID API) - - - - - - - - - - - -at.gv.egovernment.moa.id.auth - - - - -
-Classes  - -
-AuthenticationServer
- - - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html deleted file mode 100644 index 1fadccfd1..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.auth (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-

-Package at.gv.egovernment.moa.id.auth -

- - - - - - - - - -
-Class Summary
AuthenticationServerAPI for MOA ID Authentication Service.
-  - -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html deleted file mode 100644 index ed050ad9e..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.auth Class Hierarchy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package at.gv.egovernment.moa.id.auth -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html deleted file mode 100644 index 54bd8b9fb..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - -Uses of Package at.gv.egovernment.moa.id.auth (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
at.gv.egovernment.moa.id.auth

-
- - - - - - - - - -
-Packages that use at.gv.egovernment.moa.id.auth
at.gv.egovernment.moa.id.auth  
-  -

- - - - - - - - -
-Classes in at.gv.egovernment.moa.id.auth used by at.gv.egovernment.moa.id.auth
AuthenticationServer - -
-          API for MOA ID Authentication Service.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html deleted file mode 100644 index d844f1ac0..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - -Uses of Class at.gv.egovernment.moa.id.AuthenticationException (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.AuthenticationException

-
- - - - - - - - - -
-Packages that use AuthenticationException
at.gv.egovernment.moa.id.auth  
-  -

- - - - - -
-Uses of AuthenticationException in at.gv.egovernment.moa.id.auth
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.auth that throw AuthenticationException
- StringAuthenticationServer.selectBKU(String authURL, - String target, - String oaURL, - String bkuSelectionTemplateURL, - String templateURL) - -
-          Processes request to select a BKU. -
- StringAuthenticationServer.startAuthentication(String authURL, - String target, - String oaURL, - String templateURL, - String bkuURL, - String sessionID) - -
-          Processes the beginning of an authentication session. -
- StringAuthenticationServer.verifyIdentityLink(String sessionID, - String xmlInfoboxReadResponse) - -
-          Processes an <InfoboxReadResponse> sent by the - security layer implementation.
- StringAuthenticationServer.verifyAuthenticationBlock(String sessionID, - String xmlCreateXMLSignatureReadResponse) - -
-          Processes a <CreateXMLSignatureResponse> sent by the - security layer implementation.
- AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) - -
-          Retrieves AuthenticationData indexed by the SAML artifact. -
-static AuthenticationSessionAuthenticationServer.getSession(String id) - -
-          Retrieves a session from the session store.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html deleted file mode 100644 index afeb1a482..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html +++ /dev/null @@ -1,613 +0,0 @@ - - - - - - -OAConfiguration (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.config.proxy -
-Class OAConfiguration

-
-java.lang.Object
-  extended byat.gv.egovernment.moa.id.config.proxy.OAConfiguration
-
-
-
-
public class OAConfiguration
extends Object
- -

-Holds configuration data concerning an online application for use by the MOA-ID Proxy component. - These include the login type (stateful or stateless), the HTTP authentication type, - and information needed to add authentication parameters or headers for a URL connection - to the remote online application. -

- -

-

-
See Also:
MOAIDConfiguration-1.1.xsd, element Configuration
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static StringBASIC_AUTH - -
-          Constant for an auth method
-static StringHEADER_AUTH - -
-          Constant for an auth method
-static StringLOGINTYPE_STATEFUL - -
-          Constant for an login method
-static StringLOGINTYPE_STATELESS - -
-          Constant for an login method
-static StringPARAM_AUTH - -
-          Constant for an auth method
-  - - - - - - - - - - -
-Constructor Summary
OAConfiguration() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- StringgetAuthType() - -
-          Returns the authType.
- StringgetBasicAuthPasswordMapping() - -
-          Returns the basicAuthPasswordMapping.
- StringgetBasicAuthUserIDMapping() - -
-          Returns the basicAuthUserIDMapping.
- MapgetHeaderAuthMapping() - -
-          Returns the headerAuthMapping.
- StringgetLoginType() - -
-          Returns the loginType.
- MapgetParamAuthMapping() - -
-          Returns the paramAuthMapping.
- voidsetAuthType(String authLoginType) - -
-          Sets the authType.
- voidsetBasicAuthPasswordMapping(String basicAuthPassword) - -
-          Sets the basicAuthPasswordMapping.
- voidsetBasicAuthUserIDMapping(String basicAuthUserID) - -
-          Sets the basicAuthUserIDMapping.
- voidsetHeaderAuthMapping(HashMap headerAuth) - -
-          Sets the headerAuthMapping.
- voidsetLoginType(String loginType) - -
-          Sets the loginType.
- voidsetParamAuthMapping(HashMap paramAuth) - -
-          Sets the paramAuthMapping.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-LOGINTYPE_STATEFUL

-
-public static final String LOGINTYPE_STATEFUL
-
-
Constant for an login method -

-

-
See Also:
Constant Field Values
-
-
- -

-LOGINTYPE_STATELESS

-
-public static final String LOGINTYPE_STATELESS
-
-
Constant for an login method -

-

-
See Also:
Constant Field Values
-
-
- -

-BASIC_AUTH

-
-public static final String BASIC_AUTH
-
-
Constant for an auth method -

-

-
See Also:
Constant Field Values
-
-
- -

-HEADER_AUTH

-
-public static final String HEADER_AUTH
-
-
Constant for an auth method -

-

-
See Also:
Constant Field Values
-
-
- -

-PARAM_AUTH

-
-public static final String PARAM_AUTH
-
-
Constant for an auth method -

-

-
See Also:
Constant Field Values
-
- - - - - - - - -
-Constructor Detail
- -

-OAConfiguration

-
-public OAConfiguration()
-
-
- - - - - - - - -
-Method Detail
- -

-getBasicAuthPasswordMapping

-
-public String getBasicAuthPasswordMapping()
-
-
Returns the basicAuthPasswordMapping. -

-

- -
Returns:
String
-
-
-
- -

-getBasicAuthUserIDMapping

-
-public String getBasicAuthUserIDMapping()
-
-
Returns the basicAuthUserIDMapping. -

-

- -
Returns:
String
-
-
-
- -

-getHeaderAuthMapping

-
-public Map getHeaderAuthMapping()
-
-
Returns the headerAuthMapping. -

-

- -
Returns:
HashMap
-
-
-
- -

-getLoginType

-
-public String getLoginType()
-
-
Returns the loginType. -

-

- -
Returns:
String
-
-
-
- -

-getParamAuthMapping

-
-public Map getParamAuthMapping()
-
-
Returns the paramAuthMapping. -

-

- -
Returns:
HashMap
-
-
-
- -

-setBasicAuthPasswordMapping

-
-public void setBasicAuthPasswordMapping(String basicAuthPassword)
-
-
Sets the basicAuthPasswordMapping. -

-

-
-
-
-
- -

-setBasicAuthUserIDMapping

-
-public void setBasicAuthUserIDMapping(String basicAuthUserID)
-
-
Sets the basicAuthUserIDMapping. -

-

-
-
-
-
- -

-setHeaderAuthMapping

-
-public void setHeaderAuthMapping(HashMap headerAuth)
-
-
Sets the headerAuthMapping. -

-

-
-
-
-
- -

-setLoginType

-
-public void setLoginType(String loginType)
-
-
Sets the loginType. -

-

-
Parameters:
loginType - The loginType to set
-
-
-
- -

-setParamAuthMapping

-
-public void setParamAuthMapping(HashMap paramAuth)
-
-
Sets the paramAuthMapping. -

-

-
-
-
-
- -

-getAuthType

-
-public String getAuthType()
-
-
Returns the authType. -

-

- -
Returns:
String
-
-
-
- -

-setAuthType

-
-public void setAuthType(String authLoginType)
-
-
Sets the authType. -

-

-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html deleted file mode 100644 index 5e33084ad..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - -Uses of Class at.gv.egovernment.moa.id.config.proxy.OAConfiguration (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.config.proxy.OAConfiguration

-
- - - - - - - - - -
-Packages that use OAConfiguration
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - -
-Uses of OAConfiguration in at.gv.egovernment.moa.id.proxy
-  -

- - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.proxy with parameters of type OAConfiguration
- MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html deleted file mode 100644 index 442356ce1..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.config.proxy (MOA ID API) - - - - - - - - - - - -at.gv.egovernment.moa.id.config.proxy - - - - -
-Classes  - -
-OAConfiguration
- - - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html deleted file mode 100644 index 482aecc48..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.config.proxy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-

-Package at.gv.egovernment.moa.id.config.proxy -

- - - - - - - - - -
-Class Summary
OAConfigurationHolds configuration data concerning an online application for use by the MOA-ID Proxy component. -
-  - -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html deleted file mode 100644 index e66568757..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.config.proxy Class Hierarchy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package at.gv.egovernment.moa.id.config.proxy -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html deleted file mode 100644 index 184fcb226..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - -Uses of Package at.gv.egovernment.moa.id.config.proxy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
at.gv.egovernment.moa.id.config.proxy

-
- - - - - - - - - -
-Packages that use at.gv.egovernment.moa.id.config.proxy
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - - - - -
-Classes in at.gv.egovernment.moa.id.config.proxy used by at.gv.egovernment.moa.id.proxy
OAConfiguration - -
-          Holds configuration data concerning an online application for use by the MOA-ID Proxy component. -
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html deleted file mode 100644 index d6bc30647..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html +++ /dev/null @@ -1,906 +0,0 @@ - - - - - - -AuthenticationData (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.data -
-Class AuthenticationData

-
-java.lang.Object
-  extended byat.gv.egovernment.moa.id.data.AuthenticationData
-
-
-
-
public class AuthenticationData
extends Object
- -

-Encapsulates authentication data contained in a <saml:Assertion>. -

- -

-


- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
AuthenticationData() - -
-          Constructor for AuthenticationData.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- StringgetAssertionID() - -
-          Returns the assertionID.
- StringgetDateOfBirth() - -
-          Returns the dateOfBirth.
- StringgetFamilyName() - -
-          Returns the familyName.
- StringgetGivenName() - -
-          Returns the givenName.
- StringgetIdentificationType() - -
-          Returns the identificationType
- StringgetIdentificationValue() - -
-          Returns the identificationValue.
- StringgetIssueInstant() - -
-          Returns the issueInstant.
- StringgetIssuer() - -
-          Returns the issuer.
- intgetMajorVersion() - -
-          Returns the majorVersion.
- intgetMinorVersion() - -
-          Returns the minorVersion.
- StringgetPBK() - -
-          Returns the bPK.
- StringgetPublicAuthorityCode() - -
-          Returns the publicAuthorityCode.
- StringgetSamlAssertion() - -
-          Returns the samlAssertion.
- DategetTimestamp() - -
-          Returns the timestamp.
- booleanisPublicAuthority() - -
-          Returns the publicAuthority.
- booleanisQualifiedCertificate() - -
-          Returns the qualifiedCertificate.
- voidsetAssertionID(String assertionID) - -
-          Sets the assertionID.
- voidsetDateOfBirth(String dateOfBirth) - -
-          Sets the dateOfBirth.
- voidsetFamilyName(String gamilyName) - -
-          Sets the familyName.
- voidsetGivenName(String givenName) - -
-          Sets the givenName.
- voidsetIdentificationType(String identificationType) - -
-          Sets the identificationType.
- voidsetIdentificationValue(String identificationValue) - -
-          Sets the identificationValue.
- voidsetIssueInstant(String issueInstant) - -
-          Sets the issueInstant.
- voidsetIssuer(String issuer) - -
-          Sets the issuer.
- voidsetMajorVersion(int majorVersion) - -
-          Sets the majorVersion.
- voidsetMinorVersion(int minorVersion) - -
-          Sets the minorVersion.
- voidsetPBK(String bPK) - -
-          Sets the bPK.
- voidsetPublicAuthority(boolean publicAuthority) - -
-          Sets the publicAuthority.
- voidsetPublicAuthorityCode(String publicAuthorityIdentification) - -
-          Sets the publicAuthorityCode.
- voidsetQualifiedCertificate(boolean qualifiedCertificate) - -
-          Sets the qualifiedCertificate.
- voidsetSamlAssertion(String samlAssertion) - -
-          Sets the samlAssertion.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-AuthenticationData

-
-public AuthenticationData()
-
-
Constructor for AuthenticationData. -

-

- - - - - - - - -
-Method Detail
- -

-getMinorVersion

-
-public int getMinorVersion()
-
-
Returns the minorVersion. -

-

- -
Returns:
int
-
-
-
- -

-isPublicAuthority

-
-public boolean isPublicAuthority()
-
-
Returns the publicAuthority. -

-

- -
Returns:
boolean
-
-
-
- -

-getPublicAuthorityCode

-
-public String getPublicAuthorityCode()
-
-
Returns the publicAuthorityCode. -

-

- -
Returns:
String
-
-
-
- -

-isQualifiedCertificate

-
-public boolean isQualifiedCertificate()
-
-
Returns the qualifiedCertificate. -

-

- -
Returns:
boolean
-
-
-
- -

-getPBK

-
-public String getPBK()
-
-
Returns the bPK. -

-

- -
Returns:
String
-
-
-
- -

-setMinorVersion

-
-public void setMinorVersion(int minorVersion)
-
-
Sets the minorVersion. -

-

-
Parameters:
minorVersion - The minorVersion to set
-
-
-
- -

-setPublicAuthority

-
-public void setPublicAuthority(boolean publicAuthority)
-
-
Sets the publicAuthority. -

-

-
Parameters:
publicAuthority - The publicAuthority to set
-
-
-
- -

-setPublicAuthorityCode

-
-public void setPublicAuthorityCode(String publicAuthorityIdentification)
-
-
Sets the publicAuthorityCode. -

-

-
-
-
-
- -

-setQualifiedCertificate

-
-public void setQualifiedCertificate(boolean qualifiedCertificate)
-
-
Sets the qualifiedCertificate. -

-

-
Parameters:
qualifiedCertificate - The qualifiedCertificate to set
-
-
-
- -

-setPBK

-
-public void setPBK(String bPK)
-
-
Sets the bPK. -

-

-
Parameters:
bPK - The bPK to set
-
-
-
- -

-getAssertionID

-
-public String getAssertionID()
-
-
Returns the assertionID. -

-

- -
Returns:
String
-
-
-
- -

-getDateOfBirth

-
-public String getDateOfBirth()
-
-
Returns the dateOfBirth. -

-

- -
Returns:
String
-
-
-
- -

-getFamilyName

-
-public String getFamilyName()
-
-
Returns the familyName. -

-

- -
Returns:
String
-
-
-
- -

-getGivenName

-
-public String getGivenName()
-
-
Returns the givenName. -

-

- -
Returns:
String
-
-
-
- -

-getIdentificationValue

-
-public String getIdentificationValue()
-
-
Returns the identificationValue. -

-

- -
Returns:
String
-
-
-
- -

-getIdentificationType

-
-public String getIdentificationType()
-
-
Returns the identificationType -

-

- -
Returns:
String
-
-
-
- -

-getIssueInstant

-
-public String getIssueInstant()
-
-
Returns the issueInstant. -

-

- -
Returns:
String
-
-
-
- -

-getIssuer

-
-public String getIssuer()
-
-
Returns the issuer. -

-

- -
Returns:
String
-
-
-
- -

-getMajorVersion

-
-public int getMajorVersion()
-
-
Returns the majorVersion. -

-

- -
Returns:
int
-
-
-
- -

-setAssertionID

-
-public void setAssertionID(String assertionID)
-
-
Sets the assertionID. -

-

-
Parameters:
assertionID - The assertionID to set
-
-
-
- -

-setDateOfBirth

-
-public void setDateOfBirth(String dateOfBirth)
-
-
Sets the dateOfBirth. -

-

-
Parameters:
dateOfBirth - The dateOfBirth to set
-
-
-
- -

-setFamilyName

-
-public void setFamilyName(String gamilyName)
-
-
Sets the familyName. -

-

-
-
-
-
- -

-setGivenName

-
-public void setGivenName(String givenName)
-
-
Sets the givenName. -

-

-
Parameters:
givenName - The givenName to set
-
-
-
- -

-setIdentificationValue

-
-public void setIdentificationValue(String identificationValue)
-
-
Sets the identificationValue. -

-

-
Parameters:
identificationValue - The identificationValue to set
-
-
-
- -

-setIdentificationType

-
-public void setIdentificationType(String identificationType)
-
-
Sets the identificationType. -

-

-
Parameters:
identificationType - The identificationType to set
-
-
-
- -

-setIssueInstant

-
-public void setIssueInstant(String issueInstant)
-
-
Sets the issueInstant. -

-

-
Parameters:
issueInstant - The issueInstant to set
-
-
-
- -

-setIssuer

-
-public void setIssuer(String issuer)
-
-
Sets the issuer. -

-

-
Parameters:
issuer - The issuer to set
-
-
-
- -

-setMajorVersion

-
-public void setMajorVersion(int majorVersion)
-
-
Sets the majorVersion. -

-

-
Parameters:
majorVersion - The majorVersion to set
-
-
-
- -

-getSamlAssertion

-
-public String getSamlAssertion()
-
-
Returns the samlAssertion. -

-

- -
Returns:
String
-
-
-
- -

-setSamlAssertion

-
-public void setSamlAssertion(String samlAssertion)
-
-
Sets the samlAssertion. -

-

-
Parameters:
samlAssertion - The samlAssertion to set
-
-
-
- -

-getTimestamp

-
-public Date getTimestamp()
-
-
Returns the timestamp. -

-

- -
Returns:
Date
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html deleted file mode 100644 index 44c47942a..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - -Uses of Class at.gv.egovernment.moa.id.data.AuthenticationData (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.data.AuthenticationData

-
- - - - - - - - - - - - - -
-Packages that use AuthenticationData
at.gv.egovernment.moa.id.auth  
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - -
-Uses of AuthenticationData in at.gv.egovernment.moa.id.auth
-  -

- - - - - - - - - -
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationData
- AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) - -
-          Retrieves AuthenticationData indexed by the SAML artifact. -
-  -

- - - - - -
-Uses of AuthenticationData in at.gv.egovernment.moa.id.proxy
-  -

- - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.proxy with parameters of type AuthenticationData
- MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html deleted file mode 100644 index b3be4f39a..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.data (MOA ID API) - - - - - - - - - - - -at.gv.egovernment.moa.id.data - - - - -
-Classes  - -
-AuthenticationData
- - - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html deleted file mode 100644 index 28b8dd351..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.data (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-

-Package at.gv.egovernment.moa.id.data -

- - - - - - - - - -
-Class Summary
AuthenticationDataEncapsulates authentication data contained in a <saml:Assertion>.
-  - -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html deleted file mode 100644 index 6911edcdb..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.data Class Hierarchy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package at.gv.egovernment.moa.id.data -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html deleted file mode 100644 index c90a703c9..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - -Uses of Package at.gv.egovernment.moa.id.data (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
at.gv.egovernment.moa.id.data

-
- - - - - - - - - - - - - -
-Packages that use at.gv.egovernment.moa.id.data
at.gv.egovernment.moa.id.auth  
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - - - - -
-Classes in at.gv.egovernment.moa.id.data used by at.gv.egovernment.moa.id.auth
AuthenticationData - -
-          Encapsulates authentication data contained in a <saml:Assertion>.
-  -

- - - - - - - - -
-Classes in at.gv.egovernment.moa.id.data used by at.gv.egovernment.moa.id.proxy
AuthenticationData - -
-          Encapsulates authentication data contained in a <saml:Assertion>.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html deleted file mode 100644 index 9c4352356..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id (MOA ID API) - - - - - - - - - - - -at.gv.egovernment.moa.id - - - - -
-Classes  - -
-AuthenticationException
- - - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html deleted file mode 100644 index 3750976f2..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-

-Package at.gv.egovernment.moa.id -

- - - - - - - - - -
-Class Summary
AuthenticationExceptionException thrown during handling of AuthenticationSession
-  - -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html deleted file mode 100644 index ebf3b1498..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id Class Hierarchy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package at.gv.egovernment.moa.id -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html deleted file mode 100644 index bc895c974..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - -Uses of Package at.gv.egovernment.moa.id (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
at.gv.egovernment.moa.id

-
- - - - - - - - - -
-Packages that use at.gv.egovernment.moa.id
at.gv.egovernment.moa.id.auth  
-  -

- - - - - - - - -
-Classes in at.gv.egovernment.moa.id used by at.gv.egovernment.moa.id.auth
AuthenticationException - -
-          Exception thrown during handling of AuthenticationSession
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html deleted file mode 100644 index 398be7e71..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - -ConnectionBuilder (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.proxy -
-Interface ConnectionBuilder

-
-
-
public interface ConnectionBuilder
- -

-Builder for URLConnection objects used to forward requests - to the remote online application. -

- -

-


- -

- - - - - - - - - - - - - - - - - - - - -
-Method Summary
- HttpURLConnectionbuildConnection(javax.servlet.http.HttpServletRequest request, - String publicURLPrefix, - String realURLPrefix, - javax.net.ssl.SSLSocketFactory sslSocketFactory, - Map parameters) - -
-          Builds an HttpURLConnection to a URL which is derived - from an HttpServletRequest URL, by substitution of a - public URL prefix for the real URL prefix.
-  -

- - - - - - - - - - - - - - -
-Method Detail
- -

-buildConnection

-
-public HttpURLConnection buildConnection(javax.servlet.http.HttpServletRequest request,
-                                         String publicURLPrefix,
-                                         String realURLPrefix,
-                                         javax.net.ssl.SSLSocketFactory sslSocketFactory,
-                                         Map parameters)
-                                  throws IOException
-
-
Builds an HttpURLConnection to a URL which is derived - from an HttpServletRequest URL, by substitution of a - public URL prefix for the real URL prefix.
- The HttpURLConnection has been created by URL.openConnection(), but - it has not yet been connected to by URLConnection.connect().
- The field settings of the HttpURLConnection are: -
    -
  • allowUserInteraction = false
  • -
  • doInput = true
  • -
  • doOutput = true
  • -
  • requestMethod = request.getMethod()
  • -
  • useCaches = false
  • -
-

-

-
Parameters:
request - the incoming request which shall be forwarded
publicURLPrefix - the public URL prefix to be substituted by the real URL prefix
realURLPrefix - the URL prefix to substitute the public URL prefix
sslSocketFactory - factory to be used for creating an SSL socket in case - of a URL for scheme "https:"; -
if null, the default SSL socket factory would be used
parameters - parameters to be forwarded -
Returns:
a URLConnection created by URL.openConnection(), connecting to - the requested URL with publicURLPrefix substituted by realURLPrefix -
Throws: -
IOException - if an I/O exception occurs during opening the connection
See Also:
URL.openConnection(), -com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory()
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html deleted file mode 100644 index 0b2926e55..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html +++ /dev/null @@ -1,506 +0,0 @@ - - - - - - -LoginParameterResolver (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.proxy -
-Interface LoginParameterResolver

-
-
-
public interface LoginParameterResolver
- -

-Determines authentication parameters and headers to be added to a URLConnection - to the remote online application. - Utilizes OAConfiguration and AuthenticationData. -

- -

-


- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static StringMOABKZ - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOABPK - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOADateOfBirth - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOAFamilyName - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOAGivenName - -
-          Constants used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, - naming predicates used by the LoginParameterResolver.
-static StringMOAIdentificationValueType - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOAIPAddress - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOAPublicAuthority - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOAQualifiedCertificate - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-static StringMOAStammzahl - -
-          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
-  - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- voidconfigure(String configuration) - -
-           
- MapgetAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapgetAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
-  -

- - - - - - - - -
-Field Detail
- -

-MOAGivenName

-
-public static final String MOAGivenName
-
-
Constants used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, - naming predicates used by the LoginParameterResolver. -

-

-
See Also:
Constant Field Values
-
-
- -

-MOAFamilyName

-
-public static final String MOAFamilyName
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOADateOfBirth

-
-public static final String MOADateOfBirth
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOABPK

-
-public static final String MOABPK
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOAPublicAuthority

-
-public static final String MOAPublicAuthority
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOABKZ

-
-public static final String MOABKZ
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOAQualifiedCertificate

-
-public static final String MOAQualifiedCertificate
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOAStammzahl

-
-public static final String MOAStammzahl
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOAIdentificationValueType

-
-public static final String MOAIdentificationValueType
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
-
- -

-MOAIPAddress

-
-public static final String MOAIPAddress
-
-
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -

-

-
See Also:
Constant Field Values
-
- - - - - - - - - - - -
-Method Detail
- -

-getAuthenticationHeaders

-
-public Map getAuthenticationHeaders(OAConfiguration oaConf,
-                                    AuthenticationData authData,
-                                    String clientIPAddress)
-                             throws LoginParameterResolverException,
-                                    NotAllowedException
-
-
Returns authentication headers to be added to a URLConnection. -

-

-
Parameters:
oaConf - configuration data
authData - authentication data
clientIPAddress - client IP address -
Returns:
A map, the keys being header names and values being corresponding header values. -
In case of authentication type "basic-auth", header fields - username and password. -
In case of authentication type "header-auth", header fields - derived from parameter mapping and authentication data provided. -
Otherwise, an empty map. -
Throws: -
LoginParameterResolverException -
NotAllowedException
-
-
-
- -

-getAuthenticationParameters

-
-public Map getAuthenticationParameters(OAConfiguration oaConf,
-                                       AuthenticationData authData,
-                                       String clientIPAddress)
-                                throws LoginParameterResolverException
-
-
Returns request parameters to be added to a URLConnection. -

-

-
Parameters:
oaConf - configuration data
authData - authentication data
clientIPAddress - client IP address -
Returns:
A map, the keys being parameter names and values being corresponding parameter values. -
In case of authentication type "param-auth", parameters - derived from parameter mapping and authentication data provided. -
Otherwise, an empty map. -
Throws: -
LoginParameterResolverException
-
-
-
- -

-configure

-
-public void configure(String configuration)
-               throws LoginParameterResolverException,
-                      NotAllowedException
-
-
- -
Throws: -
LoginParameterResolverException -
NotAllowedException
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html deleted file mode 100644 index fd4dd84d2..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - -LoginParameterResolverException (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.proxy -
-Class LoginParameterResolverException

-
-java.lang.Object
-  extended byMOAIDException
-      extended byat.gv.egovernment.moa.id.proxy.LoginParameterResolverException
-
-
-
-
public class LoginParameterResolverException
extends MOAIDException
- -

-Exception thrown while proxying a request to the online application -

- -

-

-
See Also:
Serialized Form
-
- -

- - - - - - - - - - - - - - - - - - - -
-Constructor Summary
LoginParameterResolverException(String messageId, - Object[] parameters) - -
-          Constructor for LoginParameterResolverException.
LoginParameterResolverException(String messageId, - Object[] parameters, - Throwable wrapped) - -
-          Constructor for LoginParameterResolverException.
-  - - - - - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-LoginParameterResolverException

-
-public LoginParameterResolverException(String messageId,
-                                       Object[] parameters)
-
-
Constructor for LoginParameterResolverException. -

-

Parameters:
messageId -
parameters -
-
- -

-LoginParameterResolverException

-
-public LoginParameterResolverException(String messageId,
-                                       Object[] parameters,
-                                       Throwable wrapped)
-
-
Constructor for LoginParameterResolverException. -

-

Parameters:
messageId -
parameters -
wrapped -
- - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html deleted file mode 100644 index 7c01bd12f..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - -NotAllowedException (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -at.gv.egovernment.moa.id.proxy -
-Class NotAllowedException

-
-java.lang.Object
-  extended byMOAIDException
-      extended byat.gv.egovernment.moa.id.proxy.NotAllowedException
-
-
-
-
public class NotAllowedException
extends MOAIDException
- -

-Exception thrown while proxying a request to the online application - Reason for this exception: the dedicated LoginParameterResolver does - not allow access to the desired ressource. -

- -

-

-
See Also:
Serialized Form
-
- -

- - - - - - - - - - - - - - - - - - - -
-Constructor Summary
NotAllowedException(String messageId, - Object[] parameters) - -
-          Constructor for NotAllowedException.
NotAllowedException(String messageId, - Object[] parameters, - Throwable wrapped) - -
-          Constructor for NotAllowedException.
-  - - - - - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-NotAllowedException

-
-public NotAllowedException(String messageId,
-                           Object[] parameters)
-
-
Constructor for NotAllowedException. -

-

Parameters:
messageId -
parameters -
-
- -

-NotAllowedException

-
-public NotAllowedException(String messageId,
-                           Object[] parameters,
-                           Throwable wrapped)
-
-
Constructor for NotAllowedException. -

-

Parameters:
messageId -
parameters -
wrapped -
- - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html deleted file mode 100644 index 69af13810..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - -Uses of Interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Interface
at.gv.egovernment.moa.id.proxy.ConnectionBuilder

-
-No usage of at.gv.egovernment.moa.id.proxy.ConnectionBuilder -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html deleted file mode 100644 index aca06fa02..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - -Uses of Interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Interface
at.gv.egovernment.moa.id.proxy.LoginParameterResolver

-
-No usage of at.gv.egovernment.moa.id.proxy.LoginParameterResolver -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html deleted file mode 100644 index ccd7d50cf..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - -Uses of Class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.proxy.LoginParameterResolverException

-
- - - - - - - - - -
-Packages that use LoginParameterResolverException
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - -
-Uses of LoginParameterResolverException in at.gv.egovernment.moa.id.proxy
-  -

- - - - - - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.proxy that throw LoginParameterResolverException
- MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns request parameters to be added to a URLConnection.
- voidLoginParameterResolver.configure(String configuration) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html deleted file mode 100644 index fa0e1f24e..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - -Uses of Class at.gv.egovernment.moa.id.proxy.NotAllowedException (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
at.gv.egovernment.moa.id.proxy.NotAllowedException

-
- - - - - - - - - -
-Packages that use NotAllowedException
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - -
-Uses of NotAllowedException in at.gv.egovernment.moa.id.proxy
-  -

- - - - - - - - - - - - - -
Methods in at.gv.egovernment.moa.id.proxy that throw NotAllowedException
- MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress) - -
-          Returns authentication headers to be added to a URLConnection.
- voidLoginParameterResolver.configure(String configuration) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html deleted file mode 100644 index a8afe874e..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.proxy (MOA ID API) - - - - - - - - - - - -at.gv.egovernment.moa.id.proxy - - - - -
-Interfaces  - -
-ConnectionBuilder -
-LoginParameterResolver
- - - - - - -
-Classes  - -
-LoginParameterResolverException -
-NotAllowedException
- - - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html deleted file mode 100644 index 9c6f09843..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.proxy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-

-Package at.gv.egovernment.moa.id.proxy -

- - - - - - - - - - - - - -
-Interface Summary
ConnectionBuilderBuilder for URLConnection objects used to forward requests - to the remote online application.
LoginParameterResolverDetermines authentication parameters and headers to be added to a URLConnection - to the remote online application. -
-  - -

- - - - - - - - - - - - - -
-Class Summary
LoginParameterResolverExceptionException thrown while proxying a request to the online application
NotAllowedExceptionException thrown while proxying a request to the online application - Reason for this exception: the dedicated LoginParameterResolver does - not allow access to the desired ressource.
-  - -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html deleted file mode 100644 index 90e057ebc..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - -at.gv.egovernment.moa.id.proxy Class Hierarchy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package at.gv.egovernment.moa.id.proxy -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -

-Interface Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html b/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html deleted file mode 100644 index a8c6c026b..000000000 --- a/id.server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - -Uses of Package at.gv.egovernment.moa.id.proxy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
at.gv.egovernment.moa.id.proxy

-
- - - - - - - - - -
-Packages that use at.gv.egovernment.moa.id.proxy
at.gv.egovernment.moa.id.proxy  
-  -

- - - - - - - - - - - -
-Classes in at.gv.egovernment.moa.id.proxy used by at.gv.egovernment.moa.id.proxy
LoginParameterResolverException - -
-          Exception thrown while proxying a request to the online application
NotAllowedException - -
-          Exception thrown while proxying a request to the online application - Reason for this exception: the dedicated LoginParameterResolver does - not allow access to the desired ressource.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/constant-values.html b/id.server/doc/moa_id/api-doc/constant-values.html deleted file mode 100644 index bc145c359..000000000 --- a/id.server/doc/moa_id/api-doc/constant-values.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - -Constant Field Values (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Constant Field Values

-
-
-Contents - - - - - - -
-at.gv.*
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
at.gv.egovernment.moa.id.config.proxy.OAConfiguration
-public static final StringBASIC_AUTH"basic"
-public static final StringHEADER_AUTH"header"
-public static final StringLOGINTYPE_STATEFUL"stateful"
-public static final StringLOGINTYPE_STATELESS"stateless"
-public static final StringPARAM_AUTH"param"
- -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
at.gv.egovernment.moa.id.proxy.LoginParameterResolver
-public static final StringMOABKZ"MOABKZ"
-public static final StringMOABPK"MOABPK"
-public static final StringMOADateOfBirth"MOADateOfBirth"
-public static final StringMOAFamilyName"MOAFamilyName"
-public static final StringMOAGivenName"MOAGivenName"
-public static final StringMOAIdentificationValueType"MOAIdentificationValueType"
-public static final StringMOAIPAddress"MOAIPAddress"
-public static final StringMOAPublicAuthority"MOAPublicAuthority"
-public static final StringMOAQualifiedCertificate"MOAQualifiedCertificate"
-public static final StringMOAStammzahl"MOAStammzahl"
- -

- -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/deprecated-list.html b/id.server/doc/moa_id/api-doc/deprecated-list.html deleted file mode 100644 index d760f28ee..000000000 --- a/id.server/doc/moa_id/api-doc/deprecated-list.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - -Deprecated List (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Deprecated API

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/help-doc.html b/id.server/doc/moa_id/api-doc/help-doc.html deleted file mode 100644 index bbdccd6b5..000000000 --- a/id.server/doc/moa_id/api-doc/help-doc.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - -API Help (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-How This API Document Is Organized

-
-This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

-Overview

-
- -

-The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

-

-Package

-
- -

-Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    -
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
-
-

-Class/Interface

-
- -

-Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    -
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description -

    -

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary -

    -

  • Field Detail
  • Constructor Detail
  • Method Detail
-Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-

-Use

-
-Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-

-Tree (Class Hierarchy)

-
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    -
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
-

-Deprecated API

-
-The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-

-Index

-
-The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-

-Prev/Next

-These links take you to the next or previous class, interface, package, or related page.

-Frames/No Frames

-These links show and hide the HTML frames. All pages are available with or without frames. -

-

-Serialized Form

-Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -

- - -This help file applies to API documentation generated using the standard doclet. - -
-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/index-all.html b/id.server/doc/moa_id/api-doc/index-all.html deleted file mode 100644 index b6ccf5c68..000000000 --- a/id.server/doc/moa_id/api-doc/index-all.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - -Index (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -A B C D G H I L M N O P S V
-

-A

-
-
AuthenticationData - class at.gv.egovernment.moa.id.data.AuthenticationData.
Encapsulates authentication data contained in a <saml:Assertion>.
AuthenticationData() - -Constructor for class at.gv.egovernment.moa.id.data.AuthenticationData -
Constructor for AuthenticationData. -
AuthenticationException - class at.gv.egovernment.moa.id.AuthenticationException.
Exception thrown during handling of AuthenticationSession
AuthenticationException(String, Object[]) - -Constructor for class at.gv.egovernment.moa.id.AuthenticationException -
Constructor for AuthenticationException. -
AuthenticationException(String, Object[], Throwable) - -Constructor for class at.gv.egovernment.moa.id.AuthenticationException -
Constructor for AuthenticationException. -
AuthenticationServer - class at.gv.egovernment.moa.id.auth.AuthenticationServer.
API for MOA ID Authentication Service.
AuthenticationServer() - -Constructor for class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Constructor for AuthenticationServer. -
at.gv.egovernment.moa.id - package at.gv.egovernment.moa.id
 
at.gv.egovernment.moa.id.auth - package at.gv.egovernment.moa.id.auth
 
at.gv.egovernment.moa.id.config.proxy - package at.gv.egovernment.moa.id.config.proxy
 
at.gv.egovernment.moa.id.data - package at.gv.egovernment.moa.id.data
 
at.gv.egovernment.moa.id.proxy - package at.gv.egovernment.moa.id.proxy
 
-
-

-B

-
-
BASIC_AUTH - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Constant for an auth method -
buildConnection(HttpServletRequest, String, String, SSLSocketFactory, Map) - -Method in interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder -
Builds an HttpURLConnection to a URL which is derived - from an HttpServletRequest URL, by substitution of a - public URL prefix for the real URL prefix. -
-
-

-C

-
-
ConnectionBuilder - interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder.
Builder for URLConnection objects used to forward requests - to the remote online application.
cleanup() - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Cleans up expired session and authentication data stores. -
configure(String) - -Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
  -
-
-

-D

-
-
debugOutputXMLFile(String, Element) - -Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Writes an XML structure to file for debugging purposes, encoding UTF-8. -
debugOutputXMLFile(String, String) - -Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Writes an XML structure to file for debugging purposes, encoding UTF-8. -
-
-

-G

-
-
getAssertionID() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the assertionID. -
getAuthType() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the authType. -
getAuthenticationData(String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Retrieves AuthenticationData indexed by the SAML artifact. - -
getAuthenticationHeaders(OAConfiguration, AuthenticationData, String) - -Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Returns authentication headers to be added to a URLConnection. -
getAuthenticationParameters(OAConfiguration, AuthenticationData, String) - -Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Returns request parameters to be added to a URLConnection. -
getBasicAuthPasswordMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the basicAuthPasswordMapping. -
getBasicAuthUserIDMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the basicAuthUserIDMapping. -
getDateOfBirth() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the dateOfBirth. -
getFamilyName() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the familyName. -
getGivenName() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the givenName. -
getHeaderAuthMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the headerAuthMapping. -
getIdentificationType() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the identificationType -
getIdentificationValue() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the identificationValue. -
getInstance() - -Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Returns the single instance of AuthenticationServer. -
getIssueInstant() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the issueInstant. -
getIssuer() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the issuer. -
getLoginType() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the loginType. -
getMajorVersion() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the majorVersion. -
getMinorVersion() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the minorVersion. -
getPBK() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the bPK. -
getParamAuthMapping() - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Returns the paramAuthMapping. -
getPublicAuthorityCode() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the publicAuthorityCode. -
getSamlAssertion() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the samlAssertion. -
getSession(String) - -Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Retrieves a session from the session store. -
getTimestamp() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the timestamp. -
-
-

-H

-
-
HEADER_AUTH - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Constant for an auth method -
-
-

-I

-
-
isPublicAuthority() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the publicAuthority. -
isQualifiedCertificate() - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Returns the qualifiedCertificate. -
-
-

-L

-
-
LOGINTYPE_STATEFUL - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Constant for an login method -
LOGINTYPE_STATELESS - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Constant for an login method -
LoginParameterResolver - interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver.
Determines authentication parameters and headers to be added to a URLConnection - to the remote online application. -
LoginParameterResolverException - class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException.
Exception thrown while proxying a request to the online application
LoginParameterResolverException(String, Object[]) - -Constructor for class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException -
Constructor for LoginParameterResolverException. -
LoginParameterResolverException(String, Object[], Throwable) - -Constructor for class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException -
Constructor for LoginParameterResolverException. -
-
-

-M

-
-
MOABKZ - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOABPK - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOADateOfBirth - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOAFamilyName - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOAGivenName - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constants used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, - naming predicates used by the LoginParameterResolver. -
MOAIPAddress - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOAIdentificationValueType - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOAPublicAuthority - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOAQualifiedCertificate - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
MOAStammzahl - -Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver -
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType -
-
-

-N

-
-
NotAllowedException - class at.gv.egovernment.moa.id.proxy.NotAllowedException.
Exception thrown while proxying a request to the online application - Reason for this exception: the dedicated LoginParameterResolver does - not allow access to the desired ressource.
NotAllowedException(String, Object[]) - -Constructor for class at.gv.egovernment.moa.id.proxy.NotAllowedException -
Constructor for NotAllowedException. -
NotAllowedException(String, Object[], Throwable) - -Constructor for class at.gv.egovernment.moa.id.proxy.NotAllowedException -
Constructor for NotAllowedException. -
-
-

-O

-
-
OAConfiguration - class at.gv.egovernment.moa.id.config.proxy.OAConfiguration.
Holds configuration data concerning an online application for use by the MOA-ID Proxy component. -
OAConfiguration() - -Constructor for class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
  -
-
-

-P

-
-
PARAM_AUTH - -Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Constant for an auth method -
-
-

-S

-
-
selectBKU(String, String, String, String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes request to select a BKU. - -
setAssertionID(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the assertionID. -
setAuthType(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the authType. -
setBasicAuthPasswordMapping(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the basicAuthPasswordMapping. -
setBasicAuthUserIDMapping(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the basicAuthUserIDMapping. -
setDateOfBirth(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the dateOfBirth. -
setFamilyName(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the familyName. -
setGivenName(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the givenName. -
setHeaderAuthMapping(HashMap) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the headerAuthMapping. -
setIdentificationType(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the identificationType. -
setIdentificationValue(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the identificationValue. -
setIssueInstant(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the issueInstant. -
setIssuer(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the issuer. -
setLoginType(String) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the loginType. -
setMajorVersion(int) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the majorVersion. -
setMinorVersion(int) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the minorVersion. -
setPBK(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the bPK. -
setParamAuthMapping(HashMap) - -Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration -
Sets the paramAuthMapping. -
setPublicAuthority(boolean) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the publicAuthority. -
setPublicAuthorityCode(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the publicAuthorityCode. -
setQualifiedCertificate(boolean) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the qualifiedCertificate. -
setSamlAssertion(String) - -Method in class at.gv.egovernment.moa.id.data.AuthenticationData -
Sets the samlAssertion. -
setSecondsAuthDataTimeOut(long) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Sets the authDataTimeOut. -
setSecondsSessionTimeOut(long) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Sets the sessionTimeOut. -
startAuthentication(String, String, String, String, String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes the beginning of an authentication session. - -
-
-

-V

-
-
verifyAuthenticationBlock(String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes a <CreateXMLSignatureResponse> sent by the - security layer implementation. -
verifyIdentityLink(String, String) - -Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer -
Processes an <InfoboxReadResponse> sent by the - security layer implementation. -
-
-A B C D G H I L M N O P S V - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/index.html b/id.server/doc/moa_id/api-doc/index.html deleted file mode 100644 index 61c644160..000000000 --- a/id.server/doc/moa_id/api-doc/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -MOA ID API - - - - - - - - - -<H2> -Frame Alert</H2> - -<P> -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to<A HREF="overview-summary.html">Non-frame version.</A> - - - diff --git a/id.server/doc/moa_id/api-doc/overview-frame.html b/id.server/doc/moa_id/api-doc/overview-frame.html deleted file mode 100644 index 58e79621c..000000000 --- a/id.server/doc/moa_id/api-doc/overview-frame.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - -Overview (MOA ID API) - - - - - - - - - - - - - - - -
-
- - - - - -
All Classes -

- -Packages -
-at.gv.egovernment.moa.id -
-at.gv.egovernment.moa.id.auth -
-at.gv.egovernment.moa.id.config.proxy -
-at.gv.egovernment.moa.id.data -
-at.gv.egovernment.moa.id.proxy -
-

- -

-  - - diff --git a/id.server/doc/moa_id/api-doc/overview-summary.html b/id.server/doc/moa_id/api-doc/overview-summary.html deleted file mode 100644 index 0d16ca82c..000000000 --- a/id.server/doc/moa_id/api-doc/overview-summary.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -Overview (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -


-
-

-

MOA ID API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
-Packages
at.gv.egovernment.moa.id 
at.gv.egovernment.moa.id.auth 
at.gv.egovernment.moa.id.config.proxy 
at.gv.egovernment.moa.id.data 
at.gv.egovernment.moa.id.proxy 
- -


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/overview-tree.html b/id.server/doc/moa_id/api-doc/overview-tree.html deleted file mode 100644 index 583aeddde..000000000 --- a/id.server/doc/moa_id/api-doc/overview-tree.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - -Class Hierarchy (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For All Packages

-
-
-
Package Hierarchies:
at.gv.egovernment.moa.id, at.gv.egovernment.moa.id.auth, at.gv.egovernment.moa.id.config.proxy, at.gv.egovernment.moa.id.data, at.gv.egovernment.moa.id.proxy
-
-

-Class Hierarchy -

- -

-Interface Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/package-list b/id.server/doc/moa_id/api-doc/package-list deleted file mode 100644 index 4cafbedb3..000000000 --- a/id.server/doc/moa_id/api-doc/package-list +++ /dev/null @@ -1,5 +0,0 @@ -at.gv.egovernment.moa.id -at.gv.egovernment.moa.id.auth -at.gv.egovernment.moa.id.config.proxy -at.gv.egovernment.moa.id.data -at.gv.egovernment.moa.id.proxy diff --git a/id.server/doc/moa_id/api-doc/packages.html b/id.server/doc/moa_id/api-doc/packages.html deleted file mode 100644 index dc4a5e004..000000000 --- a/id.server/doc/moa_id/api-doc/packages.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - (MOA ID API) - - - - - - - - - - - -
- -
- -
-
-The front page has been relocated.Please see: -
-          Frame version -
-          Non-frame version.
- - - diff --git a/id.server/doc/moa_id/api-doc/resources/inherit.gif b/id.server/doc/moa_id/api-doc/resources/inherit.gif deleted file mode 100644 index c814867a1..000000000 Binary files a/id.server/doc/moa_id/api-doc/resources/inherit.gif and /dev/null differ diff --git a/id.server/doc/moa_id/api-doc/serialized-form.html b/id.server/doc/moa_id/api-doc/serialized-form.html deleted file mode 100644 index feb57f861..000000000 --- a/id.server/doc/moa_id/api-doc/serialized-form.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - -Serialized Form (MOA ID API) - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Serialized Form

-
- - - - - -
-Class at.gv.egovernment.moa.id.AuthenticationException extends MOAIDException implements Serializable
- -

- -

-


- - - - - -
-Class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException extends MOAIDException implements Serializable
- -

- -

-


- - - - - -
-Class at.gv.egovernment.moa.id.proxy.NotAllowedException extends MOAIDException implements Serializable
- -

- -

-


- - - - - - - - - - - - - - - -
- -
- - - -
- - - diff --git a/id.server/doc/moa_id/api-doc/stylesheet.css b/id.server/doc/moa_id/api-doc/stylesheet.css deleted file mode 100644 index 14c3737e8..000000000 --- a/id.server/doc/moa_id/api-doc/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF } - -/* Headings */ -h1 { font-size: 145% } - -/* Table colors */ -.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ -.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ -.TableRowColor { background: #FFFFFF } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } -.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } -.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ -.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} - 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 5536226a8..000000000 --- a/id.server/doc/moa_id/examples/BKUSelectionTemplate.html +++ /dev/null @@ -1,52 +0,0 @@ - - - -MOA ID - Auswahl der B&uuuml;rgerkartenumgebung - - - - - - - - -Organisation XY -

Auswahl der Bürgerkartenumgebung

-

-

Sie haben sich für Anmeldung mit Ihrer Bürgerkarte entschieden. Da es verschiedene Formen der Bürgerkarte gibt, müssen Sie nun wählen, welche Sie bei der Anmeldung verwenden wollen.

-

Auswahl der Bürgerkarte

-
- - - -
-

- - - - -

Hinweise:

-
    -
  • -

    Wollen Sie eine A-Trust Bürgerkarte erwerben? Hier finden Sie Informationen - dazu: A-Trust - Bürgerkarte. Bei der Anmeldung mit der A-Trust Bürgerkarte - benötigen Sie eine funktionsfähige Bürgerkartensoftware sowie - einen passenden Kartenleser.

    -
  • -
  • -

    Wollen Sie ein A1-Signatur erwerben? Wenden Sie sich an 0800-664 680 um - Informationen zur A1-Signatur zu erhalten. - Hier finden Sie ebenfalls Informationen dazu: A1-Signatur. - Bei der Anmeldung mit der A1-Signatur wird keine Bürgerkartensoftware und - kein Kartenleser benötigt.

    -
  • -
-
Valid HTML 4.01!
-

 

- - - - 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 @@ - - - CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT - 536 - - 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 @@ - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - \ 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(); - - // zusammenstellen und in einen DOM-Baum umwandeln - String samlRequest = - "" - + samlArtifact - + ""; - 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); - - // als DOM-Baum holen - Document responseDocument = response.getAsDocument(); - Element samlResponse = responseDocument.getDocumentElement(); - - // 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); - - // auslesen - Attr statusCodeAttr = (Attr)getNode(samlResponse, "/samlp:Response/samlp:Status/samlp:StatusCode/@Value"); - String samlStatusCode = statusCodeAttr.getValue(); - System.out.println("StatusCode: " + samlStatusCode); - - // auslesen - if ("samlp:Success".equals(samlStatusCode)) { - Element samlAssertion = (Element)getNode(samlResponse, "/samlp:Response/saml:Assertion"); - - // FamilyName aus der 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 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 09e60c6f1..000000000 --- a/id.server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und - "Anmeldung mit Bürgerkarte"<--> - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindung - - - - MOAIDBuergerkarteAuthentisierungsDaten - - MOAIDTransformAuthBlockText - Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> - - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - - - - GlobalVIDefaultTrust - - - - Beispiel Infobox B - GlobalInfoboxBTrust - - - - - - content1 - content2 - - content3a - content3b - - - - - - - - - - - - - - - LocalOA1DefaultTrust - - - - Demo Infobox B - oa1.validate.InfoboxBValidator - - - - - - - - Demo Infobox C - LocalInfoboxOA1CTrust - - - - - - - - - - - - - - LocalInfoboxOA2ATrust - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - 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 @@ - - - -MOA ID - Identifizierter Zugang mit Bürgerkarte - - - -Organisation XY -

Sicherer Zugang zur Online-Anwendung mit Bürgerkarte

-

- -Der identifizierte Zugang erfolgt über die Module für Online Applikationen (MOA) unter Verwendung einer Bürgerkarte und deren Signaturfunktion. - -

-

Wenn Sie in Folge die Schaltfläche "Anmeldung mit Bürgerkarte" -aktivieren, so werden zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese -signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.

- - -
-
- - - - - -
-
-
- - - - - -
- - - diff --git a/id.server/doc/moa_id/examples/TransformsInfoAuthBlock.txt b/id.server/doc/moa_id/examples/TransformsInfoAuthBlock.txt deleted file mode 100644 index edbde0073..000000000 --- a/id.server/doc/moa_id/examples/TransformsInfoAuthBlock.txt +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - Signatur der Anmeldedaten - - -

Signatur der Anmeldedaten

-

-

Mit meiner elektronischen Signatur beantrage ich, , -geboren am -.., den Zugang zur gesicherten Anwendung.

-

-

Datum und Uhrzeit: .., ::

- -

wbPK(*):

-

-
- (*) wbPK: Das Wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Buergers und des Wirtschaftsunternehmens berechnet und ermoeglicht eine eindeutige Zuordnung des Buergers zum Wirtschaftsunternehmen. -
- - -
-
-
- -
- - text/html - -
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 db43b0c1d..000000000 --- a/id.server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - MOAIDBuergerkartePersonenbindung - - - - MOAIDBuergerkarteAuthentisierungsDaten - - MOAIDTransformAuthBlockText - - - - - - - CN=zmr,OU=BMI-IV-2,O=BMI,C=AT - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission - - T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certs/ca-certs - - - - - - - - - - - - - - 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 @@ - - - - stateless - - MOAFamilyName - MOAGivenName - - 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 @@ - - - - stateless - - -
-
-
-
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 @@ - - - - stateless - - - - - - 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 1ccca10c1..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= - -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= - -rem Tomcat 4.1.x home directory (no trailing path separator) -set CATALINA_HOME= - -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 effc21637..000000000 --- a/id.server/doc/moa_id/faqs.htm +++ /dev/null @@ -1,217 +0,0 @@ - - - FAQs - Häufig gestellte Fragen - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - - - - - - -
-
FAQs
-
- -
- -
-
FAQs - Häufig gestellte Fragen
-

Frage 1 - Mit dem Internet Explorer kommt es bei einer Anmeldung an der lokal - installierten Version von MOA-ID zu Fehlern beim Redirect. Warum?

-

Frage 2 - Wenn die Proxy-Komponente lokal läuft und per TLS/SSL aufgerufen - wird, kommt es zu einer Fehlermeldung. Wie kann dies verhindert werden?

-

Frage 3 - Es soll serverseitig lediglich starke TLS/SSL Verschlüsselung (>100 - Bit) unterstützt werden. Wie kann dies erzwungen werden?

-

Frage 4 Beim Starten von - MOA ID bzw. MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: - iaik.asn1.structures.Name. Was kann der Fehler sein?

-

Frage 5 Ich möchte - MOA in einer Umgebung betreiben, die einen Internet-Zugang nur über - einen Proxy erlaubt. Funktioniert das?

-

Frage 6 Tomcat: Wärend - des Betriebs kommt es zu org.apache.commons.logging.LogConfigurationException. - Wie kann dies verhindert werden?

-
-

-

Frage 1

-

Q: Mit dem Internet Explorer kommt es bei einer Anmeldung - an der lokal installierten Version von MOA-ID zu Fehlern beim Redirect. - Warum?

-

A: Aufgrund eines Fehlers in Microsofts Internet - Explorer schlägt der (lokale) Redirect auf dem lokal installierten - Tomcat fehl.

-

Als Workaround empfiehlt es sich, zum lokalen Testen einen - alternativen Browser wie Opera, - Mozilla oder Netscape - 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.

-
-

Frage 2

-

Q: Wenn die Proxy-Komponente lokal läuft und - per TLS/SSL aufgerufen wird, kommt es zu einer Fehlermeldung. Wie kann - dies verhindert werden?

-

A: Wenn in der Konfiguration statt 'localhost' der - eigene Rechnername verwendet wird, funktioniert die Proxy-Komponente - wie gewohnt.
-
- 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.

-
-

Frage 3

-

Q: Es soll serverseitig lediglich starke TLS/SSL - Verschlüsselung (>100 Bit) unterstützt werden. Wie kann - dies erzwungen werden?

-

A: Tomcat bietet (bis dato) keine einfache Möglichkeit - die serverseitig verwendeten TLS/SSL Verschlüsselungsalgorithmen - zu konfigurieren. Daher empfiehlt es sich in diesem Fall, einen Web-Server - wie Apache oder den Microsoft Internet-Information-Server für das - SSL-Handling vorzuschalten und dort in der jeweiligen Konfiguration - starke Verschlüsselung zu erzwingen.

-
- -

Frage 4

- Q:
Beim Starten von MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: - iaik.asn1.structures.Name. Was kann der Fehler sein? -

A: 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ü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ützt, wird PKCS7.getCertificate() verwendet, und - es kommt zu einer ClassCastException.

-

Wird MOA ü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ö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üssen die Einträge -

-  security.provider.1=sun.security.provider.Sun
-  security.provider.2=com.sun.rsajca.Provider  
-
- durch folgenden Eintrag ergänzt werden: -
-  security.provider.3=iaik.security.provider.IAIK
-
-

- -
-

Frage 5

-
-

Q: Ich möchte MOA in einer Umgebung betreiben, - die einen Internet-Zugang nur über einen Proxy erlaubt. Funktioniert - das?

-

A: Ja, zumindest für Zugriffe über HTTP. - Sie müssen dazu die nachfolgenden JAVA System-Properties setzen:

-
-

http.proxyHost=<proxyhost>
- http.proxyPort=<proxyport>
- http.nonProxyHosts="<exceptionhosts>"

-
-

<proxyhost> gibt den Namen oder die IP-Adresse des - Proxies an.

-

<proxyport> gibt den Port des Proxies an.

-

<exceptionhosts> enthält eine Liste von Rechnernamen, - die nicht über den Proxy laufen sollen. Jedenfalls müssen - sie hier localhost angeben. Einzelne Namen sind durch eine - Pipe (|) zu trennen. Bitte beachten Sie, dass IP-Addressen - nicht angegeben werden dürfen, sowie die verpflichtend zu verwendenen - Anführungszeichen.

-
-
-

Frage 6

-

Q: Tomcat: Wärend des Betriebs kommt es zu org.apache.commons.logging.LogConfigurationException. - Wie kann dies verhindert werden?

-

org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: - org.apache.commons.logging.LogConfigurationException
- : Class org.apache.commons.logging.impl.Jdk14Logger does not implement - Log

-

A: 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.

-

 

-
  
- - - - - - - -

-
-
-
© 2003
-
-
- - -
- - \ No newline at end of file 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 19fa3562c..000000000 --- a/id.server/doc/moa_id/id-admin.htm +++ /dev/null @@ -1,317 +0,0 @@ - - - MOA ID-Administration - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - -
-
MOA-ID

-
- Übersicht
- - - -
- -
-
-
MOA ID-Administration v.1.4
-

-Die Komponenten des Moduls Identifikation (MOA-ID), MOA-ID-AUTH und MOA-ID-PROXY, sind als plattformunabhängige Webapplikationen ausgelegt. -MOA-ID-AUTH ist die Basiskomponente des Moduls, und MOA-ID-PROXY ist eine optionale Zusatzkomponente. -Für den Betrieb dieser Webapplikationen wird eine Java Virtual Machine und ein Java Servlet Container vorausgesetzt. -

-Dieses Handbuch beschreibt die Installation und Konfiguration von MOA-ID-AUTH und von MOA-ID-PROXY, und die Einrichtung der Systemumgebungen. -

-
-
- - - -
- - - -
-

 

-
-

Übersicht

-
-Für den Betrieb von MOA-ID-AUTH sind unterschiedliche Szenarien möglich, die unterschiedliche Möglichkeiten bieten und die Installation unterschiedlicher Software- und Hardware-Komponenten erfordern. Dieser Abschnitt gibt einen kurzen Überblick über die notwendige Basis-Installation und optionale weitere Konfigurationsmöglichkeiten. -
-
-
- -
- - - -
-

 

-
-
Basis-Installation von MOA-ID-AUTH
-

-Die Basis-Installation stellt einerseits die minimalen Anforderungen für den Betrieb von MOA-ID-AUTH dar, andererseits dient sie als Ausgangspunkt für weitere (optionale) Konfigurations-Möglichkeiten. -

-Folgende Software ist Voraussetzung für die Basis-Installation: - -

    -
  • JDK 1.4.0, JDK 1.4.2 oder JDK 1.5.0
  • -
  • Tomcat 4.1.31 oder Tomcat 5.0.28
  • -
  • MOA-ID-AUTH 1.4
  • -
  • MOA SP/SS 1.4 oder neuer (entweder als WebService oder direkt als interne Bibliothek)
  • -
-
-Um möglichen Versionskonflikten aus dem Weg zu gehen sollten stets die neuesten Versionen von MOA-ID als auch von MOA-SP/SS verwendet werden.
-In diesem Betriebs-Szenario wird MOA-ID-AUTH in Tomcat deployt. Tomcat fungiert gleichzeitig als HTTP- und HTTPS-Endpunkt für MOA-ID-AUTH. Beide Protokolle werden direkt in Tomcat konfiguriert. -

-Die Webapplikation verwendet Log4j als Logging Toolkit. -
-
-
- -
- - - -
-

 

-
-

Basis-Installation von MOA-ID-PROXY (optional)

-
-Einer Online-Applikation, für die MOA-ID-AUTH die Authentisierung übernimmt, kann die Komponente MOA-ID-PROXY vorgeschaltet werden. Diese Komponente übernimmt die Anmeldedaten von MOA-ID-AUTH, fü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. -

-MOA-ID-AUTH und MOA-ID-PROXY können in verschiedenen Konstellationen zum Einsatz gebracht werden: -
    -
  • auf verschiedenen Rechnern
  • -
  • auf ein und demselben Rechner in verschiedenen Java Servlet Containern
  • -
  • auf ein und demselben Rechner in ein und demselben Java Servlet Container
  • -
-
-Ausgehend von der Basis-Installation können die optionalen Konfigurationen, die in den nachfolgenden Abschnitten beschrieben werden, unabhängig und in beliebiger Kombination aufgesetzt werden. -
-
-
- -
- - - -
-

 

-
-

Konfiguration mit vorgeschaltetem Webserver (optional)

-
-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 üblicherweise der Apache Webserver zum Einsatz. -

- Folgende Software ist unter Windows Voraussetzung: -
-
    -
  • MS IIS 5.0
  • -
  • Jakarta mod_jk 1.2.2
  • -
-
Folgende Software ist unter Unix/Linux Voraussetzung:
-
    -
  • Apache Webserver 2.0.x mit mod_SSL
  • -
  • Jakarta mod_jk 1.2.2
  • -
-
In diesem Fall übernimmt der vorgeschaltete Webserver die Funktion des HTTP- und HTTPS-Endpunktes. Beide Protokolle werden im Webserver konfiguriert. -

-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ück übermittelt. -
-
-
- -
- - - -
-

 

-
-

Konfiguration mit PostgreSQL (optional)

-
-Das MOA ID Webservice kann eine PostgreSQL Datenbank nutzen, um: -
-
    -
  • Log-Meldungen zu speichern
  • -
-
Für den Zugriff auf PostgreSQL ist die Installation folgender Software Voraussetzung:
-
    -
  • PostgreSQL 7.3
  • -
-
-
- -
- - - -
-

 

-
-

Zusammenfassung

-
-Notwendig für den Betrieb von MOA ID ist eine Basis-Installation. Weitere optionale Konfigurationen können unabhängig und in beliebiger Kombination miteinander durchgeführt werden, um eine bessere Integration der MOA ID Webapplikationen in die vorhandene Betriebs-Infrastruktur zu erreichen. -
-
-

- - - -
- - - -
-

 

-
-

Referenzierte Software

-
-Die Versionsangaben beziehen sich auf die Versionen, mit denen die MOA ID Webapplikationen entwickelt und getestet wurde. Geringfügig andere Software-Versionen stellen üblicherweise kein Problem dar. -
-

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KomponenteGetestete Version
JDK (SDK) min. 1.4.0 bzw.
- 1.4.2

- 1.5.0 -
Tomcat -

4.1.31
- 5.0.25

-
MOA-ID-AUTH 1.4 (neueste Version)
MOA-ID-PROXY 1.4 (neueste Version)
MOA-SPSS 1.4 (neueste Version) 
Apache Webserver 1.3.X - bzw.
- 2.0.X
Microsoft Internet Information Server - 5.0 
- 6.0 
mod_SSL (**)  -
Jakarta mod_jk 1.2.2  -
Jakarta Log4j 1.2.8  -
PostgreSQL 7.3  -
-
-
-
- -
(**) passend zur Version des Apache Webservers
-
-

- - - - - -

-
-
© 2004
-
-
- - -
-
- 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 289c52d8a..000000000 --- a/id.server/doc/moa_id/id-admin_1.htm +++ /dev/null @@ -1,539 +0,0 @@ - - - MOA ID-Administration - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - -
-
MOA-ID

- -
- Basis-Installation
- - -
- -
- -
-

Basis-Installation v.1.4

-Bei der Basis-Installation von MOA-ID-AUTH und von MOA-ID-PROXY ist grundsätzlich gleichartig vorzugehen. -Unterschiede sind in der Installationsanweisung angeführt. -
-

Vorbereitung

-
-

Installation des JDK
- Installieren Sie das JDK in ein - beliebiges Verzeichnis. Das Wurzelverzeichnis der JDK-Installation - wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
-
- Installation von Tomcat
- Installieren Sie Tomcat in ein Verzeichnis, das keine Leer- und - Sonderzeichen im Pfadnamen enthä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.
-
- Entpacken der MOA ID Webapplikation
- 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.
-
- Installation der IAIK JCE und des IAIK LDAP Protocol Handlers
- Die Dateien aus dem Verzeichnis $MOA_ID_INST_AUTH/ext (oder $MOA_ID_INST_PROXY/ext) - müssen in das Verzeichnis $JAVA_HOME/jre/lib/ext kopiert werden. - Anschließend steht eine Unterstützung für Kryptographie - und SSL jeder Java-Anwendung die dieses JDK verwendet zur Verfügung.
-
- Zusätzlich müssen die so genannten Unlimited Strength - Jurisdiction Policy Files heruntergeladen, entpackt - und ins Verzeichnis $JAVA_HOME/jre/lib/security kopiert werden.

-

Der Download für diese Dateien findet sich am unteren Ende - der Download-Seite des jeweiligen JDK in der Sektion "Other - Downloads". D.h. JDK - hier für 1.4.0, das JDK hier - für 1.4.2 bzw. das JDK hier - für 1.5.0.

-
- -
- -
- - -
-

 

-
-

-
-
-

Konfiguration von Tomcat

-
-Minimale Konfiguration
-Die zentrale Konfigurations-Datei von Tomcat ist $CATALINA_HOME/conf/server.xml. Tomcat wird grundsätzlich mit -einer funktionierenden Default-Konfiguration ausgeliefert, die jedoch einiges an Ballast enthält und viele Ports -offen lässt. Die Datei $MOA_ID_INST_AUTH/tomcat/server.xml (bzw. $MOA_ID_INST_PROXY/tomcat/server.xml) enthält eine minimale -Tomcat-Konfiguration, die je einen Connector für HTTP und für HTTPS freischaltet.

-SSL
-Fü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 übernimmt. -Ebenso kann SSL auch für MOA-ID-PROXY verwendet werden. -Das Dokument Tomcat SSL Configuration HOW-TO gibt einen guten Überblick über die Konfiguration von SSL in Tomcat. Da die für SSL notwendigen Bibliotheken bereits im Abschnitt "Vorbereitung" eingebunden wurden, sind nur noch folgende Schritte notwendig: -
-
    -
  • Erstellung eines Server-Keystores, welches den privaten Schlüssel des Servers sowie das Server-Zertifikat enthält, -z.B. mit dem Java Keytool.
    -Hinweis: Standardmäßig wird beim Erzeugen eines neuen Keystores im Home-Verzeichnis des Benutzers die Datei ".keystore" angelegt. Möchte man den Dateinamen und Pfad ändern, kann man das dem SSL-Connector in $CATALINA_HOME/conf/server.xml durch hinzufügen des Attributes keystoreFile="NAME DES KEYSTORES" im Element <Factory> bekannt machen. Das zum Keystore gehörende Passwort übergibt man Tomcat mittels des Attributes keystorePass= "PASSWORT DES KEYSTORES" im Element <Factory>.
  • -
  • Erstellung eines Keystores mit vertrauenswürdigen Client-Zertifikaten, z.B. mit dem Java Keytool (nur, wenn SSL Client-Authentisierung verwendet werden soll)
  • -
  • Falls eine Client-Authentisierung gewünscht ist, muss die Konfiguration des SSL-Connectors in $CATALINA_HOME/conf/server.xml angepasst werden.
  • -
- -
-MOA Administrator
-Der Aufruf der URL für die dynamische Konfiguration von MOA-ID-AUTH ist durch eine Passwort-Abfrage geschützt, und kann nur von Benutzern aufgerufen werden, die der Benutzer-Rolle moa-admin zugeordnet werden können.
-Um diese Benutzer-Rolle und einen oder mehrere Benutzer einzurichten, müssen in der Datei $CATALINA_HOME/conf/tomcat-users.xml unter dem Element <tomcat-users> sinngemäß folgende Einträge hinzugefügt werden: -
-<role rolename="moa-admin"/>
-<user username="moa" password="moa" roles="moa-admin"/>
-
-
-
- -
- - -
-

 

-
-

-
-
-

Deployment von MOA-ID-AUTH in Tomcat

-
-Um MOA-ID-AUTH in Tomcat für den Ablauf vorzubereiten, sind folgende Schritte notwendig:
-
    -
  • 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.
  • -
  • Die MOA-ID Konfigurationsdatei und die zugehörigen Verzeichnisse - "certs" und "transforms" werden in ein beliebiges Verzeichnis - im Filesystem kopiert (z.B. $CATALINA_HOME/conf/moa-id).
    - Im Verzeichnis $MOA_ID_INST_AUTH/conf/moa-id befinden sich - acht verschiedene Beispielkonfigurationen, die als Ausgangspunkte - für die Konfiguration von MOA-ID-AUTH dienen können: -
      -
    • SampleMOAIDConfiguration.xml: Konfiguration von MOA-ID für - eine Anwendung aus dem öffentlichen Bereich. -
      Karte: Bürgerkarte -
      Konfiguration ohne Proxykomponente
    • -
    • SampleMOAIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID - für eine Anwendung aus dem öffentlichen Bereich. -
      Karte: Bürgerkarte und Testkarte -
      Konfiguration ohne Proxykomponente
    • -
    • SampleMOAWIDConfiguration.xml: Konfiguration von MOA-ID für - eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). -
      Karte: Bürgerkarte -
      Konfiguration ohne Proxykomponente
    • -
    • SampleMOAWIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID für - eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). -
      Karte: Bürgerkarte und Testkarte -
      Konfiguration ohne Proxykomponente
    • -
    • SampleMOAIDConfigurationProxy.xml: Konfiguration von MOA-ID für - eine Anwendung aus dem öffentlichen Bereich. -
      Karte: Bürgerkarte -
      Konfiguration mit Proxykomponente.
    • -
    • SampleMOAIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID - für eine Anwendung aus dem öffentlichen Bereich. -
      Karte: Bürgerkarte und Testkarte -
      Konfiguration mit Proxykomponente
    • -
    • SampleMOAWIDConfigurationProxy.xml: Konfiguration von MOA-ID für - eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). -
      Karte: Bürgerkarte -
      Konfiguration mit Proxykomponente
    • -
    • SampleMOAWIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID für - eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). -
      Karte: Bürgerkarte und Testkarte -
      Konfiguration mit Proxykomponente
    • -
    -
  • -
  • Die endorsed Libraries für Tomcat müssen aus dem - Verzeichnis $MOA_ID_INST_AUTH/endorsed in das Tomcat-Verzeichnis - $CATALINA_HOME/common/endorsed kopieren werden. Folgende Libraries - sind für das Deployment im endorsed Verzeichnis vorgesehen: -
      -
    • Xerces-J-2.4.0 (bestehend aus xercesImpl.jar - und xmlParserAPIs.jar) - für alle JDKs.
    • -
    • Xalan-j-2.5.1 (bestehend aus xalan.jar).
    • -
    - Eventuell vorhandene Dateien mit dem gleichen Namen müssen - ersetzt werden. Die ggf. in diesem Verzeichnis vorhandene Datei - xml-apis.jar muss gelöscht werden.
  • -
  • Folgende Java System Properties sind zu setzen:
    -
      -
    • 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.
    • -
    • log4j.configuration=URL der Log4j Konfigurationsdatei. - Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties - enthalten.
    • -
    • javax.net.ssl.trustStore=Name des Truststores - für vertrauenswürdige SSL Client-Zertifikate (optional; - nur, wenn SSL Client-Authentisierung durchgeführt werden - soll).
      -
    • -
    - Diese Java System-Properties werden Tomcat über die Umgebungsvariable - CATALINA_OPTS mitgeteilt (Beispiel-Skripte zum Setzen dieser - Properties für Windows und für Unix bzw. - Linux finden sie unter $MOA_ID_INST_AUTH/tomcat/win32 bzw. - $MOA_ID_INST_AUTH/tomcat/unix). Diese Skripte können sie nach $CATALINA_HOME kompieren und in Folge von dort starten nachdem die Variablen CATALINA_HOME sowie JAVA_HOME in den Skripten entsprechend den Pfaden der Installation gesetzt wurden. -
-
-
- - -
- - -
-

 

-
-

-
-
-

Deployment von MOA-ID-PROXY in Tomcat

-
-Um MOA-ID-PROXY in Tomcat für den Ablauf vorzubereiten, sind folgende Schritte notwendig: -
-
    -
  • - Für Tomcat 4.1.31: -
      -
    • Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war wird in ein - beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) kopiert. HINWEIS: - Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!
      -
    • -
    • Anschließend muss in der Datei $CATALINA_HOME/conf/server.xml der - Tomcat-Root-Context auf diese Datei gesetzt werden: wenn - das war-file sich in $CATALINA_HOME/webappsProxy befindet, geschieht dies - mit dem Einfügen von folgendem Element innerhalb von - <Server>...<Service>...<Engine>...<Host>: -
      <Context path="" 
      -    docBase="../webappsProxy/moa-id-proxy.war"
      -    debug="0"/>
      - Anmerkung: Der Root-Context von Tomcat ist normalerweise auskommentiert. -
    • -
    -
  • -
  • - Für Tomcat 5.0.28: -
      -
    • Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war ist in ein - beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) zu entpacken - (diese Datei ist mittels ZIP Algorithmus komprimiert und kann mit jedem Tool, - das mit .ZIP-Dateien umgehen kann, geöffnet werden). HINWEIS: - Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!
      -
    • -
    • Anschließend muss in der Datei $CATALINA_HOME/conf/server.xml 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ügen - von folgendem Element innerhalb von - <Server>...<Service>...<Engine>...<Host>:
    • -
      <Context path="" docBase="../webappsProxy" 
      -    debug="0"/>
      - Alternativ kann statt die Datei server.xml zu ändern in $CATALINA_HOME\conf\Catalina\localhost eine Datei moa-id-proxy.xml mit vorhin angegebenen Inhalt erstellt werden. -
    -
  • -
- -
- Tomcat Konfiguration: -
    -
  • Die MOA-ID Konfigurationsdatei und die zugehörigen - Verzeichnisse "certs" und "oa" werden in ein beliebiges Verzeichnis - im Filesystem kopiert (z.B. $CATALINA_HOME/ conf/moa-id). -
    - Im Verzeichnis $MOA_ID_INST_PROXY/conf/moa-id befinden sich - vier verschiedene Beispielkonfigurationen, - die als Ausgangspunkte für die Konfiguration von MOA-ID-PROXY - dienen können. -
  • -
  • Die endorsed Libraries für Tomcat müssen aus dem - Verzeichnis $MOA_ID_INST_PROXY/endorsed in das Tomcat-Verzeichnis - $CATALINA_HOME/common/endorsed kopiert werden. Folgende Libraries - sind für das Deployment im endorsed Verzeichnis vorgesehen: -
      -
    • Xerces-J-2.4.0 (bestehend aus xercesImpl.jar - und xmlParserAPIs.jar)
    • -
    - Eventuell vorhandene Dateien mit dem gleichen Namen müssen - ersetzt werden. -
  • -
  • Folgende Java System Properties sind zu setzen:
    -
      -
    • 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.
    • -
    • log4j.configuration=URL der Log4j Konfigurationsdatei. - Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties - enthalten.
    • -
    • javax.net.ssl.trustStore=Name des Truststores - für vertrauenswürdige SSL Client-Zertifikate - (optional; nur, wenn SSL Client-Authentisierung durchgeführt - werden soll).
    • -
    -
  • - Diese Java System-Properties werden Tomcat über die Umgebungsvariable - CATALINA_OPTS mitgeteilt (siehe Deployment von MOA-ID-AUTH). -
    -
    - Beispiel-Skripts zum Setzen von CATALINA_OPTS und zum Starten - von Tomcat sind in $MOA_ID_INST_AUTH\tomcat\ zu finden - Sie - können diese für Ihre Zwecke adaptieren (JAVA_HOME - und $CATALINA_HOME setzen) und nach $CATALINA_HOME kopieren. -
-
-
- -
- - -
-

 

-
-

-
-
-

Starten und Stoppen von Tomcat

-
Nach dem Deployment und der Konfiguration kann - Tomcat aus seinem Wurzelverzeichnis ($CATALINA_HOME) mit
-
-    startTomcat (unter Windows) oder 
-    moa-id-env.sh
-    bin/catalina.sh start (unter Unix/Linux) 
-
-gestartet werden. Das Stoppen von Tomcat erfolgt analog mit
-
-    bin\catalina stop  (unter Windows) oder 
-    bin/catalina.sh stop (unter Unix/Linux) 
-
-Ein erfolgreicher Startvorgang von MOA-ID-AUTH ist an folgender Log-Meldung ersichtlich:
-
-    INFO | 08 13:33:38,497 | main | 
-    	MOA ID Authentisierung wurde 
-    	erfolgreich gestartet
-
-Analog bei MOA-ID-PROXY:
-
-    INFO | 08 13:35:49,876 | main | 
-    	MOA ID Proxy wurde erfolgreich gestartet
-
- -Nach dem erfolgreichen Starten von Tomcat steht MOA-ID-AUTH unter der URL -
-http(s)://host:port/moa-id-auth/StartAuthentication    
-
-zur Verfügung. Der WebService ist unter -
-http(s)://host:port/moa-id-auth/services/GetAuthenticationData  
-
-erreichbar. Die Verfügbarkeit der Anwendung kann überprüft werden, indem die URLs mit einem Web-Browser aufgerufen werden.
-
-
-Dynamische Konfigurations-Updates
-Dynamische Konfigurations-Updates können für MOA-ID-AUTH durch den Aufruf der URL http://hostname:port/moa-id-auth/ConfigurationUpdate (z.B. durch Eingabe in einem Browser) durchgeführt werden. Analog wird die Konfiguration von MOA-ID-PROXY mittels http://hostname:port/ConfigurationUpdate aktualisiert.

-Hinweis: Konfigurationsänderungen für die Online-Applikationen betreffen grundsätzlich sowohl die Auth- als auch die Proxy-Komponente. -Wenn bspw. das publicURLPrefix der OA geändert wird, muss sowohl für die Auth- als auch für die Proxy-Komponente ein ConfigurationUpdate durchgeführt werden.

-Konnte MOA-ID-AUTH bzw. MOA-ID-PROXY nicht ordnungsgemäß konfiguriert und gestartet werden, geht das aus der Log-Meldung hervor:
-
-FATAL | 03 13:19:06,924 | main | Fehler 
-	beim Starten des Service MOA ID Authentisierung
-
-bzw. -
-FATAL | 03 13:19:06,924 | main | Fehler 
-	beim Starten des Service MOA ID Proxy
-
-In diesem Fall geben die WARN bzw. ERROR Log-Meldungen unmittelbar davor Aufschluss über den genaueren Grund.
-
-
- - -
- - -
-

 

-
-

-
-
-
-

Logging

-
-Die MOA ID Webapplikation verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Log4j bietet zahlreiche Konfigurationsmöglichkeiten, die ausführlich im Log4j Handbuch beschrieben sind. Unter anderem gibt es die Möglichkeit, folgende Einstellungen vorzunehmen:
-
    -
  • Das verwendete Log-Level (DEBUG, INFO, WARN, ERROR, FATAL).
  • -
  • Name und maximale Größe der Log-Datei(en).
  • -
  • Das Aussehen der Log-Einträge.
  • -
-Es werden folgende Log-Hierarchien verwendet: -
-
    -
  • moa.id.auth für alle Log-Meldungen aus dem MOA-ID-AUTH Modul
  • -
  • moa.id.proxy für alle Log-Meldungen aus dem MOA-ID-PROXY Modul
  • -
  • moa.spss.server für alle Log-Meldungen aus dem MOA-SPSS Modul
  • -
  • iaik.server für alle Log-Meldungen aus den IAIK Kryptographie-Modulen
  • -
-
-Als Ausgangspunkt fü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 $CATALINA_HOME/logs/moa-id.log geschrieben. -

-Format der Log-Meldungen
-Anhand einer konkreten Log-Meldung wird das Format der MOA ID Log-Meldungen erläutert: -
-    INFO | 09 08:23:59,385 | Thread-8 | 
-    	Anmeldedaten zu MOASession -5468974113772848113 
-    	angelegt, SAML Artifakt 
-    	AAF/BrdRfnMaQVGIbP/Gf9OwDUwwsXChb7nuT+VXQzOoHbV
-
- -Der Wert INFO besagt, dass die Log-Meldung im Log-Level INFO entstanden ist. Folgende Log-Levels existieren:
-
    -
  • DEBUG: Log-Meldungen im Log-Level DEBUG geben Auskunft über die innere Arbeitsweise des Systems. Sie sind hauptsächlich für Entwickler interessant.
  • -
  • INFO: Diese Log-Meldungen geben informative Status-Informationen über den Ablauf der Webapplikation, wie z.B., dass eine neue Anfrage eingelangt ist.
  • -
  • WARN: Bei der Ausführung einer Operation sind leichte Fehler aufgetreten. Der Ablauf der Webapplikation ist nicht weiter beeinträchtigt.
  • -
  • ERROR: Die Ausführung einer Operation musste abgebrochen werden. Die Webapplikation ist davon nicht beeinträchtigt.
  • -
  • FATAL: Es ist ein Fehler aufgetreten, der den weiteren Betrieb der Webapplikation nicht mehr sinnvoll macht.
  • -
-Der nächste Wert 09 08:23:59,385, gibt den Zeitpunkt an, an dem die Log-Meldung generiert wurde (in diesem Fall den 9. Tag im aktuellen Monat, sowie die genaue Uhrzeit).
-Der Rest der Zeile einer Log-Meldung ist der eigentliche Text, mit dem das System bestimmte Informationen anzeigt. Im Fehlerfall ist häufig ein Java Stack-Trace angefügt, der eine genauere Ursachen-Forschung ermöglicht. -

- - -Wichtige Log-Meldungen
-Neben den im Abschnitt "Starten und Stoppen von Tomcat" beschriebenen Log-Meldungen, die anzeigen, ob die Webapplikation -ordnungsgemäß gestartet wurde, geben nachfolgenden Log-Meldungen Aufschluss über die Abarbeitung von Anfragen. -Die Annahme einer Anfrage wird beispielsweise angezeigt durch: -
-
-    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
-    
-
- -
-Die 1. Log-Meldung besagt, dass sich ein Benutzer an MOA-ID-AUTH angemeldet und eine eindeutige SessionID zugewiesen bekommen hat.
-Die 2. Log-Meldung informiert darüber, dass die Anmeldedaten des Benutzers unter dem angezeigten SAML Artifakt abgeholt werden können.
-
-Wenn nun versucht wird, eine Transaktion mit einer ungültigen SessionID fortzusetzen erhält man folgende Log-Meldung:
-
-    ERROR | 09 09:34:27,105 | Thread-8 | 
-	at.gv.egovernment.moa.id.AuthenticationException: 
-	MOASessionID ist unbekannt 
-	(MOASessionID=-8650403497547200032)
-
-

In diesem Fall gibt der mitgeloggte Stacktrace Auskunft - über die Art des Fehlers. Der Aufrufer der MOA ID - Webapplikation bekommt einen Fehlercode sowie eine kurze - Beschreibung des Fehlers als Antwort zurück.
-
- Die Tatsächlich übertragenen Anfragen bzw. Antworten - werden aus Effizienzgründen nur im Log-Level DEBUG - angezeigt.

-
-

-

-

-
-
-

- - - - - - -

-
-
© 2004
-
-
- - -
-
- 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 aa7809425..000000000 --- a/id.server/doc/moa_id/id-admin_2.htm +++ /dev/null @@ -1,1417 +0,0 @@ - - - MOA ID-Administration - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - - -
-
MOA-ID

- - -
- Konfiguration
- -
- -

- - -
-
Konfiguration von MOA ID v.1.4
-
-

Konfiguration von MOA ID v.1.4

-

Die Konfiguration von MOA ID wird mittels einer XML-basierten - Konfigurationsdatei, die dem Schema - MOA-ID-Configuration-1.4.xsd - entspricht, durchgeführt. -

Der Ort der Konfigurationsdatei wird im Abschnitt Deployment - der Web-Applikation in Tomcat beschrieben. -

Die folgenden Abschnitte erläutern das Format der Konfigurationsdatei. - MOA-ID-Configuration.xml - zeigt ein Beispiel für eine umfassende Konfigurationsdatei.

-

Enthält die Konfigurationsdatei relative Pfadangaben, werden - diese relativ zum Verzeichnis, in dem sich die MOA-ID Konfigurationsdatei - befindet, interpretiert.
-

-
-

ConnectionParameter
- Das Element ConnectionParameter enthält Parameter, - die MOA-ID für den Aufbau von Verbindungen zu anderen Komponenten - benötigt. Dieses Element tritt mehrfach in der Konfigurationsdatei - auf und wird daher vorab detailliert beschrieben.
-
- Das Attribut URL enthält die URL der Komponente zu - der die Verbindung aufgebaut werden soll. Wird das Schema https - verwendet, können die Kind-Elemente AcceptedServerCertificates - und ClientKeyStore angegeben werden. Wird das Schema http - verwendet müssen keine Kind-Elemente angegeben werden bzw. - werden diese nicht ausgewertet. Andere Schemas werden nicht unterstützt. -
-
- Wird die Verbindung über TLS aufgebaut und erfordert der TLS-Server - eine Client-Authentisierung mittels Zertifikate, dann muss das Kind-Element - ClientKeyStore spezifiziert werden. Im Element ClientKeyStore - wird der Filename des PKCS#12-Keys (relativ zur MOA-ID Konfigurationsdatei) - angegeben. Diesem Keystore wird der private Schlüssel für - die TLS-Client-Authentisierung entnommen. Das Passwort zum Lesen - des privaten Schlüssels wird im Attribut ClientKeyStore/@password - konfiguriert.
- Aufgrund der Tatsache, dass starke Verschlüsselung eine Voraussetzung - für MOA-ID darstellt, werden clientseitig nur die folgenden - Cipher Suites unterstützt:
-

    -
  • SSL_RSA_WITH_RC4_128_SHA
  • -
  • SSL_RSA_WITH_RC4_128_MD5
  • -
  • SSL_RSA_WITH_3DES_EDE_CBC_SHA
  • -
- Im Kind-Element AcceptedServerCertificates 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 überprüft ob ein Zertifikatspfad - zu den im Element <TrustedCACertificates> angegebenen - Zertifikaten erstellt werden kann. Falls dies nicht möglich ist, - kommt es zu einem Fehlerfall. -

-
-

AuthComponent
- AuthComponent enthä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 AuthComponent hat fünf Kind-Elemente: -

    -
  • BKUSelection (optional)
  • -
  • SecurityLayer
  • -
  • MOA-SP
  • -
  • IdentityLinkSigners
  • -
  • VerifyInfoboxes (optional ab Version 1.4)
  • -
-

-
-

AuthComponent/BKUSelection
- Das optionale Element BKUSelection enthält Parameter - zur Nutzung eines Auswahldienstes für eine Bürgerkartenumgebung - (BKU). Wird das Element nicht angegeben, dann wird die lokale - Bürgerkartenumgebung auf http://localhost:3495/http-security-layer-request - verwendet.
-
- Das Attribut BKUSelectionAlternative gibt an welche - Alternative zur BKU-Auswahl verwendet werden soll. MOA-ID unterstützt - die Werte HTMLComplete (vollständige HTML-Auswahl) - und HTMLSelect (HTML-Code für Auswahl) ["Auswahl - von Bürgerkartenumge-bungen", Arno Hollosi].
-
- Das Kind-Element ConnectionParameter spezifiziert die - Verbindung zum Auswahldienst (siehe ConnectionParameter), - jedoch kann das Kind-Element ClientKeyStore nicht angegeben - werden.

-
-

AuthComponent/Templates
- Das optionale Element Templates kann genau einmal vorkommen, um - das Aussehen der Seiten "Auswahl der Bürgerkartenumgebung" sowie - "Anmeldung mit Bürgerkarte" anzupassen. Die hier - spezifizierten (globalen) Templates haben Priorität gegenüber Templates, - die in der aufrufenden URL (vgl. Aufruf von MOA-ID-AUTH) - übergeben werden, haben jedoch Nachrang gegenüber in - der Konfigurationsdatei für eine Online-Applikation individuell definierte (lokale) - Templates (siehe - OnlineApplication/AuthComponent/Templates). - Das heißt, sind in der Konfigurationsddatei für eine Online-Applikation lokale - Templates definiert (Element OnlineApplication/AuthComponent/Templates), so werden - die als global spezifizierten Templates (AuthComponent/Templates) für diese - OnlineApplikation ignoriert, jedoch für alle anderen Online-Applikationen - verwendet. Templates in der aufrufenden URL werden demnach nur mehr dann - herangezogen, wenn in der Konfigurationsdatei weder globale (für alle - Online-Applikationen gültig) noch lokale (Templates je Online-Applikation) - spezifiziert sind.
- Das Templates-Element hat die zwei Kindelemente - BKUSelectionTemplate und Template. Jedes dieser - beiden Elemente kann genau einmal vorkommen oder fehlen. - Das Kindelement BKUSelectionTemplate spezifiziert ein Template - zur Gestaltung der Seite "Auswahl der Bürgerkartenumgebung", - während das Kindelement Template die Seite - "Anmeldung mit Bürgerkarte" referenziert. - Beide Elemente haben genau ein Attribut namens URL, - 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.
- Im folgenden Beispiel werden zwei Templates im Verzeichnis - CATALINA_HOME/conf/moa-id/templates referenziert: -
-

-<Templates>
-  <BKUSelectionTemplate URL="templates/SampleBKUSelectionTemplate.html"/>
-  <Template URL="templates/SampleTemplate.html"/>
-</Templates>
- -
- Richtlinien zur Struktur der beiden Templates können der - MOA-ID-Spezifikation bzw. dem Abschnitt - Aufruf von MOA-ID-AUTH - dieses Handbuches entnommen werden. - -

-
-
-

AuthComponent/SecurityLayer
- Das Element SecurityLayer enthält Parameter - zur Nutzung des Security-Layers.
-
- Das Kind-Element TransformsInfo spezifiziert eine - Transformation, die für die Erstellung der Signatur des - AUTH-Blocks als Parameter in den CreateXMLSignatureRequest - des Security-Layers integriert werden muss. Mehrere unterschiedliche - Implementierungen des Security-Layer können durch die - Angabe mehrerer TransformsInfo-Elemente unterstützt - werden.
-
- Das Attribut TransformsInfo/@filename verweist auf - eine Datei, die das globale Element TransformsInfo - vom Typ TransformsInfo enthält. Die Angabe erfolgt - relativ zur MOA-ID Konfigurationsdatei. Das Encoding dieser - Datei muss UTF-8 sein.
-
- Beispiel für - eine TransformsInfo-Datei

-
-

AuthComponent/MOA-SP
- Das Element MOA-SP enthält Parameter zur Nutzung - von MOA-SP. MOA-SP wird für die überprüfung - der Signatur der Personenbindung und des AUTH-Blocks verwendet. -
-
- Wird das Kind-Element ConnectionParameter angegeben, - dann wird MOA-SP über das Webservice angesprochen.

-

Wird das Kind-Element ConnectionParameter - nicht angegeben so wird eine MOA-ID beiligende Version von - MOA-SP direkt ü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 $MOA_ID_INST_AUTH/conf/moa-spss/SampleMOASPSSConfiguration.xml - enthalten.

-
-
-
-
-
-
-
-
-
-
-
-
-
-

Hinweis: MOA-SP muss entsprechend konfiguriert - werden - siehe hierzu Abschnitt Konfiguration - von MOA-SP. Alle Details zur Konfiguration von MOA-SP - finden sie in der Distribution von MOA-SP/SS beiligenden - Dokumentation im Abschnitt 'Konfiguration'.
-

- Das Kind-Element VerifyIdentityLink/TrustProfileID - spezifiziert eine TrustProfileID, die für den VerifyXMLSignatureRequest - zur Überprüfung der Signatur der Personenbindung - verwendet werden muss. Diese TrustProfileID muss beim - verwendeten MOA-SP Modul konfiguriert sein.
-
- Die Kind-Elemente VerifyAuthBlock/TrustProfileID - und VerifyAuthBlock/VerifyTransformsInfoProfileID - spezifizieren eine TrustProfileID und eine ID für - ein Transformationsprofil, die für den VerifyXMLSignatureRequest - zur überprüfung der Signatur des Auth-Blocks - verwendet werden müssen. Diese TrustProfileID muss - beim verwendeten MOA-SP Modul konfiguriert sein.

-
-
-
-
-
-
-
-
-
-
-

AuthComponent/IdentityLinkSigners -
- Dieses Element gibt an von welchen Signatoren die Signatur - des IdentityLink erstellt werden musste damit der IdentityLink - akzeptiert wird. Für jeden Signator muss der X509SubjectName - nach RFC 2253 spezifiziert werden.
-
- Beispiel -

- Anmerkung: Ab Version 1.4 ist dieses Element nicht mehr verpflichtend notwendig, da die - Berechtigung von Zertifikaten zum Signieren von Personenbindungen ab Februar - 2007 über die Zertifikatseigenschaft "Eigenschaft zur Ausstellung von Personenbindungen" - (OID: 1.2.40.0.10.1.7.1) geprüft wird. - Der Namens-Check des alten Zertifikats wird fix in MOA-ID integriert, sodass das - IdentityLinkSigners-Element in der Konfiguration überflüssig wird. - -
-

-
-

AuthComponent/VerifyInfoboxes -
- Ab Version 1.4 bietet MOA-ID die Möglichkeit einer erweiterten Infobox-Validierung, - das heißt, es können neben der Personenbindung auch weitere ausgelesene Infoboxen - validiert werden. Die für die Validierung der Infoboxen notwendigen Parameter - können über die Konfigurationsdatei durch das VerifyInfoboxes - Element sowohl global als auch - lokal - je Online-Applikation gesetzt werden. MOA-ID übergibt diese Parameter der - Applikation, die für die Verifikation des Inhaltes der jeweilgen von der BKU - übermittelten Infobox verantwortlich ist. Im Folgenden wird eine derartige - Applikation als Prüfapplikation bezeichnet. -
- Das Verifyinfoboxes Element ist optional und kann fehlen, - wenn keine Infoboxen außer der der Personenbindung validiert werden müssen. -
- Das VerifyInfoboxes-Element hat folgende Kind-Elemente: -

    -
  • DefaultTrustProfile: Dieses optionale - Element kann nur einmal vorkommen und spezifiziert ein Trust-Profil, das - von einer Prüfapplikation zur Validierung einer Infobox - herangezogen werden kann, wenn für diese Infobox kein eigenes - Trust-Profil gesetzt wurde. Es hat genau ein - Kindelement namens TrustProfileID, das die ID eines in MOA-SP - konfigurierten Trust-Profiles enthält. -
    - Anmerkung: Das Trust-Profil für die - Personenbindung darf nicht - zur Validierung anderer Infoboxen verwendet werden. Das Trust-Profil für - die Bürgerkarte soll nur dann zur Validierung - anderer Infoboxen verwendet werden, wenn die zur Verifikation der Zertifikate benötigten - Wurzelzertifikate bereits im entsprechenden Trust-Store enthalten sind. (vgl. - MOA-ID Spezifikation, Abschnitt 4.6). -
  • -
  • Infobox: Dieses Element kann beliebig oft vorkommen - und kapselt die Parameter, die für die Validierung einer Infobox an die - jeweilige Prüfapplikation übergeben werden. -
    - Das Infobox-Element hat folgende Attribute: -
      -
    • Identifier: Dieses Attribut muss vorhanden sein und gibt - den Namen der Infobox an. Er muss dabei exakt dem Bezeichner - der jeweiligen zu validierenden Infobox aus der BKU entsprechen, also - zum Beispiel Mandates für die Vollmachten-Infobox oder - EHSPToken für die GDAToken-Infobox. -
      -
    • -
    • required: Dieses Attribut vom Typ - boolean bestimmt, ob MOA-ID den Inhalt der entsprechenden Infobox - für die Anmeldung zwingend benötigt. Ist es auf true - gesetzt, und wird der entsprechende Infobox-Inhalt nicht von der BKU - übermittelt, so bricht MOA-ID den Anmeldevorgang mit einer Fehlermeldung - ab. -
      - Fehlt dieses Attribut, so wird als Defaultwert false gesetzt. -
      -
    • -
    • provideStammzahl: Dieses Attribut vom Typ - boolean bestimmt, ob die Prüfapplikation die Stammzahl aus der - Personenbindung erhalten darf. Fehlt dieses Attribut, so wird als Defaultwert - false gesetzt. -
      - Anmerkung: Das Attribut steht in keinem Zusammenhang zum gleichnamigen - Attribut OnlineApplication/AuthComponent/@provideStammzahl, - das angibt ob die Stammzahl an die Online-Applikation weitergegeben werden darf. -
    • -
    • provideIdentityLink: Dieses Attribut vom Typ - boolean bestimmt, ob die Prüfapplikation die Personenbindung erhalten - soll. Hat es den Wert true, so wird ein Klone des Wurzel-Elements der Personenbindung - an die Prüfapplikation übergeben, wobei zu beachten ist, dass die - darin enthaltene Stammzahl auf einen leeren String gesetzt wird, falls das - Attribut provideStammzahl auf false - gesetzt ist. - Fehlt das provideIdentityLink-Attribut, so wird als Defaultwert false gesetzt. -
      - Anmerkung 1: Das Attribut steht in keinem Zusammenhang zum gleichnamigen - Attribut OnlineApplication/AuthComponent/@provideIdentityLink, - das angibt ob die Online-Applikation die Personenbindung erhalten - soll. -
      - Anmerkung 2: Der Prüfapplikation werden defaultmäßig der Vorname, - der Familienname, das Geburtsdatum, der Typ der Stammzahl, die Stammzahl - (konfigurierbar) und die öffentlichen Schlüssel aus der Personenbindung - übergeben. Das Attribut provideIdentityLink sollte deshalb - wirklich nur dann auf true gesetzt werden, wenn von der - Prüfapplikation noch andere Daten aus der Personenbindung benötigt - werden. -
    • -
    - Das Infobox-Element hat folgende Kind-Elemente: -
      -
    • FriendlyName: Das Element ist optional und - enthä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. Vollmachten - oder Stellvertretungen für die Mandates-Infobox oder - GDAToken für die EHSPToken-Infobox. -
      - Fehlt dieses Element, so wird für Fehlermeldungen der Wert des - Identifier-Attributes verwendet. -
    • -
    • TrustProfileID: Das Element ist optional und - bezeichnet ein in MOA-SP konfiguriertes Trust-Profil, das von MOA-ID - für die Validierung der Infobox verwendet wird. - Dabei ist wieder zu beachten, dass das Trust-Profil für die - Personenbindung nicht - zur Validierung anderer Infoboxen verwendet werden darf, und das Trust-Profil für - die Bürgerkarte nur dann zur Validierung - anderer Infoboxen verwendet werden soll, wenn die zur Verifikation der - Zertifikate benötigten Wurzelzertifikate bereits im entsprechenden - Trust-Store enthalten sind. (vgl. MOA-ID Spezifikation, Abschnitt 4.6). -
      Fehlt dieses Element, so wird das - Default-Trust-Profil - verwendet. Ist dieses auch nicht konfiguriert, so wird für die - Validierung der entsprechenden Infobox keine Zertifikatsprüfung - notwendig sein. -
    • -
    • ValidatorClass: 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 Identifier-Attribut der Infobox abgeleitet - wird (vgl. MOA-ID-Spezifikation, Abschnitt 4.7.2.3, - Zuordnung eines InfoboxReadResponse zu einer implementierenden Klasse). -
      - Anmerkung: Im Regelfall wird dieses Element fehlen, da bei der - Entwicklung einer Infobox-Prüfapplikation der Default-Klassennamen - verwendet werden sollte. Nur wenn es verschiedene Prüfapplikationen - für eine Infobox gibt, wird man das ValidatorClass - verwenden, um eine andere als die Default-Applikation zu laden. -
    • -
    • SchemaLocations: Das Element ist optional - und referenziert XML-Schemas, die von der Prüfapplikation zum - validierenden Parsen von Infoboxen verwendet werden können. Das - Element hat beliebig viele Schema-Kindelemente, dessen Attribute - namespace und schemaLocation jeweils die Namespace-URI - und den Ort (URI) des entsprechenden Schemas bezeichnen. Relative URIs im - schemaLocation-Attribut sind dabei relativ zum Verzeichnis der - MOA-ID-Konfigurationsdatei zu interpretieren. -
      - Beispiel: -
      -
      -    <SchemaLocations>
      -      <Schema namespace="http://ns1.ns1" schemaLocation="schemas/ns1.xsd"/>
      -      <Schema namespace="http://ns2.ns2" schemaLocation="schemas/ns2.xsd"/>
      -    </SchemaLocations>
      -                              
      - Weitere Möglichkeiten zur Übergabe von XML-Schemas an die - Prüfapplikation können in der MOA-ID-Spezifikation im - Abschnitt 4.7.2, Erweiterte Infoboxüberprüfung, nachgelesen werden. -
    • -
    • ApplicationSpecificParameters: - Das Element ist optional und nimmt Infobox-kontext-spezifische Parameter - auf. -
      - Da MOA-ID die zusätzlichen zur Personenbindung abgefragten Infoboxen - (bzw. deren Inhalte) nicht a priori kennt, ist es unmöglich vorherzusehen, - welche Parameter eine Prüfapplikation zum Validieren einer Infobox - benötigt. Die Konfiguration sieht daher das Element - ApplicationSpecificParameters vor, um einer bestimmten - Prüfapplikation kontext spezifische Parameter zu übermitteln. - Dieses Element wird vollständig an die Prüfapplikation - weitergegeben, und es obliegt der Prüfapplikation die Kindelemente - des ApplicationSpecificParameters-Element zu extrahieren und zu - interpretieren. -
      - Beispiel: -
      -
      -    <ApplicationSpecificParameters>
      -      <Parameter1>content1</Parameter1>
      -      <Parameter2>content2</Parameter2>
      -      <Parameter3>
      -        <Parameter3a>content3a</Parameter3a>
      -        <Parameter3b>content3b</Parameter3b>
      -      </Parameter3>
      -    </ApplicationSpecificParameters>
      -                              
      -
    • -
    -
  • -
-
- Eine Beispielkonfiguration finden sie am Ende das Abschnitts - OnlineApplication/AuthComponent/VerifyInfoboxes. -
-
-

-
- -
-

ProxyComponent
- ProxyComponent enthä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.
-
- Das Element ProxyComponent hat nur das Kind-Element - AuthComponent, das die Verbindung zur Authentisierungs-komponente - beschreibt.
-
- Baut die Proxykomponente die Verbindung zur Authentisierungs-komponente - über ein Webservice auf, dann muss das Element - ConnectionParameter spezifiziert werden.
-
- Baut die Proxykomponente die Verbindung zur Authentisierungs-komponente - über das API auf, dann wird das Element ConnectionParameter - nicht spezifiziert.

-
-

OnlineApplication
- Für jede Online-Applikation, die über MOA-ID - authentisiert wird, gibt es ein Element OnlineApplication. - Die Parameter betreffen teils die MOA-ID Authentisierungskomponente, - teils die MOA-ID Proxykomponente, teils beide.
-
- Das ab Version 1.3 optionale Attribut OnlineApplication/@type - spezifiziert den Typ der OnlineApplikation und kann - die Werte publicService für eine Applikation - aus dem öffentlichen Bereich und businessService - für eine Anwendung aus dem privatwirtschaftlichen Bereich annehmen. - Ab Version 1.4 kann im Modus businessService ein zusätzliches - logisches Attribut OnlineApplication/@calculateHPI angegeben werden. - Dadurch wird im Falle von calculateHPI="true" im privatwirtschaftlichen - Bereich zur Identifikation der Health Professional Identifier HPI anstatt des wbPKs (siehe - - OnlineApplication/AuthComponent/IdentificationNumber) berechnet - und zur Anmeldung weiterverwendet. - Ist dieses Attribut nicht gesetzt, so wird der Typ publicService - vorausgesetzt.
-
- Das Attribut OnlineApplication/@publicURLPrefix - entspricht dem URL-Präfix der nach außen - sichtbaren Domäne der Online-Applikation, welcher - von der MOA-ID Proxykomponente durch den URL-Präfix - der wirklichen Domäne (Attribut OnlineApplication/ProxyComponent/ConnectionParameter/@URL) - ersetzt wird. Es dient als Schlüssel zum Auffinden - der Konfigurationsparameter zur Online-Applikation. -

-

Das Attribut OnlineApplication/@keyBoxIdentifier - gibt das Schlüsselpaar an, welches von der Bürgerkartenumgebung - zum Signieren des Auth Blocks verwendet wird. Mögliche - Werte: CertifiedKeypair sowie SecureSignatureKeypair.
-

- Das Element OnlineApplication hat optional - zwei Kind-Elemente: AuthComponent und ProxyComponent. -

-
-

OnlineApplication/AuthComponent -
- Das Element OnlineApplication/AuthComponent - muss verwendet werden wenn auf dem Server die Authentisierungskomponente - installiert wird. Es enthält Parameter, die - das Verhalten der Authentisierungskomponente bezüglich - der Online-Applikation konfiguriert.
-
- Das optionale Attribut slVersion definiert die Version des - verwendeten SecurityLayer und damit den Namespace aller - Requests, die von MOA-ID an die Bürgerkartenumgebung - geschickt werden. Dieses Attribut kann entweder den Wert 1.1 - oder 1.2 annehmen. Fehlt das Attribut, so wird als - Defaultwert 1.1 gesetzt. -
Wurde als Typ der Online-Applikation - der Wert businessService (vgl. Attribut OnlineApplication/@type) - spezifiziert, so wird das Attribut slVersion ignoriert - und immer der Wert 1.2 verwendet, da die für - Applikationen aus dem privatwirtschaftlichen Bereich notwendige - Berechnung des wirtschaftsbereichsspezifischen Personenkennzeichens - (wbPK) erst ab SecurityLayer Version 1.2 möglich ist. -

- Das Attribut provideStammzahl bestimmt, - ob die Stammzahl in den Anmeldedaten aufscheint - oder ob der Wert ausgeblendet (d.h. auf den Leerstring gesetzt) - wird. Die Attribute provideAUTHBlock und - provideIdentityLink steuern, ob die - Anmeldedaten den Auth-Block bzw. die Personenbindung enthalten. - Ab Version 1.3 kann das Attribut provideCertificate - verwendet werden, um das Signatorzertifikat in die - Anmeldedaten aufzunehmen. - Alle Attribute sind optional und haben den Default-Wert - false. -
- Anmerkung: Das Attribut provideStammzahl steht in keinem - Zusammenhang zum gleichnamigen Attribut - VerifyInfoboxes/@provideStammzahl, - das angibt ob die Stammzahl an eine Prüfapplikation weitergegeben - werden darf. - Anmerkung: Das Attribut provideIdentityLink steht in keinem - Zusammenhang zum gleichnamigen Attribut - VerifyInfoboxes/@provideIdentityLink, - das angibt ob die Personenbindung an eine Prüfapplikation - weitergegeben werden soll. -
-
-

-
-

OnlineApplication/AuthComponent/IdentificationNumber -
- Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) - wird aus der auf der Bürgerkarte gespeicherten Stammzahl des Bürgers - und der Stammzahl des Wirtschaftsunternehmens berechnet. - Laut E-Governmentgesetz - darf die Errechnung eines wbPK aus der Stammzahl nicht beim Auftraggeber eines - privaten Bereichs durchgeführt werden (vgl. E-GovGesetz §12(1).4), und muss deshalb - an die Bürgerkartenumgebung ausgelagert werden. - Das OnlineApplication/AuthComponent/IdentificationNumber Element - wird nun verwendet, um die Stammzahl des Wirtschaftsunternehmens zu spezifizieren, - welche in weiterer Folge von MOA-ID an die Bürgerkartenumgebung übergeben - wird.
Dieses Element muss bei privatwirtschaftlichen Applikationen - vorhanden sein und wird ignoriert, falls es im Kontext von Anwendungen aus - dem öffentlichen Bereich verwendet wird.
- Das Element hat genau eines der folgenden möglichen Kindelemente - aus dem PersonData - Namespace, die als einzigen Inhalt die jeweilige Stammzahl des Unternehmens enthalten: -

    -
  • - Das Element pr:Firmenbuchnummer enthält als einzigen Inhalt - die Firmenbuchnummer des Unternehmens. -
  • -
  • - Das Element pr:Vereinsnummer enthält als einzigen Inhalt - die Vereinsregisternummer des Unternehmens. -
  • -
  • - Das Element pr:ERJPZahl enthält als einzigen Inhalt eine - Zahl aus dem Ergänzungsregister für nicht-natürliche Personen (CorporateBody). -
  • -
  • - Das Element pr:ZMRzahl enthält als einzigen Inhalt eine - Stammzahl einer natürlichen in Österreich meldepflichtigen Person. -
  • -
- - Die Stammzahl ist jeweils ohne Präfix anzugeben, also wird zum Beispiel - die Firmenbuchnummer FN468924i folgendermaßen definiert: -

- <pr:Firmenbuchnummer>468924i</pr:Firmenbuchnummer> -

- Leerzeichen werden ignoriert und im Falle einer Firmenbuchnummer werden - führende Nullen gelöscht und Bindestriche aus der Nummer entfernt. -

- Beispiele:
-
- 468924 i wird zu 468924i
- 00468924 wird zu 468924i
- 468924-i wird zu 468924i
-
- Alternativ zu den oben angeführten Elementen aus dem - PersonData - Namespace kann auch das Element AnyNumber verwendet werden, um - Stammzahlen zu spezifizieren, die nicht einer der vier oben aufgelisteten - Kategorien zugeordnet werden können. -

- Das Element AnyNumber hat genau ein Attribut namens Identifier, - das das Präfix der jeweiligen Stammzahl entält. Der Inhalt des - Elements AnyNumber ist die Stammzahl selbst, wobei die selben Regeln - wie oben gelten. -

- Die Firmenbuchnummer aus obigem Beispiel könnte man nun beispielsweise mit Hilfe das Elements - AnyNumber auch folgendermaßen definieren: -

- <AnyNumber Identifier="FN">468924i</AnyNumber> -

- Es sei aber nochmals daraufhingewiesen, dass für Stammzahlen der - Kategorien Firmenbuchnummer, Vereinsnummer, - ERJPZahl und ZMRzahl die vordefinierten Elemente aus - dem PersonData - Namespace verwendet werden sollen. Das Element AnyNumber wurde hauptsächlich in - das Schema aufgenommen, um offen für mögliche Erweiterungen zu sein. -

-
-

OnlineApplication/AuthComponent/Templates -
- Dieses Kindelement kann genau einmal vorkommen und entspricht in seiner Struktur dem - Element AuthComponent/Templates. - Es kann verwendet werden, um Templates zur Gestaltung der Seiten - "Auswahl der Bürgerkartenumgebung" sowie - "Anmeldung mit Bürgerkarte" individuell für - eine Online-Applikation zu definieren. Die hier definierten Templates haben - Priorität gegenüber globalen Templates und Templates, die - in der aufrufenden URL übergeben werden. -

-
- -
-

OnlineApplication/AuthComponent/TransformsInfo -
- Dieses Kindelement kann mehrfach vorkommen und entspricht in seiner Struktur - dem Element AuthComponent/SecurityLayer/TransformsInfo. - Das Element kann verwendet werden, um für unterschiedliche - Online-Applikationen unterschiedliche Transformationen zu spezifizieren. - Alle über dieses Element definierten Transformationen haben - Vorrang gegenüber die durch AuthComponent/SecurityLayer/TransformsInfo - angegebenen Transformationen. Das heißt, ist für eine - Online-Applikation das Kindelement AuthComponent/TransformsInfo - vorhanden, so wird für diese Applikation die durch dieses Element - spezifizierte Transformation verwendet (das Element kann natürlich - mehrfach vorkommen, wodurch mehrere Transformationen bezeichnet werden). - Für alle Applkikationen, die kein Kindelement vom Typ - AuthComponent/TransformsInfo enthalten, werden die unter - AuthComponent/SecurityLayer/TransformsInfo spezifizierten - "Default-Transformationen" verwendet.
- Dabei ist zu beachten, dass für jede definierte Transformation - ein entsprechendes MOA-SP/VerifyAuthBlock/VerifyTransformsInfoProfileID - Element vorhanden sein muss.

-

-
-
-

OnlineApplication/AuthComponent/VerifyInfoboxes -
- Dieses optionale Element entspricht dem VerifyInfoboxes-Element - aus der globalen AUTH-Komponente und überschreibt teilweise die - dort gesetzten Werte für die jeweilige Infobox pro Online-Applikation. - Dabei gelten die folgenden Regeln: -
- Ist nur das globale VerifyInfoboxes-Element - vorhanden, so gelten die dort definierten Parameter für alle - Online-Applikationen. Ist kein globales Element vorhanden, so kann - MOA-ID für alle Online-Applikation, in deren AUTH-Komponente - ein VerifyInfoboxes-Element enthalten ist, die darin - definierten Infoboxen überprüfen. Für - Online-Applikationen, in deren AUTH-Komponente kein - VerifyInfoboxes-Element gesetzt ist, kann demnach keine - andere Infobox als die der Personenbindung validiert werden. -
- Sind sowohl global (MOA-IDConfiguration/AuthComponent/VerifyInfoboxes) - als auch lokal (OnlineApplication/AuthComponent/VerifyInfoboxes) - in den Online-Applikationen Infobox-Validatoren konfiguriert, so verarbeitet - MOA-ID die darin enthaltenen Parameter wie folgt: -

    -
  • DefaultTrustProfile: Ein lokal - definiertes Default-Trust-Profil hat sowohl Vorrang gegenüber einem - global gesetzten Default-Trust-Profil - als auch gegenüber einem global gesetzen - infobox-spezifischen Trustprofil. Ist - beispielsweise im globalen VerifyInfoboxes-Element zwar kein - Default-Trust-Profil, aber für die Infobox A ein eigenes Trust-Profil - definiert, so wird ein lokal definiertes Default-Trust-Profil dem global - für die Infobox A gesetzten Trust-Profil vorgezogen. -
  • -
  • Infobox: MOA-ID kann die Vereinigung aus den - global und lokal konfigurierten Infoboxen für eine Online-Applikation - validieren. Sind beispielsweise global Prüfapplikationen - für die Infoboxen mit den Bezeichnern - (Infobox/@Identifier-Attribut) A - und B konfiguriert, und lokal für die Online-Applikation - OA1 die Infoboxen B, C und D, so - kann MOA-ID für die Online-Applikation OA1 die - Infoboxen A, B, C und D validieren. - Für die Infobox A werden dabei die Parameter aus der - globalen Konfiguration verwendet und für die Infoboxen - C und D die lokalen Parameter. Für die Infobox - B sind sowohl globale als auch lokale Parameter vorhanden, - die von MOA-ID wie folgt interpretiert werden: -
      -
    • Attribute: - Die Attribute required, - provideStammzahl und - provideIdentityLink überschreiben - die global gesetzten Werte. Dabei ist zu beachten, das ein Fehlen dieser - Attribute bedeutet, dass ihnen über das Schema der Defaultwert - false zugewiesen wird. Ist also beispielsweise für die - Infobox mit dem Bezeichner B das required-Attribut - global auf true gesetzt (<Infobox Identifier="B" required="true">) - und fehlt dieses Attribut lokal in der Online-Applikation OA1 - (<Infobox Identifier="B">), so hat das required-Attribut - für die Infobox B den Wert false. -
      - Die Attribute required, - provideStammzahl und - provideIdentityLink müssen also - für Infoboxen, die sowohl global als auch lokal konfiguriert sind, - in jeder lokalen Konfiguration neu gesetzt werden, wenn ihnen der Wert - true zugwiesen werden sollen. -
    • -
    • Kind-Elemente: -
        -
      • FriendlyName: - Ein lokal gesetzter FriendlyName wird einem global - gesetzten vorgezogen. Ist sowohl lokal als auch global kein - FriendlyName definiert, so wird das - Identifier-Attribut als FriendlyName - verwendet. -
        -
      • -
      • TrustProfileID: - 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ür für die Validierung dieser - Infobox kein Trust-Profil benötigt. -
      • -
      • ValidatorClass: - Eine lokal gesetzte Validator-Klasse wird einer global gesetzten - vorgezogen. Ist sowohl lokal als auch global für eine Infobox - keine Validator-Klasse konfiguriert, so wird die Default-Klasse - geladen (siehe ValidatorClass). -
      • -
      • SchemaLocations: - Lokal definierte Schemas werden global definierten vorgezogen. - Sind lokal keine Schemas konfiguriert, so werden die globalen verwendet, - so sie vorhanden sind. -
      • -
      • - ApplicationSpecificParameters: - Lokal definierte applikationsspezifische Paramter werden global - definierten vorgezogen. Sind lokal keine derartigen Paramter - konfiguriert, so werden die globalen verwendet, so sie vorhanden - sind. -
      • -
      -
    • -
    -
  • -
-
- Beispiel: In der Konfigurationsdatei - - SampleMOAIDVerifyInfoboxesConfiguration.xml sind global - (MOA-IDConfiguration/AuthComponent/VerifyInfoboxes) - Prüfapplikationen für die beiden Infoboxen mit den Bezeichnern - InfoboxA und InfoboxB konfiguriert. - InfoboxA demonstriert in diesem Beispiel die minimale Konfiguration - einer Prüfapplikation - es ist nur der Identifier angegeben. MOA-ID - wird in diesem Fall versuchen, die Default-Validatorklasse - at.gv.egovernment.moa.id.auth.validator.infoboxa.InfoboxAValidator - zu laden (siehe dazu auch MOA-ID-Spezifikation, Abschnitt 4.7.2.3, - Zuordnung eines InfoboxReadResponse zu einer implementierenden Klasse). - Da ein Default-Trust-Profil (GlobalVIDefaultTrust) konfiguriert ist, - wird MOA-ID dieses Profil zur Verifikation von Zertifikaten heranziehen. - Da kein FriendlyName gesetzt ist, wird das Identifier Attibut - (InfoboxA) als FriendlyName verwendet. Weitere Parameter - sind für die Verifikation dieser Infobox nicht erforderlich. -
- Die Prüfapplikation für die InfoboxB setzt nahezu alle - möglichen Paramter mit Ausnahme der Validator-Klasse. MOA-ID wird - zur Verifikation dieser Infobox also auch die dafür zustädige Default-Klasse - (at.gv.egovernment.moa.id.auth.validator.infoboxb.InfoboxBValidator) - laden, und alle konfigurierten Parameter an diese Klasse übergeben. -
- In die Konfigurationsdatei sind drei Online-Applikationen mit den - public URL-Prefixen https://OA1/, https://OA2/ und - https://OA3/ eingetragen. - Online-Applikation OA1 konfiguriert Prüfapplikationen für - die drei Infoboxen InfoboxB, InfoboxC und - InfoboxD. Das heißt, MOA-ID kann für die Online-Applikation - OA1 insgesamt vier Infoboxen überprüfen: die - Paramter für die Infobox InfoboxA werden - von der entsprechenden global konfigurierten Prüapplikation - übernommen. Die Infoboxen InfoboxC und - InfoboxD sind nur lokal gesetzt. Für InfoboxB - übernimmt MOA-ID die applikationsspezifischen Parameter aus der - entsprechenden global konfigurierten Infobox und überschreibt - alle weiteren Parameter mit den lokalen Werten. Als Trust-Profil wird - das lokale Deafult-Trust-Profil (LocalOA1DefaultTrust) genommen - - dieses hat Vorrang gegenüber den global gesetzten Profilen. Weiters - ist zu beachten, dass die Attribute provideStammzahl und - provideIdentityLink lokal nicht gesetzt sind, und daher den - Deafult-Wert false einnehmen. -
- Das VerifyInfoboxes-Element in der AUTH-Komponente der zweiten - Online-Applikation (OA2) spezifiziert keine anderen Prüfapplikationen - als die global definierten, überschreibt aber für beide Infoboxen - teilweise die global gesetzten Parameter. InfoboxA verwendet - ein lokal definiertes Trust-Profil (LocalInfoboxOA2ATrust), - InfoboxB übernimmt - alle globalen Parameter, setzt aber für die Attribute required, - provideStammzahl und provideIdentityLink jeweils den - Defaultwert false. -
- Die dritte Online-Applikation OA3 enthält in Ihrer AUTH-Komponente - kein VerifyInfoboxes-Element. MOA-ID übernimmt daher für - diese Online-Applikation die global konfigurierten Infobox-Prüapplikationen - (InfoboxA und InfoboxB) mit allen Paramertern genauso wie - sie dort gesetzt sind. Zu beachten ist hier, dass das in der AUTH-Komponente - auf true gesetzte Attribut proviedStammzahl die - Online-Applikation und nicht die Prüapplikation - betrifft. -
-

-
-

-
-
-

OnlineApplication/ProxyComponent -
- Das Element OnlineApplication/ProxyComponent - muss verwendet werden wenn auf dem Server die - Proxykomponente installiert wird.
-
- Das optionale Attribut configFileURL - verweist auf eine Konfigurationsdatei die dem Schema - MOA-ID-Configuration-1.4.xsd - entspricht mit Dokument-Element Configuration. - Die Angabe erfolgt relativ zur verwendeten MOA-ID - Konfigurationsdatei. Beispiel für das Element - configFileURL: "oa/SampleOAConfiguration.xml".
- Defaultmäßig wird versucht die Datei - von der betreffenden OnlineApplikation unter dem - Wert: http://<realURLPrefix>/MOAConfig.xml - zu laden.
- (<realURLPrefix> entspricht dem - Wert von OnlineApplication/ProxyComponent/ConnectionParameter/@URL) -
-
- Das optionale Attribut sessionTimeOut - legt das Timeout einer Benutzersession in der - Proxykomponente in Sekunden fest.
- Default-Wert: 3600
-
- Im optionalen Attribut loginParameterResolverImpl - kann der Klassenname eines zu verwendenden LoginParameterResolver - angegeben werden, welcher die Defaultimplementierung - ersetzt.
-

-

Im optionalen Attribut loginParameterResolverConfiguration - kann ein Configurationsstring für die - Initialisierung der betreffenden loginParameterResolverImpl - angegeben werden.
-
- Im optionalen Attribut connectionBuilderImpl - kann der Klassenname eines zu verwendenden ConnectionBuilder - angegeben werden, welcher die Defaultimplementierung - ersetzt.
-
- Im Kind-Element ConnectionParameter ist - konfiguriert, wie MOA-ID-PROXY zur Online-Applikation - verbindet.

-
-

ChainingModes
- Das Element ChainingModes definiert, - ob bei der Zertifikatspfad-überprüfung - das Kettenmodell ("chaining") oder - das Modell nach PKIX RFC 3280 ("pkix") - verwendet werden soll.
-
- Das Attribut systemDefaultMode spezifiziert - das Modell, das im Standardfall verwendet werden - soll.
-
- Mit dem Kind-Element TrustAnchor kann - für jeden Trust Anchor ein abweichendes - Modell spezifiziert werden. Ein Trust Anchor - ist ein Zertifikat, das in TrustedCACertificates - spezifiziert ist. Ein Trust Anchor wird durch - den Typ <dsig:X509IssuerSerialType> - spezifiziert. Das für diesen Trust Anchor - gültige Modell wird durch das Attribut - mode spezifiziert.
-
- Gültige Werte für die Attribute systemDefaultMode - und mode sind "chaining" und - "pkix".
-
- Beispiel -

-
-

TrustedCACertificates
- Das Element TrustedCACertificates - enthält das Verzeichnis (relativ zur - MOA-ID Konfigurationsdatei), das jene Zertifikate - enthält, die als vertrauenswürdig - betrachtet werden. Im Zuge der Überprüfung - der TLS-Serverzertifikate wird die Zertifikatspfaderstellung - an einem dieser Zertifikate beendet.

-
-

GenericConfiguration
- Das Element GenericConfiguration - ermöglicht das Setzen von Namen-Werte - Paaren mittels der Attribute name - und value. Die folgende Liste spezifiziert -

    -
  • gültige Werte für das name-Attribut, -
  • -
  • eine Beschreibung
  • -
  • gültige Werte für das value-Attribut - und (falls vorhanden)
  • -
  • den Default-Wert für das value-Attribut. -
  • -
- - - - - - - -
name: DirectoryCertStoreParameters.RootDir
Gibt den Pfadnamen zu einem - Verzeichnis an, das als Zertifikatsspeicher - im Zuge der TLS-Server-Zertifikatsüberprüfung - verwendet wird.
-
- value:
- Gültige Werte: Name eines gültigen - Verzeichnisses (relativ zur MOA-ID Konfigurationsdatei)
- Dieser Parameter muss angegeben werden. -
- - - - - - - -
name: AuthenticationSession.TimeOut
Gibt die Zeitspanne in - Sekunden vom Beginn der Authentisierung - bis zum Anlegen der Anmeldedaten an. - Wird die Angegebene Zeitspanne überschritten - wird der Anmeldevorgang abgebrochen. -
-
- value:
- Gültige Werte: positive Ganzzahlen -
- Default-Wert: 120
- - - - - - - -
name: AuthenticationData.TimeOut
Gibt die Zeitspanne in - Sekunden an, fü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öscht.
-
- value:
- Gültige Werte: positive Ganzzahlen
- Default-Wert: 600
- - - - - - - -
name: TrustManager.RevocationChecking
Für die TLS-Server-Authentisierung - dürfen nur Server-Zertifikate verwendet - werden, die eine CRLDP-Extension enthalten - (andernfalls kann von MOA-ID keine CRL-überprüfung - durchgeführt werden).
- Soll das RevocationChecking generell - ausgeschaltet werden, ist dieses Attribut - anzugeben und auf "false" zu setzen. -
-
- value:
- Gültige Werte: true, false
- Default-Wert: true
- - - - - - - -
name: FrontendServlets.EnableHTTPConnection
-

Standardmäßig können - die beiden Servlets "StartAuthentication" - und "SelectBKU" welche das - User-Frontend darstellen, aus Sicherheitsgründen, - nur über das Schema HTTPS aufgerufen - werden.

-

Wenn die beiden Servlets jedoch auch - Verbindungen nach dem Schema HTTP - entgegennehmen sollen, so kann mittels - dem Attribut "EnableHTTPServletConnection" - erlaubt werden.

-

Hinweis: Sicher und sinnvoll ist - das Erlauben der HTTP Verbindung nur - dann, wenn ein Vorgeschalteter Webserver - das HTTPS handling übernimmt, - und eine Verbindung zu den Servlets - nur über diesen Webserver möglich - ist.

-
- value:
- Gültige Werte: true, false
- Default-Wert: false
- - - - - - - -
name: - FrontendServlets.DataURLPrefix
-

Standardmäßig wird als - DataURL Prefix das URL Prä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äfix angegeben - werden. In diesem Fall muss der Webserver - so konfiguriert sein, dass er Request - auf diese URLs an den MOA-ID Server - weiterleitet.

-
- value:
- Gültige Werte: URLs nach dem Schema - 'http://' und 'https://'
- Default-Wert: kein Default-Wert
- Beispiel: <GenericConfiguration name="FrontendServlets.DataURLPrefix" - value="https://<your_webserver>/moa-id-auth/"/>
-
-
-
-
-
-
-
-
-
-
- - - - -
- - -

-
- - - -
-

 

-
-

-
-
-

Konfiguration der Online-Applikation

-
-Die Konfiguration der OA beschreibt die Art und Weise, wie die Proxykomponente die Anmeldung an der Online-Applikation -durchführt. -

-Der Name der Konfigurationsdatei wird in der Konfiguration von MOA-ID als Wert des Attributs -configFileURL des Elements MOA-IDConfiguration/OnlineApplication/ProxyComponent hinterlegt. -
Ist dieses Attribut nicht gesetzt, dann wird die Datei von http://<realURLPrefix>/MOAConfig.xml geladen, -wobei <realURLPrefix> dem Konfigurationswert OnlineApplication/ProxyComponent/ConnectionParameter/@URL entspricht. -

-Die Konfigurationsdatei ist eine XML-Datei, die dem Schema -MOA-ID-Configuration-1.4.xsd mit dem Wurzelelement -Configuration entspricht. -
- -
-

-LoginType
-Das Element LoginType gibt an, ob die Online-Applikation ein einmaliges Login erwartet (stateful), -oder ob die Login-Parameter bei jedem Request mitgegeben werden müssen (stateless). Im Fall einer stateful -Online-Applikation werden die in der HTTP-Session der Proxykomponente gespeicherten Anmeldedaten nur für den Aufruf -des Login-Scripts verwendet. Unmittelbar nach dem Aufruf werden sie gelöscht. -
-Default-Wert: stateful -

-
- -
-

-ParamAuth
-Konfiguriert die übergabe der Authentisierungs-Parameter an die Online-Applikation mittels URL-Parametern. Das Element -kann ein oder mehrere Kind-Elemente <Parameter> beinhalten. -

-
- -
-

-ParamAuth/Parameter
-Das Element <Paramter> enthält die Attribute Name und Value. -

-Das Attribut Name beschreibt den Namen des Parameters und ist ein frei zu wählender String. -

-Das Attribut Value beschreibt den Inhalt des Parameters und kann einen der durch MOAAuthDataType beschriebenen -Werte annehmen. Gültige Werte von MOAAuthDataType sind: -

    -
  • MOAGivenName - der Vorname des Benutzers, wie in der Personenbindung enthalten -
  • MOAFamilyName - der Nachname des Benutzers, wie in der Personenbindung enthalten -
  • MOADateOfBirth - das Geburtsdatum des Benutzers, wie in der Personenbindung enthalten -
  • MOABPK - die bereichsspezifische Personenkennzeichnung des Benutzers, wie von der -Authentisierungskomponente berechnet -
  • MOAWBPK - das wirtschaftsbereichsspezifische Personenkennzeichen des Benutzers, wie von der -Bügerkartenumgebung berechnet -
  • MOAPublicAuthority - wird durch true ersetzt, falls der Benutzer mit einem Zertifikat signierte, -welches eine Behördenerweiterung beinhaltet. Andernfalls wird false gesetzt -
  • MOABKZ - das Behördenkennzeichen (nur sinnvoll, wenn MOAPublicAuthority den Wert true -ergibt) -
  • MOAQualifiedCertificate - wird durch true ersetzt, falls das Zertifikat des Benutzers -qualifiziert ist, andernfalls wird false gesetzt -
  • MOAStammzahl - die Stammzahl des Benutzers; diese ist nur dann verfügbar, wenn die Online-Applikation -die Stammzahl bekommen darf (und daher in der Personenbindung enthalten ist) -
  • MOAIPAddress - IP-Adresse des Client des Benutzers. -
- -Anhand der <Parameter>-Elemente wird der Request für den Login-Vorgang (für stateful Online-Applikationen) -folgendermaßen zusammenge-stellt:
-
-GET https://<login-url>?
-  <p1.name=p1.resolvedValue>&
-  <p2.name=p2.resolvedValue>...
-
-

-Die <login-url> ergibt sich aus dem Parameter OA des Aufrufs von MOA-ID-AUTH, -zusammen mit der Konfiguration von OnlineApplication/@publicURLPrefix und von OnlineApplication/ProxyComponent/ConnectionParameter/@URL. -
Der Wert resolvedValue wird in MOA-ID-PROXY je nach Wert des Platzhalters eingesetzt. -

-
-
-

-BasicAuth
-Das Element BasicAuth konfiguriert die übergabe der Authentisierungs-Parameter an die Online-Appliktion -mittels HTTP Basic Authentication. Es enthält zwei Kind-Elemente. -

-Das Element UserID gibt die UserId des zu authentisierenden Benutzers an und kann einen der durch -MOAAuthDataType beschriebenen Werte annehmen. -

-Das Element Password gibt das Passwort des zu authentisierenden Benutzers an und kann einen der durch -MOAAuthDataType beschriebenen Werte annehmen. -

-
- -
-

-HeaderAuth
-Das Element HeaderAuth konfiguriert die übergabe der Authentisierungs-Parameter an die Online-Applikation -in HTTP Request Headern. Das Element kann ein oder mehrere Kind-Elemente <Header> beinhalten. -

-
- - -
- - -
- - - -
-

 

-
-

-
-
-

Konfiguration von MOA-SP

-
- -

MOA-ID überprüft die Signaturen der Personenbindung und - des AUTH-Blocks mit dem VerifyXMLSignatureRequest von - MOA-SP. Dazu muss MOA-SP wie unten beschreiben konfiguriert werden. -
-
- VerifyTransformsInfoProfile
- Der Request zum überprüfen der Signatur des AUTH-Blocks - verwendet ein vordefiniertes VerifyTransformsInfoProfile. Die - im Request verwendete Profil-ID wird in der MOA-ID Konfigurationsdatei - im Element /MOA-IDConfiguration/ AuthComponent/MOA-SP/VerifyAuthBlock/ - VerifyTransformsInfoProfileID 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/MOAIDTransformAuthBlock.xml - enthalten. Diese Profildefinition muss unverändert übernommen - werden.

-
- -
-

-TrustProfile
-Die Requests zur überprüfung der Signatur verwenden vordefinierte TrustProfile. -Die im Request verwendete Profil-IDs werden in der MOA-ID Konfigurationsdatei -in den Elementen /MOA-IDConfiguration/AuthComponent/MOA-SP/VerifyIdentityLink/ TrustProfileID und -/MOA-IDConfiguration/AuthComponent/MOA-SP/VerifyAuthBlock/TrustProfileID definiert. Diese beiden Elemente -können unterschiedliche oder identische TrustProfileIDs enthalten. -Am MOA-SP Server müssen TrustProfile mit gleichlautender ID definiert werden. -Die Auslieferung von MOA-ID enthält das Verzeichnis $MOA_ID_INST_AUTH/conf/moa-spss/trustprofiles/MOAIDBuergerkarteRoot, -das als TrustProfile verwendet werden kann. Weitere Zertifikate können als vertrauenswürdig hinzugefügt werden. -

-
- -
-

-Certstore
-Zum Aufbau eines Zertifikatspfades können benötigte Zertifikate aus einem Zertifikatsspeicher verwendet werden. -Die Auslieferung von MOA-ID enthält das Verzeichnis $MOA_ID_INST_AUTH/conf/moa-spss/certstore, das als initialer -Zertifikatsspeicher verwendet werden kann. -

-
- -
-Hinweis: Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues Format für die XML-Konfigurationsdatei. -Für die Konvertierung einer älteren Konfigurationsdatei auf das neue Format steht Ihnen ein Tool -zur Verfügung. Details dazu finden sie in der der Distribution von MOA-SP/SS beiligenden -Dokumentation im Kapitel 'Konfiguration', Abschnitt 1.2.1.
- -
-
- - -
- - - -
-

 

-
-

-
-
-

Änderung der Konfiguration während des Betriebs

-
-Der Inhalt dieser Konfiguration, bzw. jene Teile, auf die indirekt verwiesen wird, können während des laufenden -Betriebes des MOA-Servers geändert werden. Der Server selbst wird durch den Aufruf einer URL -(im Applikationskontext von MOA ID) dazu veranlasst, die geänderte Konfiguration neu einzulesen. -Im Falle einer fehlerhaften neuen Konfiguration wird die ursprüngliche Konfiguration beibehalten. -
- - -
-

- - - - - - -

-
-
© 2004
-
-
- - -
-
- 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 14c8aecce..000000000 --- a/id.server/doc/moa_id/id-admin_3.htm +++ /dev/null @@ -1,204 +0,0 @@ - - - MOA ID-Administration - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - -
-
-
MOA-ID

- - - -
- Optionale
    Komponenten
-
- -
-
-Optionale
Komponenten

-IIS
-Apache
-PostgreSQL
-
-
-

Konfiguration der optionalen Komponenten

-

Konfiguration des Microsoft Internet Information Server (optional)

-
-Vor MOA-ID-AUTH oder MOA-ID-PROXY kann optional ein MS IIS vorgeschaltet sein. In diesem Fall ü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ührt.

-Konfiguration von Jakarta mod_jk im MS IIS
-Fü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 mod_jk IIS HowTo. Beispiele für workers.properties und uriworkermap.properties Dateien liegen im ausgelieferten moa-id-auth-x.y.zip bzw. moa-id-proxy-x.y.zip, Verzeichnis tomcat bei. -

-Konfiguration von Tomcat
-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önnen die Connectoren für HTTP und HTTPS deaktiviert werden. Das geschieht am einfachsten durch ein- bzw. auskommentieren der entsprechenden Connector Konfigurations-Elemente in dieser Datei. -

-
-
-

Konfiguration von SSL
- Die Dokumentation zum Einrichten von SSL auf dem MS IIS steht nach - Installation des IIS unter http://localhost/iisHelp/ bzw. online - zur Verfügung.

-

Konfiguration des zu verwendenden DATA-URL - Präfix
- Befindet sich der Rechner auf dem MOA-ID installiert wird hinter - einer Firewall welche zwar Zugriffe vom vorgelagerten Webserver - zulä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äfix vergeben werden. An dieses - URL-Präfix werden Daten von der verwendeten Bürgerkartenumgebung - gesendet. Details finden sie im Abschnitt Konfiguration. - Requests an das DataURL-Präfix> müssen durch den Webserver - an https://<moa-id-rechnername>/moa-id-auth/ bzw. an http://<moa-id-rechnername>/moa-id-auth/ - weitergeleitet werden.

-
-
-

- - -
- - - -
-

 

-
-

-
-
-

Konfiguration des Apache Webservers (optional)

-
-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ür die Kommunikation zwischen Webserver und Tomcat eingesetzt. -

-Konfiguration von Jakarta mod_jk im Apache Webserver
- 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 mod_jk Apache HowTo. Ein Beispiel für eine workers.properties Datei liegt im Verzeichnis $MOA_SPSS_INST/conf/moa bei.
-Um MOA-ID-AUTH oder MOA-ID-PROXY dem Apache Webserver bekannt zu machen, muss folgender Eintrag in die Apache Konfigurationsdatei gemacht werden: -
-    JkMount /moa-id-auth/* moaworker
-
-oder für die Proxy-Komponente -
-    JkMount /* moaworker
-
-
-Konfiguration von Tomcat
-Die Konfiguration von Tomcat ist analog wie im Abschnitt über den MS IIS durchzuführen. -

- -Konfiguration von SSL mit mod_SSL
-Apache kann in Verbindung mit mod_SSL als SSL-Endpunkt für das MOA-ID-AUTH Webservice fungieren. In diesem Fall entfä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 Online-Dokumentation. -

-Bei der Verwendung von Client-Authentisierung muss darauf geachtet werden, dass mod_ssl die HTTP-Header mit den Informationen über das Client-Zertifikat exportiert. Dies wird durch Angabe der Option
-
-    SSLOptions +ExportCertData +StdEnvVars
-
-in der Apache-Konfiguration erreicht.
-Weiters muss Jakarta mod_jk angewiesen werden, die SSL Schlüssellänge zu exportieren. Dies geschieht mit der Direktive: -
-    JkOptions +ForwardKeySize 
-              +ForwardURICompat 
-              -ForwardDirectories
-
-

Konfiguration des zu verwendenden DATA-URL Präfix

-

siehe gleichnamige Überschrift - in Abschnitt "Konfiguration des Microsoft Internet Information - Server (optional)"

-
-
-

- - -
- - - -
-

 

-
-

Konfiguration von PostgreSQL

-
-MOA-ID-AUTH bzw. MOA-ID-PROXY kann PostgreSQL zum Abspeichern von Log-Meldungen verwenden. Hierfür wird eine installierte und konfigurierte Datenbank vorausgesetzt. Eine detaillierte Übersicht über die Installation und Konfiguration von PostgreSQL gibt die Online-Dokumentation.

-Logging
-Für das Logging in eine PostgreSQL Datenbank mittels Jakarta Log4j muss zunächst eine Tabelle für die Log-Meldungen angelegt werden. Dies kann mit folgendem SQL-Statement erreicht werden: -
-    create table spss_log 
-      (log_time timestamp, 
-       log_level varchar(5), 
-       log_msg varchar(256));
-
-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ält bereits eine beispielhafte Jakarta Log4j-Konfiguration für das Logging in eine PostgreSQL Datenbank, die standardmäßig ausgeschaltet ist. Hinweis: Bei Tests hat sich das Logging in eine Datenbank mit Jakarta Log4j als Performance-Engpaß herausgestellt. Es wird deshalb empfohlen, auf dieses Feature zu verzichten. -

-
- -
-

- - - - - - -

-
-
© 2004
-
-
- - -
-
- \ No newline at end of file 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 6e33f40e8..000000000 --- a/id.server/doc/moa_id/id-anwendung.htm +++ /dev/null @@ -1,104 +0,0 @@ - - - MOA ID-Anwendung - - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - -
-
MOA-ID

-
- Übersicht
- - -
- -
-
-
MOA ID-Anwendung
-

-MOA-ID führt für eine Online-Applikation (OA) die Benutzeridentifizierung und -authentisierung mit Hilfe der Bürgerkarte durch. -

-

Übersicht

-Um diese Funktionalität verfügbar zu machen, ist folgendermaßen vorzugehen:
-

-
    -
  • Die OA muss als Webapplikation installiert werden.
  • -
  • MOA-ID-AUTH muss als Webapplikation installiert und für die OA konfiguriert werden.
  • -
  • MOA-ID-AUTH wird durch einen Verweis von einer Webseite aufgerufen. -Diese Webseite kann z.B. Teil eines Portals sein.
  • -
  • Nach erfolgter Authentisierung holt die OA die bereitgestellten Anmeldedaten zum Bürger von MOA-ID-AUTH ab. -Dies kann unter Mithilfe der Webapplikation MOA-ID-PROXY geschehen, die für diesen Zweck installiert und für die OA konfiguriert werden muss.
  • -
-
-
- - - - - - -

-
-
© 2003
-
-
- - -
- - 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 27da073a5..000000000 --- a/id.server/doc/moa_id/id-anwendung_1.htm +++ /dev/null @@ -1,205 +0,0 @@ - - - MOA ID-Anwendung - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - -
-
MOA-ID

- - - -
- -

-
-

Aufruf von MOA-ID-AUTH

-
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:
-
<a href="https://<moa-id-server-und-pfad>/
-StartAuthentication?Target=<geschäftsbereich>
-&OA=<oa-url>&Template=<template-url>">
- - - - - - - - - - - - - -
<moa-id-server-und-pfad>Server und Pfad, wo MOA-ID-AUTH installiert ist
Target=<geschäftsbereich>Angabe, für welches Verfahren der Benutzer authentisiert werden soll (siehe TODO: Link auf Verzeichnis der Geschäftsbereich)
OA=<oa-url>Webseite, auf die der Browser nach erfolgter Authentisierung weitergeleitet werden soll
Template=<template-url>optional; HTML-Vorlage für der Anmeldeseite von MOA-ID-AUTH, über die der Bürger den Authentisierungsvorgang startet. Über diesen Parameter kann das Aussehen der Anmeldeseite an das Aussehen der Online-Applikation angepasst werden.
-

- -
-Template

-Ein Template für die Anmeldeseite von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:
-
<!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">
</head>
-

<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>
-

-Innerhalb dieser <form>-Elemente können Texte, Beschriftungen und Styles modifiziert werden, -und es können zusätzliche Elemente darin aufgenommen werden. -

-Die vorgegebene Grundstruktur ist aber in jedem Fall einzuhalten, und es müssen die speziellen -Tags <BKU> (kommt 2x vor), <XMLRequest>, <DataURL>, <CertInfoXMLRequest> und <CertInfoDataURL> -darin enthalten sein. Das Tag <PushInfobox> muss ab Version 1.4 vorhanden sein, wenn MOA-ID auch andere Infoboxen als die Personenbindung bearbeiten kann. -

- -
-BKU-Auswahl

-MOA-ID-AUTH bietet die Möglichkeit, die Bürgerkartenumgebung (BKU) auszuwählen, über die in weiterer Folge die Bürgerkarte ausgelesen wird. Der Aufruf erfolgt dann durch einen Verweis der Form:
-
<a href="https://<moa-id-server-und-pfad>/
-SelectBKU?Target=<geschäftsbereich>
-&OA=<oa-url>&Template=<template-url>
-&BKUSelectionTemplate=<bku-template-url>">
- - - - -
BKUSelectionTemplate= <bku-template-url>optional; HTML-Vorlage für der BKU-Auswahlseite von MOA-ID-AUTH. -Über diesen Parameter kann das Aussehen der BKU-Auswahlseite an das Aussehen der Online-Applikation angepasst werden.
-

- -
-BKUSelectionTemplate

-Ein Template für die BKU-Auswahl von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:
-
-<!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">
</head>

<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>

-

</body>
-</html>
-

-

- - -Innerhalb dieser <form>-Elemente können Texte, Beschriftungen und Styles modifiziert werden, -und es können zusätzliche Elemente darin aufgenommen werden.
-
-Auch dabei ist die vorgegebene Grundstruktur einzuhalten, die speziellen Tags <StartAuth> und <BKUSelect> sind verpflichtend.

-

Wichtiger Hinweis: wenn die Templates ü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.

-Vorgeschlagene Vorgehensweise:
-
-
-
-1. Webserver SSL/TLS Zertifikat speichern im .cer Format speichern (z.B. mittels Internet Explorer).
-2. Mittels Java Keytool das Zertifikat in einen Java Truststore importieren.
- -Im folgenden Beispiel wird in den Java Truststore "truststore.jks" mit dem Passwort "changeit" importiert.
-
keytool -import -trustcacerts -alias mytomcat -file tomcat_localhost.cer -keystore truststore.jks
-

3. Truststore beim Starten von Tomcat angeben (über das Hinzufügen folgender Parameter in - die Variable CATALINA_OPTS im Tomcat Startskript).

-


-    -Djavax.net.ssl.trustStore=<PFAD>\truststore.jks
- -Djavax.net.ssl.trustStorePassword=changeit
- -Djavax.net.ssl.trustStoreType=jks
-

- - - - - - -

-
-
© 2004
-
-
- - -
- - 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 45a815379..000000000 --- a/id.server/doc/moa_id/id-anwendung_2.htm +++ /dev/null @@ -1,247 +0,0 @@ - - - MOA ID-Anwendung - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - - -
-
MOA-ID

- - - -
- -

-
-Abfragearten: -
-Web Service
-MOA-ID-PROXY
-
-
-

Abfrage der Anmeldedaten von MOA-ID-AUTH

-
Nach erfolgter Authentisierung stehen in MOA-ID-AUTH Anmeldedaten zum Abholen bereit, -und MOA-ID-AUTH veranlasst einen Redirect zur Online-Applikation (OA). -

-In diesem Redirect werden der Geschäftsbereich und ein SAML-Artifact als Parameter übergeben. -
-
<a href="https://<oa-url>
-?Target=<geschäftsbereich>
-&SAMLArtifact=<saml-artifact>">
- - - - - -
<oa-url>URL, der beim Aufruf von MOA-ID-AUTH als Parameter "OA" übergeben wurde
Target=<geschäftsbereich>Parameter, der beim Aufruf von MOA-ID-AUTH übergeben wurde
SAMLArtifact=<saml-artifact>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.
-

-
Grundsätzlich stehen einer OA mehrere Arten zum Abholen der Anmeldedaten von MOA-ID-AUTH zur Verfügung:
-
    -
  1. Die Applikation ruft selbst das MOA-ID-AUTH Web Service auf. -
    Die Implementierung dieser Variante wird empfohlen, insbesondere für Online-Applikationen, die neu erstellt werden. -
  2. -
  3. Es wird die MOA-ID-PROXY Webapplikation eingesetzt, um die Anmeldedaten abzuholen und an die OA zu übergeben. -
    Aus Sicht von MOA-ID-PROXY ist bedeutsam, ob die OA die Anmeldedaten nach Abarbeitung des HTTP-Requests behält. -
      -
    • Stateful OA: MOA-ID-PROXY übergibt einmalig die Anmeldedaten an die OA, und die OA speichert die Anmeldedaten, typischerweise unter Einsatz von Cookies.
    • -
    • Stateless OA: MOA-ID-PROXY übergibt die Anmeldedaten bei jedem HTTP-Request vom Browser des Bürgers an die OA.
    • -
    -Diese Variante ist vorzuziehen, wenn -
      -
    • für die Plattform, auf der die OA aufbaut, Web Service-Schnittstellen nicht verfügbar sind
    • -
    • das nötige Web Service-Know How nicht zur Verfügung steht
    • -
    • die Implementierung von Variante 1 zu aufwändig wäre
    • -
    • eine Anpassung der OA aus bestimmten Gründen nicht möglich ist
    • -
    -
  4. -
-
- - - -
- - - -
-

 

-
-

-
-
-

Aufruf des MOA-ID-AUTH Web Service

-
Das MOA-ID-AUTH Web Service wird über einen <samlp:Request> aufgerufen. -Der <samlp:Request> enthält in einem <samlp:AssertionArtifact> das von MOA-ID-AUTH übergebene SAML-Artifact. -

-MOA-ID-AUTH liefert als Antwort einen <samlp:Response>. Die Anmeldedaten sind im <samlp:Response> in Form einer <saml:Assertion> enthalten. -

-SAML 1.0 Protocol Schema -
-SAML 1.0 Assertion Schema -
-Der detaillierte Aufbau der <saml:Assertion> zu den Anmeldedaten ist in der Spezifikation MOA-ID 1.4 beschrieben. -

-

Beispiel LoginServletExample

-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 über Redirect aufgerufen. -

-Das Beispiel demonstriert insgesamt die Integration von MOA-ID-AUTH in die OA: -
-
    -
  • Parameterübergabe von MOA-ID-AUTH an die OA
  • -
  • Aufruf des MOA-ID-AUTH Web Service mittels des SOAP Frameworks "Apache AXIS"
  • -
  • Parsen der Anmeldedaten mittels der XPath Engine "Jaxen"
  • -
  • Speichern der Anmeldedaten in der HTTPSession
  • -
  • Redirect auf die eigentliche Startseite der OA
  • -
- - -Voraussetzungen
-
Die folgende Liste enthält die für das Beispiel erforderlichen Java-Bibliotheken. Die angeführten Versionsnummern bezeichnen jene Versionen dieser Java-Bibliotheken, mit denen das Beispiel getestet wurde.
-
- - - - - - - - - - - - - - - - - - - - - -
Java-BibliothekVersionBemerkung
JDK1.4.0+, 1.5.0Java Development Kit
Xerces
XML Parser
2.0.2+Download: xml.apache.org/xerces2-j
AXIS
SOAP Framework
1.0+Download: xml.apache.org/axis
Jaxen XPath Engine1.0+Download: http://jaxen.sourceforge.net
Servlet API2.3+Download: java.sun.com/products/servlet
-
-Code
-LoginServletExample - -
- -
- - - -
- - -
-

 

-
-

-
-
-

Einsatz von MOA-ID-PROXY zum Abfragen der Anmeldedaten von MOA-ID-AUTH

-
-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ür die OA zu erledigen. MOA-ID-PROXY muss für die OA konfiguriert werden, so wie in MOA-ID-Administration beschrieben. -

-Bei der Konfiguration ist speziell zu beachten: -

-Konfigurationsdatei zur OA
-Der LoginType (stateful oder stateless) ist gemäß dem Applikationstyp zu setzen. -

-Die Übergabe der Anmeldedaten ist in Form und Inhalt zu konfigurieren. -
-
    -
  • BasicAuth: HTTP Basic Authentication (Beispiel)
  • -
  • ParamAuth: Übergabe über Requestparameter (Beispiel)
  • -
  • HeaderAuth: Übergabe über Requestheader (Beispiel)
  • -
- -
-LoginParameterResolver
-Das Übergabe der Anmeldedaten an die OA über Request Parameter oder Header geschieht in einer Standardimplementierung des Interface -
at.gv.egovernment.moa.proxy.LoginParameterResolver
-Falls die Erfordernisse der OA mittels Konfiguration nicht abgedeckt werden können, -so kann eine maßgeschneiderte Implementierung von LoginParameterResolver erstellt und zusammen mit MOA-ID-PROXY zum Einsatz gebracht werden -(siehe API). -

-ConnectionBuilder -Das Herstellen einer URL-Verbindung von MOA-ID-PROXY zur OA geschieht einer Standardimplementierung des Interface -
at.gv.egovernment.moa.proxy.ConnectionBuilder 
-Falls nötig, kann eine maßgeschneiderte Implementierung von ConnectionBuilder erstellt und zusammen mit MOA-ID-PROXY zum Einsatz gebracht werden -(siehe API). -
-
- - - - - -

-
-
© 2003
-
-
- - -
- - diff --git a/id.server/doc/moa_id/links.htm b/id.server/doc/moa_id/links.htm deleted file mode 100644 index c5a9b7113..000000000 --- a/id.server/doc/moa_id/links.htm +++ /dev/null @@ -1,141 +0,0 @@ - - - MOA Grundlagen - - - - - - - - - -
- - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - -
-
MOA Links

- - - - -
- -
- -
-
MOA Links
- -
- - - - - - - -

-
-
© 2003
-
-
- - -
- - \ No newline at end of file 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 Binary files a/id.server/doc/moa_id/moa-id-ablauf.jpg and /dev/null differ diff --git a/id.server/doc/moa_id/moa.htm b/id.server/doc/moa_id/moa.htm deleted file mode 100644 index 05a2d3007..000000000 --- a/id.server/doc/moa_id/moa.htm +++ /dev/null @@ -1,248 +0,0 @@ - - - MOA Module fuer Online Applikationen - - - - - - - - - -
- - - - -
- Module für Online-Applikationen -
-
-  -
-
-Projekt moa  -
-
- - - - - - - - -
-
MOA-ID

-
- Allgemein
- - - - - -
- -
-
-
-
- -
Allgemein v.1.4
-

-Dieses Dokument enthält die Dokumentation für das Modul
-

    -
  • MOA-ID (Identifikation)
  • -

-
- -
- - - -
-

 

-
-
-
-
-Das Modul Identifikation stellt Online-Applikationen Funktionalität zur Verfügung zu stellen, damit diese -eine Benutzer-Identifikation und -Authentisierung mit Hilfe der Bürgerkarte und deren Signaturfunktion -realisieren können. -

-Das Modul besteht aus zwei Komponenten: -
    -
  • Die Authentisierungskomponente (MOA-ID-AUTH) führt die eigentliche Authentisierung des Benutzers durch und übergibt der -Proxykomponente die Anmeldedaten.
  • -
  • Die Proxykomponente (MOA-ID-PROXY) übernimmt die Anmeldedaten von der Authentisierungskomponente, -führt die Anmeldung an der Online Applikation durch und schleust in der Folge Daten an die Online-Applikation -und Daten an den Benutzer durch.
  • -
-Diese beiden Komponenten können auf unterschiedlichen Rechnern -oder auf dem gleichen Rechner eingesetzt werden. -

-Die Funktionalität und der Aufbau der Schnittstelle zu MOA-ID ist in der -Spezifikation detailliert beschrieben. -
-
-Für den Betrieb von MOA-ID ist der Einsatz von MOA-Signaturprüfung (MOA-SP) erforderlich. -
- -

-
Ablauf einer Anmeldung
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1Der Benutzer verbindet sich zu einem Web-Portal, über das die verfügbaren Online-Applikationen (OA) erreichbar -sind. Jeder Link zu einer OA verweist auf die Authentisierungs-komponente. -
2Der Benutzer verbindet sich mit MOA-ID-AUTH, die die Authentisierung des -Benutzers durchführt:
2.1MOA-ID-AUTH bietet dem Benutzer optional eine Auswahl von verfügbaren Bürgerkartenumgebungen (engl. Bezeichnung: Security-Layer) an.
2.2MOA-ID-AUTH erzeugt eine HTML-Seite mit einem <InfoboxReadRequest> - zum Auslesen der Personenbindung. Diese HTML-Seite wird an den Browser geschickt.
2.3Der Browser schickt den <InfoboxReadRequest> an den ausgewählten Security-Layer. Der Security-Layer liest die -Personenbindung von der Bürgerkarte und sendet diese an MOA-ID-AUTH, die die Signatur der Personenbindung durch -einen Aufruf von MOA-SP überprüft. -
2.4MOA-ID-AUTH erstellt den AUTH-Block. Der AUTH-Block enthält -
    -
  • Vor- und Nachname aus der Personenbindung,
  • -
  • URL von MOA-ID-AUTH,
  • -
  • URL und Geschäftsbereich der Online-Applikation,
  • -
  • die aktuelle Zeit.
  • -
-Anschließend wird -eine XML Antwortseite, die das Kommando zum Signieren (<CreateXMLSignatureRequest>) des generierten -AUTH-Blocks enthält, an den ausgewählten Security-Layer gesendet.
2.5Der Request wird vom Security-Layer verarbeitet. Die signierten Daten werden an -MOA-ID-AUTH zurückgesendet.
2.6MOA-ID-AUTH überprüft den signierten AUTH-Block und legt für den Benutzer die Anmeldedaten -an. Die Anmeldedaten enthalten -
    -
  • die bereichsspezifische Personenkennzeichen (bPK),
  • -
  • den signierten AUTH-Block (optional),
  • -
  • die Personenbindung (optional),
  • -
  • die PersonData-Struktur aus der Personenbindung (optional),
  • -
  • die Information, ob die Signatur des AUTH-Blocks mit einem qualifiziertem Zertifikat erfolgte,
  • -
  • Informationen zur Behörde, falls die Signatur mit einem Behördenzertifikat erzeugt wurde.
  • -
-
2.7Ist der obige Authentisierungsvorgang erfolgreich, dann wird eine Redirect-Seite -zum Browser gesendet.
3Der Browser führt das Redirect zur Proxykomponente durch. Als Parameter wird das von MOA-ID-AUTH -erzeugte SAML-Artifact übergeben.
4Die 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öscht.
5MOA-ID-PROXY liest die Konfigurationsdatei der zugehörigen Online-Applikation, die beschreibt, wie die Anmeldedaten -an die nachfolgende Applikation übergeben werden müssen, und meldet den Benutzer bei der Applikation an.
6Ist 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.
- - -
-

- - - - - -

-
-
© 2004
-
-
- - -
- - 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 Binary files a/id.server/doc/moa_images/east.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/idle.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/moa_diagramm1.jpg and /dev/null 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 Binary files a/id.server/doc/moa_images/moa_thema.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/north.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/pfeil.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/print.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/select.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/south.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/transdot.gif and /dev/null 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 Binary files a/id.server/doc/moa_images/west.gif and /dev/null differ diff --git a/id.server/html/auth/WEB-INF/server-config.wsdd b/id.server/html/auth/WEB-INF/server-config.wsdd deleted file mode 100644 index 0f0eb49d1..000000000 --- a/id.server/html/auth/WEB-INF/server-config.wsdd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - urn:oasis:names:tc:SAML:1.0:protocol - - - /resources/wsdl/MOA-ID-1.x.wsdl - - - - - - - - - - - - - - diff --git a/id.server/html/auth/WEB-INF/web.xml b/id.server/html/auth/WEB-INF/web.xml deleted file mode 100644 index 603758fb8..000000000 --- a/id.server/html/auth/WEB-INF/web.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - MOA ID Auth - MOA ID Authentication Service - - SelectBKU - SelectBKU - Select Bürgerkartenartenumgebung - at.gv.egovernment.moa.id.auth.servlet.SelectBKUServlet - - - StartAuthentication - StartAuthentication - Start authentication process - at.gv.egovernment.moa.id.auth.servlet.StartAuthenticationServlet - 0 - - - VerifyIdentityLink - VerifyIdentityLink - Verify identity link coming from security layer - at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet - - - VerifyAuthBlock - VerifyAuthBlock - Verify AUTH block coming from security layer - at.gv.egovernment.moa.id.auth.servlet.VerifyAuthenticationBlockServlet - - - ConfigurationUpdate - ConfigurationUpdate - Update MOA-ID Auth configuration from the configuration file - at.gv.egovernment.moa.id.auth.servlet.ConfigurationServlet - - - AxisServlet - Apache-Axis Servlet - - org.apache.axis.transport.http.AxisServlet - - - - - - jspservlet - org.apache.jasper.servlet.JspServlet - - - - - - jspservlet - /errorpage-auth.jsp - - - - jspservlet - /message-auth.jsp - - - - SelectBKU - /SelectBKU - - - StartAuthentication - /StartAuthentication - - - VerifyIdentityLink - /VerifyIdentityLink - - - VerifyAuthBlock - /VerifyAuthBlock - - - ConfigurationUpdate - /ConfigurationUpdate - - - AxisServlet - /services/* - - - 30 - - - 500 - /errorpage.jsp - - - - ConfigurationUpdate - /ConfigurationUpdate - - - moa-admin - - - - BASIC - UserDatabase - - - - The role that is required to log in to the moa Application - - moa-admin - - diff --git a/id.server/html/auth/errorpage-auth.jsp b/id.server/html/auth/errorpage-auth.jsp deleted file mode 100644 index 07f3e7f69..000000000 --- a/id.server/html/auth/errorpage-auth.jsp +++ /dev/null @@ -1,50 +0,0 @@ - -<%@ page contentType="text/html; charset=UTF-8" %> - - -Ein Fehler ist aufgetreten - -<% Throwable exceptionThrown = (Throwable)request.getAttribute("ExceptionThrown"); - String errorMessage = (String)request.getAttribute("ErrorMessage"); - String wrongParameters = (String)request.getAttribute("WrongParameters"); -%> - - -

Fehler bei der Anmeldung

-

Bei der Anmeldung ist ein Fehler aufgetreten.

- -<% if (errorMessage != null) { %> -

-<%= errorMessage%>
-

-<% } %> -<% if (exceptionThrown != null) { %> -

-<%= exceptionThrown.getMessage()%> -

-<% } %> -<% if (wrongParameters != null) { %> -

Die Angabe der Parameter ist unvollständig.

- <%= wrongParameters %>
-

- Beispiele für korrekte Links zur MOA-ID Authentisierung sind: -

-

-<a href="https://<MOA-URL>/StartAuthentication?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>"> -

-

-<a href="https://<MOA-URL>/SelectBKU?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> -

-

-Im Falle einer Applikation aus dem privatwirtschaftlichen Bereich (type="businessService") entfällt die Angabe des Target Parameters: -

-

-<a href="https://<MOA-URL>/StartAuthentication?OA=<OA-URL>&Template=<Template-URL>"> -

-

-<a href="https://<MOA-URL>/SelectBKU?OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> -

-

Die Angabe der Parameter "Template" und "BKUSelectionTemplate" ist optional.

-<% } %> - - \ No newline at end of file diff --git a/id.server/html/auth/index.jsp b/id.server/html/auth/index.jsp deleted file mode 100644 index 733ba317f..000000000 --- a/id.server/html/auth/index.jsp +++ /dev/null @@ -1,40 +0,0 @@ - - -MOA ID Auth Sample Login - - -<% - String urlPath = - request.getScheme() + "://" - + request.getServerName() + ":" + request.getServerPort() - + request.getContextPath() + "/"; - String params = - "Target=gb&" + - "OA=https://localhost:8443/moa-id-proxy/index.jsp"; - String urlStartAuth = - urlPath + - "StartAuthentication?" + - params; - String templateParam = - "&Template=http://localhost:18080/oa/AuthTemplate.jsp"; - String urlStartAuthCustom = - urlStartAuth + - templateParam; - String urlSelectBKU = - urlPath + - "SelectBKU?" + - params; - String urlSelectBKUCustom = - urlSelectBKU + - templateParam + - "&BKUSelectionTemplate=http://localhost:18080/oa/BKUSelectionTemplate.jsp"; -%> -Log in to sample application -
-Log in to sample application using custom form -
-Choose BKU (HTMLComplete or HTMLSelect) and log in -
-Choose BKU (HTMLSelect) using custom form and log in - - \ No newline at end of file diff --git a/id.server/html/auth/message-auth.jsp b/id.server/html/auth/message-auth.jsp deleted file mode 100644 index 0c28c1ba7..000000000 --- a/id.server/html/auth/message-auth.jsp +++ /dev/null @@ -1,20 +0,0 @@ - -<%@ page contentType="text/html; charset=UTF-8" %> - - -MOA-ID AUTH - -<% String message = (String)request.getAttribute("Message"); -%> - - -

MOA-ID AUTH

- -<% if (message != null) { %> -

-<%= message%>
-

-<% } %> - - - \ No newline at end of file diff --git a/id.server/html/proxy/WEB-INF/web.xml b/id.server/html/proxy/WEB-INF/web.xml deleted file mode 100644 index b11606fe0..000000000 --- a/id.server/html/proxy/WEB-INF/web.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - MOA ID Proxy - MOA ID Proxy Service - - - ParameterInOrder Filter - at.gv.egovernment.moa.id.util.ParameterInOrderFilter - - - ParameterInOrder Filter - /* - - - - Proxy - Proxy - Forwards requests to the online application - at.gv.egovernment.moa.id.proxy.servlet.ProxyServlet - 0 - - - ConfigurationUpdate - ConfigurationUpdate - Update MOA-ID Proxy configuration from the configuration file - at.gv.egovernment.moa.id.proxy.servlet.ConfigurationServlet - - - - - jspservlet - org.apache.jasper.servlet.JspServlet - - - - - - jspservlet - /errorpage-proxy.jsp - - - - jspservlet - /message-proxy.jsp - - - - ConfigurationUpdate - /ConfigurationUpdate - - - Proxy - /* - - - 30 - - - 500 - /errorpage.jsp - - - - ConfigurationUpdate - /ConfigurationUpdate - - - moa-admin - - - - BASIC - UserDatabase - - - - The role that is required to log in to the moa Application - - moa-admin - - diff --git a/id.server/html/proxy/errorpage-proxy.jsp b/id.server/html/proxy/errorpage-proxy.jsp deleted file mode 100644 index 07f3e7f69..000000000 --- a/id.server/html/proxy/errorpage-proxy.jsp +++ /dev/null @@ -1,50 +0,0 @@ - -<%@ page contentType="text/html; charset=UTF-8" %> - - -Ein Fehler ist aufgetreten - -<% Throwable exceptionThrown = (Throwable)request.getAttribute("ExceptionThrown"); - String errorMessage = (String)request.getAttribute("ErrorMessage"); - String wrongParameters = (String)request.getAttribute("WrongParameters"); -%> - - -

Fehler bei der Anmeldung

-

Bei der Anmeldung ist ein Fehler aufgetreten.

- -<% if (errorMessage != null) { %> -

-<%= errorMessage%>
-

-<% } %> -<% if (exceptionThrown != null) { %> -

-<%= exceptionThrown.getMessage()%> -

-<% } %> -<% if (wrongParameters != null) { %> -

Die Angabe der Parameter ist unvollständig.

- <%= wrongParameters %>
-

- Beispiele für korrekte Links zur MOA-ID Authentisierung sind: -

-

-<a href="https://<MOA-URL>/StartAuthentication?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>"> -

-

-<a href="https://<MOA-URL>/SelectBKU?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> -

-

-Im Falle einer Applikation aus dem privatwirtschaftlichen Bereich (type="businessService") entfällt die Angabe des Target Parameters: -

-

-<a href="https://<MOA-URL>/StartAuthentication?OA=<OA-URL>&Template=<Template-URL>"> -

-

-<a href="https://<MOA-URL>/SelectBKU?OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> -

-

Die Angabe der Parameter "Template" und "BKUSelectionTemplate" ist optional.

-<% } %> - - \ No newline at end of file diff --git a/id.server/html/proxy/message-proxy.jsp b/id.server/html/proxy/message-proxy.jsp deleted file mode 100644 index 0d970898a..000000000 --- a/id.server/html/proxy/message-proxy.jsp +++ /dev/null @@ -1,20 +0,0 @@ - -<%@ page contentType="text/html; charset=UTF-8" %> - - -MOA-ID Proxy - -<% String message = (String)request.getAttribute("Message"); -%> - - -

MOA-ID Proxy

- -<% if (message != null) { %> -

-<%= message%>
-

-<% } %> - - - \ No newline at end of file diff --git a/id.server/res/META-INF/services/org.apache.axis.components.net.SecureSocketFactory b/id.server/res/META-INF/services/org.apache.axis.components.net.SecureSocketFactory deleted file mode 100644 index c4547e804..000000000 --- a/id.server/res/META-INF/services/org.apache.axis.components.net.SecureSocketFactory +++ /dev/null @@ -1 +0,0 @@ -at.gv.egovernment.moa.id.util.AxisSecureSocketFactory diff --git a/id.server/res/resources/properties/id_messages_de.properties b/id.server/res/resources/properties/id_messages_de.properties deleted file mode 100644 index 4dc2ac3ae..000000000 --- a/id.server/res/resources/properties/id_messages_de.properties +++ /dev/null @@ -1,158 +0,0 @@ -# This file contains exception messages in the standard Java properties -# format. The messages may contain formatting patterns as definied in the -# java.text.MessageFormat class. - -# -# Error messages: the key corresponds to the error code -# - -# status messages included in of GetAuthenticationDataService -1200=Anfrage erfolgreich beantwortet -1201=Fehlerhaftes Requestformat: mehr als 1 Request übergeben -1202=Fehlerhaftes Requestformat: kein SAML-Artifakt übergeben -1203=Fehlerhaftes Requestformat: mehr als 1 SAML-Artifakt übergeben -1204=Fehlerhaftes Requestformat -1205=Fehler beim Abholen der Anmeldedaten, fehlerhaftes SAML-Artifakt Format (SAML-Artifakt={0}): {1} -1206=Fehler beim Abholen der Anmeldedaten, unbekanntes SAML-Artifakt (SAML-Artifakt={0}) -1207=Zeitüberschreitung beim Abholen der Anmeldedaten (SAML-Artifakt={0}) -1299=Interner Server-Fehler - -auth.00=Anmeldung an dieser Applikation wird nicht unterstützt (URL={0}) -auth.01=Die Anmeldung ist bereits im Gange (MOASessionID={0}) -auth.02=MOASessionID ist unbekannt (MOASessionID={0}) -auth.03=Fehler beim Abholen einer Datei von der URL "{0}": Interne Fehlermeldung: {1} -auth.04=Fehler beim Auslesen der Resource "{0}": {1} -auth.05=Fehlender Parameter "{1}" beim Aufruf von "{0}" -auth.06=Fehler beim Speichern der Anmeldedaten, fehlerhaftes SAML-Artifact Format (SAML-Artifact={0}) -auth.07=Aufruf von {0} muss mit Schema "https:" erfolgen.
Hinweis: Bitte Dokumentation zu GenericConfiguration: "FrontendServlets.EnableHTTPConnection" beachten. -auth.08=In der Bürgerkartenumgebung ist ein Fehler aufgetreten:
Fehlercode {0}: {1} -auth.09=Zur Auswahlseite der Bürgertenumgebung (URL={0}) konnte keine Verbindung hergestellt werden. :
HTTP-Statuscode {1} -auth.10=Fehler beim Aufruf von "{0}": Parameter "{1}" fehlt -auth.11=Die zentral gespeicherte Auswahlseite für Bürgerkartenumgebungen konnte nicht geladen werden. Bitte informieren Sie den Adminstrator des Servers und versuchen Sie die Anmeldung in einiger Zeit abermals.
URL "{0}" Interne Fehlermeldung: {1} - -init.00=MOA ID Authentisierung wurde erfolgreich gestartet -init.01=Fehler beim Aktivieren des IAIK-JCE/JSSE/JDK1.3 Workaround: SSL ist möglicherweise nicht verfügbar -init.02=Fehler beim Starten des Service MOA ID Authentisierung - -config.00=MOA ID Konfiguration erfolgreich geladen: {0} -config.01=Umgebungsvariable "moa.id.configuration" nicht gesetzt -config.02=Nicht klassifizierter Fehler in der Konfiguration (siehe Log-Datei für Details) -config.03=Fehler beim Einlesen der Konfiguration (siehe Log-Datei für Details) -config.04=Fehler beim Lesen der MOA ID Konfiguration; es wird weiterhin die ursprüngliche Konfiguration verwendet -config.05=Fehlerhafter Wert für "{0}" in der MOA ID Konfiguration -config.06=Doppelter Eintrag in der Konfiguration für die Online-Applikation gefunden: {0} -config.07=Klasse {0} kann nicht instanziert werden -config.08=Fehlender Wert für "{0}" in der MOA ID Konfiguration -config.09=Fehler beim Erstellen von X509IssuerSerial (IssuerName={0}, SerialNumber={1}) -config.10=Fehler in der MOA SPSS Konfiguration: {0} -config.11=LoginParameterResolver konnte nicht konfiguriert werden {0} -config.12=Standard DATA URL Prefix "{0}" wird anstatt des konfigurierten DATA URL Prefix verwendet -config.13=Konfiguriertes DATA URL Prefix "{0}" muss mit http:// bzw. https:// beginnen -config.14=LoginParameterResolver-Fehler: {0} -config.15=Das Personenbindungs-Trust-Profil (TrustProfileID = {0}) darf nicht für die Verifikation anderer Infoboxen verwendet werden. -config.16=MOA ID Proxy konnte nicht gestartet werden. Das Element ConnnectionParameter im allgemeinen Konfigurationsteil der MOA-ID-PROXY Konfigurationsdatei fehlt. - - -parser.00=Leichter Fehler beim Parsen: {0} -parser.01=Fehler beim Parsen: {0} -parser.02=Schwerer Fehler beim Parsen: {0} -parser.03=Fehler beim Parsen oder Konvertieren eines ECDSA-Schlüssels: {0} -parser.04=Fehler beim Serialisieren: {0} -parser.05=Fehler beim Serialisieren: SAML-Attribute {0} (Namespace: {1}) konnte nicht serialsiert werden. -parser.06=Fehler beim Parsen: {0}-InfoboxResponse nicht vollständig ({1} im {2} fehlt) -parser.07=Fehler beim Parsen: Assoziatives Array im {0}-InfoboxResponse enthält einen Schlüssel ohne zugehörigen Wert ("Key"-Element statt "Pair"-Element). - -builder.00=Fehler beim Aufbau der Struktur "{0}": {1} -builder.01=Fehlerhaftes Template: Kennung "{0}" fehlt - -service.00=Fehler beim Aufruf des Web Service: {0} -service.01=Fehler beim Aufruf des Web Service: kein Endpoint -service.02=Fehler beim Aufruf des Web Service, Status {0}: {1} -service.03=Fehler beim Aufruf des SPSS-API: {0} - -cleaner.00=AuthenticationSessionCleaner wurde gestartet -cleaner.01=Fehler im AuthenticationSessionCleaner -cleaner.02=MOASession {0} ist abgelaufen -cleaner.03=Anmeldedaten zu SAML-Artifakt {0} sind abgelaufen - -proxy.00=MOA ID Proxy wurde erfolgreich gestartet -proxy.01=Unbekannter URL {0}, erwarteter URL auf {1} -proxy.02=Unbekannter URL {0}.
Es wurde keine Übereinstimmung zum Attribut publicURLPrefix im Element 'OnlineApplication' der verwendeten MOA-ID Konfigurationsdatei gefunden. -proxy.04=URL {0} : {1} -proxy.05=Fehler beim Aufbauen der SSLSocketFactory für {0} : {1} -proxy.06=Fehler beim Starten des Service MOA ID Proxy -proxy.07=Sie sind nicht bzw. nicht mehr angemeldet. Melden Sie sich bitte erneut an. -proxy.08=Kein URL-Mapping in der HttpSession verfügbar (URL {0}) -proxy.09=Fehler beim Aufruf des MOA-ID Auth API: {0} -proxy.10=Fehler beim Weiterleiten (MOA-ID Proxy) -proxy.11=Beim Weiterleiten der Verbindung zur Anwendung ist ein Fehler aufgetreten. -proxy.12=Fehler bei der Anmeldung.
Eine Anmeldung an der Anwendung {0} war nicht möglich.
Prüfen Sie bitte ihre Berechtigung. -proxy.13=Fehler beim Aufruf des LoginParameterResolvers zu URL-Präfix: {0} -proxy.14=

Folgende Ursachen können zu dem Fehler geführt haben:

  1. Sie sind nicht mehr angemeldet (Verbindungen werden aus Sicherheitsgründen bei längerer Inaktivität beendet.)
    Melden Sie sich bitte erneut an.
  2. Die Kommunikation mit dem Server schlug fehl.
-proxy.15=Auf die gewünschte Seite kann nicht zugegriffen werden, Sie besitzen nicht die benötigte Berechtigung. -proxy.16=Fehler bei der Anmeldung.
Eine Anmeldung an der Anwendung {0} war nicht möglich. Die maximale Anzahl von {1} ungültigen Loginversuchen wurde überschritten.
Prüfen Sie bitte ihre Berechtigung. - -validator.00=Kein SAML:Assertion Objekt gefunden {0} -validator.01=Im Subject kommt mehr als ein Element des Typs PhysicalPersonType vor {0} -validator.02=Das verwendete Schlüsselformat eines öffentlichen Schlüssels ist unbekannt {0} -validator.03=Der Namespace eines öffentlichen Schlüssels ist ungültig {0} -validator.04=Es wurde ein SAML:Attribut ohne öffentlichen Schlüssel gefunden {0} -validator.05=Es wurde {0} keine DSIG:Signature gefunden - -validator.06=Die Signatur ist ungültig -validator.07=Das Zertifikat der Personenbindung ist ungültig.
{0} -validator.08=Das Manifest ist ungültig -validator.09=Die öffentlichen Schlüssel des Identitiy Link stimmen nicht mit dem retournierten Zertifikat überein - -validator.10=Anzahl der URLs zur Authentisierungskomponente ungültig {0} -validator.11="Geschäftsbereich" wurde nicht in den SAML-Attributen gefunden {0} -validator.12=Der Namespace des SAML-Attributs "Geschäftsbereich" ist ungültig {0} -validator.13=Das Target des 'Geschäftsbereichs' ist ungültig {0} -validator.14="OA" wurde nicht in den SAML-Attributen gefunden {0} -validator.15=Der Namespace des SAML-Attributs "OA" ist ungültig {0} -validator.16=Die vorkonfigurierte URL der OnlineApplikation ist fehlerhaft {0} - -validator.17= Der SubjectDN-Name des von MOA-SP retournierten Zertifikats ist ungültig {0} -#validator.18= Der SubjectDN-Name des von MOA-SP retournierten Zertifikats ist nicht als gültiger SubjectDN-Name für eine Personenbindung konfiguriert. {0} wurde NICHT in der Konfiguration gefunden -validator.18= Das Zertifikat mit dem die Personenbindung signiert wurde, ist nicht zum Signieren der Personenbindung zulässig. Es konnte weder der SubjectDN ({0}) einem berechtigten Namen zugeordnet werden, noch enthält das Zertifikat die Erweiterung "Eigenschaft zur Ausstellung von Personenbindungen". - -validator.19=Das verwendete Zertifikat zum Signieren ist ungültig.
{0} - -validator.21=Es konnte keine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konstruiert werden. -validator.22=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für zumindest ein Zertifikat dieser Kette fällt der Prüfzeitpunkt nicht in das Gültigkeitsintervall. -validator.23=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für alle Zertifikate dieser Kette fällt der Prüfzeitpunkt in das jeweilige Gültigkeitsintervall. Für zumindest ein Zertifikat konnte der Zertifikatstatus nicht festgestellt werden. -validator.24=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für alle Zertifikate dieser Kette fällt der Prüfzeitpunkt in das jeweilige Gültigkeitsintervall. Zumindest ein Zertifikat ist zum Prüfzeitpunkt widerrufen. -validator.25=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für alle Zertifikate dieser Kette fällt der Prüfzeitpunkt in das jeweilige Gültigkeitsintervall. Kein Zertifikat dieser Kette ist zum Prüfzeitpunkt widerrufen. Zumindest ein Zertifikat ist zum Prüfzeitpunkt gesperrt. - -validator.26=OA Applikation ist eine Wirtschaftsapplikation, trotzdem ist ein SAML-Attribut "Geschäftsbereich" enthalten -validator.27=OA Applikation ist keine Wirtschaftsapplikation, trotzdem ist ein SAML-Attribut "wbPK" enthalten -validator.28=Fehlerhafter Wert im "wbPK" SAML-Attribut {0} -validator.29=Fehler beim Auslesen des "wbPK" SAML-Attributs {0} -validator.30=Der Namespace des SAML-Attributs "wbPK" ist ungültig {0} -validator.31="wbPK" wurde nicht in den SAML-Attributen gefunden {0} - - -validator.32="Issuer" im AUTH-Block nicht vorhanden. -validator.33="Issuer"-Attribut im AUTH-Block ("{0}") stimmt nicht mit dem Namen in der Personenbindung ("{1}") überein. -validator.34=Das Geburtsdatum ({0}) stimmt nicht mit dem in der Personenbindung ({1}) überein. -validator.35=Der Namespace des SAML-Attributs "Geburtsdatum" ist ungültig. -validator.36=Die Anzahl der SAML-Attribute im AUTH-Block wurde verändert: {0} statt der erwarteten {1} -validator.37=Die Reihenfolge der SAML-Attribute im AUTH-Block wurde verändert: Attribut "{0}" anstelle von Attribut "{1}" an der {2}. Position -validator.38=Der {0} des SAML-Attributs Nummer {1} ({2}) im AUTH-Block ist ungültig: "{3}" anstelle von "{4}" -validator.39=Der Austellungszeitpunkt (IssueInstant) im AUTH-Block wurde verändert: {0} anstelle von {1}. Möglicherweise wurde Ihre Bürgerkartenumgebung kompromittiert. Verwenden Sie Ihre Bürgerkarte bis auf weiteres nicht mehr, und setzen Sie sich umgehend mit dem Betreiber des Online-Dienstes, an dem Sie sich anmelden wollten, in Verbindung. - - -validator.40=Überprüfung der {0}-Infobox fehlgeschlagen: {1} -validator.41=Überprüfung der {0}-Infobox fehlgeschlagen: Keine Konfigurationsparameter zur Überprüfung der {0}-Infobox vorhanden. -validator.42=Überprüfung der {0}-Infobox fehlgeschlagen: Es konnte keine geeignete Applikation zur Verifikation der {0}-Infobox geladen werden. -validator.43=Überprüfung der {0}-Infobox fehlgeschlagen: Der InfoboxReadResponse für die {0}-Infobox konnte nicht erfolgreich geparst werden. -validator.44=Überprüfung der {0}-Infobox fehlgeschlagen: In der {0}-Infobox Prüfapplikation ist ein Fehler aufgetreten. -validator.45=Überprüfung der {0}-Infobox fehlgeschlagen: Der {1} des von der {0}-Infobox Prüfapplikation zurückgegebenen SAML-Attributes Nummer {2} ist {3}. -validator.46=Überprüfung der {0}-Infobox fehlgeschlagen: Der Wert des von der Prüfapplikation zurückgegebenen SAML-Attributes Nummer {1} ist ungültig. -validator.47=Überprüfung der {0}-Infobox fehlgeschlagen: Das von der Prüfapplikation zurückgegebene SAML-Attribut Nummer {1} kann nicht eindeutig zugeordnet werden. -validator.48={0}-Infobox wurde nicht von der BKU übermittelt: Für die Anmeldung an dieser Online-Applikation ist die {0}-Infobox erforderlich. Bitte melden Sie sich erneut an, und selektieren Sie in Ihrer BKU die {0}-Infobox. - -validator.49=Beim Ermitteln der Personenbindungs-OID im Zertifikat, mit dem die Personenbindung signiert wurde, ist ein Fehler aufgetreten. - - -ssl.01=Validierung des SSL-Server-Endzertifikates hat fehlgeschlagen diff --git a/id.server/res/resources/wsdl/MOA-ID-1.0.wsdl b/id.server/res/resources/wsdl/MOA-ID-1.0.wsdl deleted file mode 100644 index 5751b3e58..000000000 --- a/id.server/res/resources/wsdl/MOA-ID-1.0.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/res/resources/wsdl/MOA-ID-1.x.wsdl b/id.server/res/resources/wsdl/MOA-ID-1.x.wsdl deleted file mode 100644 index 45152cb38..000000000 --- a/id.server/res/resources/wsdl/MOA-ID-1.x.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id.server/res/resources/wsdl/MOA-SPSS-1.2.xsd b/id.server/res/resources/wsdl/MOA-SPSS-1.2.xsd deleted file mode 100644 index d7a06d6e7..000000000 --- a/id.server/res/resources/wsdl/MOA-SPSS-1.2.xsd +++ /dev/null @@ -1,454 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage - - - - Resultat, falls die Signaturerstellung erfolgreich war - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resultat, falls die Signaturerstellung gescheitert ist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. - - - - - Profilbezeichner für einen Transformationsweg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. - - - - Der Transformationsparameter explizit angegeben. - - - - - Der Hashwert des Transformationsparameters. - - - - - - - - - - - - - - - - - - - - - - Explizite Angabe des Transformationswegs - - - - - - - Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. - - - - - - - - - - - - - - - - diff --git a/id.server/res/resources/xmldata/CertInfoDsigSignature.xml b/id.server/res/resources/xmldata/CertInfoDsigSignature.xml deleted file mode 100644 index bf35dc73f..000000000 --- a/id.server/res/resources/xmldata/CertInfoDsigSignature.xml +++ /dev/null @@ -1,139 +0,0 @@ -id('signed-data')/node()C0hW5jQojphweuFzPb+CNkHwhe4=id('refetsi')/etsi:QualifyingProperties/etsi:SignedPropertiesBdsc7wAfyMyZ21ChcF+tRh3D7sU=lCz3hDQMbqRMmCieG3fQFax3f8JX86gDi7mf4h03J7vlJjSOJQ4Wh/3Kd81ntKuh -qFphj2cEhQYX08e6SeaU+7H7qdRa+xFRDRGav8L5x5xCUQT2SV+2/hx0C7UuJt+p -tewtbqVAcNxgKPlBuIzyXGOrBdiinp1KftEQoVCpPCI=MIIFJTCCBA2gAwIBAgICGTcwDQYJKoZIhvcNAQEFBQAwgaExCzAJBgNVBAYTAkFU -MUgwRgYDVQQKEz9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGlt -IGVsZWt0ci4gRGF0ZW52ZXJrZWhyIEdtYkgxIzAhBgNVBAsTGmEtc2lnbi1URVNU -LVByZW1pdW0tRW5jLTAxMSMwIQYDVQQDExphLXNpZ24tVEVTVC1QcmVtaXVtLUVu -Yy0wMTAeFw0wMzAyMTAxMzIwNThaFw0wNjAyMTAxMzIwNThaMGoxCzAJBgNVBAYT -AkFUMRwwGgYDVQQDExNUZXN0cGVyc29uIE1PQTQgQlJaMQwwCgYDVQQEEwNCUlox -GDAWBgNVBCoTD1Rlc3RwZXJzb24gTU9BNDEVMBMGA1UEBRMMNzkwMTg3NDYxNjMz -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDS/UW1/tZeCh7HHQmj8auUTEc4 -edAgRDkUVKOm0tF3kE3WZlhGDZL0p84xsdIKyI+bwDCMATATkQwDo/Xxn9jJMi4/ -t80bNyRsHk9giA0wcvz9NgmEcDwKNqawGsR9gNeK8TyIC8AuDkj1EwtkAObMvtp/ -Z1phi47x3JxDDfGDpQIDAQABo4ICHzCCAhswEwYDVR0jBAwwCoAIS7OAw3GTPNgw -JwYIKwYBBQUHAQMBAf8EGDAWMAgGBgQAjkYBATAKBggrBgEFBQcLATCBggYIKwYB -BQUHAQEEdjB0MCkGCCsGAQUFBzABhh1odHRwOi8vd3d3LmEtdHJ1c3QuYXQ6ODIv -b2NzcDBHBggrBgEFBQcwAoY7aHR0cDovL3d3dy5hLXRydXN0LmF0L2NlcnRzL2Et -c2lnbi1URVNULVByZW1pdW0tU2lnLTAxYS5jcnQwgZQGA1UdIASBjDCBiTB9BgYq -KAARAQQwczA1BggrBgEFBQcCARYpaHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3Mv -Y3AvYS1zaWduLVRFU1QwOgYIKwYBBQUHAgIwLhosRGllc2VzIFplcnRpZmlrYXQg -ZGllbnQgbnVyIHp1IFRlc3R6d2Vja2VuICEwCAYGBACLMAEBMG8GA1UdHwRoMGYw -ZKBioGCGXmxkYXA6Ly9sZGFwLmEtdHJ1c3QuYXQvb3U9YS1zaWduLVRFU1QtUHJl -bWl1bS1FbmMtMDEsbz1BLVRydXN0LGM9QVQ/Y2VydGlmaWNhdGVyZXZvY2F0aW9u -bGlzdD8wEQYDVR0OBAoECE4DxL9ky4M+MA4GA1UdDwEB/wQEAwIGwDAgBgNVHREE -GTAXgRV0ZXN0cGVyc29uNEBicnouZ3YuYXQwCQYDVR0TBAIwADANBgkqhkiG9w0B -AQUFAAOCAQEAioVvsZN+NnQxXMTGdjKveTBMRTYzHflkSC8lI9XXltP5+mjIuoB2 -Tn6voovA8dXz9jTsnQt8f8ye0CL2bSS9UVD1jv8So3bavquW+HlkZBAZvL39APNL -PjUUnWn0QOnrQAJ6W47UwGAUgEw3KcBcJaEa4Xb/8kUj618xGzWl6X0mKsVpxkrf -+5Cj+nmwDqChll08/90MmhSY4M5FrvmQ9GjAN5FHVsk0FPp02tKCRzoBJtzpB1DW -KHlgiDHUAXy5eD0XI7PXebPNZ4InvY/jC/IH8PRLdJT249YQmUxZ4neTtFDvb8C1 -Qh6k725fh3hVxqX8ZwwWj9+iGQVk53K3CA== - -Ãœberprüfung des Namen des Anmelde-Servers - - -

Prüfung der Identität des MOA-ID Servers

- -Bevor Sie sich in den folgenden Schritten an eine Online-Applikation anmelden, -wird empfohlen den Namen des Anmelde-Servers zu überprüfen. -Zu diesem Zweck identifiziert Ihr Webbrowser den Anmelde-Server mit Hilfe eines Zertifikates. -Ihre Aufgabe ist es zu überprüfen, ob das Server-Zertifikat von einem Unternehmen ausgestellt -wurde, dem Sie vertrauen. -

-Die folgenden Absätze beschreiben, wie Sie diese Überprüfung durchführen können. -Führen Sie jene Arbeitsschritte durch, die für den von Ihnen verwendeten Webbrowser zutreffend sind. -

-

Microsoft Internet Explorer 6.0

- -
    -
  1. Öffnen Sie (durch Doppel-Klicken) das Symbol mit dem gelben Vorhangschloß am unteren Rand des Browsers.
  2. -
  3. Selektieren Sie im nun geöffnetem Fenster "Zertifikat" den Karteireiter "Zertifizierungspfad".
  4. -
  5. Öffnen Sie (durch Doppel-Klicken) das an oberster Stelle gereihte Zertifikat.
  6. -
  7. Überprüfen Sie ob als Aussteller dieses Zertifikat (Karteireiter "Details", Eintrag "Aussteller") -ein Unternehmen aufscheint, dem Sie vertrauen den Namen des Anmelde-Servers zu überprüfen.
  8. -
  9. Überprüfen Sie, ob dieses Zertifikat authentisch vom angegebene Unternehmen stammt. Dazu können Sie den -Fingerabdruck (Karteireiter "Details", unterster Eintrag) des Zertifikats überprüfen. Am Ende dieses Dokuments ist -eine von der IKT-Stabsstelle überprüfte Liste von Zertifikaten und deren Fingerabdruck aufgelistet. -Überprüfen Sie ob das von Ihnen zu überprüfende Zertifikat -in dieser Liste enthalten ist und der Fingerabruck mit dem Wert in der Liste übereinstimmt. -
      -
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten und stimmt der Wert des Fingerabdrucks mit dem Wert -in der Liste überein, dann ist das Zertifikat authentisch und der Anmeldevorgang kann fortgesetzt werden.
    • -
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten aber stimmt der Wert des Fingerabdrucks nicht mit dem Wert -in der Liste überein, dann ist das Zertifikat nicht authentisch und der Anmeldevorgang muss abgebrochen werden.
    • -
    • Ist Ihr zu prüfendes Zertifikat nicht in der Liste enthalten müssen Sie eine andere verlässliche Quelle für den -Vergleich des Fingerabdrucks finden. Sofern das Zertifikat authentisch ist, kann der Anmeldevorgang fortgesetzt werden.
    • -
  10. -
  11. Ist das in Schritt 3. geöffnete Zertifikat nicht im Internet Explorer installiert erscheint das Zertifikat mit -einem roten Kreuz. Sie können das Zertifikat installieren, indem Sie die Schaltfläche "Zertifikat installieren ..." -(Karteireiter "Allgemein") aktivieren. In der Folge werden alle von dieser Zertifizierungsstelle ausgestellten Zertifikate -vom Internet Explorer als vertrauenswürdig erkannt.
  12. -
-

Netscape Navigator 7.0

-
    -
  1. Öffnen Sie (durch Klicken) das Symbol mit dem Vorhangschloss am rechten, unteren Rand des Browsers
  2. -
  3. Aktivieren Sie die Schaltfläche "Anzeigen"
  4. -
  5. Selektieren Sie im nun geöffnetem Fenster "Zertifikatsanzeige" den Karteireiter "Detail".
  6. -
  7. Aktivieren Sie (durch Klicken) das an oberster Stelle gereihte Zertifikat.
  8. -
  9. Überprüfen Sie ob als Aussteller dieses Zertifikat (Eintrag "Aussteller") -ein Unternehmen aufscheint, dem Sie vertrauen den Namen des Anmelde-Servers zu überprüfen.
  10. -
  11. Überprüfen Sie, ob dieses Zertifikat authentisch vom angegebene Unternehmen stammt. Dazu können Sie den -Fingerabdruck des Zertifikats überprüfen. Am Ende dieses Dokuments ist -eine von der IKT-Stabsstelle überprüfte Liste von Zertifikaten und deren Fingerabdruck aufgelistet. -Überprüfen Sie ob das von Ihnen zu überprüfende Zertifikat -in dieser Liste enthalten ist und der Fingerabruck mit dem Wert in der Liste übereinstimmt. -
      -
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten und stimmt der Wert des Fingerabdrucks mit dem Wert -in der Liste überein, dann ist das Zertifikat authentisch und der Anmeldevorgang kann fortgesetzt werden.
    • -
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten aber stimmt der Wert des Fingerabdrucks nicht mit dem Wert -in der Liste überein, dann ist das Zertifikat nicht authentisch und der Anmeldevorgang muss abgebrochen werden.
    • -
    • Ist Ihr zu prüfendes Zertifikat nicht in der Liste enthalten müssen Sie eine andere verlässliche Quelle für den -Vergleich des Fingerabdrucks finden. Sofern das Zertifikat authentisch ist, kann der Anmeldevorgang fortgesetzt werden.
    • -
  12. -
  13. Ist das Aussteller-Zertifikat nicht im Netscape Navigator installiert können Sie das Zertifikat installieren, -indem Sie die "*.cer" Datei mit Netscape Navigator öffnen. In der Folge werden alle von dieser Zertifizierungsstelle -ausgestellten Zertifikate vom Internet Explorer als vertrauenswürdig erkannt.
  14. -
- -

Zertifikate und ihr Fingerabdruck

- - - - - - - - - - - -
AusstellerCN=A-Trust-nQual-01,OU=A-Trust-nQual-01,O=A-Trust,C=AT
Seriennummer111 (0x6f)
FingerabdruckSHA-1: e6 e6 fc 88 71 91 77 c9 b7 42 18 25 75 7c 5e 47 bc ac 85 f6
- -

- - - - - - - - - - -
AusstellerCN=A-Trust-nQual-01,OU=A-Trust-nQual-01,O=A-Trust,C=AT
Seriennummer531 (0x213)
FingerabdruckSHA-1: 9e 05 12 dd 61 da 59 49 d1 d8 63 1c 3f 19 d7 5f 49 6c 37 33
- -

- - - - - - - - - - -
AusstellerCN=A-Trust-nQual-01,OU=A-Trust-nQual-01,O=A-Trust,C=AT
Seriennummer536 (0x0218)
FingerabdruckSHA-1: 0f 5a 03 42 f5 cd 44 87 99 c3 c6 d1 78 60 7e 3f 2b 5b cb 8f
- - -2003-05-06T07:09:50ZFrhu1o4mL4gQHdJcU0xSA/h4COE=CN=a-sign-TEST-Premium-Enc-01,OU=a-sign-TEST-Premium-Enc-01,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT6455text/html \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/AuthenticationException.java b/id.server/src/at/gv/egovernment/moa/id/AuthenticationException.java deleted file mode 100644 index 96a5e0673..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/AuthenticationException.java +++ /dev/null @@ -1,31 +0,0 @@ -package at.gv.egovernment.moa.id; - - -/** - * Exception thrown during handling of AuthenticationSession - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationException extends MOAIDException { - - /** - * Constructor for AuthenticationException. - * @param messageId - */ - public AuthenticationException(String messageId, Object[] parameters) { - super(messageId, parameters, null); - } - /** - * Constructor for AuthenticationException. - * @param messageId - * @param parameters - * @param wrapped - */ - public AuthenticationException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/BuildException.java b/id.server/src/at/gv/egovernment/moa/id/BuildException.java deleted file mode 100644 index 785dce7a3..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/BuildException.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.id; - - -/** - * Exception thrown while building an XML or HTML structure. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class BuildException extends MOAIDException { - - /** - * Constructor for BuildException. - * @param messageId - * @param parameters - */ - public BuildException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for BuildException. - * @param messageId - * @param parameters - * @param wrapped - */ - public BuildException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/ECDSAConverterException.java b/id.server/src/at/gv/egovernment/moa/id/ECDSAConverterException.java deleted file mode 100644 index 682395a83..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/ECDSAConverterException.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.id; - - -/** - * Exception thrown while converting ECDSAKeys from/to an XML structure. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class ECDSAConverterException extends MOAIDException { - - /** - * Constructor for ECDSAConverterException. - * @param messageId - * @param parameters - */ - public ECDSAConverterException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for ECDSAConverterException. - * @param messageId - * @param parameters - * @param wrapped - */ - public ECDSAConverterException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/MOAIDException.java b/id.server/src/at/gv/egovernment/moa/id/MOAIDException.java deleted file mode 100644 index bce2c4778..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/MOAIDException.java +++ /dev/null @@ -1,159 +0,0 @@ -package at.gv.egovernment.moa.id; - -import java.io.PrintStream; -import java.io.PrintWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.util.Constants; - -/** - * Base class of technical MOA exceptions. - * - * Technical exceptions are exceptions that originate from system failure (e.g., - * a database connection fails, a component is not available, etc.) - * - * @author Patrick Peck, Ivancsics Paul - * @version $Id$ - */ -public class MOAIDException extends Exception { - /** message ID */ - private String messageId; - /** wrapped exception */ - private Throwable wrapped; - - /** - * Create a new MOAIDException. - * - * @param messageId The identifier of the message associated with this - * exception. - * @param parameters Additional message parameters. - */ - public MOAIDException(String messageId, Object[] parameters) { - super(MOAIDMessageProvider.getInstance().getMessage(messageId, parameters)); - this.messageId = messageId; - } - - /** - * Create a new MOAIDException. - * - * @param messageId The identifier of the message associated with this - * MOAIDException. - * @param parameters Additional message parameters. - * @param wrapped The exception wrapped by this - * MOAIDException. - */ - public MOAIDException( - String messageId, - Object[] parameters, - Throwable wrapped) { - - super(MOAIDMessageProvider.getInstance().getMessage(messageId, parameters)); - this.messageId = messageId; - this.wrapped = wrapped; - } - - /** - * Print a stack trace of this exception to System.err. - * - * @see java.lang.Throwable#printStackTrace() - */ - public void printStackTrace() { - printStackTrace(System.err); - } - - /** - * Print a stack trace of this exception, including the wrapped exception. - * - * @param s The stream to write the stack trace to. - * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) - */ - public void printStackTrace(PrintStream s) { - if (getWrapped() == null) - super.printStackTrace(s); - else { - s.print("Root exception: "); - getWrapped().printStackTrace(s); - } - } - - /** - * Print a stack trace of this exception, including the wrapped exception. - * - * @param s The stream to write the stacktrace to. - * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) - */ - public void printStackTrace(PrintWriter s) { - if (getWrapped() == null) - super.printStackTrace(s); - else { - s.print("Root exception: "); - getWrapped().printStackTrace(s); - } - } - - /** - * @return message ID - */ - public String getMessageId() { - return messageId; - } - - /** - * @return wrapped exception - */ - public Throwable getWrapped() { - return wrapped; - } - - /** - * Convert this MOAIDException to an ErrorResponse - * element from the MOA namespace. - * - * @return An ErrorResponse element, containing the subelements - * ErrorCode and Info required by the MOA schema. - */ - public Element toErrorResponse() { - DocumentBuilder builder; - DOMImplementation impl; - Document doc; - Element errorResponse; - Element errorCode; - Element info; - - // create a new document - try { - builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - impl = builder.getDOMImplementation(); - } catch (ParserConfigurationException e) { - return null; - } - - // build the ErrorResponse element - doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null); - errorResponse = doc.getDocumentElement(); - - // add MOA namespace declaration - errorResponse.setAttributeNS( - Constants.XMLNS_NS_URI, - "xmlns", - Constants.MOA_NS_URI); - - // build the child elements - errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode"); - errorCode.appendChild(doc.createTextNode(messageId)); - info = doc.createElementNS(Constants.MOA_NS_URI, "Info"); - info.appendChild(doc.createTextNode(toString())); - errorResponse.appendChild(errorCode); - errorResponse.appendChild(info); - return errorResponse; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/ParseException.java b/id.server/src/at/gv/egovernment/moa/id/ParseException.java deleted file mode 100644 index a5e0088d9..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/ParseException.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.id; - - -/** - * Exception thrown while parsing an XML structure. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ParseException extends MOAIDException { - - /** - * Constructor for ParseException. - * @param messageId - * @param parameters - */ - public ParseException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for ParseException. - * @param messageId - * @param parameters - * @param wrapped - */ - public ParseException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/ServiceException.java b/id.server/src/at/gv/egovernment/moa/id/ServiceException.java deleted file mode 100644 index 9e6ab2361..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/ServiceException.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.id; - - -/** - * Exception thrown while calling the MOA-SPSS web service. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ServiceException extends MOAIDException { - - /** - * Constructor for ServiceException. - * @param messageId - * @param parameters - */ - public ServiceException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for ServiceException. - * @param messageId - * @param parameters - * @param wrapped - */ - public ServiceException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationServer.java deleted file mode 100644 index 5f4ec2d29..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ /dev/null @@ -1,1019 +0,0 @@ -package at.gv.egovernment.moa.id.auth; - -import iaik.pki.PKIException; -import iaik.x509.X509Certificate; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Vector; - -import javax.xml.transform.TransformerException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.ServiceException; -import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; -import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder; -import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; -import at.gv.egovernment.moa.id.auth.builder.CertInfoVerifyXMLSignatureRequestBuilder; -import at.gv.egovernment.moa.id.auth.builder.CreateXMLSignatureRequestBuilder; -import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; -import at.gv.egovernment.moa.id.auth.builder.GetIdentityLinkFormBuilder; -import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilder; -import at.gv.egovernment.moa.id.auth.builder.InfoboxValidatorParamsBuilder; -import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder; -import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder; -import at.gv.egovernment.moa.id.auth.builder.SelectBKUFormBuilder; -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -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.ExtendedSAMLAttribute; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult; -import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams; -import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; -import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; -import at.gv.egovernment.moa.id.auth.parser.ExtendedInfoboxReadResponseParser; -import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; -import at.gv.egovernment.moa.id.auth.parser.SAMLArtifactParser; -import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; -import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; -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; -import at.gv.egovernment.moa.id.auth.validator.ValidateException; -import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; -import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameter; -import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.util.HTTPUtils; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.Random; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * API for MOA ID Authentication Service.
- * {@link AuthenticationSession} is stored in a session store and retrieved - * by giving the session ID. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationServer implements MOAIDAuthConstants { - - /** single instance */ - private static AuthenticationServer instance; - /** session data store (session ID -> AuthenticationSession) */ - private static Map sessionStore = new HashMap(); - /** authentication data store (assertion handle -> AuthenticationData) */ - private static Map authenticationDataStore = new HashMap(); - /** - * time out in milliseconds used by {@link cleanup} for session store - */ - private long sessionTimeOut = 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 AuthenticationServer. - * - * @return the single instance of AuthenticationServer - */ - public static AuthenticationServer getInstance() { - if (instance == null) - instance = new AuthenticationServer(); - return instance; - } - /** - * Constructor for AuthenticationServer. - */ - public AuthenticationServer() { - super(); - } - /** - * Processes request to select a BKU. - *
Processing depends on value of {@link AuthConfigurationProvider#getBKUSelectionType}. - *
For bkuSelectionType==HTMLComplete, a returnURI for the - * "BKU Auswahl" service is returned. - *
For bkuSelectionType==HTMLSelect, an HTML form for BKU selection is returned. - * @param authURL base URL of MOA-ID Auth component - * @param target "Geschäftsbereich" - * @param oaURL online application URL requested - * @param bkuSelectionTemplateURL template for BKU selection form to be used - * in case of HTMLSelect; may be null - * @param templateURL URL providing an HTML template for the HTML form to be used - * for call startAuthentication - * @return for bkuSelectionType==HTMLComplete, the returnURI for the - * "BKU Auswahl" service; - * for bkuSelectionType==HTMLSelect, an HTML form for BKU selection - * @throws WrongParametersException upon missing parameters - * @throws AuthenticationException when the configured BKU selection service cannot be reached, - * and when the given bkuSelectionTemplateURL cannot be reached - * @throws ConfigurationException on missing configuration data - * @throws BuildException while building the HTML form - */ - public String selectBKU( - String authURL, - String target, - String oaURL, - String bkuSelectionTemplateURL, - String templateURL) - throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException { - - //check if HTTP Connection may be allowed (through FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY) - String boolStr = AuthConfigurationProvider.getInstance().getGenericConfigurationParameter( - AuthConfigurationProvider.FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY); - if ((!authURL.startsWith("https:")) && (false == BoolUtils.valueOf(boolStr))) - throw new AuthenticationException("auth.07", new Object[] { authURL + "*" }); - if (isEmpty(authURL)) - throw new WrongParametersException("StartAuthentication", "AuthURL"); - if (isEmpty(oaURL)) - throw new WrongParametersException("StartAuthentication", PARAM_OA); - - ConnectionParameter bkuConnParam = - AuthConfigurationProvider.getInstance().getBKUConnectionParameter(); - if (bkuConnParam == null) - throw new ConfigurationException( - "config.08", - new Object[] { "BKUSelection/ConnectionParameter" }); - OAAuthParameter oaParam = - AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); - if (oaParam == null) - throw new AuthenticationException("auth.00", new Object[] { oaURL }); - - if (!oaParam.getBusinessService()) { - if (isEmpty(target)) - throw new WrongParametersException("StartAuthentication", PARAM_TARGET); - } else { - if (!isEmpty(target)) { - Logger.info("Ignoring target parameter thus application type is \"businessService\""); - } - target = null; - } - - AuthenticationSession session = newSession(); - Logger.info("MOASession " + session.getSessionID() + " angelegt"); - session.setTarget(target); - session.setOAURLRequested(oaURL); - session.setPublicOAURLPrefix(oaParam.getPublicURLPrefix()); - session.setAuthURL(authURL); - session.setTemplateURL(templateURL); - session.setBusinessService(oaParam.getBusinessService()); - String returnURL = - new DataURLBuilder().buildDataURL(authURL, REQ_START_AUTHENTICATION, session.getSessionID()); - String bkuSelectionType = AuthConfigurationProvider.getInstance().getBKUSelectionType(); - if (bkuSelectionType.equals(AuthConfigurationProvider.BKU_SELECTION_TYPE_HTMLCOMPLETE)) { - // bkuSelectionType==HTMLComplete - String redirectURL = bkuConnParam.getUrl() + "?" + AuthServlet.PARAM_RETURN + "=" + returnURL; - return redirectURL; - } else { - // bkuSelectionType==HTMLSelect - String bkuSelectTag; - try { - bkuSelectTag = readBKUSelectTag(AuthConfigurationProvider.getInstance(), bkuConnParam); - } catch (Throwable ex) { - throw new AuthenticationException( - "auth.11", - new Object[] { bkuConnParam.getUrl(), ex.toString()}, - ex); - } - String bkuSelectionTemplate = null; - // override template url by url from configuration file - if (oaParam.getBkuSelectionTemplateURL() != null) { - bkuSelectionTemplateURL = oaParam.getBkuSelectionTemplateURL(); - } - if (bkuSelectionTemplateURL != null) { - try { - bkuSelectionTemplate = new String(FileUtils.readURL(bkuSelectionTemplateURL)); - } catch (IOException ex) { - throw new AuthenticationException( - "auth.03", - new Object[] { bkuSelectionTemplateURL, ex.toString()}, - ex); - } - } - String htmlForm = - new SelectBKUFormBuilder().build(bkuSelectionTemplate, returnURL, bkuSelectTag); - return htmlForm; - } - } - /** - * Method readBKUSelectTag. - * @param conf the ConfigurationProvider - * @param connParam the ConnectionParameter for that connection - * @return String - * @throws ConfigurationException on config-errors - * @throws PKIException on PKI errors - * @throws IOException on any data error - * @throws GeneralSecurityException on security errors - */ - private String readBKUSelectTag(ConfigurationProvider conf, ConnectionParameter connParam) - throws ConfigurationException, PKIException, IOException, GeneralSecurityException { - - if (connParam.isHTTPSURL()) - return SSLUtils.readHttpsURL(conf, connParam); - else - return HTTPUtils.readHttpURL(connParam.getUrl()); - } - /** - * Processes the beginning of an authentication session. - *

    - *
  • Starts an authentication session
  • - *
  • Creates an <InfoboxReadRequest>
  • - *
  • Creates an HTML form for querying the identity link from the - * security layer implementation. - *
    Form parameters include - *
      - *
    • the <InfoboxReadRequest>
    • - *
    • the data URL where the security layer implementation sends it response to
    • - *
    - *
- * @param authURL URL of the servlet to be used as data URL - * @param target "Geschäftsbereich" of the online application requested - * @param oaURL online application URL requested - * @param bkuURL URL of the "Bürgerkartenumgebung" to be used; - * may be null; in this case, the default location will be used - * @param templateURL URL providing an HTML template for the HTML form generated - * @return HTML form - * @throws AuthenticationException - * @see GetIdentityLinkFormBuilder - * @see InfoboxReadRequestBuilder - */ - public String startAuthentication( - String authURL, - String target, - String oaURL, - String templateURL, - String bkuURL, - String sessionID) - throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException { - - if (isEmpty(sessionID)) { - if (isEmpty(authURL)) - throw new WrongParametersException("StartAuthentication", "AuthURL"); - - //check if HTTP Connection may be allowed (through FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY) - String boolStr = - AuthConfigurationProvider.getInstance().getGenericConfigurationParameter( - AuthConfigurationProvider.FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY); - if ((!authURL.startsWith("https:")) && (false == BoolUtils.valueOf(boolStr))) - throw new AuthenticationException("auth.07", new Object[] { authURL + "*" }); - if (isEmpty(oaURL)) - throw new WrongParametersException("StartAuthentication", PARAM_OA); - } - AuthenticationSession session; - OAAuthParameter oaParam; - if (sessionID != null) { - session = getSession(sessionID); - oaParam = - AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( - session.getPublicOAURLPrefix()); - } else { - oaParam = - AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); - if (oaParam == null) - throw new AuthenticationException("auth.00", new Object[] { oaURL }); - if (!oaParam.getBusinessService()) { - if (isEmpty(target)) - throw new WrongParametersException("StartAuthentication", PARAM_TARGET); - } else { - target = null; - } - session = newSession(); - Logger.info("MOASession " + session.getSessionID() + " angelegt"); - session.setTarget(target); - session.setOAURLRequested(oaURL); - session.setPublicOAURLPrefix(oaParam.getPublicURLPrefix()); - session.setAuthURL(authURL); - session.setTemplateURL(templateURL); - session.setBusinessService(oaParam.getBusinessService()); - } - // BKU URL has not been set yet, even if session already exists - if (bkuURL == null) { - bkuURL = DEFAULT_BKU; - } - session.setBkuURL(bkuURL); - String infoboxReadRequest = - new InfoboxReadRequestBuilder().build(oaParam.getSlVersion12(), - oaParam.getBusinessService(), - oaParam.getIdentityLinkDomainIdentifier()); - String dataURL = - new DataURLBuilder().buildDataURL( - session.getAuthURL(), - REQ_VERIFY_IDENTITY_LINK, - session.getSessionID()); - String template = null; - // override template url by url from configuration file - if (oaParam.getTemplateURL() != null) { - templateURL = oaParam.getTemplateURL(); - } else { - templateURL = session.getTemplateURL(); - } - if (templateURL != null) { - try { - template = new String(FileUtils.readURL(templateURL)); - } catch (IOException ex) { - throw new AuthenticationException( - "auth.03", - new Object[] { templateURL, ex.toString()}, - ex); - } - } - String pushInfobox = ""; - VerifyInfoboxParameters verifyInfoboxParameters = oaParam.getVerifyInfoboxParameters(); - if (verifyInfoboxParameters != null) { - pushInfobox = verifyInfoboxParameters.getPushInfobox(); - } - String certInfoRequest = new CertInfoVerifyXMLSignatureRequestBuilder().build(oaParam.getSlVersion12()); - String certInfoDataURL = - new DataURLBuilder().buildDataURL( - session.getAuthURL(), - REQ_START_AUTHENTICATION, - session.getSessionID()); - String htmlForm = - new GetIdentityLinkFormBuilder().build( - template, - bkuURL, - infoboxReadRequest, - dataURL, - certInfoRequest, - certInfoDataURL, - pushInfobox); - return htmlForm; - } - /** - * Processes an <InfoboxReadResponse> sent by the - * security layer implementation.
- *
    - *
  • Validates given <InfoboxReadResponse>
  • - *
  • Parses identity link enclosed in <InfoboxReadResponse>
  • - *
  • Verifies identity link by calling the MOA SP component
  • - *
  • Checks certificate authority of identity link
  • - *
  • Stores identity link in the session
  • - *
  • Verifies all additional infoboxes returned from the BKU
  • - *
  • Creates an authentication block to be signed by the user
  • - *
  • Creates and returns a <CreateXMLSignatureRequest> - * containg the authentication block, meant to be returned to the - * security layer implementation
  • - *
- * - * @param sessionID ID of associated authentication session data - * @param infoboxReadResponseParameters The parameters from the response returned from - * the BKU including the <InfoboxReadResponse> - * @return String representation of the <CreateXMLSignatureRequest> - */ - public String verifyIdentityLink(String sessionID, Map infoboxReadResponseParameters) - throws - AuthenticationException, - BuildException, - ParseException, - ConfigurationException, - ValidateException, - ServiceException { - - if (isEmpty(sessionID)) - 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}); - - AuthenticationSession session = getSession(sessionID); - if (session.getTimestampIdentityLink() != null) - throw new AuthenticationException("auth.01", new Object[] { sessionID }); - session.setTimestampIdentityLink(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - // parses the - IdentityLink identityLink = - new InfoboxReadResponseParser(xmlInfoboxReadResponse).parseIdentityLink(); - // validates the identity link - IdentityLinkValidator.getInstance().validate(identityLink); - // builds a 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 = - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse).parseData(); - - if (identityLink.getIdentificationType().equalsIgnoreCase(Constants.URN_PREFIX_BASEID)) { - } - - 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 - VerifyXMLSignatureResponseValidator.getInstance().validate( - verifyXMLSignatureResponse, - authConf.getIdentityLinkX509SubjectNames(), - VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, - ignoreManifestValidationResult); - - session.setIdentityLink(identityLink); - // now validate the extended infoboxes - verifyInfoboxes(session, infoboxReadResponseParameters, !oaParam.getProvideStammzahl()); - // builds the AUTH-block - String authBlock = buildAuthenticationBlock(session); -// session.setAuthBlock(authBlock); - // builds the - String[] transformsInfos = oaParam.getTransformsInfos(); - if ((transformsInfos == null) || (transformsInfos.length == 0)) { - // no OA specific transforms specified, use default ones - transformsInfos = authConf.getTransformsInfos(); - } - String createXMLSignatureRequest = - new CreateXMLSignatureRequestBuilder().build(authBlock, - oaParam.getKeyBoxIdentifier(), - transformsInfos, - oaParam.getSlVersion12()); - return createXMLSignatureRequest; - } - /** - * Builds an authentication block <saml:Assertion> from given session data. - * @param session authentication session - * - * @return <saml:Assertion> 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) throws BuildException { - IdentityLink identityLink = session.getIdentityLink(); - String issuer = identityLink.getName(); - String gebDat = identityLink.getDateOfBirth(); - String identificationValue = identityLink.getIdentificationValue(); - String identificationType = identityLink.getIdentificationType(); - String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); - session.setIssueInstant(issueInstant); - String authURL = session.getAuthURL(); - String target = session.getTarget(); - String oaURL = session.getPublicOAURLPrefix(); - List extendedSAMLAttributes = session.getExtendedSAMLAttributesAUTH(); - String authBlock = new AuthenticationBlockAssertionBuilder().buildAuthBlock( - issuer, - issueInstant, - authURL, - target, - identificationValue, - identificationType, - oaURL, - gebDat, - extendedSAMLAttributes, - session); - - 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 infoboxReadResponseParams The parameters returned from the BKU as response - * to an infobox read request (including the infobox - * tokens to be verified). - * @param hideStammzahl Indicates whether source pins (Stammzahlen) - * should be hidden in any SAML attribute that may be - * returned by a validator. - * - * @throws AuthenticationException If the verification of at least one infobox fails. - * @throws ConfigurationException If the OAuthParameter cannot be extracted. - */ - private void verifyInfoboxes( - AuthenticationSession session, Map infoboxReadResponseParams, boolean hideStammzahl) - throws ValidateException, ConfigurationException - { - - AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance(); - // get the default VerifyInfobox parameters - Map defaultInfoboxParameters = null; - VerifyInfoboxParameters defaultVerifyInfoboxParameters = - authConfigurationProvider.getDefaultVerifyInfoboxParameters(); - if (defaultVerifyInfoboxParameters != null) { - defaultInfoboxParameters = defaultVerifyInfoboxParameters.getInfoboxParameters(); - } - // get the OA specific VerifyInfobox parameters - Map infoboxParameters = null; - OAAuthParameter oaParam = - authConfigurationProvider.getOnlineApplicationParameter(session.getPublicOAURLPrefix()); - VerifyInfoboxParameters verifyInfoboxParameters = oaParam.getVerifyInfoboxParameters(); - if (verifyInfoboxParameters != null) { - Vector authAttributes = new Vector(); - Vector oaAttributes = new Vector(); - infoboxParameters = verifyInfoboxParameters.getInfoboxParameters(); - // get the list of infobox identifiers - List identifiers = verifyInfoboxParameters.getIdentifiers(); - if (identifiers != null) { - // step through the identifiers and verify the infoboxes - Iterator it = identifiers.iterator(); - while (it.hasNext()) { - String identifier = (String)it.next(); - // get the infobox read response from the map of parameters - String infoboxReadResponse = (String)infoboxReadResponseParams.get(identifier); - // get the configuration parameters - VerifyInfoboxParameter verifyInfoboxParameter = null; - Object object = infoboxParameters.get(identifier); - // if not present, use default - if ((object == null) && (defaultInfoboxParameters != null)) { - object = defaultInfoboxParameters.get(identifier); - } - if (object != null) { - verifyInfoboxParameter = (VerifyInfoboxParameter)object; - } - if (infoboxReadResponse != null) { - if (verifyInfoboxParameter == null) { - // should not happen because of the pushinfobox mechanism; check it anyway - Logger.error("No validator for verifying \"" + identifier + "\"-infobox configured."); - throw new ValidateException("validator.41", new Object[] {identifier}); - } else { - String friendlyName = verifyInfoboxParameter.getFriendlyName(); - // get the class for validating the infobox - InfoboxValidator infoboxValidator = null; - try { - Class validatorClass = Class.forName(verifyInfoboxParameter.getValidatorClassName()); - infoboxValidator = (InfoboxValidator) validatorClass.newInstance(); - } catch (Exception e) { - Logger.error("Could not load validator class \"" + verifyInfoboxParameter.getValidatorClassName() + - "\" for \"" + identifier + "\"-infobox: " + e.getMessage()); - throw new ValidateException("validator.42", new Object[] {friendlyName}); - } - Logger.debug("Successfully loaded validator class \"" + verifyInfoboxParameter.getValidatorClassName() + - "\" for \"" + identifier + "\"-infobox."); - // parse the infobox read reponse - List infoboxTokenList = null; - try { - infoboxTokenList = - ExtendedInfoboxReadResponseParser.parseInfoboxReadResponse(infoboxReadResponse, friendlyName); - } catch (ParseException e) { - Logger.error("InfoboxReadResponse for \"" + identifier + - "\"-infobox could not be parsed successfully: " + e.getMessage()); - throw new ValidateException("validator.43", new Object[] {friendlyName}); - } - // build the parameters for validating the infobox - InfoboxValidatorParams infoboxValidatorParams = - InfoboxValidatorParamsBuilder.buildInfoboxValidatorParams( - session, verifyInfoboxParameter, infoboxTokenList, hideStammzahl); - // now validate the infobox - InfoboxValidationResult infoboxValidationResult = null; - try { - infoboxValidationResult = infoboxValidator.validate(infoboxValidatorParams); - } 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()}); - } - - Logger.info(identifier + " infobox successfully validated."); - - // get the SAML attributes to be appended to the AUTHBlock or to the final - // SAML Assertion - ExtendedSAMLAttribute[] extendedSAMLAttributes = infoboxValidationResult.getExtendedSamlAttributes(); - if (extendedSAMLAttributes != null) { - int length = extendedSAMLAttributes.length; - for (int i=0; i<CreateXMLSignatureResponse> sent by the - * security layer implementation.
- *
    - *
  • Validates given <CreateXMLSignatureResponse>
  • - *
  • Parses <CreateXMLSignatureResponse> for error codes
  • - *
  • Parses authentication block enclosed in - * <CreateXMLSignatureResponse>
  • - *
  • Verifies authentication block by calling the MOA SP component
  • - *
  • Creates authentication data
  • - *
  • Creates a corresponding SAML artifact
  • - *
  • Stores authentication data in the authentication data store - * indexed by the SAML artifact
  • - *
  • Deletes authentication session
  • - *
  • Returns the SAML artifact, encoded BASE64
  • - *
- * - * @param sessionID session ID of the running authentication session - * @param xmlCreateXMLSignatureReadResponse String representation of the - * <CreateXMLSignatureResponse> - * @return SAML artifact needed for retrieving authentication data, encoded BASE64 - */ - public String verifyAuthenticationBlock( - String sessionID, - String xmlCreateXMLSignatureReadResponse) - throws - AuthenticationException, - BuildException, - ParseException, - ConfigurationException, - ServiceException, - ValidateException { - - if (isEmpty(sessionID)) - 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}); - AuthenticationSession session = getSession(sessionID); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - // parses - 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 - new CreateXMLSignatureResponseValidator().validate(csresp, session); - // builds a for a MOA-SPSS call - 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 vsresp = new VerifyXMLSignatureResponseParser(domVsresp).parseData(); - // validates the - VerifyXMLSignatureResponseValidator.getInstance().validate( - vsresp, - null, - VerifyXMLSignatureResponseValidator.CHECK_AUTH_BLOCK, - false); - - - // TODO See Bug #144 - // Compare AuthBlock Data with information stored in session, especially date and time - - - // compares the public keys from the identityLink with the AuthBlock - VerifyXMLSignatureResponseValidator.getInstance().validateCertificate( - vsresp, - session.getIdentityLink()); - - // builds authentication data and stores it together with a SAML artifact - AuthenticationData authData = buildAuthenticationData(session, vsresp); - String samlArtifact = - new SAMLArtifactBuilder().build(session.getAuthURL(), session.getSessionID()); - storeAuthenticationData(samlArtifact, authData); - // invalidates the authentication session - sessionStore.remove(sessionID); - Logger.info( - "Anmeldedaten zu MOASession " + sessionID + " angelegt, SAML Artifakt " + samlArtifact); - return samlArtifact; - } - /** - * Builds the AuthenticationData object together with the - * corresponding <saml:Assertion> - * @param session authentication session - * @param verifyXMLSigResp VerifyXMLSignatureResponse from MOA-SP - * @return AuthenticationData object - * @throws ConfigurationException while accessing configuration data - * @throws BuildException while building the <saml:Assertion> - */ - private AuthenticationData buildAuthenticationData( - AuthenticationSession session, - VerifyXMLSignatureResponse verifyXMLSigResp) - throws ConfigurationException, BuildException { - - IdentityLink identityLink = session.getIdentityLink(); - AuthenticationData authData = new AuthenticationData(); - OAAuthParameter oaParam = - AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( - session.getPublicOAURLPrefix()); - boolean businessService = oaParam.getBusinessService(); - authData.setMajorVersion(1); - authData.setMinorVersion(0); - authData.setAssertionID(Random.nextRandom()); - authData.setIssuer(session.getAuthURL()); - authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance())); - - authData.setIdentificationType(identityLink.getIdentificationType()); - authData.setGivenName(identityLink.getGivenName()); - authData.setFamilyName(identityLink.getFamilyName()); - authData.setDateOfBirth(identityLink.getDateOfBirth()); - authData.setQualifiedCertificate(verifyXMLSigResp.isQualifiedCertificate()); - authData.setPublicAuthority(verifyXMLSigResp.isPublicAuthority()); - authData.setPublicAuthorityCode(verifyXMLSigResp.getPublicAuthorityCode()); - authData.setBkuURL(session.getBkuURL()); - boolean provideStammzahl = oaParam.getProvideStammzahl(); - if (provideStammzahl) { - authData.setIdentificationValue(identityLink.getIdentificationValue()); - } - String prPerson = new PersonDataBuilder().build(identityLink, provideStammzahl); - try { - String signerCertificateBase64 = ""; - if (oaParam.getProvideCertifcate()) { - X509Certificate signerCertificate = verifyXMLSigResp.getX509certificate(); - if (signerCertificate != null) { - signerCertificateBase64 = Base64Utils.encode(signerCertificate.getEncoded()); - } else { - Logger.info("\"provideCertificate\" is \"true\", but no signer certificate available"); - } - } - authData.setSignerCertificate(signerCertificateBase64); - if (businessService) { - authData.setWBPK(identityLink.getIdentificationValue()); - } else { - // only compute bPK if online applcation is a public service - String bpkBase64 = - new BPKBuilder().buildBPK( - identityLink.getIdentificationValue(), - session.getTarget()); - authData.setBPK(bpkBase64); - } - String ilAssertion = - oaParam.getProvideIdentityLink() - ? identityLink.getSerializedSamlAssertion() - : ""; - if (!oaParam.getProvideStammzahl()) { - ilAssertion = StringUtils.replaceAll(ilAssertion, identityLink.getIdentificationValue(), ""); - } - String authBlock = oaParam.getProvideAuthBlock() ? session.getAuthBlock() : ""; - String samlAssertion = - new AuthenticationDataAssertionBuilder().build( - authData, - prPerson, - authBlock, - ilAssertion, - session.getBkuURL(), - signerCertificateBase64, - businessService, - session.getExtendedSAMLAttributesOA()); - authData.setSamlAssertion(samlAssertion); - return authData; - } catch (Throwable ex) { - throw new BuildException( - "builder.00", - new Object[] { "AuthenticationData", ex.toString()}, - ex); - } - } - /** - * Retrieves AuthenticationData indexed by the SAML artifact. - * The AuthenticationData is deleted from the store upon end of this call. - * - * @return AuthenticationData - */ - public AuthenticationData getAuthenticationData(String samlArtifact) - throws AuthenticationException { - String assertionHandle; - try { - assertionHandle = new SAMLArtifactParser(samlArtifact).parseAssertionHandle(); - } catch (ParseException ex) { - throw new AuthenticationException("1205", new Object[] { samlArtifact, ex.toString()}); - } - AuthenticationData authData = null; - synchronized (authenticationDataStore) { - authData = (AuthenticationData) authenticationDataStore.get(assertionHandle); - if (authData == null) { - Logger.error("Assertion not found for SAML Artifact: " + samlArtifact); - throw new AuthenticationException("1206", new Object[] { samlArtifact }); - } - authenticationDataStore.remove(assertionHandle); - } - long now = new Date().getTime(); - if (now - authData.getTimestamp().getTime() > authDataTimeOut) - throw new AuthenticationException("1207", new Object[] { samlArtifact }); - Logger.debug("Assertion delivered for SAML Artifact: " + samlArtifact); - return authData; - } - /** - * Stores authentication data indexed by the assertion handle contained in the - * given saml artifact. - * @param samlArtifact SAML artifact - * @param authData authentication data - * @throws AuthenticationException when SAML artifact is invalid - */ - private void storeAuthenticationData(String samlArtifact, AuthenticationData authData) - throws AuthenticationException { - - try { - SAMLArtifactParser parser = new SAMLArtifactParser(samlArtifact); - // check type code 0x0001 - byte[] typeCode = parser.parseTypeCode(); - if (typeCode[0] != 0 || typeCode[1] != 1) - throw new AuthenticationException("auth.06", new Object[] { samlArtifact }); - String assertionHandle = parser.parseAssertionHandle(); - synchronized (authenticationDataStore) { - Logger.debug("Assertion stored for SAML Artifact: " + samlArtifact); - authenticationDataStore.put(assertionHandle, authData); - } - } catch (AuthenticationException ex) { - throw ex; - } catch (Throwable ex) { - throw new AuthenticationException("auth.06", new Object[] { samlArtifact }); - } - } - /** - * Creates a new session and puts it into the session store. - * - * @param id Session ID - * @return AuthenticationSession created - * @exception AuthenticationException - * thrown when an AuthenticationSession is running - * already for the given session ID - */ - private static AuthenticationSession newSession() throws AuthenticationException { - String sessionID = Random.nextRandom(); - AuthenticationSession newSession = new AuthenticationSession(sessionID); - synchronized (sessionStore) { - AuthenticationSession session = (AuthenticationSession) sessionStore.get(sessionID); - if (session != null) - throw new AuthenticationException("auth.01", new Object[] { sessionID }); - sessionStore.put(sessionID, newSession); - } - return newSession; - } - /** - * Retrieves a session from the session store. - * - * @param id session ID - * @return AuthenticationSession stored with given session ID, - * null if session ID unknown - */ - public static AuthenticationSession getSession(String id) throws AuthenticationException { - AuthenticationSession session = (AuthenticationSession) sessionStore.get(id); - if (session == null) - throw new AuthenticationException("auth.02", new Object[] { id }); - return session; - } - /** - * Cleans up expired session and authentication data stores. - */ - public void cleanup() { - long now = new Date().getTime(); - synchronized (sessionStore) { - Set keys = new HashSet(sessionStore.keySet()); - for (Iterator iter = keys.iterator(); iter.hasNext();) { - String sessionID = (String) iter.next(); - AuthenticationSession session = (AuthenticationSession) sessionStore.get(sessionID); - if (now - session.getTimestampStart().getTime() > sessionTimeOut) { - Logger.info( - MOAIDMessageProvider.getInstance().getMessage( - "cleaner.02", - new Object[] { sessionID })); - sessionStore.remove(sessionID); - } - } - } - synchronized (authenticationDataStore) { - Set keys = new HashSet(authenticationDataStore.keySet()); - for (Iterator iter = keys.iterator(); iter.hasNext();) { - String samlArtifact = (String) iter.next(); - AuthenticationData authData = - (AuthenticationData) authenticationDataStore.get(samlArtifact); - if (now - authData.getTimestamp().getTime() > authDataTimeOut) { - Logger.info( - MOAIDMessageProvider.getInstance().getMessage( - "cleaner.03", - new Object[] { samlArtifact })); - authenticationDataStore.remove(samlArtifact); - } - } - } - } - - /** - * Sets the sessionTimeOut. - * @param seconds Time out of the session in seconds - */ - public void setSecondsSessionTimeOut(long seconds) { - sessionTimeOut = 1000 * seconds; - } - /** - * Sets the authDataTimeOut. - * @param seconds Time out for signing AuthData in seconds - */ - public void setSecondsAuthDataTimeOut(long seconds) { - authDataTimeOut = 1000 * seconds; - } - - /** - * 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; - } - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java b/id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java deleted file mode 100644 index 7e5ed6ec7..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.gv.egovernment.moa.id.auth; - -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Thread cleaning the AuthenticationServer session store - * and authentication data store from garbage. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationSessionCleaner implements Runnable { - - /** interval the AuthenticationSessionCleaner is run in */ - private static final long SESSION_CLEANUP_INTERVAL = 30 * 60; // 30 min - - /** - * Runs the thread. Cleans the AuthenticationServer session store - * and authentication data store from garbage, then sleeps for given interval, and restarts. - */ - public void run() { - while (true) { - try { - Logger.debug("AuthenticationSessionCleaner run"); - AuthenticationServer.getInstance().cleanup(); - } - catch (Exception e) { - Logger.error(MOAIDMessageProvider.getInstance().getMessage("cleaner.01", null), e); - } - try { - Thread.sleep(SESSION_CLEANUP_INTERVAL * 1000); - } - catch (InterruptedException e) { - } - } - } - - /** - * start the sessionCleaner - */ - public static void start() { - // start the session cleanup thread - Thread sessionCleaner = - new Thread(new AuthenticationSessionCleaner()); - sessionCleaner.setName("SessionCleaner"); - sessionCleaner.setDaemon(true); - sessionCleaner.setPriority(Thread.MIN_PRIORITY); - sessionCleaner.start(); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java b/id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java deleted file mode 100644 index 43e88e7b5..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java +++ /dev/null @@ -1,75 +0,0 @@ -package at.gv.egovernment.moa.id.auth; - -import iaik.asn1.ObjectID; - - -/** - * Constants used throughout moa-id-auth component. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public interface MOAIDAuthConstants { - - /** servlet parameter "Target" */ - public static final String PARAM_TARGET = "Target"; - /** servlet parameter "OA" */ - public static final String PARAM_OA = "OA"; - /** servlet parameter "bkuURI" */ - public static final String PARAM_BKU = "bkuURI"; - /** servlet parameter "BKUSelectionTemplate" */ - public static final String PARAM_BKUTEMPLATE = "BKUSelectionTemplate"; - /** default BKU URL */ - public static final String DEFAULT_BKU = "http://localhost:3495/http-security-layer-request"; - /** servlet parameter "returnURI" */ - public static final String PARAM_RETURN = "returnURI"; - /** servlet parameter "Template" */ - public static final String PARAM_TEMPLATE = "Template"; - /** servlet parameter "MOASessionID" */ - public static final String PARAM_SESSIONID = "MOASessionID"; - /** servlet parameter "XMLResponse" */ - public static final String PARAM_XMLRESPONSE = "XMLResponse"; - /** servlet parameter "SAMLArtifact" */ - public static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; - /** Request name {@link at.gv.egovernment.moa.id.auth.servlet.StartAuthenticationServlet} is mapped to */ - public static final String REQ_START_AUTHENTICATION = "StartAuthentication"; - /** Request name {@link at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet} is mapped to */ - public static final String REQ_VERIFY_IDENTITY_LINK = "VerifyIdentityLink"; - /** Request name {@link at.gv.egovernment.moa.id.auth.servlet.VerifyAuthenticationBlockServlet} is mapped to */ - public static final String REQ_VERIFY_AUTH_BLOCK = "VerifyAuthBlock"; - /** Logging hierarchy used for controlling debug output of XML structures to files */ - public static final String DEBUG_OUTPUT_HIERARCHY = "moa.id.auth"; - /** Header Name for controlling the caching mechanism of the browser */ - public static final String HEADER_EXPIRES = "Expires"; - /** Header Value for controlling the caching mechanism of the browser */ - public static final String HEADER_VALUE_EXPIRES = "Sat, 6 May 1995 12:00:00 GMT"; - /** Header Name for controlling the caching mechanism of the browser */ - public static final String HEADER_PRAGMA = "Pragma"; - /** Header Value for controlling the caching mechanism of the browser */ - public static final String HEADER_VALUE_PRAGMA = "no-cache"; - /** Header Name for controlling the caching mechanism of the browser */ - public static final String HEADER_CACHE_CONTROL = "Cache-control"; - /** Header Value for controlling the caching mechanism of the browser */ - public static final String HEADER_VALUE_CACHE_CONTROL = "no-store, no-cache, must-revalidate"; - /** Header Value for controlling the caching mechanism of the browser */ - public static final String HEADER_VALUE_CACHE_CONTROL_IE = "post-check=0, pre-check=0"; - /** - * the identity link signer X509Subject names of those identity link signer certificates - * not including the identity link signer OID. The authorisation for signing the identity - * link must be checked by using their issuer names. After february 19th 2007 the OID of - * the certificate will be used fo checking the authorisation for signing identity links. - */ - public static final String[] IDENTITY_LINK_SIGNERS_WITHOUT_OID = - new String[] {"T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission", - "T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission"}; - /** - * the number of the certifcate extension "Eigenschaft zur Ausstellung von Personenbindungen" - */ - public static final String IDENTITY_LINK_SIGNER_OID_NUMBER = "1.2.40.0.10.1.7.1"; - /** - * the OID of the identity link signer certificate (Eigenschaft zur Ausstellung von Personenbindungen); - * used for checking the authorisation for signing the identity link for identity links signed after february 19th 2007 - */ - public static final ObjectID IDENTITY_LINK_SIGNER_OID = new ObjectID(IDENTITY_LINK_SIGNER_OID_NUMBER); - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java b/id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java deleted file mode 100644 index 7964e2fb6..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java +++ /dev/null @@ -1,163 +0,0 @@ -package at.gv.egovernment.moa.id.auth; - -import iaik.pki.PKIException; -import iaik.pki.jsse.IAIKX509TrustManager; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.util.Properties; - -import javax.activation.CommandMap; -import javax.activation.MailcapCommandMap; -import javax.mail.Session; -import javax.net.ssl.SSLSocketFactory; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; -import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; -import at.gv.egovernment.moa.util.Constants; - -/** - * Web application initializer - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDAuthInitializer { - - /** a boolean identifying if the MOAIDAuthInitializer has been startet */ - public static boolean initialized = false; - - /** - * Initializes the web application components which need initialization: - * logging, JSSE, MOA-ID Auth configuration, Axis, session cleaner. - */ - public static void initialize() throws ConfigurationException, - PKIException, IOException, GeneralSecurityException { - if (initialized) return; - initialized = true; - Logger.setHierarchy("moa.id.auth"); - Logger.info("Default java file.encoding: " - + System.getProperty("file.encoding")); - - //JDK bug workaround according to: - // http://jce.iaik.tugraz.at/products/03_cms/faq/index.php#JarVerifier - // register content data handlers for S/MIME types - MailcapCommandMap mc = new MailcapCommandMap(); - CommandMap.setDefaultCommandMap(mc); - - // create some properties and get the default Session - Properties props = new Properties(); - props.put("mail.smtp.host", "localhost"); - Session session = Session.getDefaultInstance(props, null); - - // Restricts TLS cipher suites - System.setProperty( - "https.cipherSuites", - "SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_3DES_EDE_CBC_SHA"); - // load some jsse classes so that the integrity of the jars can be - // verified - // before the iaik jce is installed as the security provider - // this workaround is only needed when sun jsse is used in conjunction - // with - // iaik-jce (on jdk1.3) - ClassLoader cl = MOAIDAuthInitializer.class.getClassLoader(); - try { - cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar - } catch (ClassNotFoundException e) { - Logger.warn(MOAIDMessageProvider.getInstance().getMessage( - "init.01", null), e); - } - - // Initializes SSLSocketFactory store - SSLUtils.initialize(); - - // Initializes Namespace Map - Constants.nSMap.put(Constants.SAML_PREFIX, Constants.SAML_NS_URI); - Constants.nSMap.put(Constants.ECDSA_PREFIX, - "http://www.w3.org/2001/04/xmldsig-more#"); - Constants.nSMap.put(Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); - - // Loads the configuration - AuthConfigurationProvider authConf = AuthConfigurationProvider.reload(); - ConnectionParameter moaSPConnParam = authConf - .getMoaSpConnectionParameter(); - - // If MOA-SP API calls: loads MOA-SP configuration and configures IAIK - if (moaSPConnParam == null) { - try { - LoggingContextManager.getInstance().setLoggingContext( - new LoggingContext("startup")); - ConfigurationProvider config = ConfigurationProvider - .getInstance(); - new IaikConfigurator().configure(config); - } catch (at.gv.egovernment.moa.spss.server.config.ConfigurationException ex) { - throw new ConfigurationException("config.10", new Object[] { ex - .toString() }, ex); - } - } - - // Initializes IAIKX509TrustManager logging - String log4jConfigURL = System.getProperty("log4j.configuration"); - if (log4jConfigURL != null) { - IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); - } - - // Initializes the Axis secure socket factory for use in calling the - // MOA-SP web service - if (moaSPConnParam != null && moaSPConnParam.isHTTPSURL()) { - SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(authConf, - moaSPConnParam); - AxisSecureSocketFactory.initialize(ssf); - } - - // sets the authentication session and authentication data time outs - String param = authConf - .getGenericConfigurationParameter(AuthConfigurationProvider.AUTH_SESSION_TIMEOUT_PROPERTY); - if (param != null) { - long sessionTimeOut = 0; - try { - sessionTimeOut = new Long(param).longValue(); - } catch (NumberFormatException ex) { - Logger - .error(MOAIDMessageProvider - .getInstance() - .getMessage( - "config.05", - new Object[] { AuthConfigurationProvider.AUTH_SESSION_TIMEOUT_PROPERTY })); - } - if (sessionTimeOut > 0) - AuthenticationServer.getInstance() - .setSecondsSessionTimeOut(sessionTimeOut); - } - param = authConf - .getGenericConfigurationParameter(AuthConfigurationProvider.AUTH_DATA_TIMEOUT_PROPERTY); - if (param != null) { - long authDataTimeOut = 0; - try { - authDataTimeOut = new Long(param).longValue(); - } catch (NumberFormatException ex) { - Logger - .error(MOAIDMessageProvider - .getInstance() - .getMessage( - "config.05", - new Object[] { AuthConfigurationProvider.AUTH_DATA_TIMEOUT_PROPERTY })); - } - if (authDataTimeOut > 0) - AuthenticationServer.getInstance() - .setSecondsAuthDataTimeOut(authDataTimeOut); - } - - } - -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/WrongParametersException.java b/id.server/src/at/gv/egovernment/moa/id/auth/WrongParametersException.java deleted file mode 100644 index 3ce2798ea..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/WrongParametersException.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.gv.egovernment.moa.id.auth; - -import at.gv.egovernment.moa.id.MOAIDException; - -/** - * Exception thrown when the AuthenticationServer API is - * called with wrong parameters provided. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class WrongParametersException extends MOAIDException { - - /** - * Constructor - */ - public WrongParametersException(String call, String parameter) { - super("auth.05", new Object[] {call, parameter}); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java deleted file mode 100644 index 241cf0afc..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java +++ /dev/null @@ -1,88 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.io.IOException; -import java.text.MessageFormat; -import java.util.Iterator; -import java.util.List; - -import javax.xml.transform.TransformerException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * Base class for building authentication the AUTHBlock and final OA data SAML assertions. - * Encapsulates methods used by the two specific builders - * {@link at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder AuthenticationBlockAssertionBuilder} - * and - * {@link at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder AuthenticationDataAssertionBuilder} - * - * @author Harald Bratko - */ -public class AuthenticationAssertionBuilder { - - /** the NewLine representation in Java*/ - protected static String NL = "\n"; - - protected static String SAML_ATTRIBUTE = - " " + NL + - " {2}" + NL + - " "+ NL; - - /** - * Empty constructor - */ - public AuthenticationAssertionBuilder() { - } - - /** - * Builds the SAML attributes to be appended to the AUTHBlock or to the SAML assertion - * delivered to the online application. - * The method traverses through the list of given SAML attribute objects and builds an - * XML structure (String representation) for each of the attributes. - * - * @param extendedSAMLAttributes The SAML attributes to be appended to the AUTHBlock or - * to the SAML assertion delivered to the online application. - * @return A string representation including the XML structures of - * the SAML attributes. - * - * @throws ParseException If an error occurs on serializing an SAML attribute. - */ - protected String buildExtendedSAMLAttributes(List extendedSAMLAttributes) throws ParseException - { - StringBuffer sb = new StringBuffer(); - if (extendedSAMLAttributes!=null) { - Iterator it = extendedSAMLAttributes.iterator(); - while (it.hasNext()) { - ExtendedSAMLAttribute extendedSAMLAttribute = (ExtendedSAMLAttribute)it.next(); - Object value = extendedSAMLAttribute.getValue(); - String name = extendedSAMLAttribute.getName(); - String namespace = extendedSAMLAttribute.getNameSpace(); - if (value instanceof String) { - sb.append(MessageFormat.format( SAML_ATTRIBUTE, new Object[] {name, namespace, value})); - } else if (value instanceof Element) { - try { - String serializedValue = DOMUtils.serializeNode((Element)(value)); - serializedValue = StringUtils.removeXMLDeclaration(serializedValue); - sb.append(MessageFormat.format( SAML_ATTRIBUTE, new Object[] {name, namespace, serializedValue})); - } catch (TransformerException e) { - Logger.error("Error on serializing SAML attribute \"" + name + - " (namespace: \"" + namespace + "\"."); - throw new ParseException("parser.05", new Object[] { name, namespace}); - } catch (IOException e) { - Logger.error("Error on serializing SAML attribute \"" + name + - " (namespace: \"" + namespace + "\"."); - throw new ParseException("parser.05", new Object[] { name, namespace}); - } - } - } - } - return sb.toString(); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java deleted file mode 100644 index 60cd11ed6..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.text.MessageFormat; -import java.util.List; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; - -/** - * Builder for the authentication block <saml:Assertion> - * to be included in a <CreateXMLSignatureResponse>. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertionBuilder implements Constants { - - /** template for the Auth-Block */ - private static String AUTH_BLOCK = - "" + NL + - " " + NL + - " " + NL + - " {3}" + NL + - " " + NL + - "{4}" + - " " + NL + - " {5}" + NL + - " " + NL + - " " + NL + - " {6}" + NL + - " " + NL + - "{7}" + - " " + NL + - ""; - - private static String GESCHAEFTS_BEREICH_ATTRIBUTE = - " " + NL + - " {0}" + NL + - " " + NL; - - private static String WBPK_ATTRIBUTE = - " " + NL + - " " + NL + - " " + NL + - " {0}" + NL + - " {1}" + NL + - " " + NL + - " " + NL + - " " + NL; - - /** - * The number of SAML attributes included in this AUTH-Block (without the extended SAML attributes). - */ - public static final int NUM_OF_SAML_ATTRIBUTES = 3; - - /** - * Constructor for AuthenticationBlockAssertionBuilder. - */ - public AuthenticationBlockAssertionBuilder() { - super(); - } - - /** - * Builds the authentication block <saml:Assertion> - * - * @param issuer authentication block issuer; "GivenName FamilyName" - * @param issueInstant current timestamp - * @param authURL URL of MOA-ID authentication component - * @param target "Geschäftsbereich"; maybe null if the application - * is a business application - * @param identityLinkValue the content of the <pr:Value> - * child element of the <pr:Identification> - * element derived from the Identitylink; this is the - * value of the wbPK; - * maybe null if the application is a public service - * @param identityLinkType the content of the <pr:Type> - * child element of the <pr:Identification> - * element derived from the Identitylink; this includes the - * URN prefix and the identification number of the business - * application used as input for wbPK computation; - * maybe null if the application is a public service - * @param oaURL public URL of online application requested - * @param gebDat The date of birth from the identity link. - * @param extendedSAMLAttributes The SAML attributes to be appended to the AUTHBlock. - * - * @return String representation of authentication block - * <saml:Assertion> built - * - * @throws BuildException If an error occurs on serializing an extended SAML attribute - * to be appended to the AUTH-Block. - */ - public String buildAuthBlock( - String issuer, - String issueInstant, - String authURL, - String target, - String identityLinkValue, - String identityLinkType, - String oaURL, - String gebDat, - List extendedSAMLAttributes, - AuthenticationSession session) - throws BuildException - { - session.setSAMLAttributeGebeORwbpk(true); - String gebeORwbpk = ""; - String wbpkNSDeclaration = ""; - if (target == null) { - // OA is a business application - if (!Constants.URN_PREFIX_HPI.equals(identityLinkType)) { - // Only add wbPKs to AUTH-Block. HPIs can be added to the AUTH-Block by the corresponding Validator - gebeORwbpk = MessageFormat.format(WBPK_ATTRIBUTE, new Object[] { identityLinkValue, identityLinkType }); - wbpkNSDeclaration = " xmlns:pr=\"" + PD_NS_URI + "\""; - } else { - // We do not have a wbPK, therefore no SAML-Attribute is provided - session.setSAMLAttributeGebeORwbpk(false); - } - } else { - gebeORwbpk = MessageFormat.format(GESCHAEFTS_BEREICH_ATTRIBUTE, new Object[] { target }); - } - - String assertion; - try { - assertion = MessageFormat.format( - AUTH_BLOCK, new Object[] { - wbpkNSDeclaration, - issuer, - issueInstant, - authURL, - gebeORwbpk, - oaURL, - gebDat, - buildExtendedSAMLAttributes(extendedSAMLAttributes)}); - } catch (ParseException e) { - Logger.error("Error on building AUTH-Block: " + e.getMessage()); - throw new BuildException("builder.00", new Object[] { "AUTH-Block", e.toString()}); - } - - return assertion; - - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java deleted file mode 100644 index 53520c846..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java +++ /dev/null @@ -1,156 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.text.MessageFormat; -import java.util.List; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * Builder for the authentication data <saml:Assertion> - * to be provided by the MOA ID Auth component. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionBuilder implements Constants { - /** private static String NL contains the NewLine representation in Java*/ - private static final String NL = "\n"; - /** - * XML template for the <saml:Assertion> to be built - */ - private static final String AUTH_DATA = - "" + NL + - "" + NL + - " " + NL + - " " + NL + - " {4}" + NL + - " " + NL + - " " + MOA_NS_URI + "cm" + NL + - " {5}{6}" + NL + - " " + NL + - " " + NL + - " " + NL + - " {7}" + NL + - " " + NL + - " " + NL + - " {8}" + NL + - " " + NL + - " " + NL + - " {9}" + NL + - " " + NL + - "{10}" + - "{11}" + - "{12}" + - " " + NL + - ""; - /** - * XML template for the <saml:Attribute> named "isPublicAuthority", - * to be inserted into the <saml:Assertion> - */ - private static final String PUBLIC_AUTHORITY_ATT = - " " + NL + - " {0}" + NL + - " " + NL; - - private static final String SIGNER_CERTIFICATE_ATT = - " " + NL + - " {0}" + NL + - " " + NL; - - /** - * Constructor for AuthenticationDataAssertionBuilder. - */ - public AuthenticationDataAssertionBuilder() { - super(); - } - - /** - * Builds the authentication data <saml:Assertion>. - * - * @param authData the AuthenticationData to build the - * <saml:Assertion> from - * @param xmlPersonData lt;pr:Person> element as a String - * @param xmlAuthBlock authentication block to be included in a - * lt;saml:SubjectConfirmationData> element; may include - * the "Stammzahl" or not; may be empty - * @param xmlIdentityLink the IdentityLink - * @param signerCertificateBase64 Base64 encoded certificate of the signer. Maybe - * an empty string if the signer certificate should not be provided. - * Will be ignored if the businessService parameter is - * set to false. - * @param businessService true if the online application is a - * business service, otherwise false - * @return the <saml:Assertion> - * @throws BuildException if an error occurs during the build process - */ - public String build( - AuthenticationData authData, - String xmlPersonData, - String xmlAuthBlock, - String xmlIdentityLink, - String bkuURL, - String signerCertificateBase64, - boolean businessService, - List extendedSAMLAttributes) - throws BuildException - { - - String isQualifiedCertificate = authData.isQualifiedCertificate() ? "true" : "false"; - String publicAuthorityAttribute = ""; - if (authData.isPublicAuthority()) { - String publicAuthorityIdentification = authData.getPublicAuthorityCode(); - if (publicAuthorityIdentification == null) - publicAuthorityIdentification = "True"; - publicAuthorityAttribute = MessageFormat.format( - PUBLIC_AUTHORITY_ATT, new Object[] { publicAuthorityIdentification }); - } - - - String signerCertificateAttribute = ""; - if (signerCertificateBase64 != "") { - signerCertificateAttribute = MessageFormat.format( - SIGNER_CERTIFICATE_ATT, new Object[] { signerCertificateBase64 }); - } - - String pkType; - String pkValue; - if (businessService) { - pkType = authData.getIdentificationType(); - pkValue = authData.getWBPK(); - - } else { - pkType = URN_PREFIX_BPK; - pkValue = authData.getBPK(); - } - - String assertion; - try { - assertion = MessageFormat.format(AUTH_DATA, new Object[] { - authData.getAssertionID(), - authData.getIssuer(), - authData.getIssueInstant(), - pkType, - pkValue, - StringUtils.removeXMLDeclaration(xmlAuthBlock), - StringUtils.removeXMLDeclaration(xmlIdentityLink), - StringUtils.removeXMLDeclaration(xmlPersonData), - isQualifiedCertificate, - bkuURL, - publicAuthorityAttribute, - signerCertificateAttribute, - buildExtendedSAMLAttributes(extendedSAMLAttributes)}); - } catch (ParseException e) { - Logger.error("Error on building Authentication Data Assertion: " + e.getMessage()); - throw new BuildException("builder.00", new Object[] { "Authentication Data Assertion", e.toString()}); - } - return assertion; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java deleted file mode 100644 index 6cc8c1be8..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.security.MessageDigest; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; - -/** - * Builder for the bPK, as defined in - * "Ableitung f¨r die bereichsspezifische Personenkennzeichnung" - * version 1.0.1 from "reference.e-government.gv.at". - * - * @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}); - } - String 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); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/Builder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/Builder.java deleted file mode 100644 index 3a2ee07de..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/Builder.java +++ /dev/null @@ -1,59 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * Base class for HTML/XML builders providing commonly useful functions. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class Builder { - - /** - * Replaces a given number of occurences of a special tag in an XML or HTML template by a value. - * @param template html template - * @param tag special tag - * @param value value replacing the tag - * @param expected specifies if the tag is expected to present; if true and the tag - * is not present, an exception is thrown; if false and the tag is - * not present, the original string is returned - * @param maxreplacements Set -1 to replace each occurence of tag, or limit replacements by a given positive number - * @return XML or HTML code, the tag replaced - * @throws BuildException when template does not contain the tag - */ - protected String replaceTag( - String template, - String tag, - String value, - boolean expected, - int maxreplacements) - throws BuildException - { - String result = template; - int index = result.indexOf(tag); - if (index < 0) { - if (expected) { - // Substring not found but should - throw new BuildException( - "builder.01", - new Object[] {"<" + tag.substring(1, tag.length() - 1) + ">"}); - } - } else { - // replace each occurence - if (maxreplacements == -1) { - return StringUtils.replaceAll(template, tag, value); - } else { - int found = 1; - while (index > -1 && (found <= maxreplacements)) { - result = result.substring(0, index) + value + result.substring(index + tag.length()); - index = result.indexOf(tag); - if (index > -1) found += 1; - } - } - } - return result; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java deleted file mode 100644 index 06c81f49e..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.io.IOException; -import java.text.MessageFormat; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.FileUtils; - -/** - * Builder for the <VerifyXMLSignatureRequest> structure - * used for presenting certificate information in the secure viewer of the security layer implementation. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class CertInfoVerifyXMLSignatureRequestBuilder extends Builder implements Constants { - - /** special tag in the VerifyXMLRequest template to be substituted for a <dsig:Signature> */ - private static final String SIGNATURE_TAG = ""; - - /** private static String nl contains the NewLine representation in Java*/ - private static final String nl = "\n"; - - /** - * XML template for the CertInfoVerifyXMLSignatureRequest to be built - */ - static final String CERTINFO_REQUEST = - "" + nl + - "<{0}:VerifyXMLSignatureRequest {2} xmlns:dsig=\"" + DSIG_NS_URI + "\">" + nl + - " <{0}:SignatureInfo>" + nl + - " <{0}:SignatureEnvironment>" + nl + - " <{1}:XMLContent xml:space=\"preserve\">" + nl + - " " + nl + - " <{0}:SignatureLocation>//dsig:Signature" + nl + - " " + nl + - ""; - - /** - * Constructor - */ - public CertInfoVerifyXMLSignatureRequestBuilder() { - super(); - } - /** - * Builds the <VerifyXMLSignatureRequest> structure. - * @return the XML structure - * @throws BuildException - */ - public String build(boolean slVersion12) throws BuildException { - - String sl10Prefix; - String sl11Prefix; - String slNsDeclaration; - - if (slVersion12) { - - sl10Prefix = SL12_PREFIX; - sl11Prefix = SL12_PREFIX; - slNsDeclaration = "xmlns:" + SL12_PREFIX + "=\"" + SL12_NS_URI + "\""; - - } else { - - sl10Prefix = SL10_PREFIX; - sl11Prefix = SL11_PREFIX; - slNsDeclaration = "xmlns:" + sl11Prefix + "=\"" + SL11_NS_URI + "\" xmlns:" + sl10Prefix + "=\"" + SL10_NS_URI + "\""; - - } - - String certInfoRequest = MessageFormat.format(CERTINFO_REQUEST, new Object[] {sl11Prefix, sl10Prefix, slNsDeclaration}); - String resDsigSignature = "resources/xmldata/CertInfoDsigSignature.xml"; - - - try { - String dsigSignature = FileUtils.readResource(resDsigSignature, "UTF-8"); - certInfoRequest = replaceTag(certInfoRequest, SIGNATURE_TAG, dsigSignature, true, 1); - return certInfoRequest; - } - catch (IOException ex) { - throw new BuildException("auth.04", new Object[] {resDsigSignature, ex.toString()}); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java deleted file mode 100644 index e9a9f308d..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java +++ /dev/null @@ -1,93 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.text.MessageFormat; - -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * Builder for the <CreateXMLSignatureRequest> structure - * used for requesting a signature under the authentication block from the - * security layer implementation. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class CreateXMLSignatureRequestBuilder implements Constants { - /** private static String nl contains the NewLine representation in Java*/ - private static final String nl = "\n"; - /** - * XML template for the <moa:CreateXMLSignatureRequest> to be built - */ - private static final String CREATE_XML_SIGNATURE_REQUEST = - "" + nl + - "<{3}:CreateXMLSignatureRequest xmlns:dsig=''" + DSIG_NS_URI + "'' {5}>" + nl + - " <{3}:KeyboxIdentifier>{1}" + nl + - " <{3}:DataObjectInfo Structure=''detached''>" + nl + - " <{4}:DataObject Reference=''''/>" + nl + - "{2}" + - " " + nl + - " <{3}:SignatureInfo>" + nl + - " <{3}:SignatureEnvironment>" + nl + - " <{4}:XMLContent>{0}" + nl + - " " + nl + - " <{3}:SignatureLocation Index=''2''>/saml:Assertion" + nl + - " " + nl + - ""; - - - /** - * Constructor for CreateXMLSignatureRequestBuilder. - */ - public CreateXMLSignatureRequestBuilder() { - super(); - } - - /** - * Builds the <CreateXMLSignatureRequest>. - * - * @param authBlock String representation of XML authentication block - * @param keyBoxIdentifier the key box identifier which will be used (e.g. CertifiedKeypair) - * @param slVersion12 specifies whether the Security Layer version number is 1.2 or not - * @return String representation of <CreateXMLSignatureRequest> - */ - public String build(String authBlock, String keyBoxIdentifier, String[] dsigTransformInfos, boolean slVersion12) { - - String sl10Prefix; - String sl11Prefix; - String slNsDeclaration; - - String dsigTransformInfosString = ""; - for (int i = 0; i < dsigTransformInfos.length; i++) { - dsigTransformInfosString += dsigTransformInfos[i]; - } - - if (slVersion12) { - - // replace the SecurityLayer namespace prefixes and URIs within the transforms - dsigTransformInfosString = StringUtils.changeSLVersion(dsigTransformInfosString, - SL10_PREFIX, SL12_PREFIX, - SL10_NS_URI, SL12_NS_URI); - sl10Prefix = SL12_PREFIX; - sl11Prefix = SL12_PREFIX; - slNsDeclaration = "xmlns:" + SL12_PREFIX + "='" + SL12_NS_URI + "'"; - - } else { - - sl10Prefix = SL10_PREFIX; - sl11Prefix = SL11_PREFIX; - slNsDeclaration = "xmlns:" + sl10Prefix + "='" + SL10_NS_URI + "' xmlns:" + sl11Prefix + "='" + SL11_NS_URI + "'"; - - } - - String request = MessageFormat.format( - CREATE_XML_SIGNATURE_REQUEST, new Object[] { authBlock, - keyBoxIdentifier, - dsigTransformInfosString, - sl11Prefix, - sl10Prefix, - slNsDeclaration }); - - return request; - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java deleted file mode 100644 index 30cc1df5a..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java +++ /dev/null @@ -1,83 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; -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; - -/** - * Builds a DataURL parameter meant for the security layer implementation - * to respond to. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class DataURLBuilder { - - /** - * Constructor for DataURLBuilder. - */ - public DataURLBuilder() { - super(); - } - - /** - * Constructs a data URL for VerifyIdentityLink or VerifyAuthenticationBlock, - * including the MOASessionID as a parameter. - * - * @param authBaseURL base URL (context path) of the MOA ID Authentication component, - * including a trailing '/' - * @param authServletName request part of the data URL - * @param sessionID sessionID to be included in the dataURL - * @return String - */ - public String buildDataURL(String authBaseURL, String authServletName, String sessionID) { - - String individualDataURLPrefix = null; - String dataURL; - try { - //check if an individual prefix is configured - individualDataURLPrefix = AuthConfigurationProvider.getInstance(). - getGenericConfigurationParameter(AuthConfigurationProvider.INDIVIDUAL_DATA_URL_PREFIX); - - if (null != individualDataURLPrefix) { - - //check individualDataURLPrefix - if(!individualDataURLPrefix.startsWith("http")) - throw(new ConfigurationException("config.13", new Object[] { individualDataURLPrefix})); - - //when ok then use it - dataURL = individualDataURLPrefix + authServletName; - } else - dataURL = authBaseURL + authServletName; - - } catch (ConfigurationException e) { - Logger.warn(e); - Logger.warn(MOAIDMessageProvider.getInstance().getMessage("config.12", new Object[] { authBaseURL } )); - dataURL = authBaseURL + authServletName; - } - - dataURL = addParameter(dataURL, AuthServlet.PARAM_SESSIONID, sessionID); - return dataURL; - } - - /** - * Method addParameter. - * @param urlString represents the url - * @param paramname is the parameter to be added - * @param value is the value of that parameter - * @return String - */ - private String addParameter(String urlString, String paramname, String value) { - String url = urlString; - if (paramname != null) { - if (url.indexOf("?") < 0) - url += "?"; - else - url += "&"; - url += paramname + "=" + value; - } - return url; - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java deleted file mode 100644 index 0d0595b69..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java +++ /dev/null @@ -1,150 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; - -import at.gv.egovernment.moa.id.BuildException; - -/** - * Builder for HTML form requesting the security layer implementation - * to get the identity link from smartcard by a <InfoboxReadRequest>. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class GetIdentityLinkFormBuilder extends Builder { - /** private static String NL contains the NewLine representation in Java*/ - private static final String nl = "\n"; - /** special tag in the HTML template to be substituted for the BKU URL */ - private static final String BKU_TAG = ""; - /** special tag in the HTML template to be substituted for the XML request */ - private static final String XMLREQUEST_TAG = ""; - /** special tag in the HTML template to be substituted for the data URL */ - private static final String DATAURL_TAG = ""; - /** special tag in the HTML template to be substituted for certificate info XML request */ - private static final String CERTINFO_XMLREQUEST_TAG = ""; - /** special tag in the HTML template to be substituted for the certificate info data URL */ - private static final String CERTINFO_DATAURL_TAG = ""; - /** special tag in the HTML template to be substituted for the infoboxes to be pushed from the BKU */ - private static final String PUSHINFOBOX_TAG = ""; - /** private static int all contains the representation to replace all tags*/ - private static final int ALL = -1; - - /** default HTML template */ - private static final String DEFAULT_HTML_TEMPLATE = - "" + nl + - "" + nl + - "" + nl + - "Anmeldung mit Bürgerkarte" + nl + - "" + nl + - "" + nl + - "
" + nl + - " " + nl + - " " + nl + - " " + nl + - " " + nl + - "
" + nl + - "
" + nl + - " " + nl + - " " + nl + -// " " + nl + - " " + nl + - "
" + nl + - "" + nl + - ""; - - /** - * Constructor for GetIdentityLinkFormBuilder. - */ - public GetIdentityLinkFormBuilder() { - super(); - } - /** - * Builds the HTML form, including XML Request and data URL as parameters. - * - * @param htmlTemplate template to be used for the HTML form; - * may be null, in this case a default layout will be produced - * @param xmlRequest XML Request to be sent as a parameter in the form - * @param bkuURL URL of the "Bürgerkartenumgebung" the form will be submitted to; - * may be null, in this case the default URL will be used - * @param dataURL DataURL to be sent as a parameter in the form - */ - public String build( - String htmlTemplate, - String bkuURL, - String xmlRequest, - String dataURL, - String certInfoXMLRequest, - String certInfoDataURL, - String pushInfobox) - throws BuildException - { - String htmlForm = htmlTemplate == null ? DEFAULT_HTML_TEMPLATE : htmlTemplate; -// String bku = bkuURL == null ? DEFAULT_BKU : bkuURL; - htmlForm = replaceTag(htmlForm, BKU_TAG, bkuURL, true, ALL); - htmlForm = replaceTag(htmlForm, XMLREQUEST_TAG, encodeParameter(xmlRequest), true, ALL); - htmlForm = replaceTag(htmlForm, DATAURL_TAG, dataURL, true, ALL); - htmlForm = replaceTag(htmlForm, PUSHINFOBOX_TAG, pushInfobox, false, ALL); -//new:wird oben mitreplaced htmlForm = replaceTag(htmlForm, BKU_TAG, bkuURL); - htmlForm = replaceTag(htmlForm, CERTINFO_XMLREQUEST_TAG, encodeParameter(certInfoXMLRequest), true, ALL); - htmlForm = replaceTag(htmlForm, CERTINFO_DATAURL_TAG, certInfoDataURL, true, ALL); - return htmlForm; - } - /** - * Encodes a string for inclusion as a parameter in the form. - * Double quotes are substituted by "&quot;". - * @param s the string to be encoded - * @return the string encoded - * @throws BuildException on any exception encountered - */ - public static String encodeParameter(String s) throws BuildException { - StringReader in = new StringReader(s); - StringWriter out = new StringWriter(); - try { - for (int ch = in.read(); ch >= 0; ch = in.read()) { - if (ch == '"') - out.write("""); - else if (ch == '<') - out.write("<"); - else if (ch == '>') - out.write(">"); - else if (ch == 'ä') - out.write("ä"); - else if (ch == 'ö') - out.write("ö"); - else if (ch == 'ü') - out.write("ü"); - else if (ch == 'Ä') - out.write("Ä"); - else if (ch == 'Ö') - out.write("Ö"); - else if (ch == 'Ü') - out.write("Ü"); - else if (ch == 'ß') - out.write("ß"); - else - out.write(ch); - } - } - catch (IOException ex) { - throw new BuildException("builder.00", new Object[] {"GetIdentityLinkForm", ex.toString()}); - } - return out.toString(); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java deleted file mode 100644 index c2bafe43b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.util.Constants; - -/** - * Builder for the <InfoboxReadRequest> 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 <InfoboxReadRequest>. - * - * @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 null if the OA - * is a public service; must not be null - * if the OA is a business service - * - * @return <InfoboxReadRequest> as String - */ - public String build(boolean slVersion12, boolean businessService, String identityLinkDomainIdentifier) { - - String slPrefix; - String slNsDeclaration; - - if (slVersion12) { - slPrefix = SL12_PREFIX; - slNsDeclaration = SL12_NS_URI; - } else { - slPrefix = SL10_PREFIX; - slNsDeclaration = SL10_NS_URI; - } - - StringBuffer sb = new StringBuffer(""); - 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("<"); - 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(""); - sb.append(""); - } - sb.append(""); - - return sb.toString(); - - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java deleted file mode 100644 index 038e549be..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.util.List; - -import org.w3c.dom.Element; - -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.data.InfoboxValidatorParams; -import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParamsImpl; -import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; -import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameter; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * This class provides one method for building parameters needed for - * validating an infobox token. - * - * @author Harald Bratko - */ -public class InfoboxValidatorParamsBuilder { - - // hide the default constructor - private InfoboxValidatorParamsBuilder() { - } - - /** - * Builds the parameters passed to the validator class for validating an infobox token. - * - * @param session The actual Authentication session. - * @param verifyInfoboxParameter The configuration parameters for the infobox. - * @param infoboxTokenList Contains the infobox token to be validated. - * @param hideStammzahl Indicates whether source pins (Stammzahlen) - * should be hidden in any SAML attributes returned by - * an infobox validator. - * - * @return Parameters for validating an infobox token. - */ - public static InfoboxValidatorParams buildInfoboxValidatorParams( - AuthenticationSession session, - VerifyInfoboxParameter verifyInfoboxParameter, - List infoboxTokenList, - boolean hideStammzahl) - { - InfoboxValidatorParamsImpl infoboxValidatorParams = new InfoboxValidatorParamsImpl(); - IdentityLink identityLink = session.getIdentityLink(); - - // the infobox token to validate - infoboxValidatorParams.setInfoboxTokenList(infoboxTokenList); - // configuration parameters - infoboxValidatorParams.setTrustProfileID(verifyInfoboxParameter.getTrustProfileID()); - infoboxValidatorParams.setSchemaLocations(verifyInfoboxParameter.getSchemaLocations()); - infoboxValidatorParams.setApplicationSpecificParams(verifyInfoboxParameter.getApplicationSpecificParams()); - // authentication session parameters - infoboxValidatorParams.setBkuURL(session.getBkuURL()); - infoboxValidatorParams.setTarget(session.getTarget()); - infoboxValidatorParams.setBusinessApplication(session.getBusinessService()); - // parameters from the identity link - infoboxValidatorParams.setFamilyName(identityLink.getFamilyName()); - infoboxValidatorParams.setGivenName(identityLink.getGivenName()); - infoboxValidatorParams.setDateOfBirth(identityLink.getDateOfBirth()); - if (verifyInfoboxParameter.getProvideStammzahl()) { - infoboxValidatorParams.setIdentificationValue(identityLink.getIdentificationValue()); - } - infoboxValidatorParams.setIdentificationType(identityLink.getIdentificationType()); - infoboxValidatorParams.setPublicKeys(identityLink.getPublicKey()); - if (verifyInfoboxParameter.getProvideIdentityLink()) { - Element identityLinkElem = (Element)identityLink.getSamlAssertion().cloneNode(true); - if (!verifyInfoboxParameter.getProvideStammzahl()) { - Element identificationValueElem = - (Element)XPathUtils.selectSingleNode(identityLinkElem, IdentityLinkAssertionParser.PERSON_IDENT_VALUE_XPATH); - if (identificationValueElem != null) { - identificationValueElem.getFirstChild().setNodeValue(""); - } - } - infoboxValidatorParams.setIdentityLink(identityLinkElem); - } - infoboxValidatorParams.setHideStammzahl(hideStammzahl); - return infoboxValidatorParams; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java deleted file mode 100644 index 819ed79bb..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Builder for the lt;pr:Person> element to be inserted - * in the authentication data lt;saml:Assertion>. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class PersonDataBuilder { - - /** - * Constructor for PersonDataBuilder. - */ - public PersonDataBuilder() { - super(); - } - /** - * Builds the <pr:Person> element.
- * Utilizes the parsed <prPerson> from the identity link - * and the information regarding inclusion of "Stammzahl" in the - * <pr:Person> data. - * - * @param identityLink IdentityLink containing the - * attribute prPerson - * @param provideStammzahl true if "Stammzahl" is to be included; - * false otherwise - * @return the <pr:Person> element as a String - * @throws BuildException on any error - */ - public String build(IdentityLink identityLink, boolean provideStammzahl) - throws BuildException { - - try { - Element prPerson = (Element)identityLink.getPrPerson().cloneNode(true); - if (! provideStammzahl) { - Node prIdentification = XPathUtils.selectSingleNode(prPerson, "pr:Identification/pr:Value"); - //remove IdentificationValue - prIdentification.getFirstChild().setNodeValue(""); - } - String xmlString = DOMUtils.serializeNode(prPerson); - return xmlString; - } - catch (Exception ex) { - throw new BuildException( - "builder.00", - new Object[] {"PersonData", ex.toString()}, - ex); - } - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java deleted file mode 100644 index 27e19e830..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.io.ByteArrayOutputStream; -import java.security.MessageDigest; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.Base64Utils; - -/** - * Builder for the SAML artifact, as defined in the - * Browser/Artifact profile of SAML. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLArtifactBuilder { - - /** - * Constructor for SAMLArtifactBuilder. - */ - public SAMLArtifactBuilder() { - super(); - } - - /** - * Builds the SAML artifact, encoded BASE64. - *
    - *
  • TypeCode: 0x0001.
  • - *
  • SourceID: SHA-1 hash of the authURL
  • - *
  • AssertionHandle: SHA-1 hash of the MOASessionID
  • - *
- * @param authURL URL auf the MOA-ID Auth component to be used for construction - * of SourceID - * @param sessionID MOASessionID to be used for construction - * of AssertionHandle - * @return the 42-byte SAML artifact, encoded BASE64 - */ - public String build(String authURL, String sessionID) throws BuildException { - try { - MessageDigest md = MessageDigest.getInstance("SHA-1"); - byte[] sourceID = md.digest(authURL.getBytes()); - byte[] assertionHandle = md.digest(sessionID.getBytes()); - ByteArrayOutputStream out = new ByteArrayOutputStream(42); - out.write(0); - out.write(1); - out.write(sourceID, 0, 20); - out.write(assertionHandle, 0, 20); - byte[] samlArtifact = out.toByteArray(); - String samlArtifactBase64 = Base64Utils.encode(samlArtifact); - return samlArtifactBase64; - } - catch (Throwable ex) { - throw new BuildException( - "builder.00", - new Object[] {"SAML Artifact, MOASessionID=" + sessionID, ex.toString()}, - ex); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java deleted file mode 100644 index 64cb16181..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import java.text.MessageFormat; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * Builder for the lt;samlp:Response> used for passing - * result and status information from the GetAuthenticationData - * web service. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLResponseBuilder implements Constants { - /** XML - Template for samlp:Response */ - private static final String RESPONSE = - "" + - "" + - " " + - " " + - " {4}" + - " " + - " {5}" + - " " + - " {6}" + - ""; - /** XML - Template for samlp:StatusCode */ - private static final String SUB_STATUS_CODE = - ""; - - /** - * Constructor for SAMLResponseBuilder. - */ - public SAMLResponseBuilder() { - super(); - } - /** - * Builds the SAML response. - * @param responseID response ID - * @param inResponseTo request ID of lt;samlp:Request> responded to - * @param issueInstant current timestamp - * @param statusCode status code - * @param subStatusCode sub-status code refining the status code; may be null - * @param statusMessage status message - * @param samlAssertion SAML assertion representing authentication data - * @return SAML response as a DOM element - */ - public Element build( - String responseID, - String inResponseTo, - String issueInstant, - String statusCode, - String subStatusCode, - String statusMessage, - String samlAssertion) - throws BuildException { - - try { - String xmlSubStatusCode = - subStatusCode == null ? - "" : - MessageFormat.format(SUB_STATUS_CODE, new Object[] {subStatusCode}); - - String xmlResponse = MessageFormat.format(RESPONSE, new Object[] { - responseID, - inResponseTo, - issueInstant, - statusCode, - xmlSubStatusCode, - statusMessage, - StringUtils.removeXMLDeclaration(samlAssertion) }); - Element domResponse = DOMUtils.parseDocument(xmlResponse, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - return domResponse; - } - catch (Throwable ex) { - throw new BuildException( - "builder.00", - new Object[] { "samlp:Response", ex.toString() }, - ex); - } - } - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java deleted file mode 100644 index 312179e73..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.id.BuildException; - -/** - * Builder for the BKU selection form requesting the user to choose - * a BKU from a list. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SelectBKUFormBuilder extends Builder { - /** private static String NL contains the NewLine representation in Java*/ - private static final String nl = "\n"; - /** special tag in the HTML template to be substituted for the form action which is - * a URL of MOA-ID Auth */ - private static final String ACTION_TAG = ""; - /** special tag in the HTML template to be substituted for the <select;gt; tag - * containing the BKU selection options */ - private static final String SELECT_TAG = ""; - /** - * Template for the default html-code to be returned as security-layer-selection to be built - */ - private static final String DEFAULT_HTML_TEMPLATE = - "" + nl + - "" + nl + - "" + nl + - "Auswahl der Bürgerkartenumgebung" + nl + - "" + nl + - "" + nl + - "
" + nl + - SELECT_TAG + nl + - " " + nl + - "
" + nl + - "" + nl + - ""; - - /** - * Constructor - */ - public SelectBKUFormBuilder() { - super(); - } - /** - * Method build. Builds the form - * @param htmlTemplate to be used - * @param startAuthenticationURL the url where the startAuthenticationServlet can be found - * @param bkuSelectTag if a special bku should be used - * @return String - * @throws BuildException on any error - */ - public String build(String htmlTemplate, String startAuthenticationURL, String bkuSelectTag) - throws BuildException { - - String htmlForm = htmlTemplate == null ? DEFAULT_HTML_TEMPLATE : htmlTemplate; - htmlForm = replaceTag(htmlForm, ACTION_TAG, startAuthenticationURL, true, 1); - htmlForm = replaceTag(htmlForm, SELECT_TAG, bkuSelectTag, true, 1); - return htmlForm; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java deleted file mode 100644 index 758f28150..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java +++ /dev/null @@ -1,206 +0,0 @@ -package at.gv.egovernment.moa.id.auth.builder; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; - -/** - * Builder for the <VerifyXMLSignatureRequestBuilder> structure - * used for sending the DSIG-Signature of the Security Layer card for validating to MOA-SP. - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class VerifyXMLSignatureRequestBuilder { - - /** shortcut for XMLNS namespace URI */ - private static final String XMLNS_NS_URI = Constants.XMLNS_NS_URI; - /** shortcut for MOA namespace URI */ - private static final String MOA_NS_URI = Constants.MOA_NS_URI; - /** The DSIG-Prefix */ - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - - /** The document containing the VerifyXMLsignatureRequest */ - private Document requestDoc_; - /** the VerifyXMLsignatureRequest root element */ - private Element requestElem_; - - - /** - * Builds the body for a VerifyXMLsignatureRequest including the root - * element and namespace declarations. - * - * @throws BuildException If an error occurs on building the document. - */ - public VerifyXMLSignatureRequestBuilder() throws BuildException { - try { - DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - requestDoc_ = docBuilder.newDocument(); - requestElem_ = requestDoc_.createElementNS(MOA_NS_URI, "VerifyXMLSignatureRequest"); - requestElem_.setAttributeNS(XMLNS_NS_URI, "xmlns", MOA_NS_URI); - requestElem_.setAttributeNS(XMLNS_NS_URI, "xmlns:" + Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); - requestDoc_.appendChild(requestElem_); - } catch (Throwable t) { - throw new BuildException( - "builder.00", - new Object[] {"VerifyXMLSignatureRequest", t.toString()}, - t); - } - } - - - /** - * Builds a <VerifyXMLSignatureRequest> - * from an IdentityLink with a known trustProfileID which - * has to exist in MOA-SP - * @param identityLink - The IdentityLink - * @param trustProfileID - a preconfigured TrustProfile at MOA-SP - * - * @return Element - The complete request as Dom-Element - * - * @throws ParseException - */ - public Element build(IdentityLink identityLink, String trustProfileID) - throws ParseException - { - try { - // build the request - Element dateTimeElem = requestDoc_.createElementNS(MOA_NS_URI, "DateTime"); - requestElem_.appendChild(dateTimeElem); - Node dateTime = requestDoc_.createTextNode(identityLink.getIssueInstant()); - dateTimeElem.appendChild(dateTime); - Element verifiySignatureInfoElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureInfo"); - requestElem_.appendChild(verifiySignatureInfoElem); - Element verifySignatureEnvironmentElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureEnvironment"); - verifiySignatureInfoElem.appendChild(verifySignatureEnvironmentElem); - Element base64ContentElem = requestDoc_.createElementNS(MOA_NS_URI, "Base64Content"); - verifySignatureEnvironmentElem.appendChild(base64ContentElem); - // insert the base64 encoded identity link SAML assertion - String serializedAssertion = identityLink.getSerializedSamlAssertion(); - String base64EncodedAssertion = Base64Utils.encode(serializedAssertion.getBytes("UTF-8")); - //replace all '\r' characters by no char. - StringBuffer replaced = new StringBuffer(); - for (int i = 0; i < base64EncodedAssertion.length(); i ++) { - char c = base64EncodedAssertion.charAt(i); - if (c != '\r') { - replaced.append(c); - } - } - base64EncodedAssertion = replaced.toString(); - Node base64Content = requestDoc_.createTextNode(base64EncodedAssertion); - base64ContentElem.appendChild(base64Content); - // specify the signature location - Element verifySignatureLocationElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureLocation"); - verifiySignatureInfoElem.appendChild(verifySignatureLocationElem); - Node signatureLocation = requestDoc_.createTextNode(DSIG + "Signature"); - verifySignatureLocationElem.appendChild(signatureLocation); - // signature manifest params - Element signatureManifestCheckParamsElem = - requestDoc_.createElementNS(MOA_NS_URI, "SignatureManifestCheckParams"); - requestElem_.appendChild(signatureManifestCheckParamsElem); - signatureManifestCheckParamsElem.setAttribute("ReturnReferenceInputData", "false"); - // add the transforms - Element referenceInfoElem = requestDoc_.createElementNS(MOA_NS_URI, "ReferenceInfo"); - signatureManifestCheckParamsElem.appendChild(referenceInfoElem); - Element[] dsigTransforms = identityLink.getDsigReferenceTransforms(); - for (int i = 0; i < dsigTransforms.length; i++) { - Element verifyTransformsInfoProfileElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifyTransformsInfoProfile"); - referenceInfoElem.appendChild(verifyTransformsInfoProfileElem); - verifyTransformsInfoProfileElem.appendChild(requestDoc_.importNode(dsigTransforms[i], true)); - } - Element returnHashInputDataElem = - requestDoc_.createElementNS(MOA_NS_URI, "ReturnHashInputData"); - requestElem_.appendChild(returnHashInputDataElem); - Element trustProfileIDElem = requestDoc_.createElementNS(MOA_NS_URI, "TrustProfileID"); - trustProfileIDElem.appendChild(requestDoc_.createTextNode(trustProfileID)); - requestElem_.appendChild(trustProfileIDElem); - } catch (Throwable t) { - throw new ParseException("builder.00", - new Object[] { "VerifyXMLSignatureRequest (IdentityLink)" }, t); - } - - return requestElem_; - } - - - /** - * Builds a <VerifyXMLSignatureRequest> - * from the signed AUTH-Block with a known trustProfileID which - * has to exist in MOA-SP - * @param csr - signed AUTH-Block - * @param verifyTransformsInfoProfileID - allowed verifyTransformsInfoProfileID - * @param trustProfileID - a preconfigured TrustProfile at MOA-SP - * @return Element - The complete request as Dom-Element - * @throws ParseException - */ - public Element build( - CreateXMLSignatureResponse csr, - String[] verifyTransformsInfoProfileID, - String trustProfileID) - throws BuildException { //samlAssertionObject - - try { - // build the request -// requestElem_.setAttributeNS(Constants.XMLNS_NS_URI, "xmlns:" -// + Constants.XML_PREFIX, Constants.XMLNS_NS_URI); - Element verifiySignatureInfoElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureInfo"); - requestElem_.appendChild(verifiySignatureInfoElem); - Element verifySignatureEnvironmentElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureEnvironment"); - verifiySignatureInfoElem.appendChild(verifySignatureEnvironmentElem); - Element xmlContentElem = requestDoc_.createElementNS(MOA_NS_URI, "XMLContent"); - verifySignatureEnvironmentElem.appendChild(xmlContentElem); - xmlContentElem.setAttribute(Constants.XML_PREFIX + ":space", "preserve"); - // insert the SAML assertion - xmlContentElem.appendChild(requestDoc_.importNode(csr.getSamlAssertion(), true)); - // specify the signature location - Element verifySignatureLocationElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureLocation"); - verifiySignatureInfoElem.appendChild(verifySignatureLocationElem); - Node signatureLocation = requestDoc_.createTextNode(DSIG + "Signature"); - verifySignatureLocationElem.appendChild(signatureLocation); - // signature manifest params - Element signatureManifestCheckParamsElem = - requestDoc_.createElementNS(MOA_NS_URI, "SignatureManifestCheckParams"); - requestElem_.appendChild(signatureManifestCheckParamsElem); - signatureManifestCheckParamsElem.setAttribute("ReturnReferenceInputData", "true"); - // add the transform profile IDs - Element referenceInfoElem = requestDoc_.createElementNS(MOA_NS_URI, "ReferenceInfo"); - signatureManifestCheckParamsElem.appendChild(referenceInfoElem); - for (int i = 0; i < verifyTransformsInfoProfileID.length; i++) { - Element verifyTransformsInfoProfileIDElem = - requestDoc_.createElementNS(MOA_NS_URI, "VerifyTransformsInfoProfileID"); - referenceInfoElem.appendChild(verifyTransformsInfoProfileIDElem); - verifyTransformsInfoProfileIDElem.appendChild( - requestDoc_.createTextNode(verifyTransformsInfoProfileID[i])); - } - Element returnHashInputDataElem = - requestDoc_.createElementNS(MOA_NS_URI, "ReturnHashInputData"); - requestElem_.appendChild(returnHashInputDataElem); - Element trustProfileIDElem = requestDoc_.createElementNS(MOA_NS_URI, "TrustProfileID"); - trustProfileIDElem.appendChild(requestDoc_.createTextNode(trustProfileID)); - requestElem_.appendChild(trustProfileIDElem); - - } catch (Throwable t) { - throw new BuildException("builder.00", new Object[] { "VerifyXMLSignatureRequest" }, t); - } - - return requestElem_; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java deleted file mode 100644 index 90d79a46d..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java +++ /dev/null @@ -1,383 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import java.util.Date; -import java.util.List; - -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; - -/** - * Session data to be stored between AuthenticationServer API calls. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationSession { - - private static String TARGET_PREFIX_ = Constants.URN_PREFIX_CDID + "+"; - - /** - * session ID - */ - private String sessionID; - /** - * "Geschäftsbereich" the online application belongs to; maybe null - * if the online application is a business application - */ - private String target; - /** - * public online application URL requested - */ - private String oaURLRequested; - /** - * public online application URL prefix - */ - private String oaPublicURLPrefix; - /** - * URL of MOA ID authentication component - */ - private String authURL; - /** - * HTML template URL - */ - private String templateURL; - /** - * URL of the BKU - */ - private String bkuURL; - /** - * identity link read from smartcard - */ - private IdentityLink identityLink; - /** - * authentication block to be signed by the user - */ - private String authBlock; - /** - * timestamp logging when authentication session has been created - */ - private Date timestampStart; - /** - * timestamp logging when identity link has been received - */ - private Date timestampIdentityLink; - /** - * Indicates whether the corresponding online application is a business - * service or not - */ - private boolean businessService; - - /** - * SAML attributes from an extended infobox validation to be appended - * to the SAML assertion delivered to the final online application. - */ - private List extendedSAMLAttributesOA; - - /** - * The boolean value for either a target or a wbPK is provided as - * SAML Attribute in the SAML Assertion or not. - */ - private boolean samlAttributeGebeORwbpk; - - /** - * SAML attributes from an extended infobox validation to be appended - * to the SAML assertion of the AUTHBlock. - */ - private List extendedSAMLAttributesAUTH; - - /** - * The issuing time of the AUTH-Block SAML assertion. - */ - private String issueInstant; - - /** - * Constructor for AuthenticationSession. - * - * @param id Session ID - */ - public AuthenticationSession(String id) { - sessionID = id; - setTimestampStart(); - } - - /** - * Returns the identityLink. - * @return IdentityLink - */ - public IdentityLink getIdentityLink() { - return identityLink; - } - - /** - * Returns the sessionID. - * @return String - */ - public String getSessionID() { - return sessionID; - } - - /** - * Sets the identityLink. - * @param identityLink The identityLink to set - */ - public void setIdentityLink(IdentityLink identityLink) { - this.identityLink = identityLink; - } - - /** - * Sets the sessionID. - * @param sessionId The sessionID to set - */ - public void setSessionID(String sessionId) { - this.sessionID = sessionId; - } - - /** - * Returns the oaURLRequested. - * @return String - */ - public String getOAURLRequested() { - return oaURLRequested; - } - - /** - * Returns the oaURLRequested. - * @return String - */ - public String getPublicOAURLPrefix() { - return oaPublicURLPrefix; - } - - /** - * Returns the BKU URL. - * @return String - */ - public String getBkuURL() { - return bkuURL; - } - - /** - * Returns the target. - * @return String - */ - public String getTarget() { - return target; - } - - /** - * Sets the oaURLRequested. - * @param oaURLRequested The oaURLRequested to set - */ - public void setOAURLRequested(String oaURLRequested) { - this.oaURLRequested = oaURLRequested; - } - - /** - * Sets the oaPublicURLPrefix - * @param oaPublicURLPrefix The oaPublicURLPrefix to set - */ - public void setPublicOAURLPrefix(String oaPublicURLPrefix) { - this.oaPublicURLPrefix = oaPublicURLPrefix; - } - - /** - * Sets the bkuURL - * @param bkuURL The BKU URL to set - */ - public void setBkuURL(String bkuURL) { - this.bkuURL = bkuURL; - } - - /** - * Sets the target. If the target includes the target prefix, the prefix will be stripped off. - * @param target The target to set - */ - public void setTarget(String target) { - if (target != null && target.startsWith(TARGET_PREFIX_)) - { - // If target starts with prefix "urn:publicid:gv.at:cdid+"; remove prefix - this.target = target.substring(TARGET_PREFIX_.length()); - Logger.debug("Target prefix stripped off; resulting target: " + this.target); - } - else - { - this.target = target; - } - } - - /** - * Returns the authURL. - * @return String - */ - public String getAuthURL() { - return authURL; - } - - /** - * Sets the authURL. - * @param authURL The authURL to set - */ - public void setAuthURL(String authURL) { - this.authURL = authURL; - } - - /** - * Returns the authBlock. - * @return String - */ - public String getAuthBlock() { - return authBlock; - } - - /** - * Sets the authBlock. - * @param authBlock The authBlock to set - */ - public void setAuthBlock(String authBlock) { - this.authBlock = authBlock; - } - - /** - * Returns the timestampIdentityLink. - * @return Date - */ - public Date getTimestampIdentityLink() { - return timestampIdentityLink; - } - - /** - * Returns the businessService. - * @return true if the corresponding online application is - * a business application, otherwise false - */ - public boolean getBusinessService() { - return businessService; - } - - /** - * Sets the businessService variable. - * @param businessService the value for setting the businessService variable. - */ - public void setBusinessService(boolean businessService) { - this.businessService = businessService; - } - - /** - * Returns the timestampStart. - * @return Date - */ - public Date getTimestampStart() { - return timestampStart; - } - - /** - * Sets the current date as timestampIdentityLink. - */ - public void setTimestampIdentityLink() { - timestampIdentityLink = new Date(); - } - - /** - * Sets the current date as timestampStart. - */ - public void setTimestampStart() { - timestampStart = new Date(); - } - - /** - * @return template URL - */ - public String getTemplateURL() { - return templateURL; - } - - /** - * @param string the template URL - */ - public void setTemplateURL(String string) { - templateURL = string; - } - - /** - * Returns the SAML Attributes to be appended to the AUTHBlock. Maybe null. - * - * @return The SAML Attributes to be appended to the AUTHBlock. Maybe null. - */ - public List getExtendedSAMLAttributesAUTH() { - return extendedSAMLAttributesAUTH; - } - - /** - * Sets the SAML Attributes to be appended to the AUTHBlock. - * - * @param extendedSAMLAttributesAUTH The SAML Attributes to be appended to the AUTHBlock. - */ - public void setExtendedSAMLAttributesAUTH( - List extendedSAMLAttributesAUTH) { - this.extendedSAMLAttributesAUTH = extendedSAMLAttributesAUTH; - } - - /** - * Returns the SAML Attributes to be appended to the SAML assertion - * delivered to the online application. Maybe null. - * - * @return The SAML Attributes to be appended to the SAML assertion - * delivered to the online application - */ - public List getExtendedSAMLAttributesOA() { - return extendedSAMLAttributesOA; - } - - /** - * Sets the SAML Attributes to be appended to the SAML assertion - * delivered to the online application. - * - * @param extendedSAMLAttributesOA The SAML Attributes to be appended to the SAML - * assertion delivered to the online application. - */ - public void setExtendedSAMLAttributesOA( - List extendedSAMLAttributesOA) { - this.extendedSAMLAttributesOA = extendedSAMLAttributesOA; - } - - /** - * Returns the boolean value for either a target or a wbPK is - * provided as SAML Attribute in the SAML Assertion or not. - * - * @return true either a target or a wbPK is provided as SAML Attribute - * in the SAML Assertion or false if not. - */ - public boolean getSAMLAttributeGebeORwbpk() { - return this.samlAttributeGebeORwbpk; - } - - /** - * Sets the boolean value for either a target or a wbPK is - * provided as SAML Attribute in the SAML Assertion or not. - * - * @param samlAttributeGebeORwbpk The boolean for value either a target or - * wbPK is provided as SAML Attribute in the SAML Assertion or not. - */ - public void setSAMLAttributeGebeORwbpk(boolean samlAttributeGebeORwbpk) { - this.samlAttributeGebeORwbpk = samlAttributeGebeORwbpk; - } - - /** - * Returns the issuing time of the AUTH-Block SAML assertion. - * - * @return The issuing time of the AUTH-Block SAML assertion. - */ - public String getIssueInstant() { - return issueInstant; - } - - /** - * Sets the issuing time of the AUTH-Block SAML assertion. - * - * @param issueInstant The issueInstant to set. - */ - public void setIssueInstant(String issueInstant) { - this.issueInstant = issueInstant; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java deleted file mode 100644 index d121f2c55..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java +++ /dev/null @@ -1,71 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import org.w3c.dom.Element; - -/** - * This bean saves all information of the CreateXMLSignature-Response: - * a {@link SAMLAttribute} array, the SamlAssertion-Element and the - * saml NameIdentifier - * - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class CreateXMLSignatureResponse { - /** the samlNameIdentifier */ -private String samlNameIdentifier; - /** an array of saml-attributes */ -private SAMLAttribute[] samlAttributes; - /** - * the original saml:Assertion-Element - */ - private Element samlAssertion; -/** - * Returns the samlAssertion. - * @return Element - */ -public Element getSamlAssertion() { - return samlAssertion; -} - -/** - * Returns the samlAttribute. - * @return SAMLAttribute[] - */ -public SAMLAttribute[] getSamlAttributes() { - return samlAttributes; -} - -/** - * Returns the samlNameIdentifier. - * @return String - */ -public String getSamlNameIdentifier() { - return samlNameIdentifier; -} - -/** - * Sets the samlAssertion. - * @param samlAssertion The samlAssertion to set - */ -public void setSamlAssertion(Element samlAssertion) { - this.samlAssertion = samlAssertion; -} - -/** - * Sets the samlAttribute. - * @param samlAttributes The samlAttributes to set - */ -public void setSamlAttributes(SAMLAttribute[] samlAttributes) { - this.samlAttributes = samlAttributes; -} - -/** - * Sets the samlNameIdentifier. - * @param samlNameIdentifier The samlNameIdentifier to set - */ -public void setSamlNameIdentifier(String samlNameIdentifier) { - this.samlNameIdentifier = samlNameIdentifier; -} - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java deleted file mode 100644 index 795079227..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java +++ /dev/null @@ -1,73 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -/** - * A SAML-Attribute to be appended to the final SAML-Assertion - * that will be passed to the online application. - */ -public interface ExtendedSAMLAttribute { - /** - * Add this attribute only to the SAML-Assertion - * passed to the online application, but not to - * the AUTH-Block. - */ - public final static int NOT_ADD_TO_AUTHBLOCK = 0; - /** - * Add this attribute to both, the AUTH-Block and the - * final SAML-Assertion passed to the online application. - */ - public final static int ADD_TO_AUTHBLOCK = 1; - /** - * Add this attribute to only the AUTH-Block, but not - * to the final SAML-Assertion passed to the online application. - */ - public final static int ADD_TO_AUTHBLOCK_ONLY = 2; - - /** - * The value of the SAML-Attribute. This must be either a - * org.w3c.Element or a java.lang.String - * object. Each other type will be ignored.
- * If, for example, the type of the actual SAML-Attribute is a - * <xsd:boolean> the value must be either the String - * "true" or "false". - * Or the <xsd:integer> number 273 - * has to be the String "273". - * - * @return The value of the SAML-Attribute. Must not be null. - */ - public Object getValue(); - - /** - * The name of the SAML-Attribute. - * - * @return The name of the SAML-Attribute. Must not be null. - */ - public String getName(); - - /** - * The namespace of the SAML-Attribute. - * An application will use the context specific namespace URI for the attribute it returns. - * However, if the application cannot explicitely assign a namespace URI, the - * {@link at.gv.egovernment.moa.util.Constants#MOA_NS_URI default} MOA namespace URI - * should be used. - * - * @return The namespace of the SAML-Attribute. Must not be null. - */ - public String getNameSpace(); - - /** - * Specifies if this SAML-Attribute should be added to the AUTH-Block. - *
- * Depending on the returned value, this SAML-Attribute should be only added to the - * final SAML-Assertion passed to the online application (0), to both, the final - * assertion and the AUTH-Block (1) or to the AUTH-Block only (2). - * - * @return
    - *
  • 0 - add this SAML-Attribute to the final SAML-Assertion only
  • - *
  • 1 - add this SAML-Attribute to both, the final SAML-Assertion and the - * AUTH-Block
  • - *
  • 2 - add this SAML-Attribute to the AUTH-Block only - *
- */ - public int getAddToAUTHBlock(); - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java deleted file mode 100644 index e7e490924..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java +++ /dev/null @@ -1,137 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -/** - * This class contains SAML attributes to be appended to the SAML assertion delivered to - * the Online application. - * - * @author Harald Bratko - */ -public class ExtendedSAMLAttributeImpl implements ExtendedSAMLAttribute { - - /** - * The value of this SAML attribute. Must be either of type java.lang.String - * or org.w3c.Element. - */ - protected Object value_; - - /** - * The name of this SAML attribute. - */ - protected String name_; - - /** - * The namespace URI of this SAML attribute. - */ - protected String namespace_; - - /** - * Specifies whether this SAML attribute should be appended to AUTH Block. - */ - protected int addToAUTHBlock_; - - /** - * Sets this ExtendedSAMLAttribute. - * @param name The name of this SAML Attribute. - * @param value The value of this SAML Attribute. Must be either of type - * java.lang.String or org.w3c.dom.Element. - * @param namespace The namespace of this SAML Attribute. - * @param addToAUTHBlock Specifies if this SAML Attribute should be added to the AUTHBlock. - * The following values are allowed: - *
    - *
  • - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK} - *
  • - *
  • - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#NOT_ADD_TO_AUTHBLOCK} - *
  • - *
  • - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK_ONLY} - *
  • - *
- * - */ - public ExtendedSAMLAttributeImpl(String name, Object value, String namespace, int addToAUTHBlock) { - name_ = name; - value_ = value; - namespace_ = namespace; - addToAUTHBlock_ = addToAUTHBlock; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getValue() - */ - public Object getValue() { - return value_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getName() - */ - public String getName() { - return name_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getNameSpace() - */ - public String getNameSpace() { - return namespace_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getAddToAUTHBlock() - */ - public int getAddToAUTHBlock() { - return addToAUTHBlock_; - } - - /** - * Specifies if this SAML Attribute should be added to the AUTHBlock. - * - * @param addToAUTHBlock One of the following values: - *
    - *
  • - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK} - *
  • - *
  • - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#NOT_ADD_TO_AUTHBLOCK} - *
  • - *
  • - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK_ONLY} - *
  • - *
- * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK} - */ - public void setAddToAUTHBlock(int addToAUTHBlock) { - addToAUTHBlock_ = addToAUTHBlock; - } - - /** - * Sets the name of this SAML attribute. - * - * @param name The name of this SAML attribute. - */ - public void setName(String name) { - name_ = name; - } - - /** - * Sets the namespace of this SAML attribute. - * - * @param namespace The namespace to set. - */ - public void setNamespace(String namespace) { - namespace_ = namespace; - } - - /** - * Sets the value of this SAML attribute. - * - * @param value The value of this SAML Attribute. Must be either of type - * java.lang.String or org.w3c.dom.Element. - */ - public void setValue(Object value) { - value_ = value; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/IdentityLink.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/IdentityLink.java deleted file mode 100644 index 844451035..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/IdentityLink.java +++ /dev/null @@ -1,266 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import java.io.IOException; -import java.security.PublicKey; - -import javax.xml.transform.TransformerException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.util.DOMUtils; - - -/** - * Data contained in an identity link issued by BMI, relevant to the MOA ID component. - *
"IdentityLink" is the translation of "Personenbindung". - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class IdentityLink { - /** - * "identificationValue" is the translation of "Stammzahl". - */ - private String identificationValue; - /** - * "identificationType" type of the identificationValue in the IdentityLink. - */ - private String identificationType; - /** - * first name - */ - private String givenName; - /** - * family name - */ - private String familyName; - - /** - * The name as (givenName + familyName) - */ - private String name; - /** - * date of birth - */ - private String dateOfBirth; - /** - * the original saml:Assertion-Element - */ - private Element samlAssertion; - /** - * the serializes saml:Assertion - */ - private String serializedSamlAssertion; - /** - * Element /saml:Assertion/saml:AttributeStatement/saml:Subject/saml:SubjectConfirmation/saml:SubjectConfirmationData/pr:Person - */ - private Element prPerson; - /** - * we need for each dsig:Reference Element all - * transformation elements - */ - private Element[] dsigReferenceTransforms; - - /** - * The issuing time of the identity link SAML assertion. - */ - private String issueInstant; - - /** - * we need all public keys stored in - * the identity link - */ - private PublicKey[] publicKey; - - /** - * Constructor for IdentityLink - */ - public IdentityLink() { - } - - /** - * Returns the dateOfBirth. - * @return Calendar - */ - public String getDateOfBirth() { - return dateOfBirth; - } - - /** - * Returns the familyName. - * @return String - */ - public String getFamilyName() { - return familyName; - } - - /** - * Returns the givenName. - * @return String - */ - public String getGivenName() { - return givenName; - } - - /** - * Returns the name. - * @return The name. - */ - public String getName() { - if (name == null) { - name = givenName + " " + familyName; - } - return name; - } - - /** - * Returns the identificationValue. - * "identificationValue" is the translation of "Stammzahl". - * @return String - */ - public String getIdentificationValue() { - return identificationValue; - } - - /** - * Returns the identificationType. - * "identificationType" type of the identificationValue in the IdentityLink. - * @return String - */ - public String getIdentificationType() { - return identificationType; - } - - /** - * Sets the dateOfBirth. - * @param dateOfBirth The dateOfBirth to set - */ - public void setDateOfBirth(String dateOfBirth) { - this.dateOfBirth = dateOfBirth; - } - - /** - * Sets the familyName. - * @param familyName The familyName to set - */ - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - - /** - * Sets the givenName. - * @param givenName The givenName to set - */ - public void setGivenName(String givenName) { - this.givenName = givenName; - } - - /** - * Sets the identificationValue. - * "identificationValue" is the translation of "Stammzahl". - * @param identificationValue The identificationValue to set - */ - public void setIdentificationValue(String identificationValue) { - this.identificationValue = identificationValue; - } - - /** - * Sets the Type of the identificationValue. - * @param identificationType The type of identificationValue to set - */ - public void setIdentificationType(String identificationType) { - this.identificationType = identificationType; - } - - /** - * Returns the samlAssertion. - * @return Element - */ - public Element getSamlAssertion() { - return samlAssertion; - } - - /** - * Returns the samlAssertion. - * @return Element - */ - public String getSerializedSamlAssertion() { - return serializedSamlAssertion; - } - - /** - * Sets the samlAssertion and the serializedSamlAssertion. - * @param samlAssertion The samlAssertion to set - */ - public void setSamlAssertion(Element samlAssertion) throws TransformerException, IOException { - this.samlAssertion = samlAssertion; - this.serializedSamlAssertion = DOMUtils.serializeNode(samlAssertion); - } - - /** - * Returns the dsigReferenceTransforms. - * @return Element[] - */ - public Element[] getDsigReferenceTransforms() { - return dsigReferenceTransforms; - } - - /** - * Sets the dsigReferenceTransforms. - * @param dsigReferenceTransforms The dsigReferenceTransforms to set - */ - public void setDsigReferenceTransforms(Element[] dsigReferenceTransforms) { - this.dsigReferenceTransforms = dsigReferenceTransforms; - } - - /** - * Returns the publicKey. - * @return PublicKey[] - */ - public PublicKey[] getPublicKey() { - return publicKey; - } - - /** - * Sets the publicKey. - * @param publicKey The publicKey to set - */ - public void setPublicKey(PublicKey[] publicKey) { - this.publicKey = publicKey; - } - - /** - * Returns the prPerson. - * @return Element - */ - public Element getPrPerson() { - return prPerson; - } - - /** - * Sets the prPerson. - * @param prPerson The prPerson to set - */ - public void setPrPerson(Element prPerson) { - this.prPerson = prPerson; - } - - /** - * Returns the issuing time of the identity link SAML assertion. - * - * @return The issuing time of the identity link SAML assertion. - */ - public String getIssueInstant() { - return issueInstant; - } - - /** - * Sets the issuing time of the identity link SAML assertion. - * - * @param issueInstant The issueInstant to set. - */ - public void setIssueInstant(String issueInstant) { - this.issueInstant = issueInstant; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java deleted file mode 100644 index 6b1f24aba..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java +++ /dev/null @@ -1,65 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import org.w3c.dom.Element; - -/** - * Contains an infobox token included in an InfoboxReadResponse. - * Depending on whether the token is extracted from an XMLContent or a - * Base64Content it is either returned as DOM element - * ({@link #getXMLToken()}) or base64 encoded string ({@link #getBase64Token()}). - * - * @author Harald Bratko - */ -public interface InfoboxToken { - - /** - * The key of the corresponding infobox. - * This is the value of Key attribute of the <Pair> child - * element in an <AssocArrayData> content of an InfoboxReadResponse. - * Maybe null if the InfoboxReadResponse conatains BinaryFileData. - * - * - * @return The key identifier of the corresponding infobox. - */ - public String getKey(); - - /** - * Specifies if this token is the first token (e.g in an array of tokens) included in an - * InfoboxReadResponse. If true this token is the token to be - * validated by a corresponding - * {@link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator InfoboxValidator}. - * If false this token maybe needed to validate the primary token. - * - * @return True if this token is the first token. - */ - public boolean isPrimary(); - - /** - * Returns the infobox token. - * Maybe null if the token is returned by method {@link #getBase64Token()} - * as base64 encoded string. - *
- * Note that this token is not validated against the - * application specific schema (e.g. Mandates schema in the mandates context). - * Thus the validating application has to validate the token - * against the appropriate schema. - * - * @return The infobox token. If null the token is returned by method - * {@link #getBase64Token()} as base64 encoded string. - */ - public Element getXMLToken(); - - /** - * Returns the infobox token. - * Maybe null if the token is returned by method {@link #getXMLToken()} - * as a DOM element. - *
- * Note, that the base64 encoded string actually may include more than one infobox - * elements. - * - * @return The infobox token. If null the token is returned by method - * {@link #getBase64Token()} as base64 encoded string. - */ - public String getBase64Token(); - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java deleted file mode 100644 index f1ff30a8a..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import org.w3c.dom.Element; - -/** - * This class contains an infobox token. - * - * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken - * - * @author Harald Bratko - */ -public class InfoboxTokenImpl implements InfoboxToken { - - /** - * The key of the infobox token. - */ - private String key_; - - /** - * Specifies whether this token is the primary (first in an array) token. - */ - private boolean primary_; - - /** - * The infobox token. - */ - private Element xmlToken_; - - /** - * The base64 encoded infobox token. - */ - private String base64Token_; - - /** - * Sets an XML infobox token. - * - * @param key The key of the infobox token. - * @param primary True this token is the primary (e.g .first in an array) - * token, otherwise false - * @param xmlToken The infobox token. - */ - public InfoboxTokenImpl(String key, boolean primary, Element xmlToken) { - key_ = key; - primary_ = primary; - xmlToken_ = xmlToken; - base64Token_ = null; - } - - /** - * Sets a base64 encoded infobox token. - * - * @param key The key of the infobox token. - * @param primary True this token is the primary (e.g .first in an array) - * token, otherwise false - * @param base64Token The base64 encoded infobox token. - */ - public InfoboxTokenImpl(String key, boolean primary, String base64Token) { - key_ = key; - primary_ = primary; - base64Token_ = base64Token; - xmlToken_ = null; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#getKey() - */ - public String getKey() { - return key_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#isPrimary() - */ - public boolean isPrimary() { - return primary_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#getXMLToken() - */ - public Element getXMLToken() { - return xmlToken_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#getBase64Token() - */ - public String getBase64Token() { - return base64Token_; - } - - /** - * Sets the key of the infobox token. - * - * @param key The key of the infobox token. - */ - public void setKey(String key) { - key_ = key; - } - - /** - * Specifies whether this token is the primary (e.g. first in an array) token. - * - * @param primary True this token is the primary (e.g .first in an array) - * token, otherwise false. - */ - public void setPrimary(boolean primary) { - primary_ = primary; - } - - /** - * Sets the base64 encoded token. - * - * @param base64Token The base64 encoded token. - */ - public void setBase64Token(String base64Token) { - base64Token_ = base64Token; - } - - /** - * Sets the infobox token. - * - * @param xmlToken The infobox token. - */ - public void setXmlToken(Element xmlToken) { - xmlToken_ = xmlToken; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java deleted file mode 100644 index b8dd7f18e..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java +++ /dev/null @@ -1,57 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - - -/** - * Includes the result of an extended infobox validation. - * - * If validation succeeds, an array of - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute ExtendedSAMLAttributes} - * maybe provided. Each of these SAML-Attributes will be either appended to the - * final SAML-Assertion passed to the online application or to the AUTH-Block, - * or to both. - *
- * If validation fails the implementing class has to provide a short error message. - * - * @author Harald Bratko - */ -public interface InfoboxValidationResult { - - /** - * The method returns true if validation succeeds. In that case - * method {@link #getExtendedSamlAttributes()} may provide an array of - * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute - * ExtendedSAMLAttributes} that should be appended to the final SAML-Assertion or the - * AUTH-Block or to both. - *
- * The method returns false if validation fails. In that case - * method {@link #getErrorMessage()} has to provide a short error description. - * - * @return True if validation succeeds, - * otherwise false. - */ - public boolean isValid(); - - /** - * Returns an array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute - * ExtendedSAMLAttributes} that should be added to the SAML-Assertion - * provided to the online application. - * The SAML-Attributes in that array will be added to the final - * SAML-Assertion, the AUTH-Block, or both, exactly in the order as they are arranged - * in the array this method returns. - * - * @return An array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute - * ExtendedSAMLAttributes} that should be added to the SAML-Assertion - * provided to the online application, the AUTH-Block, or both. If no attributes should - * be added this array maybe null or empty. - */ - public ExtendedSAMLAttribute[] getExtendedSamlAttributes(); - - /** - * A short error description that should be displayed by MOA-ID if - * validation of the InfoBoxReadResponse fails. - * - * @return An short error message if validation fails. - */ - public String getErrorMessage(); - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java deleted file mode 100644 index 97f52fb55..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - - -/** - * Default implementation of the {@link InfoboxValidationResult} interface. - * - * @author Harald Bratko - */ -public class InfoboxValidationResultImpl implements InfoboxValidationResult { - - /** - * Indicates whether the validation was successful or not. - */ - protected boolean valid_; - - /** - * The error message. - */ - protected String errorMessage_; - - /** - * The SAML attributes returned by the infobox validator. - */ - protected ExtendedSAMLAttribute[] extendedSamlAttributes_; - - /** - * Empty constructor. - */ - public InfoboxValidationResultImpl() { - } - - /** - * Constructor to set all values. - * - * @param valid Global validation result. - * @param extendedSamlAttributes SAML attributes that should be appended to the final - * SAML Assertion or to the AUTH Block - * or to both. - * @param errorMessage An error message if infobox validation fails. - */ - public InfoboxValidationResultImpl( - boolean valid, - ExtendedSAMLAttribute[] extendedSamlAttributes, - String errorMessage) - { - valid_ = valid; - extendedSamlAttributes_ = extendedSamlAttributes; - errorMessage_ = errorMessage; - } - - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#getErrorMessage() - */ - public String getErrorMessage() { - return errorMessage_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#getExtendedSamlAttributes() - */ - public ExtendedSAMLAttribute[] getExtendedSamlAttributes() { - return extendedSamlAttributes_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#isValid() - */ - public boolean isValid() { - return valid_; - } - - /** - * Sets the error message if validation fails.. - * - * @param errorMessage The error message to set. - */ - public void setErrorMessage(String errorMessage) { - errorMessage_ = errorMessage; - } - - /** - * Sets the SAML attributes returned by the infobox validatior.. - * - * @param extendedSamlAttributes The SAML attributes returned by the infobox validator. - */ - public void setExtendedSamlAttributes(ExtendedSAMLAttribute[] extendedSamlAttributes) { - extendedSamlAttributes_ = extendedSamlAttributes; - } - - /** - * Sets validation result.. - * - * @param valid True if the infobox could be validated successfully, - * otherwise false. - */ - public void setValid(boolean valid) { - valid_ = valid; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java deleted file mode 100644 index c7a557290..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java +++ /dev/null @@ -1,172 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import java.security.PublicKey; -import java.util.List; - -import org.w3c.dom.Element; - -/** - * Parameters for validating an infobox. - * - * This interface is used by MOA-ID to provide parameters to an - * {link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator - * InfoboxValidator}. - * - * @author Harald Bratko - */ -public interface InfoboxValidatorParams { - - /** - * Returns a list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} - * objects. The first token in this list is the one to be validated. Each further token - * maybe needed to validate this first token. - * - * @return A list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} - * objects. - */ - public List getInfoboxTokenList(); - - /** - * Returns the ID of the trust profile to be used for validating - * certificates. Maybe ignored by a validator, if no certificates - * has to be validated. - * - * @return The ID of a trust profile. - */ - public String getTrustProfileID(); - - /** - * Returns schema location URIs that may be needed by the - * validator to parse infobox tokens. - * Each entry in the list is a {@link Schema} specifying the location - * of an XML schema. - * - * @return A list of {@link Schema} objects each of them specifying the - * location of an XML schema. - */ - public List getSchemaLocations(); - - /** - * Returns the URL of the BKU. - * Maybe needed by a validator. - * - * @return The url of the BKU. - */ - public String getBkuURL(); - - /** - * Returns the target parameter. - * null in the case of a business service. - * - * @return The target parameter. - */ - public String getTarget(); - - /** - * Returns true if the application is a business - * service, otherwise false. This may be useful - * for the validating application. - * - * @return True if the application is a business - * service, otherwise false - */ - public boolean getBusinessApplication(); - - /** - * Returns the family name from the identity link. - * Maybe needed by a validator. - * - * @return The family name from the identity link. - */ - public String getFamilyName(); - - /** - * Returns the given name from the identity link. - * Maybe needed by a validator. - * - * @return The given name from the identity link. - */ - public String getGivenName(); - - /** - * The date of birth from the identity link. - * The method returns the value of the - * element from the identity link. - * Maybe needed by a validator. - * - * @return The date of birth from the identity link. - */ - public String getDateOfBirth(); - - /** - * Returns he identification value from the identity - * link. This may be the Stammzahl - * in the case of a public application or the - * wbPK in the case of a business - * application. This parameter is only returned - * if specified within the config file. - * - * @return The identification value from the identity link. - */ - public String getIdentificationValue(); - - /** - * Returns the type of the identification value - * from the identity link. This may be - * especially of interest for business - * applications. - * - * @return The type of the identification value - * from the identity link. - */ - public String getIdentificationType(); - - /** - * Returns the public keys from the identity link. - * Maybe needed by the application. - * - * @return PublicKey[] The public keys from the - * identity link. - */ - public PublicKey[] getPublicKeys(); - - /** - * Returns the identity link. - * A validator may need other data from the identity link, than - * family name, given name, date of birth and identification value. - * The identity link element is only returned if specified within the - * config file. - * - * @return The identity link. - */ - public Element getIdentityLink(); - - /** - * Indicates whether source pins (Stammzahlen) should be hidden or not. - * If an online application lying behind MOA-ID is not allowed to get source pins - * (Stammzahlen), any source pins within SAML attributes - * returned by the validator must suppressed:
- * If the parameter getHideStammzahl is true, then the validator - * MUST hide (replace by an empty string) any source pin (Stammzahl) - * that may be included in a SAML attribute returned by the validator. - * - * @return true if source pins (Stammzahlen) must be hidden, - * otherwise false. - */ - public boolean getHideStammzahl(); - - /** - * Returns application specific parameters. - * Each child element of this element contains - * a validating application specific parameter. The - * element is passed as specified within the config - * file and its up to the implementing class to - * parse and interprete its children. - * - * @return Application specific parameters. - */ - public Element getApplicationSpecificParams(); - -} - - diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java deleted file mode 100644 index 80ba5995f..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java +++ /dev/null @@ -1,348 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import java.security.PublicKey; -import java.util.List; - -import org.w3c.dom.Element; - -/** - * Parameters for validating an infobox. - * - * This interface is used by MOA-ID to provide parameters to an - * {link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator - * InfoboxValidator}. - * - * @author Harald Bratko - */ -public class InfoboxValidatorParamsImpl implements InfoboxValidatorParams { - - /** - * A list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} objects. - * The first token in this list is the one to be validated. Each further token - * maybe needed to validate this first token. - */ - protected List infoboxTokenList_; - - /** - * The ID of the trust profile used for validating certificates. - */ - protected String trustProfileID_; - - /** - * The locations of schemas that maybe needed for validating infobox tokens. - */ - protected List schemaLocations_; - - /** - * The URL of the BKU. - */ - protected String bkuURL_; - - /** - * Specifies whether the current online application is a business or a public application. - */ - protected boolean businessApplication_; - - /** - * The target parameter. - */ - protected String target_; - - /** - * The family name from the identity link. - */ - protected String familyName_; - - /** - * The given name from the identity link. - */ - protected String givenName_; - - /** - * The date of birth from the identity link. - */ - protected String dateOfBirth_; - - /** - * The date of identification value. - */ - protected String identificationValue_; - - /** - * The identification type. - */ - protected String identificationType_; - - /** - * The public keys from the identity link. - */ - protected PublicKey[] publicKeys_; - - /** - * The identity link. - */ - protected Element identityLink_; - - /** - * Indicates whether source pins (Stammzahlen) must be hidden or not. - */ - protected boolean hideStammzahl_; - - /** - * Application specific parameters. - */ - protected Element applicationSpecificParams_; - - /** - * Empty constructor. - */ - public InfoboxValidatorParamsImpl() { - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getInfoboxTokenList() - */ - public List getInfoboxTokenList() { - return infoboxTokenList_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getTrustProfileID() - */ - public String getTrustProfileID() { - return trustProfileID_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getSchemaLocations() - */ - public List getSchemaLocations() { - return schemaLocations_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getBkuURL() - */ - public String getBkuURL() { - return bkuURL_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getTarget() - */ - public String getTarget() { - return target_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getBusinessApplication() - */ - public boolean getBusinessApplication() { - return businessApplication_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getFamilyName() - */ - public String getFamilyName() { - return familyName_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getGivenName() - */ - public String getGivenName() { - return givenName_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getDateOfBirth() - */ - public String getDateOfBirth() { - return dateOfBirth_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getIdentificationValue() - */ - public String getIdentificationValue() { - return identificationValue_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getIdentificationType() - */ - public String getIdentificationType() { - return identificationType_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getPublicKeys() - */ - public PublicKey[] getPublicKeys() { - return publicKeys_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getIdentityLink() - */ - public Element getIdentityLink() { - return identityLink_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getHideStammzahl() - */ - public boolean getHideStammzahl() { - return hideStammzahl_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getApplicationSpecificParams() - */ - public Element getApplicationSpecificParams() { - return applicationSpecificParams_; - } - - /** - * Sets the application specific parameters. - * - * @param applicationSpecificParams The application specific parameters to set. - */ - public void setApplicationSpecificParams(Element applicationSpecificParams) { - applicationSpecificParams_ = applicationSpecificParams; - } - - /** - * Sets the bku URL. - * - * @param bkuURL The bku URL to set. - */ - public void setBkuURL(String bkuURL) { - bkuURL_ = bkuURL; - } - - /** - * Sets the business application parameter. - * - * @param businessApplication The business application parameter to set. - * (True if the application is a business - * application, otherwies false). - */ - public void setBusinessApplication(boolean businessApplication) { - businessApplication_ = businessApplication; - } - - /** - * Sets the date of birth. - * - * @param dateOfBirth The date of birth. - */ - public void setDateOfBirth(String dateOfBirth) { - dateOfBirth_ = dateOfBirth; - } - - /** - * Sets the family name. - * - * @param familyName The family name. - */ - public void setFamilyName(String familyName) { - familyName_ = familyName; - } - - /** - * Sets the given name. - * - * @param givenName The given name. - */ - public void setGivenName(String givenName) { - givenName_ = givenName; - } - - /** - * Sets the identification type. - * - * @param identificationType The identification type. - */ - public void setIdentificationType(String identificationType) { - identificationType_ = identificationType; - } - - /** - * Sets the identification value. - * - * @param identificationValue The identification value. - */ - public void setIdentificationValue(String identificationValue) { - identificationValue_ = identificationValue; - } - - /** - * Sets the identity link. - * - * @param identityLink The identity link. - */ - public void setIdentityLink(Element identityLink) { - identityLink_ = identityLink; - } - - /** - * Sets the infobox token to be validated. - * - * @param infoboxTokenList A list {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} - * objects. - */ - public void setInfoboxTokenList(List infoboxTokenList) { - infoboxTokenList_ = infoboxTokenList; - } - - /** - * Sets the public Keys. - * - * @param publicKeys The public keys. - */ - public void setPublicKeys(PublicKey[] publicKeys) { - publicKeys_ = publicKeys; - } - - /** - * Sets the schema locations. - * - * @param schemaLocations The schema locations. A list of - * {@link Schema} objects. - */ - public void setSchemaLocations(List schemaLocations) { - schemaLocations_ = schemaLocations; - } - - /** - * Sets the target. - * - * @param target The target. - */ - public void setTarget(String target) { - target_ = target; - } - - /** - * Sets the ID of the trust profile used for validating certificates. - * - * @param trustProfileID the ID of the trust profile used for validating certificates. - */ - public void setTrustProfileID(String trustProfileID) { - trustProfileID_ = trustProfileID; - } - - /** - * Sets the {@link #hideStammzahl_} parameter. This indicates whether source pins - * (Stammzahlen) must be hidden or not. - * - * @param hideStammzahl True if source pins (Stammzahlen) should - * be hidden, otherwise false. - */ - public void setHideStammzahl(boolean hideStammzahl) { - hideStammzahl_ = hideStammzahl; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java deleted file mode 100644 index 76ba6366d..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java +++ /dev/null @@ -1,79 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -/** - * This bean saves all data of a single SAMLAttribute: - * the name, value and namespace - * - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class SAMLAttribute { - - /** the name to be stored */ - private String name; - /** the namespace to be stored */ - private String namespace; - /** the value to be stored */ - private Object value; - - /** - * Constructor for SAMLAttribute. - */ - public SAMLAttribute(String name, String namespace, Object value) { - - this.name = name; - this.namespace = namespace; - this.value = value; - - } - - /** - * Returns the name. - * @return String - */ - public String getName() { - return name; - } - - /** - * Returns the namespace. - * @return String - */ - public String getNamespace() { - return namespace; - } - - /** - * Returns the value. - * @return String - */ - public Object getValue() { - return value; - } - - /** - * Sets the name. - * @param name The name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * Sets the namespace. - * @param namespace The namespace to set - */ - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - /** - * Sets the value. - * @param value The value to set - */ - public void setValue(Object value) { - this.value = value; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/Schema.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/Schema.java deleted file mode 100644 index c113f16b8..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/Schema.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -/** - * Specifies the location of a schema. - * - * @author Harald Bratko - */ -public interface Schema { - - /** - * The namespace URI of this schema. - * - * @return The namespace of this schema. - */ - public String getNamespace(); - - /** - * The location URI of this schema. - * Relative paths have to be interpreted relative to the - * location of the MOA-ID config file. - * - * @return The location URI of this schema. - */ - public String getSchemaLocation(); - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java deleted file mode 100644 index 964725416..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -/** - * This class specifies the location of a schema. - * - * @author Harald Bratko - */ -public class SchemaImpl implements Schema { - - /** - * The namespace of this schema. - */ - protected String namespace_; - - /** - * The location (URI) of this schema; - */ - protected String schemaLocation_; - - /** - * Sets the namespace and schema location URIS of this schema. - * - * @param namespace The namespace URI of this schema. - * @param schemaLocation The location URI of this schema. - */ - public SchemaImpl(String namespace, String schemaLocation) { - namespace_ = namespace; - schemaLocation_ = schemaLocation; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.Schema#getNamespace() - */ - public String getNamespace() { - return namespace_; - } - - /** - * @see at.gv.egovernment.moa.id.auth.data.Schema#getSchemaLocation() - */ - public String getSchemaLocation() { - return schemaLocation_; - } - - /** - * Sets the namespace. - * - * @param namespace The namespace to set. - */ - public void setNamespace(String namespace) { - namespace_ = namespace; - } - - /** - * Sets the location URI of this schema. - * - * @param schemaLocation The schemaLocation to set. - */ - public void setSchemaLocation(String schemaLocation) { - schemaLocation_ = schemaLocation; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java deleted file mode 100644 index 8233d1478..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java +++ /dev/null @@ -1,177 +0,0 @@ -package at.gv.egovernment.moa.id.auth.data; - -import iaik.x509.X509Certificate; - -/** - * This bean saves all information of the MOA-SP-Answer - * after the verification of any signature - * - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class VerifyXMLSignatureResponse { - /** The xmlDsigSubjectName to be stored */ - private String xmlDsigSubjectName; - /** The signatureCheckCode to be stored */ - private int signatureCheckCode; - /** The xmlDSIGManifestCheckCode to be stored */ - private int xmlDSIGManifestCheckCode; - /** The xmlDSIGManigest to be stored */ - private boolean xmlDSIGManigest; - /** The certificateCheckCode to be stored */ - private int certificateCheckCode; - /** The publicAuthority to be stored */ - private boolean publicAuthority; - /** The publicAuthorityCode to be stored */ - private String publicAuthorityCode; - /** The qualifiedCertificate to be stored */ - private boolean qualifiedCertificate; - /** The x509certificate to be stored */ - private X509Certificate x509certificate; - - /** - * Returns the certificateCheckCode. - * @return int - */ - public int getCertificateCheckCode() { - return certificateCheckCode; - } - - /** - * Returns the signatureCheckCode. - * @return int - */ - public int getSignatureCheckCode() { - return signatureCheckCode; - } - - /** - * Returns the xmlDSIGManifestCheckCode. - * @return int - */ - public int getXmlDSIGManifestCheckCode() { - return xmlDSIGManifestCheckCode; - } - - /** - * Returns the xmlDsigSubjectName. - * @return String - */ - public String getXmlDsigSubjectName() { - return xmlDsigSubjectName; - } - - /** - * Sets the certificateCheckCode. - * @param certificateCheckCode The certificateCheckCode to set - */ - public void setCertificateCheckCode(int certificateCheckCode) { - this.certificateCheckCode = certificateCheckCode; - } - - /** - * Sets the signatureCheckCode. - * @param signatureCheckCode The signatureCheckCode to set - */ - public void setSignatureCheckCode(int signatureCheckCode) { - this.signatureCheckCode = signatureCheckCode; - } - - /** - * Sets the xmlDSIGManifestCheckCode. - * @param xmlDSIGManifestCheckCode The xmlDSIGManifestCheckCode to set - */ - public void setXmlDSIGManifestCheckCode(int xmlDSIGManifestCheckCode) { - this.xmlDSIGManifestCheckCode = xmlDSIGManifestCheckCode; - } - - /** - * Sets the xmlDsigSubjectName. - * @param xmlDsigSubjectName The xmlDsigSubjectName to set - */ - public void setXmlDsigSubjectName(String xmlDsigSubjectName) { - this.xmlDsigSubjectName = xmlDsigSubjectName; - } - - /** - * Returns the publicAuthorityCode. - * @return int - */ - public String getPublicAuthorityCode() { - return publicAuthorityCode; - } - - /** - * Sets the publicAuthorityCode. - * @param publicAuthorityCode The publicAuthorityCode to set - */ - public void setPublicAuthorityCode(String publicAuthorityCode) { - this.publicAuthorityCode = publicAuthorityCode; - } - - /** - * Returns the qualifiedCertificate. - * @return boolean - */ - public boolean isQualifiedCertificate() { - return qualifiedCertificate; - } - - /** - * Returns the x509certificate. - * @return X509Certificate - */ - public X509Certificate getX509certificate() { - return x509certificate; - } - - /** - * Sets the qualifiedCertificate. - * @param qualifiedCertificate The qualifiedCertificate to set - */ - public void setQualifiedCertificate(boolean qualifiedCertificate) { - this.qualifiedCertificate = qualifiedCertificate; - } - - /** - * Sets the x509certificate. - * @param x509certificate The x509certificate to set - */ - public void setX509certificate(X509Certificate x509certificate) { - this.x509certificate = x509certificate; - } - - /** - * Returns the xmlDSIGManigest. - * @return boolean - */ - public boolean isXmlDSIGManigest() { - return xmlDSIGManigest; - } - - /** - * Sets the xmlDSIGManigest. - * @param xmlDSIGManigest The xmlDSIGManigest to set - */ - public void setXmlDSIGManigest(boolean xmlDSIGManigest) { - this.xmlDSIGManigest = xmlDSIGManigest; - } - - /** - * Returns the publicAuthority. - * @return boolean - */ - public boolean isPublicAuthority() { - return publicAuthority; - } - - /** - * Sets the publicAuthority. - * @param publicAuthority The publicAuthority to set - */ - public void setPublicAuthority(boolean publicAuthority) { - this.publicAuthority = publicAuthority; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java b/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java deleted file mode 100644 index a18cf7322..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java +++ /dev/null @@ -1,92 +0,0 @@ -package at.gv.egovernment.moa.id.auth.invoke; - -import java.util.Vector; - -import javax.xml.namespace.QName; -import javax.xml.rpc.Call; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceFactory; - -import org.apache.axis.message.SOAPBodyElement; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.ServiceException; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.spss.api.SignatureVerificationService; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * Invoker of the SignatureVerification web service of MOA-SPSS.
- * Either invokes the web service, or calls the corresponding API, depending on configuration data. - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class SignatureVerificationInvoker { - /** This QName Object identifies the SignatureVerification endpoint of the web service */ - private static final QName SERVICE_QNAME = new QName("SignatureVerification"); - - /** - * Method verifyXMLSignature. - * @param request to be sent - * @return Element with the answer - * @throws ServiceException if an error occurs - */ - public Element verifyXMLSignature(Element request) throws ServiceException { - return doCall(SERVICE_QNAME, request); - } - - /** - * Method doCall. - * @param serviceName the name of the service - * @param request the request to be sent - * @return Element the answer - * @throws ServiceException if an error occurs - */ - protected Element doCall(QName serviceName, Element request) throws ServiceException { - ConnectionParameter authConnParam = null; - try { - Service service = ServiceFactory.newInstance().createService(serviceName); - Call call = service.createCall(); - SOAPBodyElement body = new SOAPBodyElement(request); - SOAPBodyElement[] params = new SOAPBodyElement[] { body }; - Vector responses; - SOAPBodyElement response; - - String endPoint; - AuthConfigurationProvider authConfigProvider = AuthConfigurationProvider.getInstance(); - authConnParam = authConfigProvider.getMoaSpConnectionParameter(); - //If the ConnectionParameter do NOT exist, we try to get the api to work.... - if (authConnParam != null) { - endPoint = authConnParam.getUrl(); - call.setTargetEndpointAddress(endPoint); - responses = (Vector) call.invoke(serviceName, params); - response = (SOAPBodyElement) responses.get(0); - return response.getAsDOM(); - } - else { - SignatureVerificationService svs = SignatureVerificationService.getInstance(); - VerifyXMLSignatureRequest vsrequest = new VerifyXMLSignatureRequestParser().parse(request); - - VerifyXMLSignatureResponse vsresponse = svs.verifyXMLSignature(vsrequest); - Document result = new VerifyXMLSignatureResponseBuilder().build(vsresponse); - - Logger.setHierarchy("moa.id.auth"); - return result.getDocumentElement(); - } - } - catch (Exception ex) { - if (authConnParam != null) { - throw new ServiceException("service.00", new Object[] { ex.toString()}, ex); - } else { - throw new ServiceException("service.03", new Object[] { ex.toString()}, ex); - } - } - } -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java deleted file mode 100644 index a8b870f04..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java +++ /dev/null @@ -1,193 +0,0 @@ -package at.gv.egovernment.moa.id.auth.parser; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.id.auth.data.SAMLAttribute; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parses an <InfoboxReadResponse> returned from - * the security layer - * - * @author Stefan Knirsch - * @version $Id$ - */ - -public class CreateXMLSignatureResponseParser { - // - // XPath namespace prefix shortcuts - // - - /** Xpath prefix for reaching SAML Namespaces */ - private static final String SAML = Constants.SAML_PREFIX + ":"; - /** Xpath prefix for reaching XML-DSIG Namespaces */ - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - /** Xpath expression to the root element */ - private static final String ROOT = ":CreateXMLSignatureResponse/"; - /** Xpath expression to the SAML:Assertion element */ - private static final String SAML_ASSERTION_XPATH = ROOT + SAML + "Assertion"; - /** Xpath expression to the SAML:NameIdentifier element */ - private static final String SAML_SUBJECT_NAME_IDENTIFIER_XPATH = SAML_ASSERTION_XPATH + "/" + SAML + "AttributeStatement/" + SAML + "Subject/" + SAML + "NameIdentifier"; - /** Xpath expression to the AttributeStatement element */ - private static final String SAML_ATTRIBUTE_XPATH = SAML_ASSERTION_XPATH + "/" + SAML + "AttributeStatement/" + SAML + "Attribute"; - /** Xpath expression to the AttributeValue element */ - private static final String SAML_ATTRIBUTE_VALUE_XPATH = SAML + "AttributeValue"; - - - /** This is the root element of the CreateXMLsignatureResponse */ - private Element sigResponse_; - - /** - * Parses and validates the document given as string and extracts the - * root element. - * - * @param xmlResponse <CreateXMLSignatureResponse> as String - * - * @throws AuthenticationException if any authentication error occurs - * @throws ParseException if an element cannot be parsed - */ - public CreateXMLSignatureResponseParser(String xmlResponse) throws AuthenticationException, ParseException { - try { - InputStream s = new ByteArrayInputStream(xmlResponse.getBytes("UTF-8")); - init(s); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - } - - /** - * Parses and validates the document given as stream and extracts the - * root element. - * - * @param is <InfoboxReadResponse> as InputStream - * - * @throws AuthenticationException If any authentication error occurs - * @throws ParseException If an element cannot be parsed - */ - public CreateXMLSignatureResponseParser(InputStream is) throws AuthenticationException, ParseException { - init(is); - } - - /** - * Constructor for CreateXMLSignatureResponseParser. - * The incoming Element will be used for further operations - * @param xmlResponse <InfoboxReadResponse> as InputStream - */ - public CreateXMLSignatureResponseParser(Element xmlResponse) { - sigResponse_ = xmlResponse; - } - - /** - * Initializes the parser. - * Parses and validates the document given as stream and extracts the - * root element. - * - * @param is The CreateXMLSignatureResponse as stream. - * @throws AuthenticationException if an authentication error occurs. - * @throws ParseException If an error occurs on parsing the the document. - */ - private void init(InputStream is) throws AuthenticationException, ParseException { - try { - - Element responseElem = DOMUtils.parseXmlValidating(is); - - if ("CreateXMLSignatureResponse".equals(responseElem.getLocalName())) { - sigResponse_ = responseElem; - } else { - ErrorResponseParser erp = new ErrorResponseParser(responseElem); - throw new AuthenticationException("auth.08", new Object[] { erp.getErrorCode(), erp.getErrorInfo()}); - } - - } catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - } - - /** - * Unmarshalls the <@link sigResponse> to an - * <CreateXMLSignatureResponse> object. - * - * @return a <CreateXMLSignatureResponse> object - * @throws ParseException - */ - - public CreateXMLSignatureResponse parseResponse() throws ParseException { - CreateXMLSignatureResponse cResp; - try { - cResp = new CreateXMLSignatureResponse(); - String slPrefix = XPathUtils.getSlPrefix(sigResponse_); - cResp.setSamlNameIdentifier(XPathUtils.getElementValue(sigResponse_, "/" + slPrefix + SAML_SUBJECT_NAME_IDENTIFIER_XPATH, null)); - cResp.setSamlAssertion((Element) XPathUtils.selectSingleNode(sigResponse_, "/" + slPrefix + SAML_ASSERTION_XPATH)); - NodeIterator attrIter = XPathUtils.selectNodeIterator(sigResponse_, "/" + slPrefix + SAML_ATTRIBUTE_XPATH); - Element samlAttr; - List samlAttributes = new ArrayList(); - while ((samlAttr = (Element) attrIter.nextNode()) != null) { - String attrName = XPathUtils.getAttributeValue(samlAttr, "@AttributeName", ""); - String attrNamespace = XPathUtils.getAttributeValue(samlAttr, "@AttributeNamespace", ""); - Object attrValue; - Element attrValueElem = (Element)XPathUtils.selectSingleNode(samlAttr, SAML_ATTRIBUTE_VALUE_XPATH); - attrValue = DOMUtils.getElementFromNodeList(attrValueElem.getChildNodes()); - if (attrValue == null) { - if (null!=attrValueElem.getFirstChild()) { - attrValue = attrValueElem.getFirstChild().getNodeValue(); - } else { - attrValue = ""; - } - } - samlAttributes.add(new SAMLAttribute(attrName, attrNamespace, attrValue)); - } - SAMLAttribute[] result = new SAMLAttribute[samlAttributes.size()]; - samlAttributes.toArray(result); - cResp.setSamlAttributes(result); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - return cResp; - } - -// public CreateXMLSignatureResponse parseResponse() throws ParseException { -// CreateXMLSignatureResponse cResp; -// try { -// cResp = new CreateXMLSignatureResponse(); -// Element samlAssertion = (Element)sigResponse.getElementsByTagNameNS(Constants.SAML_NS_URI, "Assertion").item(0); -// cResp.setSamlAssertion(samlAssertion); -// Element samlAttributeStatement = (Element)samlAssertion.getElementsByTagNameNS(Constants.SAML_NS_URI, "AttributeStatement").item(0); -// Element samlSubject = (Element)samlAttributeStatement.getElementsByTagNameNS(Constants.SAML_NS_URI, "Subject").item(0); -// Element samlNameIdentifier = (Element)samlSubject.getElementsByTagNameNS(Constants.SAML_NS_URI, "NameIdentifier").item(0); -// cResp.setSamlNameIdentifier(samlNameIdentifier.getFirstChild().getNodeValue()); -// NodeList nl = samlAttributeStatement.getElementsByTagNameNS(Constants.SAML_NS_URI, "Attribute"); -// List samlAttributes = new ArrayList(); -// for (int i=0; i<ErrorResponse>. - * - * @author Stefan Knirsch - * @version $Id$ - */ - -public class ErrorResponseParser { - - /** - * The error code included in this error response. - * 1000 is used as default value, if some problems occur on - * evaluating the error response. - */ - private String errorCode_ = "1000"; - - /** - * The error info included in this error response. - * <Unklassifizierter Fehler.> is used as default value, - * if some problems occur on evaluating the error response. - */ - private String errorInfo_ = "Unklassifizierter Fehler."; - - - /** - * This Constructor extracts the error code and error info included in this - * error response. - * - * @param errorElement The error element. This is the root element of - * the error response. - */ - public ErrorResponseParser(Element errorElement) throws ParseException { - if (errorElement != null) { - String namespace = errorElement.getNamespaceURI(); - NodeList nl = errorElement.getElementsByTagNameNS(namespace, "ErrorCode"); - if (nl.getLength() == 1) { - errorCode_ = ((Element)nl.item(0)).getFirstChild().getNodeValue(); - } - nl = errorElement.getElementsByTagNameNS(namespace, "Info"); - if (nl.getLength() == 1) { - errorInfo_ = ((Element)nl.item(0)).getFirstChild().getNodeValue(); - } - } - } - - /** - * Returns the error code included in this error response. - */ - public String getErrorCode() { - return errorCode_ ; - } - - /** - * Returns the information included in this error response. - * @return The error infomation String - */ - public String getErrorInfo() { - return errorInfo_ ; - } - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java deleted file mode 100644 index e493f07fb..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java +++ /dev/null @@ -1,157 +0,0 @@ -package at.gv.egovernment.moa.id.auth.parser; - -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.InfoboxToken; -import at.gv.egovernment.moa.id.auth.data.InfoboxTokenImpl; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * Parses and unmarshales InfoboxReadResponse. - * This parser is especially used for parsing additional responses (additional to that - * one containing the IdentityLink retuned from the BKU as an answer of - * a <PushInfobox> request. - */ -public class ExtendedInfoboxReadResponseParser { - - /** - * Hide default constructor. - */ - private ExtendedInfoboxReadResponseParser() { - } - - /** - * Parses and unmarshales the given infoboxReadResponse to a list of - * {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} objects. - * The method parses the given infoboxReadResponse - * - * @param infoboxReadResponse The infobox read response to be unmarshaled. - * @param infoboxName The name of the infobox the reponse corresponds to. - * - * @return A list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} - * objects. Maybe empty. - * - * @throws ParseException If an error occurs on parsing and unmarshaling the response. - */ - public static List parseInfoboxReadResponse(String infoboxReadResponse, String infoboxName) - throws ParseException - { - Element infoboxReadResponseElem = null; - try { - Document doc = - DOMUtils.parseDocument(infoboxReadResponse, true, Constants.ALL_SCHEMA_LOCATIONS, null); - infoboxReadResponseElem = doc.getDocumentElement(); - } catch (Exception e) { - Logger.error("InfoboxReadResponse for \"" + infoboxName + - "\"-infobox could not be parsed successfully: " + e.getMessage()); - throw new ParseException("parser.01", new Object[] {infoboxName + "-InfoboxReadResponse"}); - } - - Vector infoboxTokenList = new Vector(); - - if (infoboxReadResponseElem != null) { - // avoid using namespace URI or prefix, because it might change within the response - // (e.g.: sl11-namespace, some child sl10-namespace - List infoboxReadResponseChildren = DOMUtils.getChildElements(infoboxReadResponseElem); - String key = null; - boolean primary = true; - Element infoboxReadResponseChild = (Element)infoboxReadResponseChildren.get(0); - String infoboxReadResponseChildName = infoboxReadResponseChild.getLocalName(); - if (infoboxReadResponseChildName.equals("AssocArrayData")) { - // get the child elements from the element - List assocArrayPairs = DOMUtils.getChildElements(infoboxReadResponseChild); - Iterator assocArrayPairIt = assocArrayPairs.iterator(); - int pairCount = 0; - // step through the elemnts - while (assocArrayPairIt.hasNext()) { - Element assocArrayPair = (Element)assocArrayPairIt.next(); - // check if the element actually a "Pair" element and not only a "key" - if (assocArrayPair.getLocalName().equals("Key")) { - // do not accept only a Key - throw new ParseException("parser.07", new Object[] {infoboxName}); - } - key = assocArrayPair.getAttribute("Key"); - if (pairCount > 0) { - primary = false; - } - pairCount++; - infoboxTokenList.addAll(getTokenFromXMLOrBase64Content(assocArrayPair, infoboxName, key, primary)); - } - - } else if (infoboxReadResponseChildName.equals("BinaryFileData")) { - infoboxTokenList.addAll(getTokenFromXMLOrBase64Content(infoboxReadResponseChild, infoboxName, null, true)); - } - } - return infoboxTokenList; - } - - /** - * Unmarshales the <XMLContent> or - * <Base64Content> child of the given element to a list of - * infobox token. - * - * @param contentParent The elment including the <XMLContent> or - * <Base64Content> child to unmarshal the - * infobox token from. - * @param infoboxName The name of the infobox. - * @param key The key of an AssocArrayData-Pair. - * Maybe null. - * @param primary Specifies whether this token is the first (e.g. in an - * AssocArrayData) token. - * - * @return A infobox token list. - * - * @throws ParseException If the contentParent has no <XMLContent> - * or <Base64Content> child or the - * <XMLContent> is empty. - */ - public static List getTokenFromXMLOrBase64Content( - Element contentParent, - String infoboxName, - String key, - boolean primary) - throws ParseException - { - Vector tokenList = new Vector(); - // get the or - List content = DOMUtils.getChildElements(contentParent); - if (content.size() == 1) { - Element contentElem = (Element)content.get(0); - if (contentElem.getLocalName().equals("XMLContent")) { - List xmlContentChildren = DOMUtils.getChildElements(contentElem); - if (xmlContentChildren.size() == 0) { - throw new ParseException("parser.06", new Object[] {infoboxName, "Inhalt", "XMLContent"}); - } - int xmlCount = 0; - Iterator contentIt = xmlContentChildren.iterator(); - while (contentIt.hasNext()) { - Element xmlToken = (Element)contentIt.next(); - if (xmlCount > 0) { - primary = false; - } - InfoboxToken infoboxToken = new InfoboxTokenImpl(key, primary, xmlToken); - tokenList.add(infoboxToken); - xmlCount++; - } - } else { - String base64Token = contentElem.getFirstChild().getNodeValue(); - InfoboxToken infoboxToken = new InfoboxTokenImpl(key, primary, base64Token); - tokenList.add(infoboxToken); - } - } else { - throw new ParseException("parser.06", - new Object[] {infoboxName, "XMLContent oder Base64Content", contentParent.getLocalName()}); - } - return tokenList; - } - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java deleted file mode 100644 index d8a57fd2f..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java +++ /dev/null @@ -1,319 +0,0 @@ -package at.gv.egovernment.moa.id.auth.parser; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigInteger; -import java.security.PublicKey; -import java.security.interfaces.RSAPublicKey; -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.id.ECDSAConverterException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.util.ECDSAKeyValueConverter; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parses an identity link <saml:Assertion> - * @author Paul Ivancsics - * @version $Id$ - */ -public class IdentityLinkAssertionParser { - - // - // XPath namespace prefix shortcuts - // - - /** Xpath prefix for reaching PersonData Namespaces */ - private static final String PDATA = Constants.PD_PREFIX + ":"; - /** Xpath prefix for reaching SAML Namespaces */ - private static final String SAML = Constants.SAML_PREFIX + ":"; - /** Xpath prefix for reaching XML-DSIG Namespaces */ - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - /** Xpath prefix for reaching ECDS Namespaces */ - private static final String ECDSA = Constants.ECDSA_PREFIX + ":"; - /** Xpath expression to the root element */ - private static final String ROOT = ""; - /** Xpath expression to the SAMLSubjectConfirmationData element */ - private static final String SAML_SUBJECT_CONFIRMATION_DATA_XPATH = - ROOT - + SAML - + "AttributeStatement/" - + SAML - + "Subject/" - + SAML - + "SubjectConfirmation/" - + SAML - + "SubjectConfirmationData"; - /** Xpath expression to the PersonData element */ - private static final String PERSON_XPATH = - SAML_SUBJECT_CONFIRMATION_DATA_XPATH - + "/" - + PDATA - + "Person"; - /** Xpath expression to the PersonData GivenName element */ - private static final String PERSON_GIVEN_NAME_XPATH = - PERSON_XPATH - + "/" - + PDATA - + "Name/" - + PDATA - + "GivenName"; - /** Xpath expression to the PersonData FamilyName element */ - private static final String PERSON_FAMILY_NAME_XPATH = - PERSON_XPATH - + "/" - + PDATA - + "Name/" - + PDATA - + "FamilyName"; - /** Xpath expression to the PersonData DateOfBirth element */ - private static final String PERSON_DATE_OF_BIRTH_XPATH = - PERSON_XPATH - + "/" - + PDATA - + "DateOfBirth"; - /** Xpath expression to the Identification element */ - private static final String PERSON_IDENT_XPATH = - PERSON_XPATH - + "/" - + PDATA - + "Identification"; - - /** Xpath expression to the Identification Value element */ - public static final String PERSON_IDENT_VALUE_XPATH = - PERSON_XPATH - + "/" - + PDATA - + "Identification/" - + PDATA - + "Value"; - - /** Xpath expression to the Identification Value element */ - private static final String PERSON_IDENT_TYPE_XPATH = - PERSON_XPATH - + "/" - + PDATA - + "Identification/" - + PDATA - + "Type"; - - /** Xpath expression to the RSAKeyValue element */ - private static final String RSA_KEY_VALUE_XPATH = - ROOT - + SAML - + "AttributeStatement/" - + SAML - + "Attribute/" - + SAML - + "AttributeValue/" - + DSIG - + "RSAKeyValue"; - - /** Xpath expression to the ECKeyValue element */ - private static final String ECDSA_KEY_VALUE_XPATH = - ROOT - + SAML - + "AttributeStatement/" - + SAML - + "Attribute/" - + SAML - + "AttributeValue/" - + ECDSA - + "ECDSAKeyValue"; - - - /** Xpath expression to the RSA Modulus element */ - private static final String RSA_KEY_MODULUS_XPATH = DSIG + "Modulus"; - /** Xpath expression to the RSA Exponent element */ - private static final String RSA_KEY_EXPONENT_XPATH = DSIG + "Exponent"; - /** Xpath expression to the DSIG X509Certificate element */ - private static final String DSIG_CERTIFICATES_XPATH = - ROOT - + DSIG - + "Signature/" - + DSIG - + "KeyInfo/" - + DSIG - + "X509Data/" - + DSIG - + "X509Certificate"; - /** Xpath expression to the DSIG Transforms element */ - private static final String DSIG_REFERENCE_TRANSFORMATION_XPATH = - ROOT - + DSIG - + "Signature/" - + DSIG - + "SignedInfo/" - + DSIG - + "Reference/" - + DSIG - + "Transforms"; - - /** The IssueInstant attribute of the SAML assertion */ - private static final String ISSUE_INSTANT_ATTR = "IssueInstant"; - - /**This is the root element of the XML-Document provided by the Security Layer Card*/ - private Element assertionElem; - - /** - * Constructor for IdentityLinkAssertionParser. - * A DOM-representation of the incoming String will be created - * @param xmlAssertion <saml:Assertion> as String - * @throws ParseException on any parsing error - */ - public IdentityLinkAssertionParser(String xmlAssertion) throws ParseException { - try { - InputStream s = new ByteArrayInputStream(xmlAssertion.getBytes("UTF-8")); - assertionElem = DOMUtils.parseXmlValidating(s); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - } - - /** - * Sets the <@link assertionElem>. - * @param xmlAssertion the assertion element - * @throws ParseException on any parsing error - */ - public IdentityLinkAssertionParser(Element xmlAssertion) throws ParseException { - assertionElem = xmlAssertion; - } - - /** - * Constructor for IdentityLinkAssertionParser. - * A DOM-representation of the incoming Inputstream will be created - * @param xmlAssertion <saml:Assertion> as InputStream - * @throws ParseException on any parsing error - */ - public IdentityLinkAssertionParser(InputStream xmlAssertion) throws Exception { - try { - assertionElem = DOMUtils.parseXmlValidating(xmlAssertion); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - } - - /** - * Parses the identity link from the <saml:Assertion> - * @return Identity link - * @throws ParseException on any parsing error - */ - - public IdentityLink parseIdentityLink() throws ParseException { - IdentityLink identityLink; - try { - identityLink = new IdentityLink(); - identityLink.setSamlAssertion(assertionElem); - identityLink.setIssueInstant(assertionElem.getAttribute(ISSUE_INSTANT_ATTR)); - identityLink.setPrPerson((Element) - XPathUtils.selectSingleNode(assertionElem, PERSON_XPATH)); - identityLink.setIdentificationValue( - XPathUtils.getElementValue(assertionElem, PERSON_IDENT_VALUE_XPATH, "")); - identityLink.setIdentificationType( - XPathUtils.getElementValue(assertionElem, PERSON_IDENT_TYPE_XPATH, "")); - identityLink.setGivenName( - XPathUtils.getElementValue(assertionElem, PERSON_GIVEN_NAME_XPATH, "")); - identityLink.setFamilyName( - XPathUtils.getElementValue(assertionElem, PERSON_FAMILY_NAME_XPATH, "")); - identityLink.setDateOfBirth( - XPathUtils.getElementValue(assertionElem, PERSON_DATE_OF_BIRTH_XPATH, "")); - NodeIterator dsigRefTransforms = - XPathUtils.selectNodeIterator(assertionElem, DSIG_REFERENCE_TRANSFORMATION_XPATH); - List transElems = new ArrayList(); - Element transformsElem; - while ((transformsElem = (Element) dsigRefTransforms.nextNode()) != null) { - transElems.add(transformsElem); - } - Element[] result = new Element[transElems.size()]; - transElems.toArray(result); - identityLink.setDsigReferenceTransforms(result); - - identityLink.setPublicKey(getPublicKeys()); - - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - - return identityLink; - } - - /** - * Parses an array of Public Keys from the <InfoboxReadResponse> - * @return RSAPublicKey[] - * @throws IOException can occur when decoding the base64 values of the modulus and exponent - */ - public PublicKey[] getPublicKeys() throws IOException, ECDSAConverterException{ - - - List pubKeys = new ArrayList(); - //Try to get RSA-Keys - NodeIterator rsaIter = - XPathUtils.selectNodeIterator(assertionElem, Constants.nSMap, RSA_KEY_VALUE_XPATH); - Element rsaElem; - - while ((rsaElem = (Element) rsaIter.nextNode()) != null) { - String modulus = - XPathUtils.getElementValue(rsaElem, RSA_KEY_MODULUS_XPATH, ""); - String exponent = - XPathUtils.getElementValue(rsaElem, RSA_KEY_EXPONENT_XPATH, ""); - - RSAPublicKey resPub = - new iaik.security.rsa.RSAPublicKey( - new BigInteger(1, Base64Utils.decode(modulus, true)), - new BigInteger(1, Base64Utils.decode(exponent, true))); - pubKeys.add(resPub); - } - - //Try to get ECDSA-Keys - NodeIterator ecdsaIter = - XPathUtils.selectNodeIterator(assertionElem, Constants.nSMap, ECDSA_KEY_VALUE_XPATH); - Element ecdsaElem; - PublicKey ecPubKey = null; - while ((ecdsaElem = (Element) ecdsaIter.nextNode()) != null) { - try { - ecPubKey = ECDSAKeyValueConverter.element2ECDSAPublicKey(ecdsaElem); - pubKeys.add(ecPubKey); - } - catch(Exception e) { - throw new ECDSAConverterException("parser.03", new Object[] { e.toString() }, e); - } - } - - PublicKey[] result = new PublicKey[pubKeys.size()]; - pubKeys.toArray(result); - return result; - - } - /** - * Parses a string array of decoded base64 certificates from - * the <InfoboxReadResponse> found in the dsig-signature - * @return String[] with raw-certificates from the dsig-signature keyinfo - * @throws Exception - */ - public String[] getCertificates() throws Exception { - List certs = new ArrayList(); - NodeIterator rsaIter = - XPathUtils.selectNodeIterator(assertionElem, DSIG_CERTIFICATES_XPATH); - Element certElem; - while ((certElem = (Element) rsaIter.nextNode()) != null) { - String content = DOMUtils.getText(certElem); - certs.add(new String(Base64Utils.decode(content, true))); - } - String[] result = new String[certs.size()]; - certs.toArray(result); - return result; - - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java deleted file mode 100644 index e59c88ddc..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java +++ /dev/null @@ -1,165 +0,0 @@ -package at.gv.egovernment.moa.id.auth.parser; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parses an <InfoboxReadResponse>. - * - * @author Stefan Knirsch - * @version $Id$ - */ - -public class InfoboxReadResponseParser { - - /** This is the root element of the XML-Document provided by the Security Layer Card*/ - private Element infoBoxElem_; - - /** - * Parses and validates the document given as string and extracts the - * root element. - * - * @param xmlResponse <InfoboxReadResponse> as String - * @throws ParseException If an element cannot be parsed - * @throws AuthenticationException If any authentication error occurs - */ - public InfoboxReadResponseParser(String xmlResponse) throws ParseException, AuthenticationException { - - try { - InputStream s = new ByteArrayInputStream(xmlResponse.getBytes("UTF-8")); - init(s); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - } - - /** - * Parses and validates the document given as stream and extracts the - * root element. - * - * @param is <InfoboxReadResponse> as InputStream - * @throws ParseException If an element cannot be parsed - * @throws AuthenticationException If any authentication error occurs - */ - public InfoboxReadResponseParser(InputStream is) throws ParseException, AuthenticationException { - init(is); - } - - /** - * Initializes the parser. - * Parses and validates the document given as stream and extracts the - * root element. - * - * @param is The InfoBoxReadResponse as stream. - * @throws AuthenticationException If an authentication error occurs. - * @throws ParseException If an error occurs on parsing the the document. - */ - private void init(InputStream is) throws AuthenticationException, ParseException { - try { - - Element responseElem = DOMUtils.parseXmlValidating(is); - - if ("InfoboxReadResponse".equals(responseElem.getLocalName())) { - infoBoxElem_ = responseElem; - } else { - ErrorResponseParser erp = new ErrorResponseParser(responseElem); - throw new AuthenticationException("auth.08", new Object[] { erp.getErrorCode(), erp.getErrorInfo()}); - } - - } catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - } - - - - /** - * Parses the embedded <saml:Assertion> element from <InfoboxReadResponse> - * @return <saml:Assertion> as String - * @throws ParseException on any parsing error - */ -// public String parseSAMLAssertion() throws ParseException { -// try { -// -// String slPrefix = XPathUtils.getSlPrefix(infoBoxElem_); -// StringBuffer sb = new StringBuffer("/"); -// sb.append(slPrefix); -// sb.append(":InfoboxReadResponse/"); -// sb.append(slPrefix); -// sb.append(":BinaryFileData/"); -// sb.append(slPrefix); -// sb.append(":XMLContent/"); -// sb.append(Constants.SAML_PREFIX); -// sb.append(":Assertion"); -// String samlAssertionXPath = sb.toString(); -// Element samlAssertion = (Element) XPathUtils.selectSingleNode(infoBoxElem_, samlAssertionXPath); -// return DOMUtils.serializeNode(samlAssertion); -// -// } -// catch (Throwable t) { -// throw new ParseException("parser.01", new Object[] { t.toString()}, t); -// } -// } - - /** - * Parses the embedded <saml:Assertion> element from <InfoboxReadResponse> - * @return <saml:Assertion> as String - * @throws ParseException on any parsing error - */ - public Element parseSAMLAssertion() throws ParseException { - try { - - String slPrefix = XPathUtils.getSlPrefix(infoBoxElem_); - StringBuffer sb = new StringBuffer("/"); - sb.append(slPrefix); - sb.append(":InfoboxReadResponse/"); - sb.append(slPrefix); - sb.append(":BinaryFileData/"); - sb.append(slPrefix); - sb.append(":XMLContent/"); - sb.append(Constants.SAML_PREFIX); - sb.append(":Assertion"); - String samlAssertionXPath = sb.toString(); - Element samlAssertion = (Element) XPathUtils.selectSingleNode(infoBoxElem_, samlAssertionXPath); - return samlAssertion; - - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString()}, t); - } - } - - /** - * Parses the identity link from the <saml:Assertion> - * @return Identity link - * @throws ParseException on any parsing error - */ - -// public IdentityLink parseIdentityLink() throws ParseException { -// String samlAssertionString = parseSAMLAssertion(); -// IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(samlAssertionString); -// return ilParser.parseIdentityLink(); -// } - - /** - * Parses the identity link from the <saml:Assertion> - * @return Identity link - * @throws ParseException on any parsing error - */ - public IdentityLink parseIdentityLink() throws ParseException { - Element samlAssertion = parseSAMLAssertion(); - IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(samlAssertion); - return ilParser.parseIdentityLink(); - } - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java deleted file mode 100644 index 7c4c01abe..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java +++ /dev/null @@ -1,58 +0,0 @@ -package at.gv.egovernment.moa.id.auth.parser; - -import java.io.IOException; - -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.util.Base64Utils; - -/** - * Parser for a SAML artifact. - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLArtifactParser { - /** byte array containing the SamlArtifact bytes */ - private byte[] samlArtifactBytes; - - /** - * Constructor - * @param samlArtifact as String - * @throws ParseException on any parsing error - */ - public SAMLArtifactParser(String samlArtifact) throws ParseException { - try { - samlArtifactBytes = Base64Utils.decode(samlArtifact, false); - } - catch (IOException ex) { - throw new ParseException("parser.02", new Object[] {ex.toString()}, ex); - } - } - /** - * Parses the type code. - * @return type code - * @throws ParseException when SAML artifact is invalid - */ - public byte[] parseTypeCode() throws ParseException { - try { - byte[] typeCode = new byte[] {samlArtifactBytes[0], samlArtifactBytes[1]}; - return typeCode; - } - catch (Throwable ex) { - throw new ParseException("parser.02", new Object[] {ex.toString()}, ex); - } - } - /** - * Parses the assertion handle. - * @return assertion handle - * @throws ParseException when SAML artifact is invalid - */ - public String parseAssertionHandle() throws ParseException { - try { - return new String(samlArtifactBytes, 22, 20); - } - catch (Throwable ex) { - throw new ParseException("parser.02", new Object[] {ex.toString()}, ex); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java deleted file mode 100644 index 4c49afb76..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java +++ /dev/null @@ -1,156 +0,0 @@ -package at.gv.egovernment.moa.id.auth.parser; - -import iaik.utils.Base64InputStream; -import iaik.x509.X509Certificate; -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.*; -import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parses a <VerifyXMLSignatureResponse> returned by - * MOA-SPSS. - * This class implements the Singleton pattern - * - * @author Stefan Knirsch - * @version $Id$ - */ - - -public class VerifyXMLSignatureResponseParser { - // - // XPath namespace prefix shortcuts - // - /** Xpath prefix for reaching MOA Namespaces */ - private static final String MOA = Constants.MOA_PREFIX + ":"; - /** Xpath prefix for reaching DSIG Namespaces */ - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - /** Xpath expression to the root element */ - private static final String ROOT = "/" + MOA + "VerifyXMLSignatureResponse/"; - - /** Xpath expression to the X509SubjectName element */ - private static final String DSIG_SUBJECT_NAME_XPATH = - ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + - DSIG + "X509SubjectName"; - /** Xpath expression to the X509Certificate element */ - private static final String DSIG_X509_CERTIFICATE_XPATH = - ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + - DSIG + "X509Certificate"; - /** Xpath expression to the PublicAuthority element */ - private static final String PUBLIC_AUTHORITY_XPATH = - ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + - MOA + "PublicAuthority"; - /** Xpath expression to the PublicAuthorityCode element */ - private static final String PUBLIC_AUTHORITY_CODE_XPATH = - PUBLIC_AUTHORITY_XPATH + "/" + MOA + "Code"; - /** Xpath expression to the QualifiedCertificate element */ - private static final String QUALIFIED_CERTIFICATE_XPATH = - ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + - MOA + "QualifiedCertificate"; - - /** Xpath expression to the SignatureCheckCode element */ - private static final String SIGNATURE_CHECK_CODE_XPATH = - ROOT + MOA + "SignatureCheck/" + MOA + "Code"; - /** Xpath expression to the XMLDSIGManifestCheckCode element */ - private static final String XMLDSIG_MANIFEST_CHECK_CODE_XPATH = - ROOT + MOA + "XMLDSIGManifestCheck/" + MOA + "Code"; - /** Xpath expression to the CertificateCheckCode element */ - private static final String CERTIFICATE_CHECK_CODE_XPATH = - ROOT + MOA + "CertificateCheck/" + MOA + "Code"; - - - /** This is the root element of the XML-Document provided by the Security Layer Card*/ - private Element verifyXMLSignatureResponse; - - /** - * Constructor for VerifyXMLSignatureResponseParser. - * A DOM-representation of the incoming String will be created - * @param xmlResponse <InfoboxReadResponse> as String - * @throws ParseException on any parsing error - */ - public VerifyXMLSignatureResponseParser(String xmlResponse) throws ParseException{ - try { - InputStream s = new ByteArrayInputStream(xmlResponse.getBytes("UTF-8")); - - verifyXMLSignatureResponse = DOMUtils.parseXmlValidating(s); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - } - - /** - * Constructor for VerifyXMLSignatureResponseParser. - * A DOM-representation of the incoming Inputstream will be created - * @param xmlResponse <InfoboxReadResponse> as InputStream - * @throws Exception on any parsing error - */ - public VerifyXMLSignatureResponseParser(InputStream xmlResponse) throws Exception - { - try { - verifyXMLSignatureResponse = DOMUtils.parseXmlValidating(xmlResponse); - } - catch (Throwable t) { - throw new ParseException("parser.01", null, t); - } - } - - /** - * Constructor for VerifyXMLSignatureResponseParser. - * The incoming Element will be used for further operations - * @param xmlResponse <InfoboxReadResponse> as Element - */ - public VerifyXMLSignatureResponseParser(Element xmlResponse) - { - verifyXMLSignatureResponse =xmlResponse; - - } - - /** - * Parse identity link from <InfoboxReadResponse> - * @return Identity link - * @throws ParseException on any parsing error - */ - - public VerifyXMLSignatureResponse parseData() throws ParseException { - - VerifyXMLSignatureResponse respData=new VerifyXMLSignatureResponse(); - - try { - respData.setXmlDsigSubjectName(XPathUtils.getElementValue(verifyXMLSignatureResponse,DSIG_SUBJECT_NAME_XPATH,"")); - Element e = (Element)XPathUtils.selectSingleNode(verifyXMLSignatureResponse,QUALIFIED_CERTIFICATE_XPATH); - respData.setQualifiedCertificate(e!=null); - - Base64InputStream in = new Base64InputStream(new ByteArrayInputStream(XPathUtils.getElementValue( - verifyXMLSignatureResponse,DSIG_X509_CERTIFICATE_XPATH,"").getBytes("UTF-8")),true); - - respData.setX509certificate(new X509Certificate(in)); - Element publicAuthority = (Element)XPathUtils.selectSingleNode(verifyXMLSignatureResponse,PUBLIC_AUTHORITY_XPATH); - respData.setPublicAuthority(publicAuthority != null); - respData.setPublicAuthorityCode(XPathUtils.getElementValue(verifyXMLSignatureResponse,PUBLIC_AUTHORITY_CODE_XPATH,"")); - respData.setSignatureCheckCode(new Integer(XPathUtils.getElementValue(verifyXMLSignatureResponse,SIGNATURE_CHECK_CODE_XPATH,"")).intValue()); - - String xmlDsigCheckCode = XPathUtils.getElementValue(verifyXMLSignatureResponse,XMLDSIG_MANIFEST_CHECK_CODE_XPATH,null); - if (xmlDsigCheckCode!=null) - { - respData.setXmlDSIGManigest(true); - respData.setXmlDSIGManifestCheckCode(new Integer(xmlDsigCheckCode).intValue()); - } - else - respData.setXmlDSIGManigest(false); - respData.setCertificateCheckCode(new Integer(XPathUtils.getElementValue(verifyXMLSignatureResponse,CERTIFICATE_CHECK_CODE_XPATH,"")).intValue()); - } - catch (Throwable t) { - throw new ParseException("parser.01", null, t); - } - return respData; - } - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java deleted file mode 100644 index 96e8e6dd6..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java +++ /dev/null @@ -1,202 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileItemFactory; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; - -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.auth.WrongParametersException; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.URLDecoder; - -/** - * Base class for MOA-ID Auth Servlets, providing standard error handling - * and constant names. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthServlet extends HttpServlet implements MOAIDAuthConstants { - - - /** - * Handles an error.
- *
    - *
  • Logs the error
  • - *
  • Places error message and exception thrown into the request - * as request attributes (to be used by "/errorpage-auth.jsp")
  • - *
  • Sets HTTP status 500 (internal server error)
  • - *
- * - * @param errorMessage error message - * @param exceptionThrown exception thrown - * @param req servlet request - * @param resp servlet response - */ - protected void handleError( - String errorMessage, Throwable exceptionThrown, HttpServletRequest req, HttpServletResponse resp) { - - - if(null != errorMessage) { - Logger.error(errorMessage); - req.setAttribute("ErrorMessage", errorMessage ); - } - - if (null != exceptionThrown) { - if(null == errorMessage) errorMessage = exceptionThrown.getMessage(); - Logger.error(errorMessage, exceptionThrown); - req.setAttribute("ExceptionThrown", exceptionThrown); - } - - //forward this to errorpage-auth.jsp where the HTML error page is generated - ServletContext context = getServletContext(); - RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-auth.jsp"); - try { - dispatcher.forward(req, resp); - } catch (ServletException e) { - Logger.error(e); - } catch (IOException e) { - Logger.error(e); - } - - } - /** - * Handles a WrongParametersException. - * @param req servlet request - * @param resp servlet response - */ - protected void handleWrongParameters(WrongParametersException ex, HttpServletRequest req, HttpServletResponse resp) { - Logger.error(ex.toString()); - req.setAttribute("WrongParameters", ex.getMessage()); - - // forward this to errorpage-auth.jsp where the HTML error page is generated - ServletContext context = getServletContext(); - RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-auth.jsp"); - try { - dispatcher.forward(req, resp); - } catch (ServletException e) { - Logger.error(e); - } catch (IOException e) { - Logger.error(e); - } - } - - /** - * Logs all servlet parameters for debugging purposes. - */ - protected void logParameters(HttpServletRequest req) { - for (Enumeration params = req.getParameterNames(); params.hasMoreElements(); ) { - String parname = (String)params.nextElement(); - Logger.debug("Parameter " + parname + req.getParameter(parname)); - } - } - - /** - * Parses the request input stream for parameters, assuming parameters are encoded UTF-8 - * (no standard exists how browsers should encode them). - * - * @param req servlet request - * - * @return mapping parameter name -> value - * - * @throws IOException if parsing request parameters fails. - * - * @throws FileUploadException if parsing request parameters fails. - */ - protected Map getParameters(HttpServletRequest req) - throws IOException, FileUploadException { - - Map parameters = new HashMap(); - - - if (ServletFileUpload.isMultipartContent(req)) - { - // request is encoded as mulitpart/form-data - FileItemFactory factory = new DiskFileItemFactory(); - ServletFileUpload upload = null; - upload = new ServletFileUpload(factory); - List items = null; - items = upload.parseRequest(req); - for (int i = 0; i < items.size(); i++) - { - FileItem item = (FileItem) items.get(i); - if (item.isFormField()) - { - // Process only form fields - no file upload items - parameters.put(item.getFieldName(), item.getString("UTF-8")); - Logger.debug("Processed multipart/form-data request parameter: \nName: " + - item.getFieldName() + "\nValue: " + - item.getString("UTF-8")); - } - } - } - - else - { - // request is encoded as application/x-www-urlencoded - InputStream in = req.getInputStream(); - - String paramName; - String paramValueURLEncoded; - do { - paramName = new String(readBytesUpTo(in, '=')); - if (paramName.length() > 0) { - paramValueURLEncoded = readBytesUpTo(in, '&'); - String paramValue = URLDecoder.decode(paramValueURLEncoded, "UTF-8"); - parameters.put(paramName, paramValue); - } - } - while (paramName.length() > 0); - in.close(); - } - - return parameters; - } - - /** - * Reads bytes up to a delimiter, consuming the delimiter. - * @param in input stream - * @param delimiter delimiter character - * @return String constructed from the read bytes - * @throws IOException - */ - protected String readBytesUpTo(InputStream in, char delimiter) throws IOException { - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - boolean done = false; - int b; - while (! done && (b = in.read()) >= 0) { - if (b == delimiter) - done = true; - else - bout.write(b); - } - return bout.toString(); - } - - /** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ - public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java deleted file mode 100644 index f33377547..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java +++ /dev/null @@ -1,75 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.io.IOException; -import java.text.DateFormat; -import java.util.Date; -import java.util.Locale; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; -import at.gv.egovernment.moa.id.util.HTTPRequestJSPForwarder; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for updating the MOA-ID Auth configuration from configuration file - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConfigurationServlet extends HttpServlet { - - /** - * Handle a HTTP GET request, used to indicated that the MOA - * configuration needs to be updated (reloaded). - * - * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - - MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance(); - - try { - MOAIDAuthInitializer.initialized=false; - MOAIDAuthInitializer.initialize(); - String message = msg.getMessage("config.00", new Object[] - { DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.GERMAN).format(new Date())} ); - - Logger.info(message); - HTTPRequestJSPForwarder.forwardNamed(message, "/message-auth.jsp", getServletContext(), request, response); - - } catch (Throwable t) { - String errorMessage = msg.getMessage("config.04", null); - Logger.error(errorMessage, t); - HTTPRequestJSPForwarder.forwardNamed(errorMessage, "/message-auth.jsp", getServletContext(), request, response); - } - } - - /** - * Do the same as doGet. - * - * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - doGet(request, response); - } - - /** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ - public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); - } - -} - - diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java deleted file mode 100644 index c41b514c8..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java +++ /dev/null @@ -1,135 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.util.Calendar; - -import org.apache.axis.AxisFault; -import org.w3c.dom.Element; - -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.MOAIDException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.builder.SAMLResponseBuilder; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.Random; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Web service for picking up authentication data created in the MOA-ID Auth component. - * - * @author Paul Ivancsics - * @version $Id$ - * @see at.gv.egovernment.moa.id.auth.AuthenticationServer#getAuthenticationData - */ -public class GetAuthenticationDataService implements Constants { - - /** - * Constructor for GetAuthenticationDataService. - */ - public GetAuthenticationDataService() { - super(); - } - - /** - * Takes a lt;samlp:Request> containing a - * SAML artifact and returns the corresponding - * authentication data lt;saml:Assertion> - * (obtained from the AuthenticationServer), - * enclosed in a lt;samlp:Response>. - *
Bad requests are mapped into various lt;samlp:StatusCode>s, - * possibly containing enclosed sub-lt;samlp:StatusCode>s. - * The status codes are defined in the SAML specification. - * - * @param requests request elements of type lt;samlp:Request>; - * only 1 request element is allowed - * @return response element of type lt;samlp:Response>, - * packed into an Element[] - * @throws AxisFault thrown when an error occurs in assembling the - * lt;samlp:Response> - */ - public Element[] Request(Element[] requests) - throws AxisFault { - - Element request = requests[0]; - Element[] responses = new Element[1]; - String requestID = ""; - String statusCode = ""; - String subStatusCode = null; - String statusMessageCode = null; - String statusMessage = null; - String samlAssertion = ""; - if (requests.length > 1) { - // more than 1 request given as parameter - statusCode = "samlp:Requester"; - subStatusCode = "samlp:TooManyResponses"; - statusMessageCode = "1201"; - } - else { - try { - DOMUtils.validateElement(request, ALL_SCHEMA_LOCATIONS, null); - NodeList samlArtifactList = XPathUtils.selectNodeList(request, "samlp:AssertionArtifact"); - if (samlArtifactList.getLength() == 0) { - // no SAML artifact given in request - statusCode = "samlp:Requester"; - statusMessageCode = "1202"; - } - else if (samlArtifactList.getLength() > 1) { - // too many SAML artifacts given in request - statusCode = "samlp:Requester"; - subStatusCode = "samlp:TooManyResponses"; - statusMessageCode = "1203"; - } - else { - Element samlArtifactElem = (Element)samlArtifactList.item(0); - requestID = samlArtifactElem.getAttribute("RequestID"); - String samlArtifact = DOMUtils.getText(samlArtifactElem); - try { - AuthenticationData authData = AuthenticationServer.getInstance(). - getAuthenticationData(samlArtifact); - // success - samlAssertion = authData.getSamlAssertion(); - statusCode = "samlp:Success"; - statusMessageCode = "1200"; - } - catch (AuthenticationException ex) { - // no authentication data for given SAML artifact - statusCode = "samlp:Requester"; - subStatusCode = "samlp:ResourceNotRecognized"; - statusMessage = ex.toString(); - } - } - } - catch (Throwable t) { - // invalid request format - statusCode = "samlp:Requester"; - statusMessageCode = "1204"; - } - } - try { - String responseID = Random.nextRandom(); - String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); - if (statusMessage == null) - statusMessage = MOAIDMessageProvider.getInstance().getMessage(statusMessageCode, null); - responses[0] = new SAMLResponseBuilder().build( - responseID, requestID, issueInstant, statusCode, subStatusCode, statusMessage, samlAssertion); - } - catch (MOAIDException e) { - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - throw fault; - } - catch (Throwable t) { - MOAIDException e = new MOAIDException("1299", null, t); - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - throw fault; - } - return responses; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java deleted file mode 100644 index 4dc69c70b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java +++ /dev/null @@ -1,99 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; -import at.gv.egovernment.moa.id.auth.WrongParametersException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for selecting a BKU. - *
In case of {@link AuthConfigurationProvider#getBKUSelectionType}==HTMLComplete, - * the browser is redirected to the configured "BKU-Auswahl-URL". - *
In case of {@link AuthConfigurationProvider#getBKUSelectionType}==HTMLSelect, - * the list of available BKU's is fetched from a BKU-Auswahl server, and presented - * to the user in an HTML form. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SelectBKUServlet extends AuthServlet { - - /** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ - public void init(ServletConfig servletConfig) throws ServletException { - try { - super.init(servletConfig); - MOAIDAuthInitializer.initialize(); - Logger.debug("default platform file.encoding: " + System.getProperty("file.encoding")); - Logger.info(MOAIDMessageProvider.getInstance().getMessage("init.00", null)); - } - catch (Exception ex) { - Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("init.02", null), ex); - throw new ServletException(ex); - } - } - - /** - * Responds with an HTML form which requests the user to choose a BKU. - */ - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - Logger.debug("GET SelectBKU"); - String authURL = - req.getScheme() + "://" + - req.getServerName() + ":" + - req.getServerPort() + - req.getContextPath() + "/"; - String target = req.getParameter(PARAM_TARGET); - String oaURL = req.getParameter(PARAM_OA); - String bkuSelectionTemplateURL = req.getParameter(PARAM_BKUTEMPLATE); - String templateURL = req.getParameter(PARAM_TEMPLATE); - resp.setHeader(HEADER_EXPIRES,HEADER_VALUE_EXPIRES); - resp.setHeader(HEADER_PRAGMA,HEADER_VALUE_PRAGMA); - resp.setHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL); - resp.addHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL_IE); - - try { - String returnValue = AuthenticationServer.getInstance().selectBKU( - authURL, target, oaURL, bkuSelectionTemplateURL, templateURL); - String bkuSelectionType = AuthConfigurationProvider.getInstance().getBKUSelectionType(); - if (bkuSelectionType.equals(AuthConfigurationProvider.BKU_SELECTION_TYPE_HTMLCOMPLETE)) { - // bkuSelectionType==HTMLComplete - String redirectURL = returnValue; - resp.setContentType("text/html"); - resp.sendRedirect(redirectURL); - Logger.info("REDIRECT TO: " + redirectURL); - } else { - // bkuSelectionType==HTMLSelect - String htmlForm = returnValue; - resp.setContentType("text/html;charset=UTF-8"); - Logger.debug("HTML-Form: " + htmlForm); - Writer out = new OutputStreamWriter(resp.getOutputStream(), "UTF8"); - out.write(htmlForm); - out.flush(); - Logger.debug("Finished GET SelectBKU"); - } - } - catch (WrongParametersException ex) { - handleWrongParameters(ex, req, resp); - } - catch (Throwable ex) { - handleError(null, ex, req, resp); - } - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java deleted file mode 100644 index 6098f5138..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java +++ /dev/null @@ -1,103 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import at.gv.egovernment.moa.id.MOAIDException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; -import at.gv.egovernment.moa.id.auth.WrongParametersException; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for starting a MOA ID authentication session. - * Utilizes the {@link AuthenticationServer}. - * - * @author Paul Ivancsics - * @version $Id$ - * @see AuthenticationServer#startAuthentication - */ -public class StartAuthenticationServlet extends AuthServlet { - - /** - * Responds with an HTML form which upon submit requests the identity link - * from the security layer implementation. - *
- * Response: - *
    - *
  • Content type: "text/html"
  • - *
  • Content: see return value of {@link AuthenticationServer#startAuthentication}
  • - *
  • Error status: 500 - *
- * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - Logger.debug("GET StartAuthentication"); - String authURL = - req.getScheme() + "://" + - req.getServerName() + ":" + - req.getServerPort() + - req.getContextPath() + "/"; - String target = req.getParameter(PARAM_TARGET); - String oaURL = req.getParameter(PARAM_OA); - String bkuURL = req.getParameter(PARAM_BKU); - String templateURL = req.getParameter(PARAM_TEMPLATE); - String sessionID = req.getParameter(PARAM_SESSIONID); - resp.setHeader(HEADER_EXPIRES,HEADER_VALUE_EXPIRES); - resp.setHeader(HEADER_PRAGMA,HEADER_VALUE_PRAGMA); - resp.setHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL); - resp.addHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL_IE); - try { - String getIdentityLinkForm = - AuthenticationServer.getInstance().startAuthentication(authURL, target, oaURL, templateURL, bkuURL, sessionID); - resp.setContentType("text/html;charset=UTF-8"); - PrintWriter out = new PrintWriter(resp.getOutputStream()); - out.print(getIdentityLinkForm); - out.flush(); - Logger.debug("Finished GET StartAuthentication"); - } - catch (WrongParametersException ex) { - handleWrongParameters(ex, req, resp); - } - catch (MOAIDException ex) { - handleError(null, ex, req, resp); - } - } - - - /** - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - */ - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - doGet(req, resp); - } - - - /** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ - public void init(ServletConfig servletConfig) throws ServletException { - try { - super.init(servletConfig); - MOAIDAuthInitializer.initialize(); - Logger.info(MOAIDMessageProvider.getInstance().getMessage("init.00", null)); - } - catch (Exception ex) { - Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("init.02", null), ex); - throw new ServletException(ex); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java deleted file mode 100644 index 6ec4a247d..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java +++ /dev/null @@ -1,120 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.io.IOException; -import at.gv.egovernment.moa.util.URLEncoder; //java.net.URLEncoder; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.fileupload.FileUploadException; - -import at.gv.egovernment.moa.id.MOAIDException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for verifying the signed authentication block - * provided by the security layer implementation. - * Utilizes the {@link AuthenticationServer}. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class VerifyAuthenticationBlockServlet extends AuthServlet { - - - /** - * Constructor for VerifyAuthenticationBlockServlet. - */ - public VerifyAuthenticationBlockServlet() { - super(); - } - - /** - * GET requested by security layer implementation to verify - * that data URL resource is available. - * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - Logger.debug("GET VerifyAuthenticationBlock"); - } - - /** - * Verifies the signed authentication block and redirects the browser - * to the online application requested, adding a parameter needed for - * retrieving the authentication data. - *
- * Request parameters: - *
    - *
  • MOASessionID: ID of associated authentication session
  • - *
  • XMLResponse: <CreateXMLSignatureResponse>
  • - *
- * Response: - *
    - *
  • Status: 302
  • - *
  • Header "Location": URL of the online application requested, with - * parameters "Target"(only if the online application is - * a public service) and "SAMLArtifact" added
  • - *
  • Error status: 500 - *
- * @see AuthenticationServer#verifyAuthenticationBlock - * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) - */ - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - Logger.debug("POST VerifyAuthenticationBlock"); - Map parameters; - try - { - parameters = getParameters(req); - } catch (FileUploadException e) - { - Logger.error("Parsing mulitpart/form-data request parameters failed: " + e.getMessage()); - throw new IOException(e.getMessage()); - } - String sessionID = req.getParameter(PARAM_SESSIONID); - String createXMLSignatureResponse = (String)parameters.get(PARAM_XMLRESPONSE); - - try { - AuthenticationSession session = AuthenticationServer.getSession(sessionID); - String samlArtifactBase64 = - AuthenticationServer.getInstance().verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - String redirectURL = session.getOAURLRequested(); - if (!session.getBusinessService()) { - redirectURL = addURLParameter(redirectURL, PARAM_TARGET, URLEncoder.encode(session.getTarget(), "UTF-8")); - } - redirectURL = addURLParameter(redirectURL, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); - redirectURL = resp.encodeRedirectURL(redirectURL); - resp.setContentType("text/html"); - resp.setStatus(302); - resp.addHeader("Location", redirectURL); - Logger.debug("REDIRECT TO: " + redirectURL); - } - - catch (MOAIDException ex) { - handleError(null, ex, req, resp); - } - - } - /** - * Adds a parameter to a URL. - * @param url the URL - * @param paramname parameter name - * @param paramvalue parameter value - * @return the URL with parameter added - */ - private static String addURLParameter(String url, String paramname, String paramvalue) { - String param = paramname + "=" + paramvalue; - if (url.indexOf("?") < 0) - return url + "?" + param; - else - return url + "&" + param; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java b/id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java deleted file mode 100644 index 2134c1444..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java +++ /dev/null @@ -1,107 +0,0 @@ -package at.gv.egovernment.moa.id.auth.servlet; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.Enumeration; -import java.util.Map; - -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.commons.fileupload.FileUploadException; - -import at.gv.egovernment.moa.id.MOAIDException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; -import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for verifying the identity link - * provided by the security layer implementation. - * Utilizes the {@link AuthenticationServer}. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class VerifyIdentityLinkServlet extends AuthServlet { - - /** - * Constructor for VerifyIdentityLinkServlet. - */ - public VerifyIdentityLinkServlet() { - super(); - } - - /** - * GET requested by security layer implementation to verify - * that data URL resource is available. - * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - Logger.debug("GET VerifyIdentityLink"); - } - - /** - * Verifies the identity link and responds with a new - * CreateXMLSignatureRequest. - *
- * Request parameters: - *
    - *
  • MOASessionID: ID of associated authentication session
  • - *
  • XMLResponse: <InfoboxReadResponse>
  • - *
- * Response: - *
    - *
  • Content type: "text/xml"
  • - *
  • Content: see return value of {@link AuthenticationServer#verifyIdentityLink}
  • - *
  • Error status: 500 - *
- * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) - */ - protected void doPost(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - Logger.debug("POST VerifyIdentityLink"); - Map parameters; - try - { - parameters = getParameters(req); - } catch (FileUploadException e) - { - Logger.error("Parsing mulitpart/form-data request parameters failed: " + e.getMessage()); - throw new IOException(e.getMessage()); - } - String sessionID = req.getParameter(PARAM_SESSIONID); - - - try { - AuthenticationSession session = AuthenticationServer.getSession(sessionID); - - String createXMLSignatureRequest = - AuthenticationServer.getInstance().verifyIdentityLink(sessionID, parameters); - resp.setStatus(307); - String dataURL = new DataURLBuilder().buildDataURL( - session.getAuthURL(), AuthenticationServer.REQ_VERIFY_AUTH_BLOCK, sessionID); - resp.addHeader("Location", dataURL); - - //TODO test impact of explicit setting charset with older versions of BKUs (HotSign) - resp.setContentType("text/xml;charset=UTF-8"); - - OutputStream out = resp.getOutputStream(); - out.write(createXMLSignatureRequest.getBytes("UTF-8")); - out.flush(); - out.close(); - Logger.debug("Finished POST VerifyIdentityLink"); - } - catch (MOAIDException ex) { - handleError(null, ex, req, resp); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java deleted file mode 100644 index e6c9f4bee..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java +++ /dev/null @@ -1,274 +0,0 @@ -package at.gv.egovernment.moa.id.auth.validator; - -import java.util.Iterator; -import java.util.List; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; -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.ExtendedSAMLAttribute; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.auth.data.SAMLAttribute; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.StringUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * - * This class is used to validate an {@link CreateXMLSignatureResponse} - * returned by the security layer. - * This class implements the Singleton pattern. - * @author Stefan Knirsch - * @version $Id$ - */ -public class CreateXMLSignatureResponseValidator { - - - /** Xpath expression to the dsig:Signature element */ - private static final String SIGNATURE_XPATH = Constants.DSIG_PREFIX + ":Signature"; - - - /** Singleton instance. null, if none has been created. */ - private static CreateXMLSignatureResponseValidator instance; - - /** - * Constructor for a singleton CreateXMLSignatureResponseValidator. - * @return an instance of CreateXMLSignatureResponseValidator - * @throws ValidateException if no instance can be created - */ - public static synchronized CreateXMLSignatureResponseValidator getInstance() - throws ValidateException { - if (instance == null) { - instance = new CreateXMLSignatureResponseValidator(); - } - return instance; - } - - - /** - * The Method validate is used for validating an explicit {@link CreateXMLSignatureResponse} - * @param createXMLSignatureResponse - * @param session - * @throws ValidateException - */ - public void validate(CreateXMLSignatureResponse createXMLSignatureResponse, AuthenticationSession session) - throws ValidateException { - - // A3.056: more then one /saml:Assertion/saml:AttributeStatement/saml:Subject/saml:NameIdentifier - - String gbTarget = session.getTarget(); - String oaURL = session.getPublicOAURLPrefix(); - boolean businessService = session.getBusinessService(); - - IdentityLink identityLink = session.getIdentityLink(); - - Element samlAssertion = createXMLSignatureResponse.getSamlAssertion(); - String issuer = samlAssertion.getAttribute("Issuer"); - if (issuer == null) { - // should not happen, because parser would dedect this - throw new ValidateException("validator.32", null); - } - String issueInstant = samlAssertion.getAttribute("IssueInstant"); - if (!issueInstant.equals(session.getIssueInstant())) { - throw new ValidateException("validator.39", new Object[] {issueInstant, session.getIssueInstant()}); - } - - String name = identityLink.getName(); - if (!issuer.equals(name)) { - throw new ValidateException("validator.33", new Object[] {issuer, name}); - } - - SAMLAttribute[] samlAttributes = createXMLSignatureResponse.getSamlAttributes(); - - boolean foundOA = false; - boolean foundGB = false; - boolean foundWBPK = false; - int offset = 0; - - // check number of SAML aatributes - List extendedSAMLAttributes = session.getExtendedSAMLAttributesAUTH(); - int extendedSAMLAttributesNum = 0; - if (extendedSAMLAttributes != null) { - extendedSAMLAttributesNum = extendedSAMLAttributes.size(); - } - int expectedSAMLAttributeNumber = - AuthenticationBlockAssertionBuilder.NUM_OF_SAML_ATTRIBUTES + extendedSAMLAttributesNum; - if (!session.getSAMLAttributeGebeORwbpk()) expectedSAMLAttributeNumber--; - int actualSAMLAttributeNumber = samlAttributes.length; - if (actualSAMLAttributeNumber != expectedSAMLAttributeNumber) { - Logger.error("Wrong number of SAML attributes in CreateXMLSignatureResponse: expected " + - expectedSAMLAttributeNumber + ", but was " + actualSAMLAttributeNumber); - throw new ValidateException( - "validator.36", - new Object[] {String.valueOf(actualSAMLAttributeNumber), String.valueOf(expectedSAMLAttributeNumber)}); - } - - SAMLAttribute samlAttribute; - if (session.getSAMLAttributeGebeORwbpk()) { - // check the first attribute ("Geschaeftsbereich" or "wbPK") - samlAttribute = samlAttributes[0]; - if (businessService) { - if (!samlAttribute.getName().equals("wbPK")) { - if (samlAttribute.getName().equals("Geschaeftsbereich")) { - throw new ValidateException("validator.26", null); - } else { - throw new ValidateException( - "validator.37", - new Object[] {samlAttribute.getName(), "wbPK", String.valueOf(1)}); - } - } - if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { - foundWBPK = true; - try { - Element attrValue = (Element)samlAttribute.getValue(); - String value = ((Element)attrValue.getElementsByTagNameNS(Constants.PD_NS_URI, "Value").item(0)).getFirstChild().getNodeValue(); - String type = ((Element)attrValue.getElementsByTagNameNS(Constants.PD_NS_URI, "Type").item(0)).getFirstChild().getNodeValue(); - if (!value.equals(identityLink.getIdentificationValue())) { - throw new ValidateException("validator.28", null); - } - if (!type.equals(identityLink.getIdentificationType())) { - throw new ValidateException("validator.28", null); - } - } catch (Exception ex) { - throw new ValidateException("validator.29", null); - } - } else { - throw new ValidateException("validator.30", null); - } - } else { - if (!samlAttribute.getName().equals("Geschaeftsbereich")) { - if (samlAttribute.getName().equals("wbPK")) { - throw new ValidateException("validator.26", null); - } else { - throw new ValidateException( - "validator.37", - new Object[] {samlAttribute.getName(), "Geschaeftsbereich", String.valueOf(1)}); - } - } - if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { - foundGB = true; - if (!gbTarget.equals((String)samlAttribute.getValue())) { - throw new ValidateException("validator.13", null); - } - } else { - throw new ValidateException("validator.12", null); - } - } - } else { - offset--; - } - - // check the second attribute (must be "OA") - samlAttribute = samlAttributes[1 + offset]; - if (!samlAttribute.getName().equals("OA")) { - throw new ValidateException( - "validator.37", - new Object[] {samlAttribute.getName(), "OA", String.valueOf(2)}); - } - if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { - foundOA = true; - if (!oaURL.equals((String)samlAttribute.getValue())) { // CHECKS für die AttributeVALUES fehlen noch - throw new ValidateException("validator.16", new Object[] {":gefunden wurde '" + oaURL + "', erwartet wurde '" + samlAttribute.getValue()}); - } - } else { - throw new ValidateException("validator.15", null); - } - - // check the third attribute (must be "Geburtsdatum") - samlAttribute = samlAttributes[2 + offset]; - if (!samlAttribute.getName().equals("Geburtsdatum")) { - throw new ValidateException( - "validator.37", - new Object[] {samlAttribute.getName(), "Geburtsdatum", String.valueOf(3)}); - } - if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { - String samlDateOfBirth = (String)samlAttribute.getValue(); - String dateOfBirth = identityLink.getDateOfBirth(); - if (!samlDateOfBirth.equals(dateOfBirth)) { - throw new ValidateException("validator.34", new Object[] {samlDateOfBirth, dateOfBirth}); - } - } else { - throw new ValidateException("validator.35", null); - } - - // now check the extended SAML attributes - int i = AuthenticationBlockAssertionBuilder.NUM_OF_SAML_ATTRIBUTES + offset; - if (extendedSAMLAttributes != null) { - Iterator it = extendedSAMLAttributes.iterator(); - while (it.hasNext()) { - ExtendedSAMLAttribute extendedSAMLAttribute = (ExtendedSAMLAttribute)it.next(); - samlAttribute = samlAttributes[i]; - String actualName = samlAttribute.getName(); - String expectedName = extendedSAMLAttribute.getName(); - if (!actualName.equals(expectedName)) { - throw new ValidateException( - "validator.38", - new Object[] {"Name", String.valueOf((i+1)), actualName, actualName, expectedName }); - } - String actualNamespace = samlAttribute.getNamespace(); - String expectedNamespace = extendedSAMLAttribute.getNameSpace(); - if (!actualNamespace.equals(expectedNamespace)) { - throw new ValidateException( - "validator.38", - new Object[] {"Namespace", String.valueOf((i+1)), actualName, actualNamespace, expectedNamespace, }); - } - Object expectedValue = extendedSAMLAttribute.getValue(); - Object actualValue = samlAttribute.getValue(); - try { - if (expectedValue instanceof String) { - // replace \r\n because text might be base64-encoded - String expValue = StringUtils.replaceAll((String)expectedValue,"\r",""); - expValue = StringUtils.replaceAll(expValue,"\n",""); - String actValue = StringUtils.replaceAll((String)actualValue,"\r",""); - actValue = StringUtils.replaceAll(actValue,"\n",""); - if (!expValue.equals(actValue)) { - throw new ValidateException( - "validator.38", - new Object[] {"Wert", String.valueOf((i+1)), actualName, actualValue, expectedValue }); - } - } else if (expectedValue instanceof Element) { - // only check the name of the element - String actualElementName = ((Element)actualValue).getNodeName(); - String expectedElementName = ((Element)expectedValue).getNodeName(); - if (!(expectedElementName.equals(actualElementName))){ - throw new ValidateException( - "validator.38", - new Object[] {"Wert", String.valueOf((i+1)), actualName, actualElementName, expectedElementName}); - } - } else { - // should not happen - throw new ValidateException( - "validator.38", - new Object[] {"Typ", String.valueOf((i+1)), expectedName, "java.lang.String oder org.wrc.dom.Element", expectedValue.getClass().getName()}); - } - } catch (ClassCastException e) { - throw new ValidateException( - "validator.38", - new Object[] {"Typ", String.valueOf((i+1)), expectedName, expectedValue.getClass().getName(), actualValue.getClass().getName()}); - } - i++; - } - } - - - if (!foundOA) throw new ValidateException("validator.14", null); - if (businessService) { - if (session.getSAMLAttributeGebeORwbpk() && !foundWBPK) throw new ValidateException("validator.31", null); - } else { - if (!foundGB) throw new ValidateException("validator.11", null); - } - - //Check if dsig:Signature exists -// NodeList nl = createXMLSignatureResponse.getSamlAssertion().getElementsByTagNameNS(Constants.DSIG_NS_URI, "Signature"); -// if (nl.getLength() != 1) { -// throw new ValidateException("validator.05", null); -// } - Element dsigSignature = (Element) XPathUtils.selectSingleNode(samlAssertion, SIGNATURE_XPATH); - if (dsigSignature == null) { - throw new ValidateException("validator.05", new Object[] {"im AUTHBlock"}) ; - } - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java deleted file mode 100644 index 444f706e4..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java +++ /dev/null @@ -1,159 +0,0 @@ -package at.gv.egovernment.moa.id.auth.validator; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * This class is used to validate an {@link IdentityLink} - * returned by the security layer - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class IdentityLinkValidator implements Constants { - - // - // XPath namespace prefix shortcuts - // - /** Xpath prefix for reaching PersonData Namespaces */ - private static final String PDATA = PD_PREFIX + ":"; - /** Xpath prefix for reaching SAML Namespaces */ - private static final String SAML = SAML_PREFIX + ":"; - /** Xpath prefix for reaching XML-DSIG Namespaces */ - private static final String DSIG = DSIG_PREFIX + ":"; - /** Xpath prefix for reaching ECDSA Namespaces */ - private static final String ECDSA = ECDSA_PREFIX + ":"; - /** Xpath expression to the root element */ - private static final String ROOT = ""; - /** Xpath expression to the SAML:SubjectConfirmationData element */ - private static final String SAML_SUBJECT_CONFIRMATION_DATA_XPATH = - ROOT - + SAML - + "AttributeStatement/" - + SAML - + "Subject/" - + SAML - + "SubjectConfirmation/" - + SAML - + "SubjectConfirmationData"; -/** Xpath expression to the PersonData:Person element */ - private static final String PERSON_XPATH = - SAML_SUBJECT_CONFIRMATION_DATA_XPATH + "/" + PDATA + "Person"; - /** Xpath expression to the SAML:Attribute element */ - private static final String ATTRIBUTE_XPATH = - ROOT + SAML + "AttributeStatement/" + SAML + "Attribute"; - /** Xpath expression to the SAML:AttributeName attribute */ - private static final String ATTRIBUTE_NAME_XPATH = - ROOT + SAML + "AttributeStatement/" + SAML + "Attribute/@AttributeName"; - /** Xpath expression to the SAML:AttributeNamespace attribute */ - private static final String ATTRIBUTE_NAMESPACE_XPATH = - ROOT - + SAML - + "AttributeStatement/" - + SAML - + "Attribute/@AttributeNamespace"; - /** Xpath expression to the SAML:AttributeValue element */ - private static final String ATTRIBUTE_VALUE_XPATH = - ROOT - + SAML - + "AttributeStatement/" - + SAML - + "Attribute/" - + SAML - + "AttributeValue"; - - /** Singleton instance. null, if none has been created. */ - private static IdentityLinkValidator instance; - - /** - * Constructor for a singleton IdentityLinkValidator. - * @return a new IdentityLinkValidator instance - * @throws ValidateException if no instance can be created - */ - public static synchronized IdentityLinkValidator getInstance() - throws ValidateException { - if (instance == null) { - instance = new IdentityLinkValidator(); - } - return instance; - } - - /** - * Method validate. Validates the {@link IdentityLink} - * @param identityLink The identityLink to validate - * @throws ValidateException on any validation error - */ - public void validate(IdentityLink identityLink) throws ValidateException { - - Element samlAssertion = identityLink.getSamlAssertion(); - //Search the SAML:ASSERTION Object (A2.054) - if (samlAssertion == null) { - throw new ValidateException("validator.00", null); - } - - // Check how many saml:Assertion/saml:AttributeStatement/ - // saml:Subject/ saml:SubjectConfirmation/ - // saml:SubjectConfirmationData/pr:Person of type - // PhysicalPersonType exist (A2.056) - NodeList nl = XPathUtils.selectNodeList(samlAssertion, PERSON_XPATH); - // If we have just one Person-Element we don't need to check the attributes - int counterPhysicalPersonType = 0; - if (nl.getLength() > 1) - for (int i = 0; i < nl.getLength(); i++) { - String xsiType = - ((Element) nl.item(i)) - .getAttributeNodeNS( - "http://www.w3.org/2001/XMLSchema-instance", - "type") - .getNodeValue(); - // We have to check if xsiType contains "PhysicalPersonType" - // An equal-check will fail because of the Namespace-prefix of the attribute value - if (xsiType.indexOf("PhysicalPersonType") > -1) - counterPhysicalPersonType++; - } - if (counterPhysicalPersonType > 1) - throw new ValidateException("validator.01", null); - - //Check the SAML:ATTRIBUTES - nl = XPathUtils.selectNodeList(samlAssertion, ATTRIBUTE_XPATH); - for (int i = 0; i < nl.getLength(); i++) { - String attributeName = - XPathUtils.getAttributeValue( - (Element) nl.item(i), - "@AttributeName", - null); - String attributeNS = - XPathUtils.getAttributeValue( - (Element) nl.item(i), - "@AttributeNamespace", - null); - if (attributeName.equals("CitizenPublicKey")) { - - if (attributeNS.equals("http://www.buergerkarte.at/namespaces/personenbindung/20020506#") || - attributeNS.equals("urn:publicid:gv.at:namespaces:identitylink:1.2")) { - Element attributeValue = - (Element) XPathUtils.selectSingleNode((Element) nl.item(i),nSMap, SAML + "AttributeValue/" + DSIG + "RSAKeyValue"); - if (attributeValue==null) - attributeValue = - (Element) XPathUtils.selectSingleNode((Element)nl.item(i), nSMap, SAML + "AttributeValue/" + ECDSA + "ECDSAKeyValue"); - if (attributeValue == null) - throw new ValidateException("validator.02", null); - - } - else - throw new ValidateException("validator.03", new Object [] {attributeNS} ); - } - else - throw new ValidateException("validator.04", new Object [] {attributeName} ); - } - - //Check if dsig:Signature exists - Element dsigSignature = (Element) XPathUtils.selectSingleNode(samlAssertion,ROOT + DSIG + "Signature"); - if (dsigSignature==null) throw new ValidateException("validator.05", new Object[] {"in der Personenbindung"}); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java deleted file mode 100644 index c776418ab..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.gv.egovernment.moa.id.auth.validator; - -import at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult; -import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams; - -/** - * Validates an InfoboxReadResponse. - * An implementing class has to validate the content of the InfoboxReadResponse - * according to the type specific rules and guidelines of the underlying - * application. - */ -public interface InfoboxValidator { - - /** - * This method validates an InfoboxReadResponse. - * The method validates the content of the passed infoboxReadResponse - * according to the type specific rules and guidelines of the underlying - * application. - * - * @param params {@link at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams - * Parameters} needed by the validator. - * - * @return True if validation succeeds, - * otherwise false. - * - * @throws ValidateException If an error occurs on validating the - * InfoboxReadResponse. - */ - public InfoboxValidationResult validate (InfoboxValidatorParams params) - throws ValidateException; - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/ValidateException.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/ValidateException.java deleted file mode 100644 index a6685fca8..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/ValidateException.java +++ /dev/null @@ -1,35 +0,0 @@ -package at.gv.egovernment.moa.id.auth.validator; - -import at.gv.egovernment.moa.id.MOAIDException; - -/** - * Exception thrown while validating an incoming XML structure - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ValidateException extends MOAIDException { - - /** - * Constructor for ValidateException. - * @param messageId - * @param parameters - */ - public ValidateException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for ValidateException. - * @param messageId - * @param parameters - * @param wrapped - */ - public ValidateException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java deleted file mode 100644 index 1f2ebc37c..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java +++ /dev/null @@ -1,177 +0,0 @@ -package at.gv.egovernment.moa.id.auth.validator; - -import iaik.asn1.structures.Name; -import iaik.security.ecc.ecdsa.ECPublicKey; -import iaik.utils.RFC2253NameParserException; -import iaik.x509.X509Certificate; -import iaik.x509.X509ExtensionInitException; - -import java.security.PublicKey; -import java.security.interfaces.RSAPublicKey; -import java.util.List; - -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.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * This class is used to validate an {@link VerifyXMLSignatureResponse} - * returned by MOA-SPSS - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class VerifyXMLSignatureResponseValidator { - - /** Identification string for checking identity link */ - public static final String CHECK_IDENTITY_LINK = "IdentityLink"; - /** Identification string for checking authentication block */ - public static final String CHECK_AUTH_BLOCK = "AuthBlock"; - - /** Singleton instance. null, if none has been created. */ - private static VerifyXMLSignatureResponseValidator instance; - - /** - * Constructor for a singleton VerifyXMLSignatureResponseValidator. - */ - public static synchronized VerifyXMLSignatureResponseValidator getInstance() - throws ValidateException { - if (instance == null) { - instance = new VerifyXMLSignatureResponseValidator(); - } - return instance; - } - - /** - * Validates a {@link VerifyXMLSignatureResponse} returned by MOA-SPSS. - * - * @param verifyXMLSignatureResponse the <VerifyXMLSignatureResponse> - * @param identityLinkSignersSubjectDNNames subject names configured - * @param whatToCheck is used to identify whether the identityLink or the Auth-Block is validated - * @param ignoreManifestValidationResult specifies whether the validation result of the - * manifest has to be ignored (identityLink validation if - * the OA is a business service) or not - * @throws ValidateException on any validation error - */ - public void validate(VerifyXMLSignatureResponse verifyXMLSignatureResponse, - List identityLinkSignersSubjectDNNames, - String whatToCheck, - boolean ignoreManifestValidationResult) - throws ValidateException { - - if (verifyXMLSignatureResponse.getSignatureCheckCode() != 0) - throw new ValidateException("validator.06", null); - - if (verifyXMLSignatureResponse.getCertificateCheckCode() != 0) { - String checkFailedReason =""; - if (verifyXMLSignatureResponse.getCertificateCheckCode() == 1) - checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.21", null); - if (verifyXMLSignatureResponse.getCertificateCheckCode() == 2) - checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.22", null); - if (verifyXMLSignatureResponse.getCertificateCheckCode() == 3) - checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.23", null); - if (verifyXMLSignatureResponse.getCertificateCheckCode() == 4) - 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 } ); - } - - if (ignoreManifestValidationResult) { - Logger.debug("OA type is business service, thus ignoring DSIG manifest validation result"); - } else { - if (verifyXMLSignatureResponse.isXmlDSIGManigest()) - if (verifyXMLSignatureResponse.getXmlDSIGManifestCheckCode() != 0) - throw new ValidateException("validator.08", null); - } - - - // TODO See Bug #322 - // Check result of SignatureManifestCheck - - - //Check whether the returned X509 SubjectName is in the MOA-ID configuration or not - if (identityLinkSignersSubjectDNNames != null) { - String subjectDN = ""; - X509Certificate x509Cert = verifyXMLSignatureResponse.getX509certificate(); - try { - subjectDN = ((Name) x509Cert.getSubjectDN()).getRFC2253String(); - } - catch (RFC2253NameParserException e) { - throw new ValidateException("validator.17", null); - } - // check the authorisation to sign the identity link - if (!identityLinkSignersSubjectDNNames.contains(subjectDN)) { - // subject DN check failed, try OID check: - try { - if (x509Cert.getExtension(MOAIDAuthConstants.IDENTITY_LINK_SIGNER_OID) == null) { - throw new ValidateException("validator.18", new Object[] { subjectDN }); - } else { - Logger.debug("Identity link signer cert accepted for signing identity link: " + - "subjectDN check failed, but OID check successfully passed."); - } - } catch (X509ExtensionInitException e) { - throw new ValidateException("validator.49", null); - } - } else { - Logger.debug("Identity link signer cert accepted for signing identity link: " + - "subjectDN check successfully passed."); - } - - } - } - - /** - * Method validateCertificate. - * @param verifyXMLSignatureResponse The VerifyXMLSignatureResponse - * @param idl The Identitylink - * @throws ValidateException - */ - public void validateCertificate( - VerifyXMLSignatureResponse verifyXMLSignatureResponse, - IdentityLink idl) - throws ValidateException { - - X509Certificate x509Response = verifyXMLSignatureResponse.getX509certificate(); - PublicKey[] pubKeysIdentityLink = (PublicKey[]) idl.getPublicKey(); - - PublicKey pubKeySignature = x509Response.getPublicKey(); - - boolean found = false; - for (int i = 0; i < pubKeysIdentityLink.length; i++) { - - //compare RSAPublicKeys - if ((idl.getPublicKey()[i] instanceof java.security.interfaces.RSAPublicKey) && - (pubKeySignature instanceof java.security.interfaces.RSAPublicKey)) { - - RSAPublicKey rsaPubKeySignature = (RSAPublicKey) pubKeySignature; - RSAPublicKey rsakey = (RSAPublicKey) pubKeysIdentityLink[i]; - - if (rsakey.getModulus().equals(rsaPubKeySignature.getModulus()) - && rsakey.getPublicExponent().equals(rsaPubKeySignature.getPublicExponent())) - found = true; - } - - //compare ECDSAPublicKeys - if((idl.getPublicKey()[i] instanceof iaik.security.ecc.ecdsa.ECPublicKey) && - (pubKeySignature instanceof iaik.security.ecc.ecdsa.ECPublicKey)) { - - ECPublicKey ecdsaPubKeySignature = (ECPublicKey) pubKeySignature; - ECPublicKey ecdsakey = (ECPublicKey) pubKeysIdentityLink[i]; - - if(ecdsakey.equals(ecdsaPubKeySignature)) - found = true; - } - } - - if (!found) - throw new ValidateException("validator.09", null); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java b/id.server/src/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java deleted file mode 100644 index 90b780526..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java +++ /dev/null @@ -1,894 +0,0 @@ -package at.gv.egovernment.moa.id.config; - -import iaik.pki.pathvalidation.ChainingModes; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; - -import java.math.BigInteger; -import java.security.Principal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.auth.data.Schema; -import at.gv.egovernment.moa.id.auth.data.SchemaImpl; -import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; -import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameter; -import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters; -import at.gv.egovernment.moa.id.data.IssuerAndSerial; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.StringUtils; -import at.gv.egovernment.moa.util.XPathException; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * A class that builds configuration data from a DOM based representation. - * - * @author Patrick Peck - * @author Stefan Knirsch - * @version $Id$ - */ -public class ConfigurationBuilder { - - // - // XPath namespace prefix shortcuts - // - /** an XPATH-Expression */ - protected static final String CONF = Constants.MOA_ID_CONFIG_PREFIX + ":"; - /** an XPATH-Expression */ - protected static final String DSIG = Constants.DSIG_PREFIX + ":"; - - // - // chaining mode constants appearing in the configuration file - // - /** an XPATH-Expression */ - protected static final String CM_CHAINING = "chaining"; - /** an XPATH-Expression */ - protected static final String CM_PKIX = "pkix"; - /** an XPATH-Expression */ - protected static final String DEFAULT_ENCODING = "UTF-8"; - - // - // XPath expressions to select certain parts of the configuration - // - /** an XPATH-Expression */ - protected static final String ROOT = "/" + CONF + "MOA-IDConfiguration/"; - - /** an XPATH-Expression */ - protected static final String AUTH_BKU_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "BKUSelection"; - /** an XPATH-Expression */ - protected static final String AUTH_BKUSELECT_TEMPLATE_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "Templates/" + CONF + "BKUSelectionTemplate/@URL"; - /** an XPATH-Expression */ - protected static final String AUTH_TEMPLATE_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "Templates/" + CONF + "Template/@URL"; - /** an XPATH-Expression */ - public static final String AUTH_SECLAYER_TRANSFORMS_INFO_FILENAME_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "SecurityLayer/" + CONF + "TransformsInfo/@filename"; - /** an XPATH-Expression */ - protected static final String AUTH_MOA_SP_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP"; - /** an XPATH-Expression */ - protected static final String AUTH_MOA_SP_VERIFY_IDENTITY_TRUST_ID_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP/" + CONF + "VerifyIdentityLink/" + CONF + "TrustProfileID"; - /** an XPATH-Expression */ - protected static final String AUTH_MOA_SP_VERIFY_AUTH_TRUST_ID_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP/" + CONF + "VerifyAuthBlock/" + CONF + "TrustProfileID"; - /** an XPATH-Expression */ - protected static final String AUTH_MOA_SP_VERIFY_AUTH_VERIFY_ID_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP/" + CONF + "VerifyAuthBlock/" + CONF + "VerifyTransformsInfoProfileID"; - - /** an XPATH-Expression */ - protected static final String AUTH_IDENTITY_LINK_X509SUBJECTNAME_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "IdentityLinkSigners/" + CONF + "X509SubjectName"; - - /** an XPATH-Expression */ - public static final String AUTH_VERIFY_INFOBOXES_XPATH = - ROOT + CONF + "AuthComponent/" + CONF + "VerifyInfoboxes"; - - /** an XPATH-Expression */ - protected static final String OA_XPATH = ROOT + CONF + "OnlineApplication"; - /** an XPATH-Expression */ - protected static final String OA_LOGIN_XPATH = ROOT + CONF + "OnlineApplication/@loginURL"; - /** an XPATH-Expression */ - protected static final String OA_AUTH_COMPONENT_XPATH = CONF + "AuthComponent"; - /** an XPATH-Expression */ - protected static final String OA_AUTH_COMPONENT_IDENT_NUMBER_XPATH = CONF + "IdentificationNumber"; - /** an XPATH-Expression */ - protected static final String OA_AUTH_COMPONENT_BKUSELECT_TEMPLATE_XPATH = - CONF + "Templates/" + CONF + "BKUSelectionTemplate/@URL"; - /** an XPATH-Expression */ - protected static final String OA_AUTH_COMPONENT_TEMPLATE_XPATH = - CONF + "Templates/" + CONF + "Template/@URL"; - /** an XPATH-Expression */ - protected static final String OA_AUTH_COMPONENT_TRANSFORMS_INFO_FILENAME_XPATH = CONF + "TransformsInfo/@filename"; - /** an XPATH-Expression */ - protected static final String OA_AUTH_COMPONENT_VERIFY_INFOBOXES_XPATH = CONF + "VerifyInfoboxes"; - /** an XPATH-Expression */ - protected static final String CONNECTION_PARAMETER_URL_XPATH = - CONF + "ConnectionParameter/@URL"; - /** an XPATH-Expression */ - protected static final String CONNECTION_PARAMETER_ACCEPTED_CERTS_XPATH = - CONF + "ConnectionParameter/" + CONF + "AcceptedServerCertificates"; - /** an XPATH-Expression */ - protected static final String CONNECTION_PARAMETERN_KEYSTORE_XPATH = - CONF + "ConnectionParameter/" + CONF + "ClientKeyStore"; - /** an XPATH-Expression */ - protected static final String CONNECTION_PARAMETER_KEYSTORE_PASS_XPATH = - CONNECTION_PARAMETERN_KEYSTORE_XPATH + "/@password"; - /** an XPATH-Expression */ - protected static final String GENERIC_CONFIGURATION_XPATH = - ROOT + CONF + "GenericConfiguration"; - - /** an XPATH-Expression */ - protected static final String CHAINING_MODES_XPATH = - ROOT + CONF + "ChainingModes"; - /** an XPATH-Expression */ - protected static final String CHAINING_MODES_DEFAULT_XPATH = - CHAINING_MODES_XPATH + "/@systemDefaultMode"; - /** an XPATH-Expression */ - protected static final String TRUST_ANCHOR_XPATH = - ROOT + CONF + "ChainingModes/" + CONF + "TrustAnchor"; - /** an XPATH-Expression */ - protected static final String ISSUER_XPATH = DSIG + "X509IssuerName"; - /** an XPATH-Expression */ - protected static final String SERIAL_XPATH = DSIG + "X509SerialNumber"; - /** an XPATH-Expression */ - protected static final String TRUSTED_CA_CERTIFICATES_XPATH = - ROOT + CONF + "TrustedCACertificates"; - - /** an XPATH-Expression */ - protected static final String VERIFY_INFOBOXES_DEFAULT_TRUST_PROFILE_XPATH = CONF + "DefaultTrustProfile"; - /** an XPATH-Expression */ - protected static final String VERIFY_INFOBOXES_TRUST_PROFILE_ID_XPATH = CONF + "TrustProfileID"; - /** an XPATH-Expression */ - protected static final String VERIFY_INFOBOXES_INFOBOX_XPATH = CONF + "Infobox"; - - - - - /** - * main configuration file directory name used to configure MOA-ID - */ - protected String rootConfigFileDir_; - - /** The root element of the MOA-ID configuration */ - protected Element configElem_; - - /** - * Creates a new MOAConfigurationProvider. - * - * @param configElem The root element of the MOA-ID configuration. - */ - public ConfigurationBuilder(Element configElem, String rootConfigDir) { - configElem_ = configElem; - rootConfigFileDir_ = rootConfigDir; - } - - /** - * Returns the root element of the MOA-ID configuration. - * - * @return The root element of the MOA-ID configuration. - */ - public Element getConfigElem() { - return configElem_; - } - - /** - * Build a ConnectionParameter object containing all information - * of the moa-sp element in the authentication component - * @return ConnectionParameter of the authentication component moa-sp element - */ - public ConnectionParameter buildAuthBKUConnectionParameter() { - - Element authBKU = (Element) XPathUtils.selectSingleNode(configElem_, AUTH_BKU_XPATH); - if (authBKU==null) return null; - return buildConnectionParameter(authBKU); - } - - /** - * Method buildAuthBKUSelectionType. - * - * Build a string with the configuration value of BKUSelectionAlternative - * - * @return String - */ - public String buildAuthBKUSelectionType() { - - Element authBKU = (Element) XPathUtils.selectSingleNode(configElem_, AUTH_BKU_XPATH); - if (authBKU==null) return null; - return (authBKU).getAttribute("BKUSelectionAlternative"); - } - - /** - * Build a string array with all filenames leading - * to the Transforms Information for the Security Layer - * @param contextNode The node from which should be searched - * @param xpathExpr The XPATH expression for the search - * @return String[] of filenames to the Security Layer Transforms Information - * or null if no transforms are included - */ - public String[] buildTransformsInfoFileNames(Node contextNode, String xpathExpr) { - - List transformsInfoFileNames = new ArrayList(); - - try { - NodeIterator tiIter = XPathUtils.selectNodeIterator(contextNode, xpathExpr); - - Attr tiElem; - while ((tiElem = (Attr) tiIter.nextNode()) != null) { - String tiFileName = tiElem.getNodeValue(); - transformsInfoFileNames.add(tiFileName); - } - - String[] result = new String[transformsInfoFileNames.size()]; - transformsInfoFileNames.toArray(result); - - return result; - } catch (XPathException xpe) { - return new String[0]; - } - } - - - /** - * Loads the transformsInfos from files. - * @throws Exception on any exception thrown - */ - public String[] loadTransformsInfos(String[] transformsInfoFileNames) throws Exception { - - String[] transformsInfos = new String[transformsInfoFileNames.length]; - for (int i = 0; i < transformsInfoFileNames.length; i++) { - String fileURL = transformsInfoFileNames[i]; - - //if fileURL is relative to rootConfigFileDir make it absolute - fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir_); - String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING); - transformsInfos[i] = transformsInfo; - } - return transformsInfos; - } - - /** - * Build a ConnectionParameter bean containing all information - * of the authentication component moa-sp element - * @return ConnectionParameter of the authentication component moa-sp element - */ - public ConnectionParameter buildMoaSpConnectionParameter() { - - Element connectionParameter = (Element) XPathUtils.selectSingleNode(configElem_, AUTH_MOA_SP_XPATH); - if (connectionParameter==null) return null; - return buildConnectionParameter(connectionParameter); - } - - /** - * Return a string with a url-reference to the VerifyIdentityLink trust - * profile id within the moa-sp part of the authentication component - * @return String with a url-reference to the VerifyIdentityLink trust profile ID - */ - public String getMoaSpIdentityLinkTrustProfileID() { - return XPathUtils.getElementValue( - configElem_, - AUTH_MOA_SP_VERIFY_IDENTITY_TRUST_ID_XPATH, - ""); - } - /** - * Return a string representation of an URL pointing to trusted CA Certificates - * @return String representation of an URL pointing to trusted CA Certificates - */ - public String getTrustedCACertificates() { - return XPathUtils.getElementValue( - configElem_, - TRUSTED_CA_CERTIFICATES_XPATH,null); - } - - /** - * Return a string with a url-reference to the VerifyAuthBlock trust - * profile id within the moa-sp part of the authentication component - * @return String with a url-reference to the VerifyAuthBlock trust profile ID - */ - public String getMoaSpAuthBlockTrustProfileID() { - return XPathUtils.getElementValue( - configElem_, - AUTH_MOA_SP_VERIFY_AUTH_TRUST_ID_XPATH, - ""); - } - /** - * Build a string array with references to all verify transform info - * IDs within the moa-sp part of the authentication component - * @return A string array containing all urls to the - * verify transform info IDs - */ - public String[] buildMoaSpAuthBlockVerifyTransformsInfoIDs() { - - List verifyTransformsInfoIDs = new ArrayList(); - NodeIterator vtIter = - XPathUtils.selectNodeIterator( - configElem_, - AUTH_MOA_SP_VERIFY_AUTH_VERIFY_ID_XPATH); - Element vtElem; - - while ((vtElem = (Element) vtIter.nextNode()) != null) { - - String vtInfoIDs = DOMUtils.getText(vtElem); - verifyTransformsInfoIDs.add(vtInfoIDs); - } - String[] result = new String[verifyTransformsInfoIDs.size()]; - verifyTransformsInfoIDs.toArray(result); - - return result; - } - - - /** - * Returns a list containing all X509 Subject Names - * of the Identity Link Signers - * @return a list containing the configured identity-link signer X509 subject names - */ - public List getIdentityLink_X509SubjectNames() { - - Vector x509SubjectNameList = new Vector(); - NodeIterator x509Iter = - XPathUtils.selectNodeIterator( - configElem_, - AUTH_IDENTITY_LINK_X509SUBJECTNAME_XPATH); - Element x509Elem; - - while ((x509Elem = (Element) x509Iter.nextNode()) != null) { - String vtInfoIDs = DOMUtils.getText(x509Elem); - x509SubjectNameList.add(vtInfoIDs); - } - - // now add the default identity link signers - String[] identityLinkSignersWithoutOID = MOAIDAuthConstants.IDENTITY_LINK_SIGNERS_WITHOUT_OID; - for (int i=0; inull
. - * @param moaSpIdentityLinkTrustProfileID The ID of the trust profile used for validating - * the identity link signer certificate. Needed for - * checking if this ID is not used for validating other - * infoboxes. - * - * @return An OAProxyParameter array containing beans - * with all relevant information for the authentication component of the online - * application - */ - public OAAuthParameter[] buildOnlineApplicationAuthParameters( - VerifyInfoboxParameters defaultVerifyInfoboxParameters, String moaSpIdentityLinkTrustProfileID) - throws ConfigurationException - { - - String bkuSelectionTemplateURL = - XPathUtils.getAttributeValue(configElem_, AUTH_BKUSELECT_TEMPLATE_XPATH, null); - String templateURL = - XPathUtils.getAttributeValue(configElem_, AUTH_TEMPLATE_XPATH, null); - - List OA_set = new ArrayList(); - NodeList OAIter = XPathUtils.selectNodeList(configElem_, OA_XPATH); - - for (int i = 0; i < OAIter.getLength(); i++) { - Element oAElem = (Element) OAIter.item(i); - Element authComponent = - (Element) XPathUtils.selectSingleNode(oAElem, OA_AUTH_COMPONENT_XPATH); - - OAAuthParameter oap = new OAAuthParameter(); - String publicURLPrefix = oAElem.getAttribute("publicURLPrefix"); - oap.setPublicURLPrefix(publicURLPrefix); - oap.setKeyBoxIdentier(oAElem.getAttribute("keyBoxIdentifier")); - - // get the type of the online application - String oaType = oAElem.getAttribute("type"); - oap.setOaType(oaType); - String slVersion = "1.1"; - if ("businessService".equalsIgnoreCase(oaType)) { - if (authComponent==null) { - Logger.error("Missing \"AuthComponent\" for OA of type \"businessService\""); - throw new ConfigurationException("config.02", null); - } - Element identificationNumberElem = - (Element) XPathUtils.selectSingleNode(authComponent, OA_AUTH_COMPONENT_IDENT_NUMBER_XPATH); - if (identificationNumberElem==null) { - Logger.error("Missing \"IdentificationNumber\" for OA of type \"businessService\""); - throw new ConfigurationException("config.02", null); - } - Element identificationNumberChild = DOMUtils.getElementFromNodeList(identificationNumberElem.getChildNodes()); - if (identificationNumberChild == null) { - Logger.error("Missing \"IdentificationNumber\" for OA of type \"businessService\""); - throw new ConfigurationException("config.02", null); - } - if ("false".equalsIgnoreCase(oAElem.getAttribute("calculateHPI"))) { - oap.setIdentityLinkDomainIdentifier(buildIdentityLinkDomainIdentifier(identificationNumberChild)); - } else { - // If we have business service and want to dealt with GDA, the security layer can be advised to calulate - // the Health Professional Identifier HPI instead of the wbPK - Logger.info("OA uses HPI for Identification"); - oap.setIdentityLinkDomainIdentifier(Constants.URN_PREFIX_HPI); - } - - // if OA type is "businessSErvice" set slVersion to 1.2 and ignore parameter in config file - Logger.info("OA type is \"businessService\"; setting Security Layer version to 1.2"); - slVersion = "1.2"; - - } else { - - if (authComponent!=null) { - slVersion = authComponent.getAttribute("slVersion"); - } - - } - oap.setSlVersion(slVersion); - //Check if there is an Auth-Block to read from configuration - - if (authComponent!=null) - { - oap.setProvideStammzahl(BoolUtils.valueOf(authComponent.getAttribute("provideStammzahl"))); - oap.setProvideAuthBlock(BoolUtils.valueOf(authComponent.getAttribute("provideAUTHBlock"))); - oap.setProvideIdentityLink(BoolUtils.valueOf(authComponent.getAttribute("provideIdentityLink"))); - oap.setProvideCertificate(BoolUtils.valueOf(authComponent.getAttribute("provideCertificate"))); - oap.setBkuSelectionTemplateURL(buildTemplateURL(authComponent, OA_AUTH_COMPONENT_BKUSELECT_TEMPLATE_XPATH, bkuSelectionTemplateURL)); - oap.setTemplateURL(buildTemplateURL(authComponent, OA_AUTH_COMPONENT_TEMPLATE_XPATH, templateURL)); - // load OA specific transforms if present - String[] transformsInfoFileNames = buildTransformsInfoFileNames(authComponent, OA_AUTH_COMPONENT_TRANSFORMS_INFO_FILENAME_XPATH); - try { - oap.setTransformsInfos(loadTransformsInfos(transformsInfoFileNames)); - } catch (Exception ex) { - Logger.error("Error loading transforms specified for OA \"" + publicURLPrefix + "\"; using default transforms."); - } - Node verifyInfoboxParamtersNode = XPathUtils.selectSingleNode(authComponent, OA_AUTH_COMPONENT_VERIFY_INFOBOXES_XPATH); - oap.setVerifyInfoboxParameters(buildVerifyInfoboxParameters( - verifyInfoboxParamtersNode, defaultVerifyInfoboxParameters, moaSpIdentityLinkTrustProfileID)); - } - OA_set.add(oap); - } - OAAuthParameter[] result = - new OAAuthParameter[OA_set.size()]; - OA_set.toArray(result); - - return result; - - } - - /** - * Builds the URL for a BKUSelectionTemplate or a Template. The method selects - * the uri string from the MOA ID configuration file via the given xpath expression - * and returns either this string or the default value. - * - * @param oaAuthComponent The AuthComponent element to get the template from. - * @param xpathExpr The xpath expression for selecting the template uri. - * @param defaultURL The default template url. - * @return The template url. This may either the via xpath selected uri - * or, if no template is specified within the online appliacation, - * the default url. Both may be null. - */ - protected String buildTemplateURL(Element oaAuthComponent, String xpathExpr, String defaultURL) { - String templateURL = XPathUtils.getAttributeValue(oaAuthComponent, xpathExpr, defaultURL); - if (templateURL != null) { - templateURL = FileUtils.makeAbsoluteURL(templateURL, rootConfigFileDir_); - } - return templateURL; - } - - - /** - * Method buildConnectionParameter: internal Method for creating a - * ConnectionParameter object with all data found in the incoming element - * @param root This Element contains the ConnectionParameter - * @return ConnectionParameter - */ - protected ConnectionParameter buildConnectionParameter(Element root) - { - ConnectionParameter result = new ConnectionParameter(); - result.setAcceptedServerCertificates( - XPathUtils.getElementValue(root,CONNECTION_PARAMETER_ACCEPTED_CERTS_XPATH,null)); - - result.setAcceptedServerCertificates(FileUtils.makeAbsoluteURL( - result.getAcceptedServerCertificates(), rootConfigFileDir_)); - - result.setUrl( - XPathUtils.getAttributeValue(root, CONNECTION_PARAMETER_URL_XPATH, "")); - result.setClientKeyStore( - XPathUtils.getElementValue(root,CONNECTION_PARAMETERN_KEYSTORE_XPATH,null)); - - result.setClientKeyStore(FileUtils.makeAbsoluteURL( - result.getClientKeyStore(), rootConfigFileDir_)); - - result.setClientKeyStorePassword( - XPathUtils.getAttributeValue(root,CONNECTION_PARAMETER_KEYSTORE_PASS_XPATH,"")); - - if ((result.getAcceptedServerCertificates()==null) - && (result.getUrl()=="") - && (result.getClientKeyStore()==null) - && (result.getClientKeyStorePassword()=="")) - return null; - - return result; - } - - - /** - * Build the mapping of generic configuration properties. - * - * @return a {@link Map} of generic configuration properties (a name to value - * mapping) from the configuration. - */ - public Map buildGenericConfiguration() { - - Map genericConfiguration = new HashMap(); - NodeIterator gcIter = - XPathUtils.selectNodeIterator( - configElem_, - GENERIC_CONFIGURATION_XPATH); - Element gcElem; - - while ((gcElem = (Element) gcIter.nextNode()) != null) { - String gcName = gcElem.getAttribute("name"); - String gcValue = gcElem.getAttribute("value"); - - genericConfiguration.put(gcName, gcValue); - } - - return genericConfiguration; - } - - - /** - * Returns the default chaining mode from the configuration. - * - * @return The default chaining mode. - */ - public String getDefaultChainingMode() { - String defaultChaining = - XPathUtils.getAttributeValue( - configElem_, - CHAINING_MODES_DEFAULT_XPATH, - CM_CHAINING); - - return translateChainingMode(defaultChaining); - - } - /** - * Build the chaining modes for all configured trust anchors. - * - * @return The mapping from trust anchors to chaining modes. - */ - public Map buildChainingModes() { - Map chainingModes = new HashMap(); - NodeIterator trustIter = - XPathUtils.selectNodeIterator(configElem_, TRUST_ANCHOR_XPATH); - Element trustAnchorElem; - - while ((trustAnchorElem = (Element) trustIter.nextNode()) != null) { - IssuerAndSerial issuerAndSerial = buildIssuerAndSerial(trustAnchorElem); - String mode = trustAnchorElem.getAttribute("mode"); - - if (issuerAndSerial != null) { - chainingModes.put(issuerAndSerial, translateChainingMode(mode)); - } - } - - return chainingModes; - } - - /** - * Build an IssuerAndSerial from the DOM representation. - * - * @param root The root element (being of type dsig: - * X509IssuerSerialType. - * @return The issuer and serial number contained in the root - * element or null if could not be built for any reason. - */ - protected IssuerAndSerial buildIssuerAndSerial(Element root) { - String issuer = XPathUtils.getElementValue(root, ISSUER_XPATH, null); - String serial = XPathUtils.getElementValue(root, SERIAL_XPATH, null); - - if (issuer != null && serial != null) { - try { - RFC2253NameParser nameParser = new RFC2253NameParser(issuer); - Principal issuerDN = nameParser.parse(); - - return new IssuerAndSerial(issuerDN, new BigInteger(serial)); - } catch (RFC2253NameParserException e) { - warn("config.09", new Object[] { issuer, serial }, e); - return null; - } catch (NumberFormatException e) { - warn("config.09", new Object[] { issuer, serial }, e); - return null; - } - } - return null; - } - - /** - * Translate the chaining mode from the configuration file to one used in the - * IAIK MOA API. - * - * @param chainingMode The chaining mode from the configuration. - * @return The chaining mode as provided by the ChainingModes - * interface. - * @see iaik.pki.pathvalidation.ChainingModes - */ - protected String translateChainingMode(String chainingMode) { - if (chainingMode.equals(CM_CHAINING)) { - return ChainingModes.CHAIN_MODE; - } else if (chainingMode.equals(CM_PKIX)) { - return ChainingModes.PKIX_MODE; - } else { - return ChainingModes.CHAIN_MODE; - } - } - - /** - * Builds the IdentityLinkDomainIdentifier as needed for providing it to the - * SecurityLayer for computation of the wbPK. - *

e.g.:
- * input element: - *
- * <pr:Firmenbuchnummer Identifier="FN">000468 i</pr:Firmenbuchnummer> - *

- * return value: urn:publicid:gv.at+wbpk+FN468i - * - * @param number The element holding the identification number of the business - * company. - * @return The domain identifier - */ - protected String buildIdentityLinkDomainIdentifier(Element number) { - if (number == null) { - return null; - } - String identificationNumber = number.getFirstChild().getNodeValue(); - String identifier = number.getAttribute("Identifier"); - // remove all blanks - identificationNumber = StringUtils.removeBlanks(identificationNumber); - if (number.getLocalName().equals("Firmenbuchnummer") || identifier.equalsIgnoreCase("fn")) { - // delete zeros from the beginning of the number - identificationNumber = StringUtils.deleteLeadingZeros(identificationNumber); - // remove hyphens - identificationNumber = StringUtils.removeToken(identificationNumber, "-"); - } - StringBuffer identityLinkDomainIdentifier = new StringBuffer(Constants.URN_PREFIX_WBPK); - identityLinkDomainIdentifier.append("+"); - if (!identificationNumber.startsWith(identifier)) { - identityLinkDomainIdentifier.append(identifier); - } - identityLinkDomainIdentifier.append("+"); - identityLinkDomainIdentifier.append(identificationNumber); - return identityLinkDomainIdentifier.toString(); - } - - /** - * Builds the parameters for verifying additional infoboxes (additional to the - * IdentityLink infobox). - * - * @param verifyInfoboxesElem The VerifyInfoboxes element from the - * config file. This maybe the global element or the - * elment from an Online application. - * @param defaultVerifyInfoboxParameters Default parameters to be used, if no - * VerifyInfoboxes element is present. - * This only applies to parameters - * of an specific online application and is set to - * null when building the global parameters. - * @param moaSpIdentityLinkTrustProfileID The ID of the trust profile used for validating - * the identity link signer certificate. Needed for - * checking if this ID is not used for validating other - * infoboxes. - * - * @return A {@link at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters VerifyInfoboxParameters} - * object needed for verifying additional infoboxes. - * - * @throws ConfigurationException If the trust profile for validating the identity link - * signer certificate is used for validating another infobox. - */ - public VerifyInfoboxParameters buildVerifyInfoboxParameters( - Node verifyInfoboxesElem, - VerifyInfoboxParameters defaultVerifyInfoboxParameters, - String moaSpIdentityLinkTrustProfileID) - throws ConfigurationException - { - - if ((verifyInfoboxesElem == null) && (defaultVerifyInfoboxParameters == null)) { - return null; - } - Vector identifiers = new Vector(); - List defaultIdentifiers = null; - Map defaultInfoboxParameters = null; - if (defaultVerifyInfoboxParameters != null) { - defaultIdentifiers = defaultVerifyInfoboxParameters.getIdentifiers(); - defaultInfoboxParameters = defaultVerifyInfoboxParameters.getInfoboxParameters(); - } - Hashtable infoboxParameters = new Hashtable(); - if (verifyInfoboxesElem != null) { - // get the DefaultTrustProfileID - String defaultTrustProfileID = null; - Node defaultTrustProfileNode = - XPathUtils.selectSingleNode(verifyInfoboxesElem, VERIFY_INFOBOXES_DEFAULT_TRUST_PROFILE_XPATH); - if (defaultTrustProfileNode != null) { - Node trustProfileIDNode = - XPathUtils.selectSingleNode(defaultTrustProfileNode, VERIFY_INFOBOXES_TRUST_PROFILE_ID_XPATH); - defaultTrustProfileID = trustProfileIDNode.getFirstChild().getNodeValue(); - if (defaultTrustProfileID.equals(moaSpIdentityLinkTrustProfileID)) { - throw new ConfigurationException("config.15", new Object[] {moaSpIdentityLinkTrustProfileID}); - } - } - // get the Infoboxes - NodeList infoboxes = - XPathUtils.selectNodeList(verifyInfoboxesElem, VERIFY_INFOBOXES_INFOBOX_XPATH); - for (int i=0; iMOAConfigurationException. - */ - public ConfigurationException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Create a MOAConfigurationException. - */ - public ConfigurationException( - String messageId, - Object[] parameters, - Throwable wrapped) { - - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/ConfigurationProvider.java b/id.server/src/at/gv/egovernment/moa/id/config/ConfigurationProvider.java deleted file mode 100644 index e65c47bad..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/ConfigurationProvider.java +++ /dev/null @@ -1,128 +0,0 @@ -package at.gv.egovernment.moa.id.config; - -import java.math.BigInteger; -import java.security.Principal; -import java.security.cert.X509Certificate; -import java.util.Map; - -import at.gv.egovernment.moa.id.data.IssuerAndSerial; - -/** - * Base class for AuthConfigurationProvider and ProxyConfigurationProvider, - * providing functions common to both of them. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConfigurationProvider { - - /** - * Constructor - */ - public ConfigurationProvider() { - super(); - } - - /** - * The name of the system property which contains the file name of the - * configuration file. - */ - public static final String CONFIG_PROPERTY_NAME = - "moa.id.configuration"; - - /** - * The name of the generic configuration property giving the certstore directory path. - */ - public static final String DIRECTORY_CERTSTORE_PARAMETER_PROPERTY = - "DirectoryCertStoreParameters.RootDir"; - - /** - * The name of the generic configuration property switching the ssl revocation checking on/off - */ - public static final String TRUST_MANAGER_REVOCATION_CHECKING = - "TrustManager.RevocationChecking"; - - - /** - * A Map which contains generic configuration information. Maps a - * configuration name (a String) to a configuration value (also a - * String). - */ - protected Map genericConfiguration; - - /** The default chaining mode. */ - protected String defaultChainingMode; - - /** - * A Map which contains the IssuerAndSerial to - * chaining mode (a String) mapping. - */ - protected Map chainingModes; - - /** - * the URL for the trusted CA Certificates - */ - protected String trustedCACertificates; - - /** - * main configuration file directory name used to configure MOA-ID - */ - protected String rootConfigFileDir; - - /** - * Returns the main configuration file directory used to configure MOA-ID - * - * @return the directory - */ - public String getRootConfigFileDir() { - return rootConfigFileDir; - } - - /** - * Returns the mapping of generic configuration properties. - * - * @return The mapping of generic configuration properties (a name to value - * mapping) from the configuration. - */ - public Map getGenericConfiguration() { - return genericConfiguration; - } - - /** - * Returns the value of a parameter from the generic configuration section. - * - * @return the parameter value; null if no such parameter - */ - public String getGenericConfigurationParameter(String parameter) { - if (! genericConfiguration.containsKey(parameter)) - return null; - return (String)genericConfiguration.get(parameter); - } - - /** - * Return the chaining mode for a given trust anchor. - * - * @param trustAnchor The trust anchor for which the chaining mode should be - * returned. - * @return The chaining mode for the given trust anchor. If the trust anchor - * has not been configured separately, the system default will be returned. - */ - public String getChainingMode(X509Certificate trustAnchor) { - Principal issuer = trustAnchor.getIssuerDN(); - BigInteger serial = trustAnchor.getSerialNumber(); - IssuerAndSerial issuerAndSerial = new IssuerAndSerial(issuer, serial); - - String mode = (String) chainingModes.get(issuerAndSerial); - return mode != null ? mode : defaultChainingMode; - } - - /** - * Returns the trustedCACertificates. - * @return String - */ - public String getTrustedCACertificates() { - - return trustedCACertificates; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/ConnectionParameter.java b/id.server/src/at/gv/egovernment/moa/id/config/ConnectionParameter.java deleted file mode 100644 index 30b09cfe0..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/ConnectionParameter.java +++ /dev/null @@ -1,106 +0,0 @@ -package at.gv.egovernment.moa.id.config; - -/** - * This bean class is used to store data for various connectionParameter - * within the MOA-ID configuration - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class ConnectionParameter { - - /** - * Server URL - */ - private String url; - /** - * File URL for a directory containing PKCS#12 server SSL certificates. - * From these certificates, a X509 trust store will be assembled for use - * by a JSSE TrustManager. - * This field will only be used in case of an HTTPS URL. - */ - private String acceptedServerCertificates; - /** - * File URL of a X509 key store containing the private key to be used - * for an HTTPS connection when the server requires client authentication. - * This field will only be used in case of an HTTPS URL. - */ - private String clientKeyStore; - /** - * Password protecting the client key store. - */ - private String clientKeyStorePassword; - - /** - * Checks whether the URL scheme is "https". - * @return true in case of an URL starting with "https" - */ - public boolean isHTTPSURL() { - return getUrl().indexOf("https") == 0; - } - - /** - * Returns the url. - * @return String - */ - public String getUrl() { - return url; - } - - /** - * Returns the acceptedServerCertificates. - * @return String - */ - public String getAcceptedServerCertificates() { - return acceptedServerCertificates; - } - - /** - * Sets the acceptedServerCertificates. - * @param acceptedServerCertificates The acceptedServerCertificates to set - */ - public void setAcceptedServerCertificates(String acceptedServerCertificates) { - this.acceptedServerCertificates = acceptedServerCertificates; - } - - /** - * Sets the url. - * @param url The url to set - */ - public void setUrl(String url) { - this.url = url; - } - - /** - * Returns the clientKeyStore. - * @return String - */ - public String getClientKeyStore() { - return clientKeyStore; - } - - /** - * Returns the clientKeyStorePassword. - * @return String - */ - public String getClientKeyStorePassword() { - return clientKeyStorePassword; - } - - /** - * Sets the clientKeyStore. - * @param clientKeyStore The clientKeyStore to set - */ - public void setClientKeyStore(String clientKeyStore) { - this.clientKeyStore = clientKeyStore; - } - - /** - * Sets the clientKeyStorePassword. - * @param clientKeyStorePassword The clientKeyStorePassword to set - */ - public void setClientKeyStorePassword(String clientKeyStorePassword) { - this.clientKeyStorePassword = clientKeyStorePassword; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/OAParameter.java b/id.server/src/at/gv/egovernment/moa/id/config/OAParameter.java deleted file mode 100644 index 19a27b463..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/OAParameter.java +++ /dev/null @@ -1,76 +0,0 @@ -package at.gv.egovernment.moa.id.config; - -/** - * Configuration parameters belonging to an online application, - * to be used within both, the MOA ID Auth and the - * MOA ID PROXY component. - * - * @author Harald Bratko - */ -public class OAParameter { - - /** - * type of the online application (maybe "PublicService" or "BusinessService") - */ - private String oaType; - - /** - * specifies whether the online application is a business application or not - * (true if value of {@link #oaType} is "businessService" - */ - private boolean businessService; - - /** - * public URL prefix of the online application - */ - private String publicURLPrefix; - - /** - * Returns the type of the online application. - * @return the type of the online application. - */ - public String getOaType() { - return oaType; - } - - /** - * Returns true is the OA is a businss application, otherwise - * false. - * @return true is the OA is a businss application, otherwise - * false - */ - public boolean getBusinessService() { - return this.businessService; - } - - /** - * Returns the publicURLPrefix. - * @return String - */ - public String getPublicURLPrefix() { - return publicURLPrefix; - } - - /** - * - * Sets the type of the online application. - * If the type is "businessService" the value of businessService - * ({@link #getBusinessService()}) is also set to true - * @param oaType The type of the online application. - */ - public void setOaType(String oaType) { - this.oaType = oaType; - if ("businessService".equalsIgnoreCase(oaType)) { - this.businessService = true; - } - } - - /** - * Sets the publicURLPrefix. - * @param publicURLPrefix The publicURLPrefix to set - */ - public void setPublicURLPrefix(String publicURLPrefix) { - this.publicURLPrefix = publicURLPrefix; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id.server/src/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java deleted file mode 100644 index b4af6592c..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ /dev/null @@ -1,414 +0,0 @@ -package at.gv.egovernment.moa.id.config.auth; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import at.gv.egovernment.moa.id.config.ConfigurationBuilder; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * A class providing access to the Auth Part of the MOA-ID configuration data. - * - *

Configuration data is read from an XML file, whose location is given by - * the moa.id.configuration system property.

- *

This class implements the Singleton pattern. The reload() - * method can be used to update the configuration data. Therefore, it is not - * guaranteed that consecutive calls to getInstance() will return - * the same AuthConfigurationProvider all the time. During the - * processing of a web service request, the current - * TransactionContext should be used to obtain the - * AuthConfigurationProvider local to that request.

- * - * @author Patrick Peck - * @author Stefan Knirsch - * - * @version $Id$ - */ -public class AuthConfigurationProvider extends ConfigurationProvider { - - /** DEFAULT_ENCODING is "UTF-8" */ - private static final String DEFAULT_ENCODING="UTF-8"; - /** - * The name of the generic configuration property giving the authentication session time out. - */ - public static final String AUTH_SESSION_TIMEOUT_PROPERTY = - "AuthenticationSession.TimeOut"; - /** - * The name of the generic configuration property giving the authentication data time out. - */ - public static final String AUTH_DATA_TIMEOUT_PROPERTY = - "AuthenticationData.TimeOut"; - - /** - * BKUSelectionType HTMLComplete, according to schema type BKUSelectionType - */ - public static final String BKU_SELECTION_TYPE_HTMLCOMPLETE = - "HTMLComplete"; - - /** - * BKUSelectionType HTMLSelect, according to schema type BKUSelectionType - */ - public static final String BKU_SELECTION_TYPE_HTMLSELECT = - "HTMLSelect"; - - /** - * The name of the generic configuration property allowing https connection to - * the user frontend servlets ("StartAuthentication" and "SelectBKU" servlets) - */ - public static final String FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY = - "FrontendServlets.EnableHTTPConnection"; - - /** - * The name of the generic configuration property allowing to set a individual - * DATA URL used to communicate with the BKU (SecurityLayer) - */ - public static final String INDIVIDUAL_DATA_URL_PREFIX = - "FrontendServlets.DataURLPrefix"; - - /** Singleton instance. null, if none has been created. */ - private static AuthConfigurationProvider instance; - - // - // configuration data - // - - /** - * configuration files containing transformations for rendering in the - * secure viewer of the security layer implementation; - * multiple files can be given for different mime types - */ - private String[] transformsInfoFileNames; - - /** - * transformations for rendering in the secure viewer of the security layer implementation, - * read from {@link transformsInfoFileNames}; - * multiple transformation can be given for different mime types - */ - private String[] transformsInfos; - - /** - * parameters for connection to MOA SP component - */ - private ConnectionParameter moaSpConnectionParameter; - /** - * trust profile ID to be used for verifying the identity link signature via MOA ID SP - */ - private String moaSpIdentityLinkTrustProfileID; - /** - * trust profile ID to be used for verifying the AUTH block signature via MOA ID SP - */ - private String moaSpAuthBlockTrustProfileID; - /** - * transformations to be used for verifying the AUTH block signature via MOA ID SP - */ - private String[] moaSpAuthBlockVerifyTransformsInfoIDs; - /** - * X509 SubjectNames which will be trusted - */ - private List identityLinkX509SubjectNames; - /** - * default parameters for verifying additional infoboxes. - */ - private VerifyInfoboxParameters defaultVerifyInfoboxParameters; - - /** - * configuration parameters for online applications - */ - private OAAuthParameter[] onlineApplicationAuthParameters; - /** - * the Selection Type of the bku Selection Element - */ - private String bKUSelectionType; - /** - * is the bku Selection Element present? - */ - private boolean bKUSelectable; - /** - * the bku Selection Connection Parameters - */ - private ConnectionParameter bKUConnectionParameter; - - /** - * Return the single instance of configuration data. - * - * @return AuthConfigurationProvider The current configuration data. - * @throws ConfigurationException - */ - public static synchronized AuthConfigurationProvider getInstance() - throws ConfigurationException { - - if (instance == null) { - reload(); - } - return instance; - } - - /** - * Reload the configuration data and set it if successful. - * - * @return AuthConfigurationProvider The loaded configuration data. - * @throws ConfigurationException Failure to load the configuration data. - */ - public static synchronized AuthConfigurationProvider reload() - throws ConfigurationException { - String fileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); - if (fileName == null) { - throw new ConfigurationException("config.01", null); - } - Logger.info("Loading MOA-ID-AUTH configuration " + fileName); - - instance = new AuthConfigurationProvider(fileName); - return instance; - } - - /** - * Constructor for AuthConfigurationProvider. - * @param fileName - * @throws ConfigurationException - */ - public AuthConfigurationProvider(String fileName) - throws ConfigurationException { - - load(fileName); - } - - /** - * Load the configuration data from XML file with the given name and build - * the internal data structures representing the MOA ID configuration. - * - * @param fileName The name of the XML file to load. - * @throws ConfigurationException The MOA configuration could not be - * read/built. - */ - private void load(String fileName) throws ConfigurationException { - InputStream stream = null; - Element configElem; - ConfigurationBuilder builder; - - try { - // load the main config file - stream = new BufferedInputStream(new FileInputStream(fileName)); - configElem = DOMUtils.parseXmlValidating(stream); - } catch (Throwable t) { - throw new ConfigurationException("config.03", null, t); - } - finally { - try { - if (stream != null) { - stream.close(); - } - } catch (IOException e) { - } - } - try { - // determine the directory of the root config file - rootConfigFileDir = new File(fileName).getParent(); - try { - rootConfigFileDir = new File(rootConfigFileDir).toURL().toString(); - } catch (MalformedURLException t) { - throw new ConfigurationException("config.03", null, t); - } - - // build the internal datastructures - builder = new ConfigurationBuilder(configElem, rootConfigFileDir); - bKUConnectionParameter = builder.buildAuthBKUConnectionParameter(); - bKUSelectable = (bKUConnectionParameter!=null); - bKUSelectionType = builder.buildAuthBKUSelectionType(); - genericConfiguration = builder.buildGenericConfiguration(); - transformsInfoFileNames = builder.buildTransformsInfoFileNames(builder.getConfigElem(), ConfigurationBuilder.AUTH_SECLAYER_TRANSFORMS_INFO_FILENAME_XPATH); - transformsInfos = builder.loadTransformsInfos(transformsInfoFileNames); - moaSpConnectionParameter = builder.buildMoaSpConnectionParameter(); - moaSpIdentityLinkTrustProfileID = builder.getMoaSpIdentityLinkTrustProfileID(); - moaSpAuthBlockTrustProfileID = builder.getMoaSpAuthBlockTrustProfileID(); - moaSpAuthBlockVerifyTransformsInfoIDs = builder.buildMoaSpAuthBlockVerifyTransformsInfoIDs(); - defaultVerifyInfoboxParameters = null; - Node defaultVerifyInfoboxParamtersElem = XPathUtils.selectSingleNode(configElem, ConfigurationBuilder.AUTH_VERIFY_INFOBOXES_XPATH); - if (defaultVerifyInfoboxParamtersElem != null) { - defaultVerifyInfoboxParameters = - builder.buildVerifyInfoboxParameters((Element)defaultVerifyInfoboxParamtersElem, null, moaSpIdentityLinkTrustProfileID); - } - onlineApplicationAuthParameters = builder.buildOnlineApplicationAuthParameters(defaultVerifyInfoboxParameters, moaSpIdentityLinkTrustProfileID); - identityLinkX509SubjectNames = builder.getIdentityLink_X509SubjectNames(); - defaultChainingMode = builder.getDefaultChainingMode(); - chainingModes = builder.buildChainingModes(); - trustedCACertificates = builder.getTrustedCACertificates(); - trustedCACertificates = FileUtils.makeAbsoluteURL(trustedCACertificates, rootConfigFileDir); - - } catch (Throwable t) { - throw new ConfigurationException("config.02", null, t); - } - } - - /** - * Loads the transformsInfos from files. - * @throws Exception on any exception thrown - */ -// private void loadTransformsInfos() throws Exception { -// -// transformsInfos = new String[transformsInfoFileNames.length]; -// for (int i = 0; i < transformsInfoFileNames.length; i++) { -// String fileURL = transformsInfoFileNames[i]; -// -// //if fileURL is relative to rootConfigFileDir make it absolute -// fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir); -// String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING); -// transformsInfos[i] = transformsInfo; -// } -// } - - /** - * Loads the transformsInfos from files. - * @throws Exception on any exception thrown - */ - private String[] loadTransformsInfos(String[] transformsInfoFileNames) throws Exception { - - String[] transformsInfos = new String[transformsInfoFileNames.length]; - for (int i = 0; i < transformsInfoFileNames.length; i++) { - String fileURL = transformsInfoFileNames[i]; - - //if fileURL is relative to rootConfigFileDir make it absolute - fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir); - String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING); - transformsInfos[i] = transformsInfo; - } - return transformsInfos; - } - /** - * Return a string array with all filenames leading - * to the Transforms Information for the Security Layer - * @return String[] of filenames to the Security Layer Transforms Information - */ - public String[] getTransformsInfoFileNames() { - return transformsInfoFileNames; - } - - /** - * Build an array of the OnlineApplication Parameters containing information - * about the authentication component - * @return An OAProxyParameter array containing beans - * with all relevant information for theauthentication component of the online - * application - */ - public OAAuthParameter[] getOnlineApplicationParameters() { - return onlineApplicationAuthParameters; - } - - /** - * Provides configuration information regarding the online application behind - * the given URL, relevant to the MOA-ID Auth component. - * - * @param oaURL URL requested for an online application - * @return an OAAuthParameter, or null - * if none is applicable - */ - public OAAuthParameter getOnlineApplicationParameter(String oaURL) { - OAAuthParameter[] oaParams = getOnlineApplicationParameters(); - for (int i = 0; i < oaParams.length; i++) { - OAAuthParameter oaParam = oaParams[i]; - if (oaURL.indexOf(oaParam.getPublicURLPrefix()) == 0) - return oaParam; - } - return null; - } - - /** - * Return a string with a url-reference to the VerifyAuthBlock trust - * profile id within the moa-sp part of the authentication component - * - * @return String with a url-reference to the VerifyAuthBlock trust profile ID - */ - public String getMoaSpAuthBlockTrustProfileID() { - return moaSpAuthBlockTrustProfileID; - } - - /** - * Return a string array with references to all verify transform info - * IDs within the moa-sp part of the authentication component - * @return A string array containing all urls to the - * verify transform info IDs - */ - public String[] getMoaSpAuthBlockVerifyTransformsInfoIDs() { - return moaSpAuthBlockVerifyTransformsInfoIDs; - } - - /** - * Return a ConnectionParameter bean containing all information - * of the authentication component moa-sp element - * @return ConnectionParameter of the authentication component moa-sp element - */ - public ConnectionParameter getMoaSpConnectionParameter() { - return moaSpConnectionParameter; - } - - /** - * Return a string with a url-reference to the VerifyIdentityLink trust - * profile id within the moa-sp part of the authentication component - * @return String with a url-reference to the VerifyIdentityLink trust profile ID - */ - public String getMoaSpIdentityLinkTrustProfileID() { - return moaSpIdentityLinkTrustProfileID; - } - /** - * Returns the transformsInfos. - * @return String[] - */ - public String[] getTransformsInfos() { - return transformsInfos; - } - - /** - * Returns the identityLinkX509SubjectNames. - * @return List - */ - public List getIdentityLinkX509SubjectNames() { - return identityLinkX509SubjectNames; - } - - /** - * Returns the bKUConnectionParameter. - * @return ConnectionParameter - */ - public ConnectionParameter getBKUConnectionParameter() { - return bKUConnectionParameter; - } - - /** - * Returns the bKUSelectable. - * @return boolean - */ - public boolean isBKUSelectable() { - return bKUSelectable; - } - - /** - * Returns the bKUSelectionType. - * @return String - */ - public String getBKUSelectionType() { - return bKUSelectionType; - } - - /** - * Returns the defaultVerifyInfoboxParameters. - * - * @return The defaultVerifyInfoboxParameters. - */ - public VerifyInfoboxParameters getDefaultVerifyInfoboxParameters() { - return defaultVerifyInfoboxParameters; - } - -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id.server/src/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java deleted file mode 100644 index ba3b61f9d..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java +++ /dev/null @@ -1,268 +0,0 @@ -package at.gv.egovernment.moa.id.config.auth; - -import at.gv.egovernment.moa.id.config.OAParameter; - -/** - * Configuration parameters belonging to an online application, - * to use with the MOA ID Auth component. - * - * @author Stefan Knirsch - * @version $Id$ - */ -/** - * - * - * @author Harald Bratko - */ -public class OAAuthParameter extends OAParameter { - /** - * Sercurity Layer version - */ - private String slVersion; - /** - * true, if the Security Layer version is version 1.2, otherwise false - */ - private boolean slVersion12; - /** - * identityLinkDomainIdentifier - * (e.g urn:publicid:gv.at+wbpk+FN468i for a "Firmenbuchnummer") - *
- * only used within a business application context for providing it to the - * security layer as input for wbPK computation - */ - private String identityLinkDomainIdentifier; - /** - * key box Identifier (e.g. CertifiedKeypair, SecureSignatureKeypair) - */ - private String keyBoxIdentifier; - /** - * transformations for rendering in the secure viewer of the security layer - * implementation; multiple transformation can be given for different mime types - */ - private String[] transformsInfos; - /** - * determines whether "Stammzahl" is to be included in the authentication data - */ - private boolean provideStammzahl; - /** - * determines whether AUTH block is to be included in the authentication data - */ - private boolean provideAuthBlock; - /** - * determines whether identity link is to be included in the authentication data - */ - private boolean provideIdentityLink; - /** - * determines whether the certificate is to be included in the authentication data - */ - private boolean provideCertificate; - /** - * url to a template for web page "Auswahl der Bürgerkartenumgebung" - */ - private String bkuSelectionTemplateURL; - /** - * template for web page "Anmeldung mit Bürgerkarte" - */ - private String templateURL; - /** - * Parameters for verifying infoboxes. - */ - private VerifyInfoboxParameters verifyInfoboxParameters; - - /** - * Returns true if the Security Layer version is version 1.2, - * otherwise false. - * @return true if the Security Layer version is version 1.2, - * otherwise false - */ - public boolean getSlVersion12() { - return slVersion12; - } - - /** - * Returns the security layer version. - * @return the security layer version. - */ - public String getSlVersion() { - return slVersion; - } - - /** - * Returns the identityLinkDomainIdentifier. - * @return the identityLinkDomainIdentifier. - */ - public String getIdentityLinkDomainIdentifier() { - return identityLinkDomainIdentifier; - } - - /** - * Returns the transformsInfos. - * @return the transformsInfos. - */ - public String[] getTransformsInfos() { - return transformsInfos; - } - - /** - * Returns the provideAuthBlock. - * @return String - */ - public boolean getProvideAuthBlock() { - return provideAuthBlock; - } - - /** - * Returns the provideIdentityLink. - * @return String - */ - public boolean getProvideIdentityLink() { - return provideIdentityLink; - } - - /** - * Returns the provideStammzahl. - * @return String - */ - public boolean getProvideStammzahl() { - return provideStammzahl; - } - - /** - * Returns true if the certificate should be provided within the - * authentication data, otherwise false. - * @return true if the certificate should be provided, - * otherwise false - */ - public boolean getProvideCertifcate() { - return provideCertificate; - } - - /** - * Returns the key box identifier. - * @return String - */ - public String getKeyBoxIdentifier() { - return keyBoxIdentifier; - } - - /** - * Returns the BkuSelectionTemplate url. - * @return The BkuSelectionTemplate url or null if no url for - * a BkuSelectionTemplate is set. - */ - public String getBkuSelectionTemplateURL() { - return bkuSelectionTemplateURL; - } - - /** - * Returns the TemplateURL url. - * @return The TemplateURL url or null if no url for - * a Template is set. - */ - public String getTemplateURL() { - return templateURL; - } - - /** - * Returns the parameters for verifying additional infoboxes. - * - * @return The parameters for verifying additional infoboxes. - * Maybe null. - */ - public VerifyInfoboxParameters getVerifyInfoboxParameters() { - return verifyInfoboxParameters; - } - - /** - * Sets the security layer version. - * Also sets slVersion12 ({@link #getSlVersion12()}) - * to true if the Security Layer version is 1.2. - * @param slVersion The security layer version to be used. - */ - public void setSlVersion(String slVersion) { - this.slVersion = slVersion; - if ("1.2".equals(slVersion)) { - this.slVersion12 = true; - } - } - /** - * Sets the IdentityLinkDomainIdentifier. - * @param identityLinkDomainIdentifier The IdentityLinkDomainIdentifiern number of the online application. - */ - public void setIdentityLinkDomainIdentifier(String identityLinkDomainIdentifier) { - this.identityLinkDomainIdentifier = identityLinkDomainIdentifier; - } - /** - * Sets the transformsInfos. - * @param transformsInfos The transformsInfos to be used. - */ - public void setTransformsInfos(String[] transformsInfos) { - this.transformsInfos = transformsInfos; - } - /** - * Sets the provideAuthBlock. - * @param provideAuthBlock The provideAuthBlock to set - */ - public void setProvideAuthBlock(boolean provideAuthBlock) { - this.provideAuthBlock = provideAuthBlock; - } - - /** - * Sets the provideIdentityLink. - * @param provideIdentityLink The provideIdentityLink to set - */ - public void setProvideIdentityLink(boolean provideIdentityLink) { - this.provideIdentityLink = provideIdentityLink; - } - - /** - * Sets the provideStammzahl. - * @param provideStammzahl The provideStammzahl to set - */ - public void setProvideStammzahl(boolean provideStammzahl) { - this.provideStammzahl = provideStammzahl; - } - - /** - * Sets the provideCertificate variable. - * @param provideCertificate The provideCertificate value to set - */ - public void setProvideCertificate(boolean provideCertificate) { - this.provideCertificate = provideCertificate; - } - - /** - * Sets the key box identifier. - * @param keyBoxIdentifier to set - */ - public void setKeyBoxIdentier(String keyBoxIdentifier) { - this.keyBoxIdentifier = keyBoxIdentifier; - } - - /** - * Sets the BkuSelectionTemplate url. - * @param bkuSelectionTemplateURL The url string specifying the location - * of a BkuSelectionTemplate. - */ - public void setBkuSelectionTemplateURL(String bkuSelectionTemplateURL) { - this.bkuSelectionTemplateURL = bkuSelectionTemplateURL; - } - - /** - * Sets the Template url. - * @param templateURL The url string specifying the location - * of a Template. - */ - public void setTemplateURL(String templateURL) { - this.templateURL = templateURL; - } - - /** - * Sets the parameters for verifying additonal (to the identitylink infobox) infoboxes. - * - * @param verifyInfoboxParameters The verifyInfoboxParameters to set. - */ - public void setVerifyInfoboxParameters(VerifyInfoboxParameters verifyInfoboxParameters) { - this.verifyInfoboxParameters = verifyInfoboxParameters; - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java b/id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java deleted file mode 100644 index fbd42f975..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java +++ /dev/null @@ -1,360 +0,0 @@ -package at.gv.egovernment.moa.id.config.auth; - -import java.io.IOException; -import java.util.Iterator; -import java.util.List; - -import javax.xml.transform.TransformerException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.data.Schema; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.StringUtils; - -/** - * This class is a container for parameters that maybe needed for verifying an infobox. - * - * @author Harald Bratko - */ -public class VerifyInfoboxParameter { - - /** - * The default package name (first part) of a infobox validator class. - */ - public static final String DEFAULT_PACKAGE_TRUNK = "at.gv.egovernment.moa.id.auth.validator."; - - /** - * The identifier of the infobox to be verified. This identifier must exactly the - * identifier of the infobox returned by BKU. - */ - protected String identifier_; - - /** - * The friendly name of the infobox. - * This name is used within browser messages, thus it should be the german equivalent of - * the {@link #identifier_ infobox identifier} (e.g. "Stellvertretungen" - * for "Mandates" or "GDAToken" for - * "EHSPToken". - *
If not specified within the config file the {@link #identifier_ infobox identifier} - * will be used. - */ - protected String friendlyName_; - - /** - * The Id of the TrustProfile to be used for validating certificates. - */ - protected String trustProfileID_; - - /** - * The full name of the class to be used for verifying the infobox. - */ - protected String validatorClassName_; - - /** - * Schema location URIs that may be needed by the - * validator to parse infobox tokens. - * Each entry in the list is a {@link at.gv.egovernment.moa.id.auth.data.Schema Schema} - * specifying the location of an XML schema. - */ - protected List schemaLocations_; - - /** - * Application specific parameters that may be needed for verifying an infobox. - */ - protected Element applicationSpecificParams_; - - /** - * Specifies if the infobox is be required to be returned by the BKU. - */ - protected boolean required_; - - /** - * Specifies whether the Stammzahl should be passed to the verifying - * application or not. - */ - protected boolean provideStammzahl_; - - /** - * Specifies whether the identity link should be passed to the verifying - * application or not. - */ - protected boolean provideIdentityLink_; - - /** - * Initializes this VerifiyInfoboxParamater with the given identifier and a default - * validator class name. - * - * @param identifier The identifier of the infobox to be verified. - */ - public VerifyInfoboxParameter(String identifier) { - identifier_ = identifier; - StringBuffer sb = new StringBuffer(DEFAULT_PACKAGE_TRUNK); - sb.append(identifier.toLowerCase()); - sb.append("."); - sb.append(identifier.substring(0, 1).toUpperCase()); - sb.append(identifier.substring(1)); - sb.append("Validator"); - validatorClassName_ = sb.toString(); - } - - /** - * Returns application specific parameters. - * Each child element of this element contains a verifying application specific parameter. {@link #applicationSpecificParams_} - * - * @see #applicationSpecificParams_ - * - * @return Application specific parameters. - */ - public Element getApplicationSpecificParams() { - return applicationSpecificParams_; - } - - /** - * Sets the application specific parameters. - * - * @see #applicationSpecificParams_ - * - * @param applicationSpecificParams The application specific parameters to set. - */ - public void setApplicationSpecificParams(Element applicationSpecificParams) { - applicationSpecificParams_ = applicationSpecificParams; - } - - /** - * Returns the friendly name. - * - * @see #friendlyName_ - * - * @return The friendly name. - */ - public String getFriendlyName() { - return friendlyName_; - } - - /** - * Sets the friendly name. - * - * @param friendlyName The friendly name to set. - */ - public void setFriendlyName(String friendlyName) { - friendlyName_ = friendlyName; - } - - /** - * Returns the infobox identifier. - * - * @see #identifier_ - * - * @return The infobox identifier. - */ - public String getIdentifier() { - return identifier_; - } - - /** - * Sets the the infobox identifier. - * - * @see #identifier_ - * - * @param identifier The infobox identifier to set. - */ - public void setIdentifier(String identifier) { - identifier_ = identifier; - } - - /** - * Specifies whether the identity link should be passed to the verifying application - * or not. - * - * @return True if the identity link should be passed to the verifying - * application, otherwise false. - */ - public boolean getProvideIdentityLink() { - return provideIdentityLink_; - } - - /** - * Sets the {@link #provideIdentityLink_} parameter. - * - * @param provideIdentityLink True if the identity link should be passed to - * the verifying application, otherwise false. - */ - public void setProvideIdentityLink(boolean provideIdentityLink) { - provideIdentityLink_ = provideIdentityLink; - } - - /** - * Specifies whether the Stammzahl should be passed to the verifying - * application or not. - * - * @return True if the Stammzahl should be passed to the - * verifying application, otherwise false. - */ - public boolean getProvideStammzahl() { - return provideStammzahl_; - } - - /** - * Sets the {@link #provideStammzahl_} parameter. - * - * @param provideStammzahl True if the Stammzahl should be - * passed to the verifying application, otherwise false. - */ - public void setProvideStammzahl(boolean provideStammzahl) { - provideStammzahl_ = provideStammzahl; - } - - /** - * Specifies whether the infobox is required or not. - * - * @return True if the infobox is required to be returned by the BKU, - * otherwise false. - */ - public boolean isRequired() { - return required_; - } - - /** - * Sets the {@link #required_} parameter. - * - * @param required True if the infobox is required to be returned by the - * BKU, otherwise false. - */ - public void setRequired(boolean required) { - required_ = required; - } - - /** - * Schema location URIs that may be needed by the - * validator to parse infobox tokens. - * Each entry in the list is a {@link at.gv.egovernment.moa.id.auth.data.Schema Schema} - * specifying the location of an XML schema. - * - * @return A list of {@link at.gv.egovernment.moa.id.auth.data.Schema Schema} objects - * each of them specifying the location of an XML schema. - */ - public List getSchemaLocations() { - return schemaLocations_; - } - - /** - * Sets the schema locations. - * - * @see #schemaLocations_ - * - * @param schemaLocations The schema location list to be set. - */ - public void setSchemaLocations(List schemaLocations) { - schemaLocations_ = schemaLocations; - } - - /** - * Returns the ID of the trust profile to be used for verifying certificates. - * - * @return The ID of the trust profile to be used for verifying certificates. - * Maybe null. - */ - public String getTrustProfileID() { - return trustProfileID_; - } - - /** - * Sets the ID of the trust profile to be used for verifying certificates. - * - * @param trustProfileID The ID of the trust profile to be used for verifying certificates. - */ - public void setTrustProfileID(String trustProfileID) { - trustProfileID_ = trustProfileID; - } - - /** - * Returns the name of the class to be used for verifying this infobox. - * - * @return The name of the class to be used for verifying this infobox. - */ - public String getValidatorClassName() { - return validatorClassName_; - } - - /** - * Sets the name of the class to be used for verifying this infobox. - * - * @param validatorClassName The name of the class to be used for verifying this infobox. - */ - public void setValidatorClassName(String validatorClassName) { - validatorClassName_ = validatorClassName; - } - - /** - * Get a string representation of this object. - * This method is for debugging purposes only. - * - * @return A string representation of this object. - */ - public String toString() { - - StringBuffer buffer = new StringBuffer(1024); - - buffer.append(" "); - buffer.append("\n"); - if (friendlyName_ != null) { - buffer.append(" "); - buffer.append(friendlyName_); - buffer.append(""); - buffer.append("\n"); - } - if (trustProfileID_ != null) { - buffer.append(" "); - buffer.append(trustProfileID_); - buffer.append(""); - buffer.append("\n"); - } - if (validatorClassName_ != null) { - buffer.append(" "); - buffer.append(validatorClassName_); - buffer.append(""); - buffer.append("\n"); - } - if (schemaLocations_ != null) { - buffer.append(" "); - buffer.append("\n"); - Iterator it = schemaLocations_.iterator(); - while (it.hasNext()) { - buffer.append(" \n"); - } - buffer.append(" "); - buffer.append("\n"); - } - if (applicationSpecificParams_ != null) { - try { - String applicationSpecificParams = DOMUtils.serializeNode(applicationSpecificParams_); - buffer.append(" "); - buffer.append(StringUtils.removeXMLDeclaration(applicationSpecificParams)); - buffer.append("\n"); - } catch (TransformerException e) { - // do nothing - } catch (IOException e) { - // do nothing - } - } - buffer.append(" "); - - - return buffer.toString() ; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java b/id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java deleted file mode 100644 index 15c0c328c..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java +++ /dev/null @@ -1,135 +0,0 @@ -package at.gv.egovernment.moa.id.config.auth; - -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * This class contains the parameters for verifying all the infoboxes configured for an - * online application. - * - * @author Harald Bratko - */ -public class VerifyInfoboxParameters { - - /** - * A map of {@link VerifyInfoboxParameter} objects. - * Each of these objects contains parameters that maybe needed for validating an - * infobox. - */ - protected Map infoboxParameters_; - - /** - * A list of the identifiers of the infoboxes supported by this - * VerifyInfoboxParameters; - */ - protected List identifiers_; - - /** - * Holds the (comma separated) identifiers of those infoboxes MOA-IF is able to validate - * in the context of the actual online application. - * The string will be added as value of the PushInfobox parameter in the - * HTML form used for reading the infoboxes from the BKU. - */ - protected String pushInfobox_; - - /** - * Initializes this VerifyInfoboxParameters with an empty {@link #infoboxParameters_} - * map. - */ - public VerifyInfoboxParameters() { - infoboxParameters_ = new Hashtable(); - pushInfobox_ = ""; - } - - /** - * Initializes this VerifyInfoboxParameters with the given - * infoboxParameters map and builds the {@link #pushInfobox_} string - * from the keys of the given map. - */ - public VerifyInfoboxParameters(List identifiers, Map infoboxParameters) { - identifiers_ = identifiers; - infoboxParameters_ = infoboxParameters; - // build the pushInfobox string - if ((identifiers != null) && (!identifiers.isEmpty())) { - StringBuffer identifiersSB = new StringBuffer(); - int identifiersNum = identifiers.size(); - int i = 1; - Iterator it = identifiers.iterator(); - while (it.hasNext()) { - identifiersSB.append((String)it.next()); - if (i != identifiersNum) { - identifiersSB.append(","); - } - i++; - } - pushInfobox_ = identifiersSB.toString(); - } else { - pushInfobox_ = ""; - } - } - - /** - * Returns the (comma separated) identifiers of the infoboxes configured for the actual - * online application. - * - * @see #pushInfobox_ - * - * @return The (comma separated) identifiers of the infoboxes configured for the actual - * online application. - */ - public String getPushInfobox() { - return pushInfobox_; - } - - /** - * Sets the {@link #pushInfobox_} string. - * - * @param pushInfobox The pushInfobox string to be set. - */ - public void setPushInfobox(String pushInfobox) { - pushInfobox_ = pushInfobox; - } - - /** - * Returns map of {@link VerifyInfoboxParameter} objects. - * Each of these objects contains parameters that maybe needed for validating an - * infobox. - * - * @return The map of {@link VerifyInfoboxParameter} objects. - */ - public Map getInfoboxParameters() { - return infoboxParameters_; - } - - /** - * Sets the map of {@link VerifyInfoboxParameter} objects. - * - * @see #infoboxParameters_ - * - * @param infoboxParameters The infoboxParameters to set. - */ - public void setInfoboxParameters(Map infoboxParameters) { - infoboxParameters_ = infoboxParameters; - } - - /** - * Returns the identifiers of the supported infoboxes. - * - * @return The identifiers. - */ - public List getIdentifiers() { - return identifiers_; - } - - /** - * Sets the identifiers. - * - * @param identifiers The identifiers to set. - */ - public void setIdentifiers(List identifiers) { - identifiers_ = identifiers; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java b/id.server/src/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java deleted file mode 100644 index d25cb3b2b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java +++ /dev/null @@ -1,173 +0,0 @@ -package at.gv.egovernment.moa.id.config.proxy; - -import java.util.HashMap; -import java.util.Map; - -/** - * Holds configuration data concerning an online application for use by the MOA-ID Proxy component. - * These include the login type (stateful or stateless), the HTTP authentication type, - * and information needed to add authentication parameters or headers for a URL connection - * to the remote online application. - * @see MOAIDConfiguration-1.1.xsd, element Configuration - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class OAConfiguration { - - /** Constant for an login method */ - public static final String LOGINTYPE_STATEFUL = "stateful"; - /** Constant for an login method */ - public static final String LOGINTYPE_STATELESS = "stateless"; - - /** Constant for an auth method */ - public static final String BASIC_AUTH = "basic"; - /** Constant for an auth method */ - public static final String HEADER_AUTH = "header"; - /** Constant for an auth method */ - public static final String PARAM_AUTH = "param"; - - - /** Constant for binding */ - public static final String BINDUNG_USERNAME = "userName"; - /** Constant for binding */ - public static final String BINDUNG_FULL = "full"; - /** Constant for binding */ - public static final String BINDUNG_NONE = "none"; - /** Constant for binding */ - public static final String BINDUNG_NOMATCH = "noMatch"; - - /** login type: stateful or stateless */ - String loginType; - /** authentication type: basic, header, or param */ - String authType; - /** - * mapping of parameter names to AuthenticationData field names - * in case of authentication type "header-auth" - */ - Map paramAuthMapping; - /** - * mapping of parameter names to AuthenticationData field names - * in case of authentication type "param-auth" - */ - Map headerAuthMapping; - /** mapping for user ID to be used in case of authentication type "basic-auth" */ - String basicAuthUserIDMapping; - /** mapping for password to be used in case of authentication type "basic-auth" */ - String basicAuthPasswordMapping; - /** Binding for basic authentication */ - String binding; - - /** - * Returns the basicAuthPasswordMapping. - * @return String - */ - public String getBasicAuthPasswordMapping() { - return basicAuthPasswordMapping; - } - - /** - * Returns the basicAuthUserIDMapping. - * @return String - */ - public String getBasicAuthUserIDMapping() { - return basicAuthUserIDMapping; - } - - /** - * Returns the headerAuthMapping. - * @return HashMap - */ - public Map getHeaderAuthMapping() { - return headerAuthMapping; - } - - /** - * Returns the loginType. - * @return String - */ - public String getLoginType() { - return loginType; - } - - /** - * Returns the paramAuthMapping. - * @return HashMap - */ - public Map getParamAuthMapping() { - return paramAuthMapping; - } - - /** - * Returns the binding. - * @return String - */ - public String getBinding() { - return binding; - } - - /** - * Sets the basicAuthPasswordMapping. - * @param basicAuthPassword The basicAuthPasswordMapping to set - */ - public void setBasicAuthPasswordMapping(String basicAuthPassword) { - this.basicAuthPasswordMapping = basicAuthPassword; - } - - /** - * Sets the basicAuthUserIDMapping. - * @param basicAuthUserID The basicAuthUserIDMapping to set - */ - public void setBasicAuthUserIDMapping(String basicAuthUserID) { - this.basicAuthUserIDMapping = basicAuthUserID; - } - - /** - * Sets the headerAuthMapping. - * @param headerAuth The headerAuthMapping to set - */ - public void setHeaderAuthMapping(HashMap headerAuth) { - this.headerAuthMapping = headerAuth; - } - - /** - * Sets the loginType. - * @param loginType The loginType to set - */ - public void setLoginType(String loginType) { - this.loginType = loginType; - } - - /** - * Sets the paramAuthMapping. - * @param paramAuth The paramAuthMapping to set - */ - public void setParamAuthMapping(HashMap paramAuth) { - this.paramAuthMapping = paramAuth; - } - - /** - * Returns the authType. - * @return String - */ - public String getAuthType() { - return authType; - } - - /** - * Sets the authType. - * @param authLoginType The authType to set - */ - public void setAuthType(String authLoginType) { - this.authType = authLoginType; - } - - /** - * Sets the binding. - * @param binding The binding to be set. - */ - public void setBinding (String binding) { - this.binding = binding; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java b/id.server/src/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java deleted file mode 100644 index 83ab73dcd..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java +++ /dev/null @@ -1,184 +0,0 @@ -package at.gv.egovernment.moa.id.config.proxy; - -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.OAParameter; - -/** - * Configuration parameters belonging to an online application, - * to use with the MOA ID Proxy component. - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class OAProxyParameter extends OAParameter { - -// /** -// * public URL prefix of the online application -// */ -// private String publicURLPrefix; - /** - * URL of online application configuration file; - * defaults to relative URL /moaconfig.xml - */ - private String configFileURL; - /** - * implementation of {@link at.gv.egovernment.moa.id.proxy.LoginParameterResolver} interface - * to be used for authenticating the online application; - * defaults to {@link at.gv.egovernment.moa.id.proxy.DefaultLoginParameterResolver} - */ - private String loginParameterResolverImpl; - - /** - * Configuration Parameter of LoginParameterResolver - */ - private String loginParameterResolverConfiguration; - - /** - * implementation of {@link at.gv.egovernment.moa.id.proxy.ConnectionBuilder} interface - * to be used for connecting to the online application; - * defaults to {@link at.gv.egovernment.moa.id.proxy.DefaultConnectionBuilder} - */ - private String connectionBuilderImpl; - /** - * session time out to be used in case of a stateless online application - */ - private int sessionTimeOut; - /** - * parameters regarding the connection from the proxy to the online application - */ - private ConnectionParameter connectionParameter; - /** - * parameters for logging into the online application - */ - private OAConfiguration oaConfiguration; - - - /** - * Returns the configFileURL. - * @return String - */ - public String getConfigFileURL() { - return configFileURL; - } - - /** - * Returns the sessionTimeOut. - * @return int - */ - public int getSessionTimeOut() { - return sessionTimeOut; - } - - /** - * Returns the connectionParameter. - * @return ConnectionParameter - */ - public ConnectionParameter getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the configFileURL for the proxy. - * @param oaProxyConfigFileURL The configFileURL to set - */ - public void setConfigFileURL(String oaProxyConfigFileURL) { - this.configFileURL = oaProxyConfigFileURL; - } - - /** - * Sets the sessionTimeOut for the proxy. - * @param oaProxySessionTimeOut The sessionTimeOut to set - */ - public void setSessionTimeOut(int oaProxySessionTimeOut) { - this.sessionTimeOut = oaProxySessionTimeOut; - } - - /** - * Sets the connectionParameter for the proxy. - * @param proxyConnectionParameter The connectionParameter to set - */ - public void setConnectionParameter(ConnectionParameter proxyConnectionParameter) { - this.connectionParameter = proxyConnectionParameter; - } - -// /** -// * Returns the publicURLPrefix. -// * @return String -// */ -// public String getPublicURLPrefix() { -// return publicURLPrefix; -// } -// -// /** -// * Sets the publicURLPrefix. -// * @param publicURLPrefix The publicURLPrefix to set -// */ -// public void setPublicURLPrefix(String url) { -// this.publicURLPrefix = url; -// } - - /** - * Returns the connectionBuilderImpl. - * @return String - */ - public String getConnectionBuilderImpl() { - return connectionBuilderImpl; - } - - /** - * Returns the loginParameterResolverImpl. - * @return String - */ - public String getLoginParameterResolverImpl() { - return loginParameterResolverImpl; - } - - /** - * Returns the loginParameterResolverConfiguration. - * @return String - */ - public String getLoginParameterResolverConfiguration() { - return loginParameterResolverConfiguration; - } - - /** - * Sets the connectionBuilderImpl for the proxy. - * @param connectionBuilderImpl The connectionBuilderImpl to set - */ - public void setConnectionBuilderImpl(String connectionBuilderImpl) { - this.connectionBuilderImpl = connectionBuilderImpl; - } - - /** - * Sets the loginParameterResolverImpl for the proxy. - * @param loginParameterResolverImpl The loginParameterResolverImpl to set - */ - public void setLoginParameterResolverImpl(String loginParameterResolverImpl) { - this.loginParameterResolverImpl = loginParameterResolverImpl; - } - - /** - * Sets the loginParameterResolverConfiguration for the proxy. - * @param loginParameterResolverConfiguration The loginParameterResolverImpl to set - */ - public void setLoginParameterResolverConfiguration(String loginParameterResolverConfiguration) { - this.loginParameterResolverConfiguration = loginParameterResolverConfiguration; - } - - /** - * Returns the oaConfiguration. - * @return OAConfiguration - */ - public OAConfiguration getOaConfiguration() { - return oaConfiguration; - } - - /** - * Sets the oaConfiguration. - * @param oaConfiguration The oaConfiguration to set - */ - public void setOaConfiguration(OAConfiguration oaConfiguration) { - this.oaConfiguration = oaConfiguration; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java b/id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java deleted file mode 100644 index f578ea634..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (C) 2002 IAIK -// http://jce.iaik.tugraz.at -// -// Copyright (C) 2007 Stiftung Secure Information and -// Communication Technologies SIC -// http://www.sic.st -// -// All rights reserved. -// -// This source is provided for inspection purposes and recompilation only, -// unless specified differently in a contract with IAIK. This source has to -// be kept in strict confidence and must not be disclosed to any third party -// under any circumstances. Redistribution in source and binary forms, with -// or without modification, are permitted in any case! -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -// SUCH DAMAGE. - -package at.gv.egovernment.moa.id.config.proxy; - -import java.io.ByteArrayInputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.id.config.ConfigurationBuilder; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Builds the configuration for MOA-ID Proxy. - */ -public class ProxyConfigurationBuilder extends ConfigurationBuilder { - - /** - * Default online application configuration file name - * (used when /OnlineApplication/ProxyComponent@configFileURL is null). - */ - public static final String DEFAULT_OA_CONFIG_FILENAME = "MOAConfig.xml"; - - /** an XPATH-Expression */ - private static final String PROXY_AUTH_XPATH = - ROOT + CONF + "ProxyComponent/" + CONF + "AuthComponent"; - /** an XPATH-Expression */ - protected static final String ROOTOA = "/" + CONF + "Configuration/"; - /** an XPATH-Expression */ - private static final String OA_PROXY_COMPONENT_XPATH = CONF + "ProxyComponent"; - /** an XPATH-Expression */ - private static final String OA_PROXY_COMPONENT_ABSOLUTE_XPATH = ROOT + CONF + "OnlineApplication/" + CONF + "ProxyComponent"; - /** an XPATH-Expression */ - private static final String OA_PROXY_URL_XPATH = CONF + "ProxyComponent/@configFileURL"; - /** an XPATH-Expression */ - private static final String OA_PROXY_SESSION_TIMEOUT_XPATH = CONF + "ProxyComponent/@sessionTimeOut"; - /** an XPATH-Expression */ - private static final String OA_PROXY_LOGIN_PARA_XPATH = CONF + "ProxyComponent/@loginParameterResolverImpl"; - /** an XPATH-Expression */ - private static final String OA_PROXY_LOGIN_PARA_CONF_XPATH = CONF + "ProxyComponent/@loginParameterResolverConfiguration"; - /** an XPATH-Expression */ - private static final String OA_PROXY_CONNECTION_BUILDER_XPATH = CONF + "ProxyComponent/@connectionBuilderImpl"; - /** an XPATH-Expression */ - protected static final String OACONF_LOGIN_TYPE_XPATH = - ROOTOA + CONF + "LoginType"; - /** an XPATH-Expression */ - protected static final String OACONF_BINDING_TYPE_XPATH = - ROOTOA + CONF + "Binding"; - /** an XPATH-Expression */ - protected static final String OACONF_PARAM_AUTH_PARAMETER_XPATH = - ROOTOA + CONF + "ParamAuth/" + CONF + "Parameter"; - /** an XPATH-Expression */ - protected static final String OACONF_USER_ID_XPATH = - ROOTOA + CONF + "BasicAuth/" + CONF + "UserID"; - /** an XPATH-Expression */ - protected static final String OACONF_PASSWORD_XPATH = - ROOTOA + CONF + "BasicAuth/" + CONF + "Password"; - /** an XPATH-Expression */ - protected static final String OACONF_HEADER_AUTH_HEADER_XPATH = - ROOTOA + CONF + "HeaderAuth/" + CONF + "Header"; - - /** - * Creates a new MOAConfigurationProvider. - * - * @param configElem The root element of the MOA-ID configuration. - */ - public ProxyConfigurationBuilder(Element configElem, String rootConfigDir) { - super(configElem, rootConfigDir); - } - - /** - * Method buildOAConfiguration. - * - * Build an {@link OAConfiguration} Object from the given configuration DOM element - * - * @param root - * @return OAConfiguration - * @throws ConfigurationException - */ - public OAConfiguration buildOAConfiguration(Element root) throws ConfigurationException{ - - OAConfiguration oaConfiguration = new OAConfiguration(); - - //The LoginType hast to be "stateless" or "stateful" to be valid - - oaConfiguration.setLoginType( - XPathUtils.getElementValue(root, OACONF_LOGIN_TYPE_XPATH, null)); - - oaConfiguration.setBinding( - XPathUtils.getElementValue(root, OACONF_BINDING_TYPE_XPATH, OAConfiguration.BINDUNG_FULL)); - - //Try to build the Parameter Auth Parameters - NodeIterator paramAuthIter = - XPathUtils.selectNodeIterator( - root, - OACONF_PARAM_AUTH_PARAMETER_XPATH); - Element paramAuthElem; - HashMap paramAuthMap = new HashMap(); - while ((paramAuthElem = (Element) paramAuthIter.nextNode()) != null) { - String name = XPathUtils.getAttributeValue(paramAuthElem, "@Name", null); - String value = XPathUtils.getAttributeValue(paramAuthElem, "@Value", null); - if (paramAuthMap.containsKey(name)) - throw new ConfigurationException("config.06", new Object[]{"Doppelter Wert für Parameter per HeaderAuthentication"}); - paramAuthMap.put(name, value); - } - oaConfiguration.setParamAuthMapping(paramAuthMap); - // Try to build the BasicAuthParameters - oaConfiguration.setBasicAuthUserIDMapping( - XPathUtils.getElementValue(root, OACONF_USER_ID_XPATH, null)); - oaConfiguration.setBasicAuthPasswordMapping( - XPathUtils.getElementValue(root, OACONF_PASSWORD_XPATH, null)); - - //Try to build the Parameter Auth Parameters - NodeIterator headerAuthIter = XPathUtils.selectNodeIterator(root,OACONF_HEADER_AUTH_HEADER_XPATH); - - Element headerAuthElem; - HashMap headerAuthMap = new HashMap(); - while ((headerAuthElem = (Element) headerAuthIter.nextNode()) != null) { - String name = - XPathUtils.getAttributeValue(headerAuthElem, "@Name", null); - String value = - XPathUtils.getAttributeValue(headerAuthElem, "@Value", null); - // Contains Key (Neue Config-Exception: doppelte werte) - if (headerAuthMap.containsKey(name)) - throw new ConfigurationException("config.06", new Object[]{"Doppelter Wert für Parameter per HeaderAuthentication"}); - headerAuthMap.put(name, value); - } - oaConfiguration.setHeaderAuthMapping(headerAuthMap); - - if (paramAuthMap.size() == 0) { - if (oaConfiguration.getBasicAuthUserIDMapping() == null) { - oaConfiguration.setAuthType(OAConfiguration.HEADER_AUTH); - } - else - oaConfiguration.setAuthType(OAConfiguration.BASIC_AUTH); - } - else - oaConfiguration.setAuthType(OAConfiguration.PARAM_AUTH); - - return oaConfiguration; - } - - - /** - * Build an array of OnlineApplication Parameter Beans containing information - * about the proxy component - * @return An OAProxyParameter array containing beans - * with all relevant information for the proxy component of the online - * application - */ - public OAProxyParameter[] buildOnlineApplicationProxyParameters() throws ConfigurationException{ - - List oA_list = new ArrayList(); - NodeList OAIter = XPathUtils.selectNodeList(configElem_, OA_XPATH); - - for (int i = 0; i < OAIter.getLength(); i++) { - Element oAElem = (Element) OAIter.item(i); - - Element proxyComponentElem = (Element) XPathUtils.selectSingleNode(oAElem,OA_PROXY_COMPONENT_XPATH); - if (proxyComponentElem != null) { - OAProxyParameter oap = new OAProxyParameter(); - - oap.setPublicURLPrefix(oAElem.getAttribute("publicURLPrefix")); - oap.setOaType(oAElem.getAttribute("type")); - oap.setConfigFileURL(XPathUtils.getAttributeValue(oAElem, OA_PROXY_URL_XPATH, null)); - oap.setConfigFileURL(FileUtils.makeAbsoluteURL(oap.getConfigFileURL(), rootConfigFileDir_)); - // default session time out: 3600 sec = 1 h - oap.setSessionTimeOut(new Integer(XPathUtils.getAttributeValue(oAElem,OA_PROXY_SESSION_TIMEOUT_XPATH,"3600")).intValue()); - oap.setLoginParameterResolverImpl(XPathUtils.getAttributeValue(oAElem, OA_PROXY_LOGIN_PARA_XPATH, null)); - oap.setLoginParameterResolverConfiguration(XPathUtils.getAttributeValue(oAElem, OA_PROXY_LOGIN_PARA_CONF_XPATH, null)); - oap.setLoginParameterResolverConfiguration(FileUtils.makeAbsoluteURL(oap.getLoginParameterResolverConfiguration(), rootConfigFileDir_)); - oap.setConnectionBuilderImpl(XPathUtils.getAttributeValue(oAElem,OA_PROXY_CONNECTION_BUILDER_XPATH, null)); - - ConnectionParameter conPara = buildConnectionParameter(proxyComponentElem); - oap.setConnectionParameter(conPara); - - OAConfiguration oaConf = buildOAConfiguration(getOAConfigElement(oap)); - oap.setOaConfiguration(oaConf); - - oA_list.add(oap); - } - } - OAProxyParameter[] result = - new OAProxyParameter[oA_list.size()]; - oA_list.toArray(result); - - return result; - - } - - /** - * Reads the configuration file of the online application, and creates a DOM tree from it. - * If /OnlineApplication/ProxyComponent@configFileURL is not given, - * uses default configuration file location. - * - * @param oap configuration data of online application, meant for use by MOA-ID-PROXY - * @return Element DOM tree root element - * @throws ConfigurationException on any exception thrown - */ - private Element getOAConfigElement(OAProxyParameter oap) throws ConfigurationException - { - try { - String configFileURL = oap.getConfigFileURL(); - if (configFileURL == null) { - // use default config file URL, when config file URL is not given - configFileURL = oap.getConnectionParameter().getUrl(); - if (configFileURL.charAt(configFileURL.length() - 1) != '/') - configFileURL += "/"; - configFileURL += DEFAULT_OA_CONFIG_FILENAME; - } - Logger.info("Loading MOA-OA configuration " + configFileURL); - Element configElem = DOMUtils.parseXmlValidating( - new ByteArrayInputStream(FileUtils.readURL(configFileURL))); - return configElem; - } - catch (Throwable t) { - throw new ConfigurationException("config.03", new Object[] {"OAConfiguration"} , t); - } - } - - /** - * Build a bean containing all information about the ProxyComponent - * @return The ConnectionParameter for the Proxy Component - */ - public ConnectionParameter buildAuthComponentConnectionParameter() - { - - Element connectionParameter = (Element) XPathUtils.selectSingleNode(configElem_, PROXY_AUTH_XPATH); - if (connectionParameter==null) return null; - return buildConnectionParameter(connectionParameter); - - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java b/id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java deleted file mode 100644 index 572ce5708..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java +++ /dev/null @@ -1,188 +0,0 @@ -package at.gv.egovernment.moa.id.config.proxy; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.MalformedURLException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; - -/** - * A class providing access to the Proxy Part of the MOA-ID configuration data. - * - *

Configuration data is read from an XML file, whose location is given by - * the moa.id.configuration system property.

- *

This class implements the Singleton pattern. The reload() - * method can be used to update the configuration data. Therefore, it is not - * guaranteed that consecutive calls to getInstance() will return - * the same ProxyConfigurationProvider all the time. During the - * processing of a web service request, the current - * TransactionContext should be used to obtain the - * ProxyConfigurationProvider local to that request.

- * - * @author Stefan Knirsch - */ -public class ProxyConfigurationProvider extends ConfigurationProvider { - - /** Singleton instance. null, if none has been created. */ - private static ProxyConfigurationProvider instance; - - - // - // configuration data - // - /** - * connection parameters for connection to MOA ID Auth component - */ - private ConnectionParameter authComponentConnectionParameter; - /** - * configuration parameters for online applications - */ - private OAProxyParameter[] onlineApplicationProxyParameter; - - /** - * Return the single instance of configuration data. - * - * @return ProxyConfigurationProvider The current configuration data. - * @throws ConfigurationException - */ - public static synchronized ProxyConfigurationProvider getInstance() - throws ConfigurationException { - - if (instance == null) { - reload(); - } - return instance; - } - - /** - * Reload the configuration data and set it if successful. - * - * @return ProxyConfigurationProvider The loaded configuration data. - * @throws ConfigurationException Failure to load the configuration data. - */ - public static synchronized ProxyConfigurationProvider reload() - throws ConfigurationException { - String fileName = System.getProperty(CONFIG_PROPERTY_NAME); - if (fileName == null) { - throw new ConfigurationException("config.01", null); - } - Logger.info("Loading MOA-ID-PROXY configuration " + fileName); - - instance = new ProxyConfigurationProvider(fileName); - return instance; - } - - /** - * Constructor for ProxyConfigurationProvider. - */ - public ProxyConfigurationProvider(String fileName) - throws ConfigurationException { - - load(fileName); - } - - /** - * Load the configuration data from XML file with the given name and build - * the internal data structures representing the MOA configuration. - * - * @param fileName The name of the XML file to load. - * @throws ConfigurationException The MOA configuration could not be - * read/built. - */ - private void load(String fileName) throws ConfigurationException { - FileInputStream stream = null; - Element configElem; - ProxyConfigurationBuilder builder; - - try { - // load the main config file - stream = new FileInputStream(fileName); - configElem = DOMUtils.parseXmlValidating(stream); - } - catch (Throwable t) { - throw new ConfigurationException("config.03", null, t); - } - finally { - try { - if (stream != null) { - stream.close(); - } - } - catch (IOException e) { - } - } - try { - // determine the directory of the root config file - rootConfigFileDir = new File(fileName).getParent(); - try { - rootConfigFileDir = new File(rootConfigFileDir).toURL().toString(); - } catch (MalformedURLException t) { - throw new ConfigurationException("config.03", null, t); - } - - // build the internal datastructures - builder = new ProxyConfigurationBuilder(configElem, rootConfigFileDir); - authComponentConnectionParameter = builder.buildAuthComponentConnectionParameter(); - - onlineApplicationProxyParameter = builder.buildOnlineApplicationProxyParameters(); - for(int i = 0; i < onlineApplicationProxyParameter.length; i++) { - onlineApplicationProxyParameter[i].setConfigFileURL(FileUtils.makeAbsoluteURL(onlineApplicationProxyParameter[i].getConfigFileURL(), rootConfigFileDir)); - } - - genericConfiguration = builder.buildGenericConfiguration(); - defaultChainingMode = builder.getDefaultChainingMode(); - chainingModes = builder.buildChainingModes(); - trustedCACertificates = builder.getTrustedCACertificates(); - trustedCACertificates = FileUtils.makeAbsoluteURL(trustedCACertificates, rootConfigFileDir); - - } - catch (Throwable t) { - throw new ConfigurationException("config.02", null, t); - } - } - - /** - * Return a bean containing all information about the ProxyComponent - * @return The ConnectionParameter for the Proxy Component - */ - public ConnectionParameter getAuthComponentConnectionParameter() { - return authComponentConnectionParameter; - } - - /** - * Build an array of OnlineApplication Parameter Beans containing all - * information about the proxy component of the online application - * @return An OAProxyParameter array containing beans - * with all relevant information for the proxy component of the online - * application - */ - public OAProxyParameter[] getOnlineApplicationParameters() { - return onlineApplicationProxyParameter; - } - /** - * Provides configuration information regarding the online application behind - * the given URL, relevant to the MOA-ID Proxy component. - * - * @param oaURL URL requested for an online application - * @return an OAProxyParameter, or null - * if none is applicable - */ - public OAProxyParameter getOnlineApplicationParameter(String oaURL) { - OAProxyParameter[] oaParams = getOnlineApplicationParameters(); - for (int i = 0; i < oaParams.length; i++) { - OAProxyParameter oaParam = oaParams[i]; - if (oaURL.startsWith(oaParam.getPublicURLPrefix())) - return oaParam; - } - return null; - } - -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/data/AuthenticationData.java b/id.server/src/at/gv/egovernment/moa/id/data/AuthenticationData.java deleted file mode 100644 index 4fc35c1e6..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/data/AuthenticationData.java +++ /dev/null @@ -1,394 +0,0 @@ -package at.gv.egovernment.moa.id.data; - -import java.util.Date; - -/** - * Encapsulates authentication data contained in a <saml:Assertion>. - * - * @author Paul Ivancsics - * @version $Id$ - */ - -public class AuthenticationData { - /** - * major version number of the SAML assertion - */ - private int majorVersion; - /** - * minor version number of the SAML assertion - */ - private int minorVersion; - /** - * identifier for this assertion - */ - private String assertionID; - /** - * URL of the MOA-ID Auth component issueing this assertion - */ - private String issuer; - /** - * time instant of issue of this assertion - */ - private String issueInstant; - /** - * user identification value (Stammzahl); null, - * if the authentication module is configured not to return this data - */ - private String identificationValue; - /** - * user identification type - */ - private String identificationType; - /** - * application specific user identifier (bPK) - */ - private String bPK; - /** - * private sector-specific personal identifier (wbPK) - */ - private String wbPK; - /** - * given name of the user - */ - private String givenName; - /** - * family name of the user - */ - private String familyName; - /** - * date of birth of the user - */ - private String dateOfBirth; - /** - * says whether the certificate is a qualified certificate or not - */ - private boolean qualifiedCertificate; - /** - * says whether the certificate is a public authority or not - */ - private boolean publicAuthority; - /** - * public authority code (Behördenkennzeichen - BKZ) - */ - private String publicAuthorityCode; - /** - * The base64 encoded signer certificate. - */ - private String signerCertificate; - /** - * URL of the BKU - */ - private String bkuURL; - /** - * the corresponding lt;saml:Assertion> - */ - private String samlAssertion; - /** - * creation timestamp - */ - Date timestamp; - - /** - * Constructor for AuthenticationData. - */ - public AuthenticationData() { - timestamp = new Date(); - } - - /** - * Returns the minorVersion. - * @return int - */ - public int getMinorVersion() { - return minorVersion; - } - - /** - * Returns the publicAuthority. - * @return boolean - */ - public boolean isPublicAuthority() { - return publicAuthority; - } - - /** - * Returns the publicAuthorityCode. - * @return String - */ - public String getPublicAuthorityCode() { - return publicAuthorityCode; - } - - /** - * Returns the qualifiedCertificate. - * @return boolean - */ - public boolean isQualifiedCertificate() { - return qualifiedCertificate; - } - - /** - * Returns the bPK. - * @return String - */ - public String getBPK() { - return bPK; - } - - /** - * Returns the wbPK. - * @return String the wbPK. - */ - public String getWBPK() { - return wbPK; - } - - /** - * Sets the minorVersion. - * @param minorVersion The minorVersion to set - */ - public void setMinorVersion(int minorVersion) { - this.minorVersion = minorVersion; - } - - /** - * Sets the publicAuthority. - * @param publicAuthority The publicAuthority to set - */ - public void setPublicAuthority(boolean publicAuthority) { - this.publicAuthority = publicAuthority; - } - - /** - * Sets the publicAuthorityCode. - * @param publicAuthorityIdentification The publicAuthorityCode to set - */ - public void setPublicAuthorityCode(String publicAuthorityIdentification) { - this.publicAuthorityCode = publicAuthorityIdentification; - } - - /** - * Sets the qualifiedCertificate. - * @param qualifiedCertificate The qualifiedCertificate to set - */ - public void setQualifiedCertificate(boolean qualifiedCertificate) { - this.qualifiedCertificate = qualifiedCertificate; - } - - /** - * Sets the bPK. - * @param bPK The bPK to set - */ - public void setBPK(String bPK) { - this.bPK = bPK; - } - - /** - * Sets the wbPK. - * @param wbPK The wbPK to set - */ - public void setWBPK(String wbPK) { - this.wbPK = wbPK; - } - - /** - * Returns the assertionID. - * @return String - */ - public String getAssertionID() { - return assertionID; - } - - /** - * Returns the dateOfBirth. - * @return String - */ - public String getDateOfBirth() { - return dateOfBirth; - } - - /** - * Returns the familyName. - * @return String - */ - public String getFamilyName() { - return familyName; - } - - /** - * Returns the givenName. - * @return String - */ - public String getGivenName() { - return givenName; - } - - /** - * Returns the identificationValue. - * @return String - */ - public String getIdentificationValue() { - return identificationValue; - } - - /** - * Returns the identificationType - * @return String - */ - public String getIdentificationType() { - return identificationType; - } - - /** - * Returns the issueInstant. - * @return String - */ - public String getIssueInstant() { - return issueInstant; - } - - /** - * Returns the issuer. - * @return String - */ - public String getIssuer() { - return issuer; - } - - /** - * Returns the majorVersion. - * @return int - */ - public int getMajorVersion() { - return majorVersion; - } - - /** - * Returns the BKU URL. - * @return String - */ - public String getBkuURL() { - return bkuURL; - } - - /** - * Returns the signer certificate. - * @return String - */ - public String getSignerCertificate() { - return signerCertificate; - } - - /** - * Sets the assertionID. - * @param assertionID The assertionID to set - */ - public void setAssertionID(String assertionID) { - this.assertionID = assertionID; - } - - /** - * Sets the dateOfBirth. - * @param dateOfBirth The dateOfBirth to set - */ - public void setDateOfBirth(String dateOfBirth) { - this.dateOfBirth = dateOfBirth; - } - - /** - * Sets the familyName. - * @param familyName The familyName to set - */ - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - - /** - * Sets the givenName. - * @param givenName The givenName to set - */ - public void setGivenName(String givenName) { - this.givenName = givenName; - } - - /** - * Sets the identificationValue. - * @param identificationValue The identificationValue to set - */ - public void setIdentificationValue(String identificationValue) { - this.identificationValue = identificationValue; - } - - /** - * Sets the identificationType. - * @param identificationType The identificationType to set - */ - public void setIdentificationType(String identificationType) { - this.identificationType = identificationType; - } - - /** - * Sets the issueInstant. - * @param issueInstant The issueInstant to set - */ - public void setIssueInstant(String issueInstant) { - this.issueInstant = issueInstant; - } - - /** - * Sets the issuer. - * @param issuer The issuer to set - */ - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - /** - * Sets the majorVersion. - * @param majorVersion The majorVersion to set - */ - public void setMajorVersion(int majorVersion) { - this.majorVersion = majorVersion; - } - - /** - * Sets the bkuURL - * @param url The BKU URL to set - */ - public void setBkuURL(String url) { - this.bkuURL = url; - } - - /** - * Sets the signer certificate - * @param signerCertificate The signer certificate - */ - public void setSignerCertificate(String signerCertificate) { - this.signerCertificate = signerCertificate; - } - - /** - * Returns the samlAssertion. - * @return String - */ - public String getSamlAssertion() { - return samlAssertion; - } - - /** - * Sets the samlAssertion. - * @param samlAssertion The samlAssertion to set - */ - public void setSamlAssertion(String samlAssertion) { - this.samlAssertion = samlAssertion; - } - - /** - * Returns the timestamp. - * @return Date - */ - public Date getTimestamp() { - return timestamp; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/data/Cookie.java b/id.server/src/at/gv/egovernment/moa/id/data/Cookie.java deleted file mode 100644 index 6ed133c5a..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/data/Cookie.java +++ /dev/null @@ -1,119 +0,0 @@ -package at.gv.egovernment.moa.id.data; -import java.util.HashMap; -import java.util.Iterator; -import java.util.StringTokenizer; - -import at.gv.egovernment.moa.logging.Logger; - -/** - * The Cookie-class provides methods to save and return cookies for - * each single session - * - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class Cookie { - /** A HahsMap containing all our cookies */ - HashMap cookies = new HashMap(); - /** A HashMap to temporarely store 'Set-Cookie' values from the OnlineApplication - * to send them back to the client/browser as soon as possible */ - HashMap cookies401 = new HashMap(); - - /** - * Adds a Cookie from a response with response-code 401 to the cookie-pool - * for sending it back to the browser / client - * @param cookieString The complete 'Set-Cookie' - String - */ - public void add401(String cookieString) - { - cookies401.put(getKey(cookieString),cookieString); - } - - /** - * Get the HashMap containing all cookies to be sent to the browser / client - * @return HashMap with all cookies - */ - public HashMap get401() - { - return cookies401; - } - - /** - * Clear the 401 cookie-pool - */ - public void clear401() - { - cookies401.clear(); - } - - /** - * Set a cookie that comes from the Online-Application - * and save it in our "normal" cookie-pool - * @param value The complete "Set-Cookie" - String from the Online-Application - */ - public void setCookie(String value) { - cookies.put(getKey(value), getValue(value)); - } - - /** - * Method saveOldCookies. - * @param value The complete "Set-Cookie" - String from the Online-Application - */ - public void saveOldCookies(String value) { - StringTokenizer st = new StringTokenizer(value,";"); - while (st.hasMoreTokens()) - { - // We have to trim because the Tokenizer returns cookies including spaces at the beginning - StringTokenizer st2 = new StringTokenizer(st.nextToken().trim(),"="); - String cookieKey = st2.nextToken().trim(); - if (st2.hasMoreTokens()) - { - String cookieValue = st2.nextToken().trim(); - if (!cookies.containsKey(cookieKey)) - cookies.put(cookieKey , cookieValue); - } - } - Logger.debug("Found these cookies: " + getCookies()); - } - - /** - * Get a String containing all cookies saved in that session seperated by '; ' - * to be sent back to the Online-Application - * @return String containing all cookies saved in that session seperated by '; ' - */ - public String getCookies() { - String result = ""; - if (cookies.size()==0) - return null; - Iterator i = cookies.keySet().iterator(); - while (i.hasNext()) { - String key = (String) i.next(); - result += key + "=" + (String)cookies.get(key) + "; "; - } - return result.substring(0, result.length() - 2); - } - - /** - * Returns the key of a key-value-pair of a cookie - * getKey("CookieA=1234") returns CookieA - * @param String the complete "Set-cookie" String containing a key-value-pair of a cookie - * @return String the key of a key-value-pair of a cookie - */ - private String getKey(String input) { - return input.substring(0, input.indexOf("=")); - } - - /** - * Returns the value of a key-value-pair of a cookie - * getKey("CookieA=1234") returns 1234 - * @param String the complete "Set-cookie" String containing a key-value-pair of a cookie - * @return String the value of a key-value-pair of a cookie - */ - private String getValue(String input) { - if (input.indexOf(";") == -1) - return input.substring(input.indexOf("=") + 1, input.getBytes().length); - return input.substring(input.indexOf("=") + 1, input.indexOf(";")); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java b/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java deleted file mode 100644 index 1762a52b7..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/data/CookieManager.java +++ /dev/null @@ -1,114 +0,0 @@ -package at.gv.egovernment.moa.id.data; - -import java.util.HashMap; - -/** - * The CookieManager is a singleton to manage a Cookie-Object for - * each session - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class CookieManager { - /** the singleton instance of the CookieManager */ - private static CookieManager instance; - /** a HashMap to bind a Cookie-object to every single session*/ - private static HashMap cookies = new HashMap(); - - /** - * Create a singleton of the CookieManager - * @return CookieManager - */ - public static CookieManager getInstance() - { - if(instance==null) instance=new CookieManager(); - return instance; - } - - /** - * Save a cookie to a specified session-id - * @param id The session id - * @param cookie_string The complete 'Set-Cookie' String from the OnlineApplication - */ - public void saveCookie(String id, String cookie_string) - { - getCookieWithID(id).setCookie(cookie_string); - } - - /** - * Method saveOldCookies. - * @param id - * @param cookie_string - */ - public void saveOldCookies(String id,String cookie_string) - { - getCookieWithID(id).saveOldCookies(cookie_string); - } - - /** - * Get a Cookie-Object for a specified session-id - * @param id The session id - * @return Cookie object containing all saved cookies for this session - */ - public Cookie getCookieWithID(String id) - { - Cookie c = null; - if(cookies.containsKey(id)) - c = (Cookie)cookies.get(id); - else - { - c = new Cookie(); - cookies.put(id,c); - } - return c; - } - - - /** - * Get a String containing all cookies of a specified session-id - * saved in that session seperated by '; ' to be sent back to - * the Online-Application - * @param id the session-id - * @return String containing all cookies saved in that session seperated by '; ' - */ - public String getCookie(String id) - { - Cookie result = (Cookie)cookies.get((String)id); - if (result==null) - return null; - return result.getCookies(); - - } - - /** - * Adds a Cookie for a special session from a response with - * response-code 401 to the cookie-pool for sending it back - * to the browser / client - * @param id The session-id - * @param value The complete 'Set-Cookie' - String - */ - public void add401(String id,String value) - { - getCookieWithID(id).add401(value); - } - - /** - * Clear the 401 cookie-pool of a session - * @param id the session-id - */ - public void clear401(String id) - { - getCookieWithID(id).clear401(); - } - - /** - * Get the HashMap containing all cookies of a session to be sent to the browser / client - * @param id the session-id - * @return HashMap with all cookies - */ - public HashMap get401(String id) - { - return getCookieWithID(id).get401(); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/data/IssuerAndSerial.java b/id.server/src/at/gv/egovernment/moa/id/data/IssuerAndSerial.java deleted file mode 100644 index a47dd8b29..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/data/IssuerAndSerial.java +++ /dev/null @@ -1,111 +0,0 @@ -package at.gv.egovernment.moa.id.data; - -import java.math.BigInteger; -import java.security.Principal; - -import iaik.asn1.structures.Name; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; - -/** - * A class containing the issuer and serial number of a certificate, which can - * be used to uniquely identify the certificate. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IssuerAndSerial { - /** store the issuer as String*/ - private String issuerDN; - /** store the serial as BigInteger*/ - private BigInteger serial; - - /** - * Create an IssuerAndSerial object. - * - * The name of the issuer is converted to RFC2253. If it cannot be parsed, the - * DN contained in the issuer is set. - * - * @param issuer The isser of a certificate. - * @param serial The serial number of the certificate. - */ - public IssuerAndSerial(Principal issuer, BigInteger serial) { - RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); - - try { - this.issuerDN = ((Name) parser.parse()).getRFC2253String(); - } catch (RFC2253NameParserException e) { - this.issuerDN = issuer.getName(); - } - this.serial = serial; - } - - /** - * Create an IssuerAndSerial object. - * - * @param issuerDN The issuer distinguished name. Should be an RFC2253 name. - * @param serial The serial number of the certificate. - */ - public IssuerAndSerial(String issuerDN, BigInteger serial) { - this.issuerDN = issuerDN; - this.serial = serial; - } - - /** - * Return the issuer DN in RFC2253 format. - * - * @return The issuer part of this object. - */ - public String getIssuerDN() { - return issuerDN; - } - - /** - * Return the serial number. - * - * @return The serial number of this object. - */ - public BigInteger getSerial() { - return serial; - } - - /** - * Compare this IssuerAndSerial to another object. - * - * @return true, if other is an - * IssuerAndSerial object and the issuer and - * serial fields are both equal. false otherwise. - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if (other instanceof IssuerAndSerial) { - IssuerAndSerial ias = (IssuerAndSerial) other; - return getIssuerDN().equals(ias.getIssuerDN()) - && getSerial().equals(ias.getSerial()); - } - return false; - } - - /** - * Return the hash code of this IssuerAndSerial. - * - * @return The hash code of this IssuerAndSerial. - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return issuerDN.hashCode() ^ serial.hashCode(); - } - - /** - * Return a String representation of this - * IssuerAndSerial object. - * - * @return The String representation. - * @see java.lang.Object#toString() - */ - public String toString() { - return ("(IssuerAndSerial - Issuer<" + getIssuerDN()) - + ("> Serial<" + serial.toString() + ">)"); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/data/SAMLStatus.java b/id.server/src/at/gv/egovernment/moa/id/data/SAMLStatus.java deleted file mode 100644 index ed61827b6..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/data/SAMLStatus.java +++ /dev/null @@ -1,59 +0,0 @@ -package at.gv.egovernment.moa.id.data; - -/** - * Data contained in a <samlp:Status> - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLStatus { - - /** main status code */ - private String statusCode; - /** sub status code */ - private String subStatusCode; - /** status message */ - private String statusMessage; - - /** - * @return status code - */ - public String getStatusCode() { - return statusCode; - } - - /** - * @return status message - */ - public String getStatusMessage() { - return statusMessage; - } - - /** - * @return enclosed sub-status code - */ - public String getSubStatusCode() { - return subStatusCode; - } - - /** - * @param string the status code - */ - public void setStatusCode(String string) { - statusCode = string; - } - - /** - * @param string the status message - */ - public void setStatusMessage(String string) { - statusMessage = string; - } - - /** - * @param string the enclosed sub-status code - */ - public void setSubStatusCode(String string) { - subStatusCode = string; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java deleted file mode 100644 index c338e96fc..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -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 iaik.pki.store.certstore.CertStoreConfiguration; -import iaik.pki.store.certstore.CertStoreParameters; -import iaik.pki.store.certstore.CertStoreTypes; -import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; - -/** - * Implementation of interface needed to initialize an IAIK JSSE TrustManager - * @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 CertStoreConfigurationImpl. - * - * @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 paramName = ConfigurationProvider.DIRECTORY_CERTSTORE_PARAMETER_PROPERTY; - String certStoreRootDirParam = conf.getGenericConfigurationParameter(paramName); - if (certStoreRootDirParam == null) - throw new ConfigurationException( - "config.08", new Object[] {paramName}); - - 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[] {paramName}); - - 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 CertStoreTypes.DIRECTORY - * @see iaik.pki.store.certstore.CertStoreParameters#getType() - */ - public String getType() { - return CertStoreTypes.DIRECTORY; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java deleted file mode 100644 index 3cd02a2b5..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.config; - -import iaik.logging.LogConfigurationException; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.Properties; - -/** - * Implementation of interface TrustManager - * @author Paul Ivancsics - * @version $Id$ - */ -public class LoggerConfigImpl implements iaik.logging.LoggerConfig { - - /** logging properties **/ - private Properties loggingProperties; - - /** - * Constructor - */ - public LoggerConfigImpl(String propertyFileURL) throws IOException { - InputStream in = new URL(propertyFileURL).openStream(); - loggingProperties = new Properties(); - loggingProperties.load(in); - in.close(); - } - - /** - * @see iaik.logging.LoggerConfig#getFactory() - */ - public String getFactory() { - return "iaik.logging.impl.Log4jFactory"; - } - - /** - * @see iaik.logging.LoggerConfig#getProperties() - */ - public Properties getProperties() throws LogConfigurationException { - return loggingProperties; - } - - /** - * @see iaik.logging.LoggerConfig#getNodeId() - */ - public String getNodeId() { - return "iaik"; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java deleted file mode 100644 index b41de3c44..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.config; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import iaik.pki.PKIConfiguration; -import iaik.pki.pathvalidation.ValidationConfiguration; -import iaik.pki.revocation.RevocationConfiguration; -import iaik.pki.store.certstore.CertStoreConfiguration; -import iaik.pki.store.revocation.archive.ArchiveConfiguration; - -/** - * Implementation of interface PKIConfiguration needed to - * initialize an IAIK JSSE TrustManager - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class PKIConfigurationImpl implements PKIConfiguration { - /** The configuration for the CertStore */ - private CertStoreConfiguration certStoreConfiguration; - /** The configuration for the RevocationChecks */ - private RevocationConfiguration revocationConfiguration; - /** The configuration for the Validation */ - private ValidationConfiguration validationConfiguration; - - /** - * Constructor - * @param conf the Configuration for the PKIConfig - * @throws ConfigurationException for any config error - */ - public PKIConfigurationImpl(ConfigurationProvider conf) throws ConfigurationException { - - certStoreConfiguration = new CertStoreConfigurationImpl(conf); - revocationConfiguration = new RevocationConfigurationImpl(); - validationConfiguration = new ValidationConfigurationImpl(conf); - } - - /** - * @see iaik.pki.PKIConfiguration#getCertStoreConfiguration() - */ - public CertStoreConfiguration getCertStoreConfiguration() { - return certStoreConfiguration; - } - - /** - * @see iaik.pki.PKIConfiguration#getRevocationConfiguration() - */ - public RevocationConfiguration getRevocationConfiguration() { - return revocationConfiguration; - } - - /** - * @see iaik.pki.PKIConfiguration#getArchiveConfiguration() - */ - public ArchiveConfiguration getArchiveConfiguration() { - return null; - } - - /** - * @see iaik.pki.PKIConfiguration#getValidationConfiguration() - */ - public ValidationConfiguration getValidationConfiguration() { - return validationConfiguration; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java deleted file mode 100644 index fff75775d..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.config; - -import iaik.pki.revocation.RevocationConfiguration; - -import java.security.cert.X509Certificate; -import java.util.Collections; -import java.util.Date; -import java.util.Set; - -import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl; - -/** - * Implementation of interface needed to initialize an IAIK JSSE TrustManager - * @author Paul Ivancsics - * @version $Id$ - */ -public class RevocationConfigurationImpl extends ObservableImpl implements RevocationConfiguration { - - /** - * @see iaik.pki.revocation.RevocationConfiguration#getAlternativeDistributionPoints(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date) - */ - public Set getAlternativeDistributionPoints( - X509Certificate arg0, - X509Certificate arg1, - Date arg2) { - return Collections.EMPTY_SET; - } - - /** - * @see iaik.pki.revocation.RevocationConfiguration#archiveRevocationInfo(java.lang.String, java.lang.String) - */ - public boolean archiveRevocationInfo(String arg0, String arg1) { - return false; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java deleted file mode 100644 index c500e2e8e..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.config; - -import iaik.pki.pathvalidation.ValidationConfiguration; - -import java.security.cert.X509Certificate; -import java.security.spec.AlgorithmParameterSpec; - -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl; - -/** - * Implementation of interface needed to initialize an IAIK JSSE TrustManager - * @author Paul Ivancsics - * @version $Id$ - */ -public class ValidationConfigurationImpl extends ObservableImpl - implements ValidationConfiguration { - /** The ConfigurationProvider for the validation*/ - private ConfigurationProvider conf; - - /** - * Constructor - * @param conf with the configuration - */ - public ValidationConfigurationImpl(ConfigurationProvider conf) { - this.conf = conf; - } - - /** - * @see iaik.pki.pathvalidation.ValidationConfiguration#getChainingMode(java.security.cert.X509Certificate) - */ - public String getChainingMode(X509Certificate trustAnchor) { - String chainingMode = conf.getChainingMode(trustAnchor); - return chainingMode; - } - - /** - * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsSpec(java.security.cert.X509Certificate) - */ - public AlgorithmParameterSpec getPublicKeyParamsAsSpec(X509Certificate arg0) { - return null; - } - - /** - * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsCert(java.security.cert.X509Certificate) - */ - public X509Certificate getPublicKeyParamsAsCert(X509Certificate arg0) { - return null; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java deleted file mode 100644 index 3c37706e1..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.pki; - -import java.security.cert.X509Certificate; -import java.util.Collections; -import java.util.Set; - -import iaik.pki.PKIProfile; -import iaik.pki.pathvalidation.ValidationProfile; -import iaik.pki.revocation.RevocationProfile; -import iaik.pki.revocation.RevocationSourceTypes; -import iaik.pki.store.truststore.TrustStoreProfile; -import iaik.pki.store.truststore.TrustStoreTypes; - -import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl; - -/** - * Implementation of the PKIProfile interface and subinterfaces - * providing information needed for certificate path validation. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class PKIProfileImpl extends ObservableImpl - implements PKIProfile, RevocationProfile, TrustStoreProfile, ValidationProfile { - - /** - * URI to the truststore - */ - private String trustStoreURI; - - /** - * revocation checking; - */ - private boolean revocationChecking; - - /** - * The trust profile identifier. - */ - private String id; - - - /** - * Create a new PKIProfileImpl. - * - * @param trustStoreURI trust store URI - */ - public PKIProfileImpl(String trustStoreURI, boolean revocationChecking) { - this.trustStoreURI = trustStoreURI; - this.revocationChecking = revocationChecking; - String id = String.valueOf(System.currentTimeMillis()); - setId("id-" + id); - } - - /** - * @see iaik.pki.PKIProfile#autoAddCertificates() - */ - public boolean autoAddCertificates() { - return true; - } - - /** - * @see iaik.pki.PKIProfile#getRevocationProfile() - */ - public RevocationProfile getRevocationProfile() { - return this; - } - - /** - * @see iaik.pki.PKIProfile#getTrustStoreProfile() - */ - public TrustStoreProfile getTrustStoreProfile() { - return this; - } - - /** - * @see iaik.pki.PKIProfile#getValidationProfile() - */ - public ValidationProfile getValidationProfile() { - return this; - } - - /** - * @see iaik.pki.PKIProfile#useAuthorityInfoAccess() - */ - public boolean useAuthorityInfoAccess() { - return true; - } - - /** - * @see iaik.pki.revocation.RevocationProfile#getMaxRevocationAge(java.lang.String) - */ - public long getMaxRevocationAge(String arg0) { - return 0; - } - - /** - * @see iaik.pki.revocation.RevocationProfile#getOCSPRequestHashAlgorithm() - */ - public String getOCSPRequestHashAlgorithm() { - return null; - } - - /** - * @see iaik.pki.revocation.RevocationProfile#getPreferredServiceOrder(java.security.cert.X509Certificate) - */ - public String[] getPreferredServiceOrder(X509Certificate arg0) { - return new String[] {RevocationSourceTypes.CRL}; - } - - /** - * @see iaik.pki.store.truststore.TrustStoreProfile#getType() - */ - public String getType() { - return TrustStoreTypes.DIRECTORY; - } - - /** - * @see iaik.pki.store.truststore.TrustStoreProfile#getURI() - */ - public String getURI() { - return trustStoreURI; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialAnyPolicyInhibit() - */ - public boolean getInitialAnyPolicyInhibit() { - return false; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialExplicitPolicy() - */ - public boolean getInitialExplicitPolicy() { - return false; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicyMappingInhibit() - */ - public boolean getInitialPolicyMappingInhibit() { - return false; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicySet() - */ - public Set getInitialPolicySet() { - return Collections.EMPTY_SET; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getNameConstraintsProcessing() - */ - public boolean getNameConstraintsProcessing() { - return false; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getPolicyProcessing() - */ - public boolean getPolicyProcessing() { - return false; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getRevocationChecking() - */ - public boolean getRevocationChecking() { - return this.revocationChecking; - } - - /** - * @see iaik.pki.store.truststore.TrustStoreProfile#getId() - */ - public String getId() { - return id; - } - /** - * Sets the trust profile identifier. - * @param id The id to set. - */ - public void setId(String id) { - this.id = id; - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java b/id.server/src/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java deleted file mode 100644 index 9da006d35..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java +++ /dev/null @@ -1,119 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.pki.jsse; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URL; -import java.security.GeneralSecurityException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; - -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; - -import iaik.pki.jsse.IAIKX509TrustManager; - -/** - * TrustManager implementation featuring CRL checking (inherited from - * IAIKX509TrustManager), plus server-end-SSL-certificate checking. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDTrustManager extends IAIKX509TrustManager { - - /** an x509Certificate array containing all accepted server certificates*/ - private X509Certificate[] acceptedServerCertificates; - - /** - * Constructor - * @param acceptedServerCertificateStoreURL the url leading to the acceptedServer cert store - * @throws GeneralSecurityException occurs on security errors - * @throws IOException occurs on IO errors - */ - public MOAIDTrustManager(String acceptedServerCertificateStoreURL) - throws IOException, GeneralSecurityException { - - if (acceptedServerCertificateStoreURL != null) - buildAcceptedServerCertificates(acceptedServerCertificateStoreURL); - else - acceptedServerCertificates = null; - } - - - /** - * Initializes the LoggingContextManager logging context. - * Fixes a bug occuring in the case MOA-SP is called by API. - * In this case, IAIKX509TrustManager uses the LogginConfig of MOA-SP. - * This method must be called before a MOAIDTrustManager is constructed, - * from every thread. - */ - public static void initializeLoggingContext() { - if (LoggingContextManager.getInstance().getLoggingContext() == null) - LoggingContextManager.getInstance().setLoggingContext( - new LoggingContext(Thread.currentThread().getName())); - } - - - /** - * Builds an Array of accepted server certificates from an URL, - * and stores it in acceptedServerCertificates. - * @param acceptedServerCertificateStoreURL file URL pointing to the directory - * containing accepted server X509 certificates - * @throws GeneralSecurityException on security errors - * @throws IOException on any IO errors - */ - private void buildAcceptedServerCertificates(String acceptedServerCertificateStoreURL) - throws IOException, GeneralSecurityException { - - List certList = new ArrayList(); - URL storeURL = new URL(acceptedServerCertificateStoreURL); - File storeDir = new File(storeURL.getFile()); - // list certificate files in directory - File[] certFiles = storeDir.listFiles(); - for (int i = 0; i < certFiles.length; i++) { - // for each: create an X509Certificate and store it in list - File certFile = certFiles[i]; - FileInputStream fis = new FileInputStream(certFile.getPath()); - CertificateFactory certFact = CertificateFactory.getInstance("X.509"); - X509Certificate cert = (X509Certificate)certFact.generateCertificate(fis); - fis.close(); - certList.add(cert); - } - // store acceptedServerCertificates - acceptedServerCertificates = (X509Certificate[]) certList.toArray(new X509Certificate[0]); - } - - /** - * Does additional server-end-SSL-certificate checking. - * @see com.sun.net.ssl.X509TrustManager#isServerTrusted(java.security.cert.X509Certificate[]) - */ - public boolean isServerTrusted(X509Certificate[] certChain) { - boolean trusted = super.isServerTrusted(certChain); - if (! trusted || acceptedServerCertificates == null) - return trusted; - else { - // check server-end-SSL-certificate with acceptedServerCertificates - X509Certificate serverCert = certChain[0]; - for (int i = 0; i < acceptedServerCertificates.length; i++) { - X509Certificate acceptedServerCert = acceptedServerCertificates[i]; - if (serverCert.equals(acceptedServerCert)) - return true; - } - Logger.warn(MOAIDMessageProvider.getInstance().getMessage("ssl.01", null)); - return false; - } - } - /** - * In rare cases, this method is being called although it should not be. - * @see com.sun.net.ssl.X509TrustManager#isClientTrusted(X509Certificate[]) - */ - public boolean isClientTrusted(java.security.cert.X509Certificate arg0[]) - { - return true; - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java b/id.server/src/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java deleted file mode 100644 index 8f36ac5c0..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package at.gv.egovernment.moa.id.iaik.servertools.observer; - -import iaik.pki.store.observer.NotificationData; -import iaik.pki.store.observer.Observable; -import iaik.pki.store.observer.Observer; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - - -/** - * Implementation of interface TrustManager - * @author Paul Ivancsics - * @version $Id$ - */ -public class ObservableImpl implements Observable { - /** a List for all observers */ - private List observers = new ArrayList(); - - /** - * @see iaik.pki.store.observer.Observable#addObserver(iaik.pki.store.observer.Observer) - */ - public void addObserver(Observer observer) { - observers.add(observer); - } - - /** - * @see iaik.pki.store.observer.Observable#removeObserver(iaik.pki.store.observer.Observer) - */ - public boolean removeObserver(Observer observer) { - return observers.remove(observer); - } - - /** - * @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData) - */ - public void notify(NotificationData data) { - Iterator iter = observers.iterator(); - for (iter = observers.iterator(); iter.hasNext();) { - Observer observer = (Observer) iter.next(); - observer.notify(data); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java deleted file mode 100644 index 731212ef8..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -/** - * Builder for {@link java.net.URLConnection} objects used to forward requests - * to the remote online application. - * - * @author Paul Ivancsics - * @version $Id$ - */ - -public interface ConnectionBuilder { - - /** - * Builds an HttpURLConnection to a {@link java.net.URL} which is derived - * from an {@link HttpServletRequest} URL, by substitution of a - * public URL prefix for the real URL prefix.
- * The HttpURLConnection has been created by {@link java.net.URL#openConnection}, but - * it has not yet been connected to by {@link java.net.URLConnection#connect}.
- * The field settings of the HttpURLConnection are: - *
    - *
  • allowUserInteraction = false
  • - *
  • doInput = true
  • - *
  • doOutput = true
  • - *
  • requestMethod = request.getMethod()
  • - *
  • useCaches = false
  • - *
- * - * @param request the incoming request which shall be forwarded - * @param publicURLPrefix the public URL prefix to be substituted by the real URL prefix - * @param realURLPrefix the URL prefix to substitute the public URL prefix - * @param sslSocketFactory factory to be used for creating an SSL socket in case - * of a URL for scheme "https:"; - *
if null, the default SSL socket factory would be used - * @param parameters parameters to be forwarded - * @return a URLConnection created by {@link java.net.URL#openConnection}, connecting to - * the requested URL with publicURLPrefix substituted by realURLPrefix - * @throws IOException if an I/O exception occurs during opening the connection - * @see java.net.URL#openConnection() - * @see com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory() - */ - public HttpURLConnection buildConnection( - HttpServletRequest request, - String publicURLPrefix, - String realURLPrefix, - SSLSocketFactory sslSocketFactory, - Vector parameters) throws IOException; - - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param con the HttpURLConnection which is normaly to be closed - */ - public void disconnect(HttpURLConnection con); -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java b/id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java deleted file mode 100644 index ff7787839..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java +++ /dev/null @@ -1,68 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; - -/** - * Factory delivering a {@link ConnectionBuilder} implementation for - * an online application, initialized from configuration data. - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConnectionBuilderFactory { - - /** default connection builder to be used for online application - * where no special implementation of the ConnectionBuilder - * interface is configured - */ - private static ConnectionBuilder defaultConnectionBuilder; - /** mapping from online application public URL prefix to an implementation - * of the ConnectionBuilder interface to be used; - * if no mapping is given for an online application, the - * DefaultConnectionBuilder will be used */ - private static Map connectionBuilderMap; - - /** - * Initializes the ConnectionBuilder map from the configuration data. - * @throws ConfigurationException when the configuration cannot be read, - * or when a class name configured cannot be instantiated - */ - public static void initialize() throws ConfigurationException { - defaultConnectionBuilder = new DefaultConnectionBuilder(); - connectionBuilderMap = new HashMap(); - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - for (int i = 0; i < proxyConf.getOnlineApplicationParameters().length; i++) { - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameters()[i]; - String publicURLPrefix = oaParam.getPublicURLPrefix(); - String className = oaParam.getConnectionBuilderImpl(); - if (className != null) { - try { - ConnectionBuilder cb = (ConnectionBuilder)Class.forName(className).newInstance(); - connectionBuilderMap.put(publicURLPrefix, cb); - } - catch (Throwable ex) { - throw new ConfigurationException("config.07", new Object[] {publicURLPrefix}, ex); - } - } - } - } - - /** - * Gets the ConnectionBuilder implementation to be used for the given - * online application. - * @param publicURLPrefix public URL prefix of the online application - * @return ConnectionBuilder implementation - */ - public static ConnectionBuilder getConnectionBuilder(String publicURLPrefix) { - ConnectionBuilder cb = (ConnectionBuilder) connectionBuilderMap.get(publicURLPrefix); - if (cb == null) - return defaultConnectionBuilder; - else - return cb; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java deleted file mode 100644 index 151b1cec3..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java +++ /dev/null @@ -1,149 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URL; -import at.gv.egovernment.moa.util.URLEncoder; //java.net.URLEncoder; -import java.util.Iterator; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; - -import com.sun.net.ssl.HostnameVerifier; -import com.sun.net.ssl.HttpsURLConnection; - -/** - * Defaultimplementierung von ConnectionBuilder. - * @author Paul Ivancsics - * @version $Id$ - */ -public class DefaultConnectionBuilder implements ConnectionBuilder { - - /** a boolean to disable the HostnameVerification (default = false)*/ - private static boolean cbDisableHostnameVerification = false; - - /** - * Constructor for DefaultConnectionBuilder. - * @throws ConfigurationException on any config error - */ - public DefaultConnectionBuilder() throws ConfigurationException { - cbDisableHostnameVerification = BoolUtils.valueOf( - ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( - "ProxyComponent.DisableHostnameVerification")); - //TODO MOA-ID BRZ undocumented feature - if (cbDisableHostnameVerification) - Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); - } - - /** - * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection - */ - public HttpURLConnection buildConnection( - HttpServletRequest req, - String publicURLPrefix, - String realURLPrefix, - SSLSocketFactory sslSocketFactory, - Vector parameters) - throws IOException { - - String requestedURL = req.getRequestURL().toString(); - // check whether requested URL starts with publicURLPrefix - - //Temporary allow http:// urls instead of the https:// in publicURLPrefix - //if (req.getSession().getAttribute("authorizationkey")==null) { - // if (! requestedURL.startsWith(publicURLPrefix)) - // throw new IOException(MOAIDMessageProvider.getInstance().getMessage( - // "proxy.01", new Object[] {requestedURL, publicURLPrefix})); - //} - - // in case of GET request, append query string to requested URL; - // otherwise, HttpURLConnection would perform a POST request - if ("get".equalsIgnoreCase(req.getMethod()) && ! parameters.isEmpty()) { - requestedURL = appendQueryString(requestedURL, parameters); - } - // build real URL in online application - String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); - URL url = new URL(realURLString); - Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); - - HttpURLConnection conn = (HttpURLConnection)url.openConnection(); - conn.setRequestMethod(req.getMethod()); - conn.setDoInput(true); - conn.setDoOutput(true); - //conn.setUseCaches(false); - //conn.setAllowUserInteraction(true); - conn.setInstanceFollowRedirects(false); - if (conn instanceof HttpsURLConnection && sslSocketFactory != null) { - HttpsURLConnection httpsConn = (HttpsURLConnection) conn; - httpsConn.setSSLSocketFactory(sslSocketFactory); - if (cbDisableHostnameVerification) - httpsConn.setHostnameVerifier(new HostnameNonVerifier()); - } - return conn; - } - - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param conn the HttpURLConnection which is normaly to be closed - */ - public void disconnect(HttpURLConnection conn) { - conn.disconnect(); - } - - - /** - * @param requestedURL - * @param parameters - * @return - */ - private String appendQueryString(String requestedURL, Vector parameters) { - String newURL = requestedURL; - String parameter[] = new String[2]; - String paramValue =""; - String paramName =""; - String paramString =""; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - try { - parameter = (String[]) iter.next(); - //next two lines work not with OWA-SSL-Login-form - paramName = URLEncoder.encode((String) parameter[0], "UTF-8"); - paramValue = URLEncoder.encode((String) parameter[1], "UTF-8"); - - } catch (UnsupportedEncodingException e) { - //UTF-8 should be supported - } - paramString = "&" + paramName + "=" + paramValue + paramString; - } - if (paramString.length()>0) newURL = newURL + "?" + paramString.substring(1); - return newURL; - } - - /** - * @author Stefan Knirsch - * @version $Id$ - * A private class to change the standard HostName verifier to disable the - * Hostname Verification Check - */ - private class HostnameNonVerifier implements HostnameVerifier { - - /** - * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) - */ - public boolean verify(String arg0, String arg1) { - return true; - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java b/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java deleted file mode 100644 index 3df76656b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java +++ /dev/null @@ -1,142 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.URLEncoder; - -/** - * Implementation of interface LoginParameterResolver - * @author Paul Ivancsics - * @version $Id$ - */ -public class DefaultLoginParameterResolver implements LoginParameterResolver { - - /** - * Constructor - */ - public DefaultLoginParameterResolver() { - } - - /** - * Configuration mehtod (not used) - */ - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { - } - - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationHeaders(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationHeaders( - OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) { - - Map result = new HashMap(); - - if (oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) { - String useridPredicate = oaConf.getBasicAuthUserIDMapping(); - String userid = resolveValue(useridPredicate, authData, clientIPAddress); - String passwordPredicate = oaConf.getBasicAuthPasswordMapping(); - String password = resolveValue(passwordPredicate, authData, clientIPAddress); - - try { - String userIDPassword = userid + ":" + password; - String credentials = Base64Utils.encode(userIDPassword.getBytes()); - result.put("Authorization", "Basic " + credentials); - } - catch (IOException ignore) { - } - } - else if (oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) { - for (Iterator iter = oaConf.getHeaderAuthMapping().keySet().iterator(); iter.hasNext();) { - String key = (String) iter.next(); - String predicate = (String) oaConf.getHeaderAuthMapping().get(key); - String resolvedValue = resolveValue(predicate, authData, clientIPAddress); - result.put(key, resolvedValue); - } - } - - return result; - } - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationParameters(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationParameters( - OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) { - - Map result = new HashMap(); - - if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { - for (Iterator iter = oaConf.getParamAuthMapping().keySet().iterator(); iter.hasNext();) { - String key = (String) iter.next(); - String predicate = (String) oaConf.getParamAuthMapping().get(key); - String resolvedValue; - try { - resolvedValue = - URLEncoder.encode(resolveValue(predicate, authData, clientIPAddress), "ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - //ISO-8859-1 is supported - resolvedValue = null; - } - result.put(key, resolvedValue); - } - } - - return result; - } - - /** - * Resolves a login header or parameter value. - * @param predicate header or parameter predicate name from online application configuration - * @param authData authentication data for current login - * @param clientIPAddress client IP address - * @return header or parameter value resolved; null if unknown name is given - */ - private static String resolveValue(String predicate, AuthenticationData authData, String clientIPAddress) { - if (predicate.equals(MOAGivenName)) - return authData.getGivenName(); - if (predicate.equals(MOAFamilyName)) - return authData.getFamilyName(); - if (predicate.equals(MOADateOfBirth)) - return authData.getDateOfBirth(); - if (predicate.equals(MOABPK)) - return authData.getBPK(); - if (predicate.equals(MOAWBPK)) - return authData.getWBPK(); - if (predicate.equals(MOAPublicAuthority)) - if (authData.isPublicAuthority()) - return "true"; - else - return "false"; - if (predicate.equals(MOABKZ)) - return authData.getPublicAuthorityCode(); - if (predicate.equals(MOAQualifiedCertificate)) - if (authData.isQualifiedCertificate()) - return "true"; - else - return "false"; - if (predicate.equals(MOAStammzahl)) - return authData.getIdentificationValue(); - if (predicate.equals(MOAIdentificationValueType)) - return authData.getIdentificationType(); - if (predicate.equals(MOAIPAddress)) - return clientIPAddress; - else return null; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java deleted file mode 100644 index 909e2d51e..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java +++ /dev/null @@ -1,249 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; - -import com.ibm.webdav.HTTPHeaders; -import com.ibm.webdav.protocol.URLStreamHandlerFactory; -import com.ibm.webdav.protocol.http.WebDAVURLConnection; -import java.util.StringTokenizer; -import java.net.URL; -import at.gv.egovernment.moa.util.URLEncoder; //java.net.URLEncoder; -import java.net.URLStreamHandler; -import java.util.Iterator; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; - -import com.sun.net.ssl.HostnameVerifier; -import com.sun.net.ssl.HttpsURLConnection; - -/** - * Defaultimplementierung von ConnectionBuilder. - * @author Paul Ivancsics - * @version $Id$ - */ -public class ElakConnectionBuilder implements ConnectionBuilder { - - /** a boolean to disable the HostnameVerification (default = false)*/ - private static boolean cbDisableHostnameVerification = false; - - /** a boolean to indicat if webdav protocol handler was already set */ - private static boolean webdavPHSet = false; - - /** - * The system property name used to register a protocol handler. - */ - public final static String PROTOCOL_HANDLER_PROPERTY_NAME = "java.protocol.handler.pkgs"; - - /** - * The package providing the ldap protocol handler. - */ - public final static String WEBDAV_PROTOCOL_HANDLER = "com.ibm.webdav.protocol"; - - /** - * The pipe character used to sepearte different protocol handlers. - */ - public final static char PIPE_CHAR = '|'; - - - - - - /** - * Constructor for ElakConnectionBuilder. - * @throws ConfigurationException on any config error - */ - public ElakConnectionBuilder() throws ConfigurationException { - cbDisableHostnameVerification = BoolUtils.valueOf( - ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( - "ProxyComponent.DisableHostnameVerification")); - //TODO MOA-ID BRZ undocumented feature - if (cbDisableHostnameVerification) - Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); - } - - /** - * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection - */ - public HttpURLConnection buildConnection( - HttpServletRequest req, - String publicURLPrefix, - String realURLPrefix, - SSLSocketFactory sslSocketFactory, - Vector parameters) - throws IOException { - - String requestedURL = req.getRequestURL().toString(); - // check whether requested URL starts with publicURLPrefix - if (! requestedURL.startsWith(publicURLPrefix)) - throw new IOException(MOAIDMessageProvider.getInstance().getMessage( - "proxy.01", new Object[] {requestedURL, publicURLPrefix})); - - - - // in case of GET request, append query string to requested URL; - // otherwise, HttpURLConnection would perform a POST request - //FIXME right parameters - /* - if ("get".equalsIgnoreCase(req.getMethod()) && ! parameters.isEmpty()) { - requestedURL = appendQueryString(requestedURL, parameters); - } - */ - //TODO RSCH check functionality - if (null != req.getQueryString() && 0 != req.getQueryString().length() ) { - String query = req.getQueryString(); - requestedURL = requestedURL + "?" + query; - - String parameter[] = new String[2]; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - parameter = (String[]) iter.next(); - if(query.indexOf(parameter[0]) >= 0) iter.remove(); - } - } - - // build real URL in online application - String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); - - - Logger.info("Registering WebDAV protocol handler"); - String protocolHandlers = System.getProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME); - if (protocolHandlers == null) { - protocolHandlers = ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER; - System.setProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME, protocolHandlers); - } else { - // check, if WEBDAV protocol handler is already configured - boolean isConfigured = false; - StringTokenizer tokenizer = new StringTokenizer(protocolHandlers, "| "); - while (tokenizer.hasMoreTokens()) { - String protocolHandler = tokenizer.nextToken(); - if (protocolHandler.equals(ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER)) { - isConfigured = true; - break; - } - } - // if it has not been configured yet, configure it - if (!isConfigured) { - protocolHandlers = ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER + ElakConnectionBuilder.PIPE_CHAR + protocolHandlers; - System.setProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME, protocolHandlers); - } - } - Logger.info("Registered protocol handlers: " + protocolHandlers); - Class webdavSH = null; - try - { - webdavSH = Class.forName(ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER + ".http.Handler"); - } - catch (ClassNotFoundException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - URLStreamHandler urlStreamHandler = null; - try - { - urlStreamHandler = (URLStreamHandler) webdavSH.newInstance(); - } - catch (InstantiationException e1) - { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - catch (IllegalAccessException e1) - { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - //URL testURL = new URL("http", realURLString.substring("http://localhost:82".length()), 82, "", urlStreamHandler); - //WebDAVURLConnection webDavTest = (WebDAVURLConnection) testURL.openConnection(); - - - URL testURL = new URL(realURLString); - Logger.debug("TEST URL ist von der Klasse: " + testURL.getClass().getName()); - - //URL url = new URL(realURLString); - URL testURL2 = new URL(realURLString); - - URL url = new URL("http", "localhost", 82, realURLString.substring("http://localhost:82".length()), urlStreamHandler); - - Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); - WebDAVURLConnection webDavConn = (WebDAVURLConnection) url.openConnection(); - HttpURLConnection conn = (HttpURLConnection)webDavConn; - webDavConn.setRequestMethod(req.getMethod()); - webDavConn.setDoInput(true); - webDavConn.setDoOutput(true); - //conn.setUseCaches(false); - webDavConn.setAllowUserInteraction(true); - webDavConn.setInstanceFollowRedirects(false); - if (conn instanceof HttpsURLConnection && sslSocketFactory != null) { - HttpsURLConnection httpsConn = (HttpsURLConnection) conn; - httpsConn.setSSLSocketFactory(sslSocketFactory); - if (cbDisableHostnameVerification) - httpsConn.setHostnameVerifier(new HostnameNonVerifier()); - } - return conn; - } - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param conn the HttpURLConnection which is normaly to be closed - */ - public void disconnect(HttpURLConnection conn) { - conn.disconnect(); - } - - /** - * @param requestedURL - * @param parameters - * @return - */ - private String appendQueryString(String requestedURL, Vector parameters) { - String newURL = requestedURL; - String parameter[] = new String[2]; - String paramValue =""; - String paramName =""; - String paramString =""; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - try { - parameter = (String[]) iter.next(); - //Following two lines do not work with OWA-SSL-Login-form - paramName = URLEncoder.encode((String) parameter[0], "UTF-8"); - paramValue = URLEncoder.encode((String) parameter[1], "UTF-8"); - - } catch (UnsupportedEncodingException e) { - //UTF-8 should be supported - } - paramString = "&" + paramName + "=" + paramValue + paramString; - } - if (paramString.length()>0) newURL = newURL + "?" + paramString.substring(1); - return newURL; - } - - /** - * @author Stefan Knirsch - * @version $Id$ - * A private class to change the standard HostName verifier to disable the - * Hostname Verification Check - */ - private class HostnameNonVerifier implements HostnameVerifier { - - /** - * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) - */ - public boolean verify(String arg0, String arg1) { - return true; - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java b/id.server/src/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java deleted file mode 100644 index f934ab80b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java +++ /dev/null @@ -1,211 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.net.URL; -import java.net.URLStreamHandler; -import java.util.Iterator; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; - -import com.sun.net.ssl.HostnameVerifier; -import HTTPClient.HttpURLConnection; -import HTTPClient.HTTPConnection; - - -/** - * Outlook Web Access (OWA) Implementierung von ConnectionBuilder. - * uses the HTTP(s)Client from Ronald Tschalär. - * origin version (without https support) is available at http://www.innovation.ch/java/HTTPClient/ - * - * @author pdanner - */ -public class EnhancedConnectionBuilder implements ConnectionBuilder { - - /** a boolean to disable the HostnameVerification (default = false)*/ - private static boolean cbDisableHostnameVerification = false; - /** Name of the Parameter for the Target */ - private static final String PARAM_TARGET = "Target"; - /** Name of the Parameter for the SAMLArtifact */ - private static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; - /** Name of the Attribute for marking the session as authenticated*/ - private static final String ATT_AUTHDATAFETCHED = "AuthDataFetched"; - - static { - HTTPConnection.setDefaultTimeout(0); - try { - HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.AuthorizationModule")); - HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.RedirectionModule")); - HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.CookieModule")); - //HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.RetryModule")); - } catch (ClassNotFoundException e) { - - } - } - - /** - * Constructor for OWAConnectionBuilder. - * @throws ConfigurationException on any config error - */ - public EnhancedConnectionBuilder() throws ConfigurationException { - cbDisableHostnameVerification = BoolUtils.valueOf( - ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( - "ProxyComponent.DisableHostnameVerification")); - //TODO MOA-ID BRZ undocumented feature - if (cbDisableHostnameVerification) - Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); - } - - /** - * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection - */ - public java.net.HttpURLConnection buildConnection(HttpServletRequest req, String publicURLPrefix, String realURLPrefix, SSLSocketFactory sslSocketFactory, Vector parameters) throws IOException { - - String requestedURL = req.getRequestURL().toString(); - // check whether requested URL starts with publicURLPrefix - - if (! requestedURL.startsWith(publicURLPrefix.substring(0,5))) - throw new IOException(MOAIDMessageProvider.getInstance().getMessage( - "proxy.01", new Object[] {requestedURL, publicURLPrefix})); - - String query = req.getQueryString(); - if (req.getSession().getAttribute(ATT_AUTHDATAFETCHED)!=null) { - query = removeParameter(query, PARAM_SAMLARTIFACT); - query = removeParameter(query, PARAM_TARGET); - req.getSession().removeAttribute(ATT_AUTHDATAFETCHED); - } - if (null != query && 0 != query.length() ) { - requestedURL = requestedURL + "?" + query; - - String parameter[] = new String[2]; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - parameter = (String[]) iter.next(); - if(query.indexOf(parameter[0]) >= 0) iter.remove(); - } - } - - // build real URL in online application - String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); - - // build real URL in online application - URLStreamHandler urlStreamHandler = null; - - //URL url = new URL(realURLString); - if (realURLString.startsWith("https")) { - urlStreamHandler = new HTTPClient.https.Handler(); - } else{ - urlStreamHandler = new HTTPClient.http.Handler(); - } - URL url = new URL(null, realURLString, urlStreamHandler); - Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); - - HttpURLConnection conn = (HttpURLConnection)url.openConnection(); - - conn.setRequestMethod(req.getMethod()); - conn.setDoInput(true); - conn.setDoOutput(true); - //conn.setUseCaches(false); - //conn.setAllowUserInteraction(true); - conn.setInstanceFollowRedirects(false); - - if (realURLString.startsWith("https") && sslSocketFactory != null) { - conn.setSSLSocketFactory(sslSocketFactory); - //Not available in HTTPClient - //if (cbDisableHostnameVerification) - // conn.setHostnameVerifier(new HostnameNonVerifier()); - } - - return conn; - - } - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param conn the HttpURLConnection which is normaly to be closed - */ - public void disconnect(java.net.HttpURLConnection conn) { - // In HTTPClient there must not be an diconnect! - // conn.disconnect(); - } - - /** - * @author Stefan Knirsch - * @version $Id$ - * A private class to change the standard HostName verifier to disable the - * Hostname Verification Check - */ - private class HostnameNonVerifier implements HostnameVerifier { - - /** - * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) - */ - public boolean verify(String arg0, String arg1) { - return true; - } - } - - /** - * Removes parameters from the query-URL recursively - * - * @param query the query from which the parameter is to be removed - * @param parameter the parameter to be removed - * @return the parameterclean query - */ - private String removeParameter(String query, String parameter) { - return removeParameter(query, parameter, true); - } - - /** - * Removes one parameter from the query-URL recursively - * - * @param query the query from which the parameter is to be removed - * @param parameter the parameter to be removed - * @param remove. Boolean value wether a parameter was removed in last call or not. In initial call set to true to check for new occurrences - * @return the parameterclean query - */ - private String removeParameter(String query, String parameter, boolean remove) { - String result = query; - if (remove && query!=null && !query.equals("") && parameter!=null && !parameter.equals("")) { - String param = parameter; - int capEnd=0; - if (!param.endsWith("=")) param=param+"="; - if (query.startsWith(param)) { - //remove leading - result=""; - } else { - if (!param.startsWith("&")) param="&"+param; - capEnd = query.indexOf(param); - if (capEnd!=-1) { - //leading part - result=query.substring(0, capEnd); - } - } - if (capEnd!=-1) { - //trailing part - capEnd += param.length(); - int capBegin = -1; - if (capEnd MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, - * naming predicates used by the LoginParameterResolver. */ - public static final String MOAGivenName = "MOAGivenName"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAFamilyName = "MOAFamilyName"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOADateOfBirth = "MOADateOfBirth"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOABPK = "MOABPK"; - /** Constant used in MOAIDConfiguration-1.3.xsd, type MOAAuthDataType */ - public static final String MOAWBPK = "MOAWBPK"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAPublicAuthority = "MOAPublicAuthority"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOABKZ = "MOABKZ"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAQualifiedCertificate = "MOAQualifiedCertificate"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAStammzahl = "MOAStammzahl"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAIdentificationValueType = "MOAIdentificationValueType"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAIPAddress = "MOAIPAddress"; - - /** - * Returns authentication headers to be added to a URLConnection. - * - * @param oaConf configuration data - * @param authData authentication data - * @param clientIPAddress client IP address - * @param businessService boolean value for recognizing (w)bPK-mode - * @param publicURLPrefix to distinguish different online applications - * @return A map, the keys being header names and values being corresponding header values. - *
In case of authentication type "basic-auth", header fields - * username and password. - *
In case of authentication type "header-auth", header fields - * derived from parameter mapping and authentication data provided. - *
Otherwise, an empty map. - */ - public Map getAuthenticationHeaders( - OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException; - - /** - * Returns request parameters to be added to a URLConnection. - * - * @param oaConf configuration data - * @param authData authentication data - * @param clientIPAddress client IP address - * @param businessService boolean value for recognizing (w)bPK-mode - * @param publicURLPrefix to distinguish different online applications - * @return A map, the keys being parameter names and values being corresponding parameter values. - *
In case of authentication type "param-auth", parameters - * derived from parameter mapping and authentication data provided. - *
Otherwise, an empty map. - */ - public Map getAuthenticationParameters( - OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException; - - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException; - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java b/id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java deleted file mode 100644 index 3aa2368bf..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import at.gv.egovernment.moa.id.MOAIDException; - -/** - * Exception thrown while proxying a request to the online application - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class LoginParameterResolverException extends MOAIDException { - - /** - * Constructor for LoginParameterResolverException. - * @param messageId - * @param parameters - */ - public LoginParameterResolverException( - String messageId, - Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for LoginParameterResolverException. - * @param messageId - * @param parameters - * @param wrapped - */ - public LoginParameterResolverException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java b/id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java deleted file mode 100644 index 8edd23438..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java +++ /dev/null @@ -1,82 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; - -/** - * Factory delivering a {@link LoginParameterResolver} implementation for - * an online application, initialized from configuration data. - * @author Paul Ivancsics - * @version $Id$ - */ -public class LoginParameterResolverFactory { - - /** default login parameter resolver to be used for online application - * where no special implementation of the LoginParameterResolver - * interface is configured - */ - private static LoginParameterResolver defaultLoginParameterResolver; - /** mapping from online application public URL prefix to an implementation - * of the LoginParameterResolver interface to be used; - * if no mapping is given for an online application, the - * DefaultLoginParameterResolver will be used */ - private static Map loginParameterResolverMap; - - /** - * Initializes the LoginParameterResolver map from the configuration data. - * @throws ConfigurationException when the configuration cannot be read, - * or when a class name configured cannot be instantiated - */ - public static void initialize() throws ConfigurationException { - defaultLoginParameterResolver = new DefaultLoginParameterResolver(); - loginParameterResolverMap = new HashMap(); - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - for (int i = 0; i < proxyConf.getOnlineApplicationParameters().length; i++) { - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameters()[i]; - String publicURLPrefix = oaParam.getPublicURLPrefix(); - String className = oaParam.getLoginParameterResolverImpl(); - String configuration = oaParam.getLoginParameterResolverConfiguration(); - if (className != null) { - try { - Class lprClass = Class.forName(className); - LoginParameterResolver lpr = (LoginParameterResolver)Class.forName(className).newInstance(); - - Class[] argumentTypes = { String.class, Boolean.class }; - Method confMethod = lprClass.getMethod( "configure", argumentTypes ); - - Object[] arguments = { new String(configuration), new Boolean(oaParam.getBusinessService()) }; - confMethod.invoke( lpr, arguments ); - - loginParameterResolverMap.put(publicURLPrefix, lpr); - } - catch (InvocationTargetException lpex) { - throw new ConfigurationException("config.11", new Object[] {className}, lpex); - } - catch (Throwable ex) { - throw new ConfigurationException("config.07", new Object[] {publicURLPrefix}, ex); - } - } - } - } - - /** - * Gets the LoginParameterResolver implementation to be used for the given - * online application. - * @param publicURLPrefix public URL prefix of the online application - * @return LoginParameterResolver implementation - */ - public static LoginParameterResolver getLoginParameterResolver(String publicURLPrefix) { - LoginParameterResolver lpr = (LoginParameterResolver) loginParameterResolverMap.get(publicURLPrefix); - if (lpr == null) - return defaultLoginParameterResolver; - else - return lpr; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java b/id.server/src/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java deleted file mode 100644 index 3f615b01c..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java +++ /dev/null @@ -1,95 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import iaik.pki.PKIException; -import iaik.pki.jsse.IAIKX509TrustManager; - -import java.io.IOException; -import java.security.GeneralSecurityException; - -import javax.net.ssl.SSLSocketFactory; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; -import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Web application initializer - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDProxyInitializer { - - /** - * Initializes the web application components which need initialization: - * logging, JSSE, MOA-ID Auth configuration, Axis, session cleaner. - */ - public static void initialize() - throws ConfigurationException, IOException, GeneralSecurityException, PKIException { - - Logger.setHierarchy("moa.id.proxy"); - - // Restricts TLS cipher suites - System.setProperty("https.cipherSuites", "SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_3DES_EDE_CBC_SHA"); - - // load some jsse classes so that the integrity of the jars can be verified - // before the iaik jce is installed as the security provider - // this workaround is only needed when sun jsse is used in conjunction with - // iaik-jce (on jdk1.3) - ClassLoader cl = MOAIDProxyInitializer.class.getClassLoader(); - try { - cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar - } - catch (ClassNotFoundException e) { - Logger.warn(MOAIDMessageProvider.getInstance().getMessage("init.01", null), e); - } - - // Initializes the SSLSocketFactory store - SSLUtils.initialize(); - - // Initializes IAIKX509TrustManager logging - String log4jConfigURL = System.getProperty("log4j.configuration"); - if (log4jConfigURL != null) { - IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); - } - - // Loads the configuration - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.reload(); - - // Initializes the Axis secure socket factory for use in calling the MOA-Auth web service, - // using configuration data - ConnectionParameter connParamAuth = proxyConf.getAuthComponentConnectionParameter(); - if (connParamAuth!=null) { - if (connParamAuth.isHTTPSURL()) { - SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(proxyConf, connParamAuth); - AxisSecureSocketFactory.initialize(ssf); - } - } else { - throw new ConfigurationException("config.16", null); - } - - // Initializes the Axis secure socket factories for use in calling the online applications, - // using configuration data - OAProxyParameter[] oaParams = proxyConf.getOnlineApplicationParameters(); - for (int i = 0; i < oaParams.length; i++) { - OAProxyParameter oaParam = oaParams[i]; - ConnectionParameter oaConnParam = oaParam.getConnectionParameter(); - if (oaConnParam.isHTTPSURL()) - SSLUtils.getSSLSocketFactory(proxyConf, oaConnParam); - } - - // Initializes the ConnectionBuilderFactory from configuration data - ConnectionBuilderFactory.initialize(); - - // Initializes the LoginParameterResolverFactory from configuration data - LoginParameterResolverFactory.initialize(); - - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/NotAllowedException.java b/id.server/src/at/gv/egovernment/moa/id/proxy/NotAllowedException.java deleted file mode 100644 index 849160a7b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/NotAllowedException.java +++ /dev/null @@ -1,39 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import at.gv.egovernment.moa.id.MOAIDException; - -/** - * Exception thrown while proxying a request to the online application - * Reason for this exception: the dedicated LoginParameterResolver does - * not allow access to the desired ressource. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class NotAllowedException extends MOAIDException { - - /** - * Constructor for NotAllowedException. - * @param messageId - * @param parameters - */ - public NotAllowedException( - String messageId, - Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for NotAllowedException. - * @param messageId - * @param parameters - * @param wrapped - */ - public NotAllowedException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java b/id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java deleted file mode 100644 index 9bfd9de9b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java +++ /dev/null @@ -1,678 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import iaik.security.provider.IAIK; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.Key; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.Security; -import java.util.HashMap; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.spec.IvParameterSpec; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.URLEncoder; - -/** - * XMLLoginParameterResolver an implementation of implementation of interface - * LoginParameterResolver - * This implementation used to map identities stored in an XML file to parameters - * which are given to OAs. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class XMLLoginParameterResolverEncryptedData implements LoginParameterResolver { - - //file which is parsed and interpreted for paremeter resolving. - private String identityFile; - - private Cipher blowfishCipher; - private Key key; - /** - * inner class used to store mapped parameters - */ - class LPRParams { - - /** - * getter method for parameter Enabled. - * Parameter Enabled decides if mapped parameters should be used by XMLLoginParameterResolver - */ - public boolean getEnabled() { - return enabled.booleanValue(); - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - public String getUN() { - return UN; - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - //TODO XMLLPR decrypt - public String getPlainUN() { - //Security.addProvider(); - - - return UN; - } - - - /** - * getter method for parameter PW (password) - * @return Parameter PW or null not set. - */ - public String getPW() { - return PW; - } - - /** - * getter method for generic parameter Param1 - * @return Parameter Param1 or null not set. - */ - public String getParam1() { - return Param1; - } - - /** - * getter method for generic parameter Param2 - * @return Parameter Param2 or null not set. - */ - public String getParam2() { - return Param2; - } - - /** - * getter method for generic parameter Param3 - * @return Parameter Param3 or null not set. - */ - public String getParam3() { - return Param3; - } - - /** - * Returns a string representation of LPRParams - * - * @return a String representation of this object. - * @see XMLLoginParameterResolver.LPRParams - */ - public String toString() { - return "Enabled: " - + enabled.toString() - + "UN: '" - + UN - + "' PW: '" - + PW - + "' Param1: '" - + Param1 - + "' Param2: '" - + Param2 - + "' Param3: '" - + Param3 - + "'\n"; - } - - //private member variables used to store the parameters - private Boolean enabled = null; - private String UN = null; - private String PW = null; - private String Param1 = null; - private String Param2 = null; - private String Param3 = null; - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - * @param Param1 generic parameter1 used in HeaderAuthentication and ParameterAuthentication - * @param Param2 generic parameter2 used in HeaderAuthentication and ParameterAuthentication - * @param Param3 generic parameter3 used in HeaderAuthentication and ParameterAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW, String Param1, String Param2, String Param3) { - this.enabled = new Boolean(enabled); - this.UN = UN; - this.PW = PW; - this.Param1 = Param1; - this.Param2 = Param2; - this.Param3 = Param3; - } - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW) { - this(enabled, UN, PW, null, null, null); - } - } - - /** - * Constructs a newly allocated XMLLoginParameterResolver object. - **/ - public XMLLoginParameterResolverEncryptedData() { - bPKMap = new HashMap(); - namedMap = new HashMap(); - } - - /** - * configuration method - * @param configuration enabled enable user mapping to parameter set for the parameter set. - */ - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { - File idFile; - Element rootElement; - - Security.addProvider(new IAIK()); - try { - blowfishCipher = Cipher.getInstance("Blowfish/CBC/PKCS5Padding", "IAIK"); - - } catch (NoSuchPaddingException e) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: NoSuchPaddingException \n" + e.toString()}); - } catch (NoSuchProviderException e) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: NoSuchProviderException \n" + e.toString()}); - } catch (NoSuchAlgorithmException e) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: NoSuchAlgorithmException \n" + e.toString()}); - } - - String plaintext = "start"; - String encrypted = encryptData(plaintext, "1234567890123456", "123hochgeheim"); - String decrypted = decryptData(encrypted, "1234567890123456", "123hochgeheim"); - Logger.debug("plaintext: " + plaintext); - Logger.debug("encrypted: " + encrypted); - Logger.debug("decrypted: " + decrypted); - - //make file name absolut (if it is relative to main config file) - //TODO MOAID XMLLPR check - String moaIDConfigFileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); - String rootConfigFileDir = new File(moaIDConfigFileName).getParent(); - this.identityFile = FileUtils.makeAbsoluteURL(configuration, rootConfigFileDir); - - if (null == identityFile || false == (idFile = new File(identityFile)).canRead()) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: could not read '" + identityFile + "' " }); - } - try { - rootElement = readXMLFile(identityFile); - } catch (IOException lex) { - Logger.error(lex.toString()); - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: could not read '" + identityFile + "' " }); - - } catch (SAXException sex) { - Logger.error(sex.toString()); - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: parsing problem in file:'" + identityFile + "' ", sex.toString() }); - } catch (ParserConfigurationException e) { - // TODO XMLPR Auto-generated catch block - Logger.error(e.toString()); - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: parsing problem in file:'" + identityFile + "' ", e.toString() }); - } - buildInfo(rootElement, businessService.booleanValue()); - isConfigured = true; - } - - /** - * encryptData method uses parameters masterSecret and bPK as key information to encrypt plaintext - * @param plaintext - * @param bPK - * @param masterSecret - * @return encrypted data (blowfish encrypted, base64 encoded) - * @throws LoginParameterResolverException - */ - public String encryptData(String plaintext, String bPK, String masterSecret) throws LoginParameterResolverException - { - try { - String keyString = bPK + masterSecret; - key = new iaik.security.cipher.SecretKey(keyString.getBytes("UTF-8"), "Blowfish"); - IvParameterSpec param = new IvParameterSpec(new byte [] {0,0,0,0,0,0,0,0}); - - blowfishCipher.init(Cipher.ENCRYPT_MODE, key, param); - byte [] cipherText = blowfishCipher.doFinal(plaintext.getBytes("UTF-8")); - return Base64Utils.encode(cipherText); - } catch (UnsupportedEncodingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidKeyException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (BadPaddingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalBlockSizeException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalStateException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidAlgorithmParameterException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IOException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } - } - - - /** - * encryptData method uses parameters masterSecret and bPK as key information to decrypt ciphertext - * @param ciphertext (blowfish encrypted, base64encoded) - * @param bPK - * @param masterSecret - * @return decrypted Data (plaintext) - * @throws LoginParameterResolverException - */ - public String decryptData(String ciphertext, String bPK, String masterSecret) throws LoginParameterResolverException - { - try { - String keyString = bPK + masterSecret; - key = new iaik.security.cipher.SecretKey(keyString.getBytes("UTF-8"), "Blowfish"); - IvParameterSpec param = new IvParameterSpec(new byte [] {0,0,0,0,0,0,0,0}); - blowfishCipher.init(Cipher.DECRYPT_MODE, key, param); - byte [] plaintext = blowfishCipher.doFinal(Base64Utils.decode(ciphertext, true)); - return new String(plaintext); - } catch (UnsupportedEncodingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidKeyException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (BadPaddingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalBlockSizeException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalStateException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidAlgorithmParameterException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IOException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } - } - - - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationHeaders(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationHeaders( - OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException { - Map result = new HashMap(); - - if (!isConfigured) { - //TODO XMLLPR - throw new LoginParameterResolverException("XMLLoginParameterResolver with configuration '" + - identityFile + "' is not configured!", null); - } - - //get the Identity of the user - String famName = resolveValue("MOAFamilyName", authData, clientIPAddress); - String givenName = resolveValue("MOAGivenName", authData, clientIPAddress); - String dateOfBirth = resolveValue("MOADateOfBirth", authData, clientIPAddress); - String bPK =""; - String wType= ""; - if (businessService) { - bPK = resolveValue(MOAWBPK, authData, clientIPAddress); - wType = "w"; - } else { - bPK = resolveValue(MOABPK, authData, clientIPAddress); - } - String userid = ""; - String password = ""; - LPRParams params = null; - boolean userFound = false; - - //try (w)bPK and named search - params = bPKIdentitySearch(bPK, wType); - - if (null == params) - params = namedIdentitySearch(famName, givenName, dateOfBirth); - - //if both searches failed, report error. - if(null == params) - throw new NotAllowedException("User:_" + wType + "bPK:'" +bPK+ ", " + famName + ", " + givenName + "' not authorized.", null); - - //HTTP 401 - Basic Authentication - if (oaConf.getAuthType().equals("basic")) { - userid = (null != params.getUN()) ? params.getUN() : ""; - password = (null != params.getPW()) ? params.getPW() : ""; - - try { - String userIDPassword = userid + ":" + password; - String credentials = Base64Utils.encode(userIDPassword.getBytes("UTF-8")); - Logger.debug("XMLLoginParameterResolver: calculated credentials: " + credentials); - result.put("Authorization", "Basic " + credentials); - } catch (IOException ignore) { - throw new LoginParameterResolverException("config.14", new Object[] {"internal error while encoding in Base64"}); - } - } else if (oaConf.getAuthType().equals("header")) { //HTTP Authentication - String key; - String resolvedValue; - //TODO MOAID XMLLPR select value through OA-ConfigFile; - if(null != params.getUN()) result.put("UN", params.getUN()); - if(null != params.getPW()) result.put("UN", params.getPW()); - if(null != params.getParam1()) result.put("UN", params.getParam1()); - if(null != params.getParam2()) result.put("UN", params.getParam2()); - if(null != params.getParam3()) result.put("UN", params.getParam3()); - - } else { - throw new LoginParameterResolverException("config.14", new Object[] {"AuthType not supported"}); - } - - return result; - } - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationParameters(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationParameters( - OAConfiguration oaConf, - AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException { - - Map result = new HashMap(); - - if (!isConfigured) { - Logger.warn("XMLLoginParameterResolver with configuration '" + identityFile + " is not configured"); - return result; - } - - String famName = resolveValue("MOAFamilyName", authData, clientIPAddress); - String givenName = resolveValue("MOAGivenName", authData, clientIPAddress); - String dateOfBirth = resolveValue("MOADateOfBirth", authData, clientIPAddress); - String bPK =""; - String wType= ""; - if (businessService) { - bPK = resolveValue(MOAWBPK, authData, clientIPAddress); - wType = "w"; - } else { - bPK = resolveValue(MOABPK, authData, clientIPAddress); - } - String userid = ""; - String password = ""; - LPRParams params = null; - - //try (w)bPK and named search - params = bPKIdentitySearch(bPK, wType); - - if (null == params) - params = namedIdentitySearch(famName, givenName, dateOfBirth); - - //if both searches failed, report error. - if(null == params) - throw new NotAllowedException("User:_" + wType + "bPK:'" +bPK+ ", " + famName + ", " + givenName + "' not authorized.", null); - - //TODO MOAID XMLLPR URLEncoder.encode - if (oaConf.getAuthType().equals("param")) { - try { - if(null != params.getUN()) result.put(XSD_UNATTR, URLEncoder.encode(params.getUN(),"ISO-8859-1")); - if(null != params.getPW()) result.put(XSD_PWATTR, URLEncoder.encode(params.getPW(),"ISO-8859-1")); - if(null != params.getParam1()) result.put(XSD_PARAM1ATTR, URLEncoder.encode(params.getParam1(),"ISO-8859-1")); - if(null != params.getParam2()) result.put(XSD_PARAM2ATTR, URLEncoder.encode(params.getParam2(),"ISO-8859-1")); - if(null != params.getParam3()) result.put(XSD_PARAM3ATTR, URLEncoder.encode(params.getParam3(),"ISO-8859-1")); - } catch (UnsupportedEncodingException e) { - // ISO-8859-1 is supported - throw new LoginParameterResolverException("URLEncoder error", null); - } - } else { - throw new LoginParameterResolverException("AuthType not supported", null); - } - return result; - } - - /** - * Resolves a login header or parameter value. - * @param predicate header or parameter predicate name from online application configuration - * @param authData authentication data for current login - * @param clientIPAddress client IP address - * @return header or parameter value resolved; null if unknown name is given - */ - private static String resolveValue( - String predicate, - AuthenticationData authData, - String clientIPAddress) { - if (predicate.equals("MOAGivenName")) - return authData.getGivenName(); - if (predicate.equals("MOAFamilyName")) - return authData.getFamilyName(); - if (predicate.equals("MOADateOfBirth")) - return authData.getDateOfBirth(); - if (predicate.equals("MOABPK")) - return authData.getBPK(); - if (predicate.equals("MOAWBPK")) - return authData.getWBPK(); - if (predicate.equals("MOAPublicAuthority")) - if (authData.isPublicAuthority()) - return "true"; - else - return "false"; - if (predicate.equals("MOABKZ")) - return authData.getPublicAuthorityCode(); - if (predicate.equals("MOAQualifiedCertificate")) - if (authData.isQualifiedCertificate()) - return "true"; - else - return "false"; - if (predicate.equals("MOAStammzahl")) - return authData.getIdentificationValue(); - if (predicate.equals(MOAIdentificationValueType)) - return authData.getIdentificationType(); - if (predicate.equals("MOAIPAddress")) - return clientIPAddress; - else - return null; - } - - /** - * reads, parses the configuration file of XMLLoginParameterResolver and returns the document element. - * @param fileName of the configuration file. - */ - private Element readXMLFile(String fileName) throws ParserConfigurationException, SAXException, IOException { - Logger.info("XMLLoginParameterResolver: Loading and parsing XMLPLoginParameterConfiguration configuration: " + fileName); - - InputStream stream = null; - Element configElem; - - stream = new BufferedInputStream(new FileInputStream(fileName)); - configElem = DOMUtils.parseDocument(stream, true, Constants.ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - return configElem; - } - - /** - * buildInfo builds up the internal data mapping between the "Identities" and the "Parameters" from the parsed XML file. - * @param root document root element. - */ - private void buildInfo(Element root, boolean businessService) { - NodeList idList = root.getElementsByTagName(XSD_IDELEM); - NodeList paramList = root.getElementsByTagName(XSD_PARAMELEM); - String wType =""; - if (businessService) wType = "w"; - for (int i = 0; i < idList.getLength(); i++) - Logger.debug("XMLLoginParameterResolver: LocalName idList: " + idList.item(i).getLocalName()); - - for (int i = 0; i < paramList.getLength(); i++) - Logger.debug("XMLLoginParameterResolver: LocalName paramList: " + paramList.item(i).getLocalName()); - - for (int i = 0; i < idList.getLength(); i++) { - Element tmpElem = (Element) idList.item(i); - NodeList tmpList = tmpElem.getElementsByTagName(XSD_NAMEDIDELEM); - for (int j = 0; j < tmpList.getLength(); j++) - Logger.debug("XMLLoginParameterResolver: LocalName tmp: " + tmpList.item(j).getLocalName()); - - //Search for NamedIdentity Elements - if (1 == tmpList.getLength()) { - tmpElem = (Element) tmpList.item(0); - String tmpStr = tmpElem.getAttribute(XSD_SURNAMEATTR) + "," + - tmpElem.getAttribute(XSD_GIVENNAMEATTR) + "," + - tmpElem.getAttribute(XSD_BIRTHDATEATTR); - boolean tmpBool = false; - if (tmpElem.getFirstChild() != null - && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - //TODO XMLLPR remove - Logger.debug("XMLLoginParameterResolver: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element) paramList.item(i); - Logger.debug("XMLLoginParameterResolver: attribute UN: " + tmpElem.getAttribute(XSD_UNATTR) + - " attribute PW: " + tmpElem.getAttribute(XSD_PWATTR) + - " attribute Param1: " + tmpElem.getAttribute(XSD_PARAM1ATTR) + - " attribute Param2: " + tmpElem.getAttribute(XSD_PARAM2ATTR) + - " attribute Param3: " + tmpElem.getAttribute(XSD_PARAM3ATTR) ); - namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute(XSD_UNATTR), tmpElem.getAttribute(XSD_PWATTR), - tmpElem.getAttribute(XSD_PARAM1ATTR), tmpElem.getAttribute(XSD_PARAM2ATTR), - tmpElem.getAttribute(XSD_PARAM3ATTR)) ); - } else { - - //(w)bPKIdentity Elements - if (businessService) { - tmpList = tmpElem.getElementsByTagName(XSD_WBPKIDELEM); - } else { - tmpList = tmpElem.getElementsByTagName(XSD_BPKIDELEM); - } - if (1 == tmpList.getLength()) { - tmpElem = (Element) tmpList.item(0); - String tmpStr = ""; - if (businessService) { - tmpStr = tmpElem.getAttribute(XSD_WBPKATTR); - } else { - tmpStr = tmpElem.getAttribute(XSD_BPKATTR); - } - boolean tmpBool = false; - if (tmpElem.getFirstChild() != null - && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - Logger.debug("XMLLoginParameterResolver: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element) paramList.item(i); - Logger.debug("XMLLoginParameterResolver: attribute UN: " + tmpElem.getAttribute(XSD_UNATTR) + - " attribute PW: " + tmpElem.getAttribute(XSD_PWATTR) + - " attribute Param1: " + tmpElem.getAttribute(XSD_PARAM1ATTR) + - " attribute Param2: " + tmpElem.getAttribute(XSD_PARAM2ATTR) + - " attribute Param3: " + tmpElem.getAttribute(XSD_PARAM3ATTR) ); - namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute(XSD_UNATTR), tmpElem.getAttribute(XSD_PWATTR), - tmpElem.getAttribute(XSD_PARAM1ATTR), tmpElem.getAttribute(XSD_PARAM2ATTR), - tmpElem.getAttribute(XSD_PARAM3ATTR)) ); - } else { - if (businessService) { - Logger.warn("XMLLoginParameterResolver: wrong format no Elements " + XSD_NAMEDIDELEM + " or " + XSD_WBPKIDELEM + " found"); - } else { - Logger.warn("XMLLoginParameterResolver: wrong format no Elements " + XSD_NAMEDIDELEM + " or " + XSD_BPKIDELEM + " found"); - } - } - } - } - - Logger.debug("namedMap:" + namedMap.toString()); - Logger.debug(wType + "bPKMap:" + bPKMap.toString()); - } - - - - - /** - * searches for a given bPK and returns the appropriate LPRParams structure - * @param bPK search argument - * @return LPRParams if bPK could be found in internal mappings or null otherwise. - */ - LPRParams bPKIdentitySearch(String bPK, String wType) { - //search for mapping with (w)bPK of the user - Logger.info("XMLLoginParameterResolver: search for login data mapped to " + wType + "bPK:" + bPK); - LPRParams params = (LPRParams) bPKMap.get(bPK); - if (null == params) { - Logger.info("XMLLoginParameterResolver: params for " + wType + "bPK: " + bPK + " not found!"); - return null; - } else if (params.getEnabled()) { - Logger.info("XMLLoginParameterResolver: " + wType + "bPK: " + bPK + "found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolver: using: " + params.toString()); - return params; - } - Logger.info("XMLLoginParameterResolver: " + wType + "bPK: " + bPK + "found in list but user is NOT enabled"); - return null; - } - - /** - * searches for a given namedIdentity and returns the appropriate LPRParams structure - * @param surName surname search argument - * @param givenName givenname search argument - * @param dateOfBirth dateofbirth search argument - * @return LPRParams if (w)bPK could be found in internal mappings or null otherwise. - */ - LPRParams namedIdentitySearch(String surName, String givenName, String dateOfBirth) { - Logger.info("XMLLoginParameterResolver: search for login data for SurName:" + surName + " GivenName: " + givenName + " DateOfBirth" + dateOfBirth); - //try first a search with surname, givenname and birthdate - LPRParams params = (LPRParams) namedMap.get(surName + "," + givenName + "," + dateOfBirth); - if (null == params) { - Logger.debug("XMLLoginParameterResolver: params for Surname: " + surName + " GivenName: " + givenName + "BirthDate: " + dateOfBirth + " not found!"); - //try a search with surname, givenname only - params = (LPRParams) namedMap.get(surName + "," + givenName + "," + XSD_BIRTHDATEBLANKATTR); - if(null == params) { - Logger.debug("XMLLoginParameterResolver: params for Surname: " + surName + " GivenName: " + givenName + " not found!"); - return null; - } - } - - if (params.getEnabled()) { - Logger.info("XMLLoginParameterResolver: Surname:" + surName + " GivenName: " + givenName + " found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolver: using: " + params.toString()); - return params; - } - Logger.info("XMLLoginParameterResolver: SurName:" + surName + " GivenName: " + givenName + "found in list; user is NOT enabled"); - return null; - } - - //public static final String XSD_MAPPING = "Mapping"; - //public static final String XSD_DOCELEM = "MOAIdentities"; - public static final String XSD_IDELEM = "Identity"; - public static final String XSD_NAMEDIDELEM = "NamedIdentity"; - public static final String XSD_BPKIDELEM = "bPKIdentity"; - public static final String XSD_WBPKIDELEM = "wbPKIdentity"; - public static final String XSD_PARAMELEM = "Parameters"; - public static final String XSD_SURNAMEATTR = "SurName"; - public static final String XSD_GIVENNAMEATTR = "GivenName"; - public static final String XSD_BIRTHDATEATTR = "BirthDate"; - public static final String XSD_BIRTHDATEBLANKATTR = "any"; - public static final String XSD_BPKATTR = "bPK"; - public static final String XSD_WBPKATTR = "wbPK"; - public static final String XSD_UNATTR = "UN"; - public static final String XSD_PWATTR = "PW"; - public static final String XSD_PARAM1ATTR = "Param1"; - public static final String XSD_PARAM2ATTR = "Param2"; - public static final String XSD_PARAM3ATTR = "Param3"; - private Map bPKMap; - private Map namedMap; - private boolean isConfigured = false; -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java b/id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java deleted file mode 100644 index aedafdf85..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java +++ /dev/null @@ -1,422 +0,0 @@ -package at.gv.egovernment.moa.id.proxy; - -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; -import java.io.IOException; -import java.util.*; -import org.apache.xerces.parsers.DOMParser; -import org.w3c.dom.*; - -// Referenced classes of package at.gv.egovernment.moa.id.proxy: -// -// TODO MOA-ID test full functionality - -public class XMLLoginParameterResolverPlainData - implements LoginParameterResolver -{ - private String configuration; - - /** - * inner class used to store mapped parameters - */ - class LPRParams { - - /** - * getter method for parameter Enabled. - * Parameter Enabled decides if mapped parameters should be used by XMLLoginParameterResolver - */ - public boolean getEnabled() { - return enabled.booleanValue(); - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - public String getUN() { - return UN; - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - public String getPlainUN() { - return UN; - } - - - /** - * getter method for parameter PW (password) - * @return Parameter PW or null not set. - */ - public String getPW() { - return PW; - } - - /** - * getter method for generic parameter Param1 - * @return Parameter Param1 or null not set. - */ - public String getParam1() { - return Param1; - } - - /** - * getter method for generic parameter Param2 - * @return Parameter Param2 or null not set. - */ - public String getParam2() { - return Param2; - } - - /** - * getter method for generic parameter Param3 - * @return Parameter Param3 or null not set. - */ - public String getParam3() { - return Param3; - } - - /** - * Returns a string representation of LPRParams - * - * @return a String representation of this object. - * @see XMLLoginParameterResolver.LPRParams - */ - public String toString() { - return "Enabled: " - + enabled.toString() - + "UN: '" - + UN - + "' PW: '" - + PW - + "' Param1: '" - + Param1 - + "' Param2: '" - + Param2 - + "' Param3: '" - + Param3 - + "'\n"; - } - - //private member variables used to store the parameters - private Boolean enabled = null; - private String UN = null; - private String PW = null; - private String Param1 = null; - private String Param2 = null; - private String Param3 = null; - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - * @param Param1 generic parameter1 used in HeaderAuthentication and ParameterAuthentication - * @param Param2 generic parameter2 used in HeaderAuthentication and ParameterAuthentication - * @param Param3 generic parameter3 used in HeaderAuthentication and ParameterAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW, String Param1, String Param2, String Param3) { - this.enabled = new Boolean(enabled); - this.UN = UN; - this.PW = PW; - this.Param1 = Param1; - this.Param2 = Param2; - this.Param3 = Param3; - } - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW) { - this(enabled, UN, PW, null, null, null); - } - } - - //TODO document - public XMLLoginParameterResolverPlainData() - { - bPKMap = new HashMap(); - namedMap = new HashMap(); - - } - - //TODO document - public Map getAuthenticationHeaders(OAConfiguration oaConf, AuthenticationData authData, String clientIPAddress, boolean businessService, String publicURLPrefix) throws NotAllowedException - { - Map result = new HashMap(); - if(oaConf.getAuthType().equals("basic")) - { - String famName = resolveValue(MOAFamilyName, authData, clientIPAddress); - String givenName = resolveValue(MOAGivenName, authData, clientIPAddress); - String dateOfBirth = resolveValue(MOADateOfBirth, authData, clientIPAddress); - String bPK =""; - String wType= ""; - if (businessService) { - bPK = resolveValue(MOAWBPK, authData, clientIPAddress); - wType = "w"; - } else { - bPK = resolveValue(MOABPK, authData, clientIPAddress); - } - String userid = ""; - String password = ""; - String param1 = ""; - String param2 = ""; - String param3 = ""; - - LPRParams params = null; - boolean userFound = false; - - //first step: search for (w)bPK entry in user list - Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for "+ wType + "bPK:" + bPK); - params = (LPRParams)bPKMap.get(bPK); - if(params == null) - Logger.debug("XMLLoginParameterResolverPlainData: params for "+ wType + "bPK: " + bPK + " not found in file!"); - else - if(params.getEnabled()) - { //if user is enabled: get related parameters - Logger.debug("XMLLoginParameterResolverPlainData: "+ wType + "bPK: " + bPK + " found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); - userid = params.getUN(); - password = params.getPW(); - param1 = params.getParam1(); - param2 = params.getParam2(); - param3 = params.getParam3(); - userFound = true; - } else - { - Logger.info("XMLLoginParameterResolverPlainData: "+ wType + "bPK: " + bPK + " found in list; user is NOT enabled"); - } - if(!userFound) //secound step: search for name entry in user list - { - Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for SurName:" + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth); - params = (LPRParams)namedMap.get(famName + "," + givenName + "," + dateOfBirth); - if(params == null) { - Logger.debug("XMLLoginParameterResolverPlainData: params for Surname: " + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth + " not found in file!"); - //try also with wildcard ("*") birthdate - params = (LPRParams)namedMap.get(famName + "," + givenName + "," + "*"); - if(params != null) Logger.debug("XMLLoginParameterResolverPlainData: params for Surname: " + famName + " GivenName: " + givenName + " DateOfBirth: " + "*" + " found!"); - } - - if(null != params && params.getEnabled()) - { - Logger.debug("XMLLoginParameterResolverPlainData: SurName:" + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth + " found in file; user is enabled"); - Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); - userid = params.getUN(); - password = params.getPW(); - param1 = params.getParam1(); - param2 = params.getParam2(); - param3 = params.getParam3(); - userFound = true; - } - } - if(!userFound) //third step: search for default user in user list - { - //third step: search for (w)bPK for the default user entry in user list - Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for default user"); - params = (LPRParams)bPKMap.get("default"); - if(params == null) - Logger.debug("XMLLoginParameterResolverPlainData: params for default user not found in file!"); - else - if(params.getEnabled()) - { //if user is enabled: get related parameters - Logger.debug("XMLLoginParameterResolverPlainData: default user found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); - userid = params.getUN(); - password = params.getPW(); - param1 = params.getParam1(); - param2 = params.getParam2(); - param3 = params.getParam3(); - userFound = true; - } else - { - Logger.info("XMLLoginParameterResolverPlainData: default user found in list; user is NOT enabled"); - } - } - - if(!userFound) //if user is not found then throw NotAllowedException exception - { - //TODO MOA-ID proove this with testcases! - Logger.info("XMLLoginParameterResolverPlainData: Person is not allowed No automatic login"); - throw new NotAllowedException("XMLLoginParameterResolverPlainData: Person is not allowed No automatic login ", new Object[] { }); - } - try //if user was found: generate Authorization header entry with associated credemtials - { - String userIDPassword = userid + ":" + password; - String credentials = Base64Utils.encode(userIDPassword.getBytes()); - Logger.debug("XMLLoginParameterResolverPlainData: calculated credentials: " + credentials); - result.put("Authorization", "Basic " + credentials); - } - catch(IOException ignore) { } - } else - if(oaConf.getAuthType().equals("header")) - { - String key; - String resolvedValue; - for(Iterator iter = oaConf.getHeaderAuthMapping().keySet().iterator(); iter.hasNext(); result.put(key, resolvedValue)) - { - key = (String)iter.next(); - String predicate = (String)oaConf.getHeaderAuthMapping().get(key); - resolvedValue = resolveValue(predicate, authData, clientIPAddress); - } - - } - return result; - } - - public Map getAuthenticationParameters(OAConfiguration oaConf, AuthenticationData authData, String clientIPAddress, boolean businessService, String publicURLPrefix) - { - Map result = new HashMap(); - if(oaConf.getAuthType().equals("param")) - { - String key; - String resolvedValue; - for(Iterator iter = oaConf.getParamAuthMapping().keySet().iterator(); iter.hasNext(); result.put(key, resolvedValue)) - { - key = (String)iter.next(); - String predicate = (String)oaConf.getParamAuthMapping().get(key); - resolvedValue = resolveValue(predicate, authData, clientIPAddress); - } - - } - return result; - } - - private static String resolveValue(String predicate, AuthenticationData authData, String clientIPAddress) - { - if(predicate.equals(MOAGivenName)) - return authData.getGivenName(); - if(predicate.equals(MOAFamilyName)) - return authData.getFamilyName(); - if(predicate.equals(MOADateOfBirth)) - return authData.getDateOfBirth(); - if(predicate.equals(MOABPK)) - return authData.getBPK(); - if(predicate.equals(MOAWBPK)) - return authData.getWBPK(); - if(predicate.equals(MOAPublicAuthority)) - if(authData.isPublicAuthority()) - return "true"; - else - return "false"; - if(predicate.equals(MOABKZ)) - return authData.getPublicAuthorityCode(); - if(predicate.equals(MOAQualifiedCertificate)) - if(authData.isQualifiedCertificate()) - return "true"; - else - return "false"; - if(predicate.equals(MOAStammzahl)) - return authData.getIdentificationValue(); - if (predicate.equals(MOAIdentificationValueType)) - return authData.getIdentificationType(); - if(predicate.equals(MOAIPAddress)) - return clientIPAddress; - else - return null; - } - - private Document readXMLFile(String fileName) throws LoginParameterResolverException - { - Logger.info("XMLLoginParameterResolverPlainData: Loading MOA-OA configuration " + fileName); - DOMParser parser = new DOMParser(); - try - { - parser.setFeature("http://xml.org/sax/features/validation", true); - parser.setFeature("http://apache.org/xml/features/validation/schema", true); - parser.parse(fileName); - return parser.getDocument(); - } - catch(Exception e) - { - String msg = e.toString(); - throw new LoginParameterResolverException("proxy.13", new Object[] {": XMLLoginParameterResolverPlainData: Error parsing file " + fileName, "detail problem: " + msg}); - } - } - - private void buildInfo(Document doc, boolean businessService) - { - Element root = doc.getDocumentElement(); - NodeList idList = root.getElementsByTagName("Identity"); - NodeList paramList = root.getElementsByTagName("Parameters"); - String wType =""; - if (businessService) wType = "w"; - for(int i = 0; i < idList.getLength(); i++) - Logger.debug("XMLLoginParameterResolverPlainData: LocalName idList: " + idList.item(i).getLocalName()); - - for(int i = 0; i < paramList.getLength(); i++) - Logger.debug("XMLLoginParameterResolverPlainData: LocalName paramList: " + paramList.item(i).getLocalName()); - - for(int i = 0; i < idList.getLength(); i++) - { - Element tmpElem = (Element)idList.item(i); - NodeList tmpList = tmpElem.getElementsByTagName("NamedIdentity"); - for(int j = 0; j < tmpList.getLength(); j++) - Logger.debug("XMLLoginParameterResolverPlainData: LocalName tmp: " + tmpList.item(j).getLocalName()); - - if(1 == tmpList.getLength()) - { - tmpElem = (Element)tmpList.item(0); - String tmpStr = tmpElem.getAttribute("SurName") + "," + tmpElem.getAttribute("GivenName") + "," + tmpElem.getAttribute("BirthDate"); - boolean tmpBool = false; - if(tmpElem.getFirstChild() != null && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - Logger.debug("XMLLoginParameterResolverPlainData: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element)paramList.item(i); - Logger.debug("XMLLoginParameterResolverPlainData: attribute UN: " + tmpElem.getAttribute("UN") + " attribute PW: " + tmpElem.getAttribute("PW")); - namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute("UN"), tmpElem.getAttribute("PW"))); - } else - { - tmpList = tmpElem.getElementsByTagName(wType + "bPKIdentity"); - if(1 == tmpList.getLength()) - { - tmpElem = (Element)tmpList.item(0); - String tmpStr = tmpElem.getAttribute(wType + "bPK"); - boolean tmpBool = false; - if(tmpElem.getFirstChild() != null && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - Logger.debug("XMLLoginParameterResolverPlainData: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element)paramList.item(i); - Logger.debug("XMLLoginParameterResolverPlainData: attribute UN: " + tmpElem.getAttribute("UN") + " attribute PW: " + tmpElem.getAttribute("PW") + " attribute Param1: " + tmpElem.getAttribute("Param1")); - bPKMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute("UN"), tmpElem.getAttribute("PW"))); - } else - { - Logger.warn("XMLLoginParameterResolverPlainData: wrong format or incorrect mode; no NamedIdentity or " + wType + "bPKIdentity found"); - } - } - } - - Logger.debug("namedMap:" + namedMap.toString()); - Logger.debug(wType + "bPKMap:" + bPKMap.toString()); - } - - //public static final String XSD_DOCELEM = "MOAIdentities"; - //public static final String XSD_IDELEM = "Identity"; - //public static final String XSD_NAMEDIDELEM = "NamedIdentity"; - //public static final String XSD_BPKIDELEM = "bPKIdentity"; - //public static final String XSD_PARAMELEM = "Parameters"; - //public static final String XML_LPR_CONFIG_PROPERTY_NAME1 = "moa.id.xmllpr1.configuration"; - private Map bPKMap; - private Map namedMap; - - - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { - Logger.info("XMLLoginParameterResolverPlainData: initialization string: " + configuration); - this.configuration = configuration; - String fileName = configuration; - if(fileName == null) { - fileName = "file:conf/moa-id/Identities.xml"; - Logger.info("XMLLoginParameterResolverPlainData: used file name string: " + fileName); - } - Document doc = readXMLFile(fileName); - buildInfo(doc, businessService.booleanValue() ); - } -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java b/id.server/src/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java deleted file mode 100644 index e0e1fde4a..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.builder; - -import java.text.MessageFormat; -import java.util.Calendar; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; - -/** - * Builder for the <samlp:Request> used for querying - * the authentication data <saml:Assertion>. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLRequestBuilder implements Constants { - /** samlp-Request template */ - private static final String REQUEST = - "" + - "{2}" + - ""; - - /** - * Constructor for SAMLRequestBuilder. - */ - public SAMLRequestBuilder() { - super(); - } - - /** - * Builds the <samlp:Request>. - * @param requestID request ID - * @param samlArtifactBase64 SAML artifact, encoded BASE64 - * @return the DOM element - */ - public Element build(String requestID, String samlArtifactBase64) throws BuildException { - try { - String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); - String request = MessageFormat.format(REQUEST, new Object[] {requestID, issueInstant, samlArtifactBase64}); - Element requestElem = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - return requestElem; - } - catch (Throwable ex) { - throw new BuildException( - "builder.00", - new Object[] {"samlp:Request", ex.toString()}, - ex); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java b/id.server/src/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java deleted file mode 100644 index f7e5299ab..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java +++ /dev/null @@ -1,143 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.invoke; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Vector; - -import javax.xml.namespace.QName; -import javax.xml.rpc.Call; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceFactory; - -import org.apache.axis.message.SOAPBodyElement; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.ServiceException; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.data.SAMLStatus; -import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; -import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; -import at.gv.egovernment.moa.id.proxy.servlet.ProxyException; -import at.gv.egovernment.moa.id.util.Random; - -/** - * Invoker of - *
    - *
  • either the GetAuthenticationData web service of MOA-ID Auth
  • - *
  • or the API call {@link at.gv.egovernment.moa.id.auth.AuthenticationServer#getAuthenticationData},
  • - *
- * depending of the configuration. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class GetAuthenticationDataInvoker { - /** Create a new QName object for the webservice endpoint */ - private static final QName SERVICE_QNAME = new QName("GetAuthenticationData"); - - /** invoked object for API call of MOA-ID Auth */ - private static Object apiServer = null; - /** invoked method for API call of MOA-ID Auth */ - private static Method apiMethod = null; - - /** - * Invokes the service passing domain model objects. - * @param samlArtifact SAML artifact - * @return AuthenticationData object - * @throws ServiceException on any exception thrown - */ - /** - * Get authentication data from the MOA-ID Auth component, - * either via API call or via web service call. - * @param samlArtifact SAML artifact to be used as a parameter - * @return AuthenticationData - */ - public AuthenticationData getAuthenticationData(String samlArtifact) - throws ConfigurationException, ProxyException, BuildException, ServiceException, ParseException, AuthenticationException { - - ConnectionParameter authConnParam = - ProxyConfigurationProvider.getInstance().getAuthComponentConnectionParameter(); - if (authConnParam == null) { - try { - if (apiServer == null) { - Class serverClass = Class.forName("at.gv.egovernment.moa.id.auth.AuthenticationServer"); - Method getInstanceMethod = serverClass.getMethod("getInstance", (Class[]) null); - apiServer = getInstanceMethod.invoke(null, (Object[]) null); - apiMethod = serverClass.getMethod( - "getAuthenticationData", new Class[] {String.class}); - } - AuthenticationData authData = (AuthenticationData)apiMethod.invoke(apiServer, new Object[] {samlArtifact}); - return authData; - } - catch (InvocationTargetException ex) { - Throwable targetEx = ex.getTargetException(); - if (targetEx instanceof AuthenticationException) - throw (AuthenticationException) targetEx; - else - throw new ProxyException("proxy.09", new Object[] {targetEx.toString()}); - } - catch (Throwable ex) { - throw new ProxyException("proxy.09", new Object[] {ex.toString()}); - } - } - else { - Element samlpRequest = new SAMLRequestBuilder().build(Random.nextRandom(), samlArtifact); - Element samlpResponse = getAuthenticationData(samlpRequest); - SAMLResponseParser srp = new SAMLResponseParser(samlpResponse); - SAMLStatus status = srp.parseStatusCode(); - if (! "samlp:Success".equals(status.getStatusCode())) { - // on error status throw exception - String code = status.getStatusCode(); - if (status.getSubStatusCode() != null && status.getSubStatusCode().length() > 0) - code += "(" + status.getSubStatusCode() + ")"; - throw new ServiceException("service.02", new Object[] {code, status.getStatusMessage()}); - } - return srp.parseAuthenticationData(); - } - } - - /** - * Invokes the service passing DOM elements. - * @param request request DOM element - * @return response DOM element - * @throws ServiceException on any exception thrown - */ - public Element getAuthenticationData(Element request) throws ServiceException { - try { - Service service = ServiceFactory.newInstance().createService(SERVICE_QNAME); - Call call = service.createCall(); - SOAPBodyElement body = - new SOAPBodyElement(request); - SOAPBodyElement[] params = new SOAPBodyElement[] {body}; - Vector responses; - SOAPBodyElement response; - - String endPoint; - ConnectionParameter authConnParam = - ProxyConfigurationProvider.getInstance().getAuthComponentConnectionParameter(); - - //If the ConnectionParameter do NOT exist, we throw an exception .... - if (authConnParam!=null) { - endPoint = authConnParam.getUrl(); - call.setTargetEndpointAddress(endPoint); - responses = (Vector) call.invoke(SERVICE_QNAME, params); - response = (SOAPBodyElement) responses.get(0); - return response.getAsDOM(); - } - else - { - throw new ServiceException("service.01", null); - } - } - catch (Exception ex) { - throw new ServiceException("service.00", new Object[] {ex.toString()}, ex); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java b/id.server/src/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java deleted file mode 100644 index 6bf5da02b..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java +++ /dev/null @@ -1,158 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.parser; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parser for the <saml:Assertion> returned by the - * GetAuthenticationData web service. - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationDataAssertionParser implements Constants { - - /** Prefix for SAML-Xpath-expressions */ - private static String SAML = SAML_PREFIX + ":"; - /** Prefix for PersonData-Xpath-expressions */ - private static String PR = PD_PREFIX + ":"; - /** Prefix for Attribute MajorVersion in an Xpath-expression */ - private static String MAJOR_VERSION_XPATH = - "@MajorVersion"; - /** Prefix for Attribute MinorVersion in an Xpath-expression */ - private static String MINOR_VERSION_XPATH = - "@MinorVersion"; - /** Prefix for Attribute AssertionID in an Xpath-expression */ - private static String ASSERTION_ID_XPATH = - "@AssertionID"; - /** Prefix for Attribute Issuer in an Xpath-expression */ - private static String ISSUER_XPATH = - "@Issuer"; - /** Prefix for Attribute IssueInstant in an Xpath-expression */ - private static String ISSUE_INSTANT_XPATH = - "@IssueInstant"; - /** Prefix for Element AttributeStatement in an Xpath-expression */ - private static String ATTRIBUTESTATEMENT_XPATH = - SAML + "AttributeStatement/"; - /** Prefix for Element NameIdentifier in an Xpath-expression */ - private static String PK_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Subject/" + - SAML + "NameIdentifier"; - private static String NAME_QUALIFIER_XPATH = - PK_XPATH + "/@NameQualifier"; - /** Prefix for Element Person in an Xpath-expression */ - private static String PERSONDATA_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Attribute[@AttributeName=\"PersonData\"]/" + - SAML + "AttributeValue/" + - PR + "Person/"; - /** Prefix for Element Value in an Xpath-expression */ - private static String IDENTIFICATION_VALUE_XPATH = - PERSONDATA_XPATH + - PR + "Identification/" + - PR + "Value"; - private static String IDENTIFICATION_TYPE_XPATH = - PERSONDATA_XPATH + - PR + "Identification/" + - PR + "Type"; - /** Prefix for Element GivenName in an Xpath-expression */ - private static String GIVEN_NAME_XPATH = - PERSONDATA_XPATH + - PR + "Name/" + - PR + "GivenName"; - /** Prefix for Element FamilyName in an Xpath-expression */ - private static String FAMILY_NAME_XPATH = - PERSONDATA_XPATH + - PR + "Name/" + - PR + "FamilyName"; - /** Prefix for Element DateOfBirth in an Xpath-expression */ - private static String DATE_OF_BIRTH_XPATH = - PERSONDATA_XPATH + - PR + "DateOfBirth"; - /** Prefix for Element AttributeValue in an Xpath-expression */ - private static String IS_QUALIFIED_CERT_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Attribute[@AttributeName=\"isQualifiedCertificate\"]/" + - SAML + "AttributeValue"; - /** Prefix for Element AttributeValue in an Xpath-expression */ - private static String PUBLIC_AUTHORITY_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Attribute[@AttributeName=\"isPublicAuthority\"]/" + - SAML + "AttributeValue"; - /** Element samlAssertion represents the SAML:Assertion */ - private Element samlAssertion; - - /** - * Constructor - * @param samlAssertion samlpResponse the <samlp:Response> as a DOM element - */ - public AuthenticationDataAssertionParser(Element samlAssertion) { - this.samlAssertion = samlAssertion; - } - - /** - * Parses the <saml:Assertion>. - * @return AuthenticationData object - * @throws ParseException on any error - */ - public AuthenticationData parseAuthenticationData() - throws ParseException { - - try { - AuthenticationData authData = new AuthenticationData(); - //ÄNDERN: NUR der Identification-Teil - authData.setSamlAssertion(DOMUtils.serializeNode(samlAssertion)); - authData.setMajorVersion(new Integer( - XPathUtils.getAttributeValue(samlAssertion, MAJOR_VERSION_XPATH, "-1")).intValue()); - authData.setMinorVersion(new Integer( - XPathUtils.getAttributeValue(samlAssertion, MINOR_VERSION_XPATH, "-1")).intValue()); - authData.setAssertionID( - XPathUtils.getAttributeValue(samlAssertion, ASSERTION_ID_XPATH, "")); - authData.setIssuer( - XPathUtils.getAttributeValue(samlAssertion, ISSUER_XPATH, "")); - authData.setIssueInstant( - XPathUtils.getAttributeValue(samlAssertion, ISSUE_INSTANT_XPATH, "")); - String pkValue = XPathUtils.getElementValue(samlAssertion, PK_XPATH, ""); - if (XPathUtils.getAttributeValue(samlAssertion, NAME_QUALIFIER_XPATH, "").equalsIgnoreCase(URN_PREFIX_BPK)) { - authData.setBPK(pkValue); - } else { - authData.setWBPK(pkValue); - } - authData.setIdentificationValue( - XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_VALUE_XPATH, "")); - authData.setIdentificationType( - XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_TYPE_XPATH, "")); - authData.setGivenName( - XPathUtils.getElementValue(samlAssertion, GIVEN_NAME_XPATH, "")); - authData.setFamilyName( - XPathUtils.getElementValue(samlAssertion, FAMILY_NAME_XPATH, "")); - authData.setDateOfBirth( - XPathUtils.getElementValue(samlAssertion, DATE_OF_BIRTH_XPATH, "")); - authData.setQualifiedCertificate(BoolUtils.valueOf( - XPathUtils.getElementValue(samlAssertion, IS_QUALIFIED_CERT_XPATH, ""))); - String publicAuthority = - XPathUtils.getElementValue(samlAssertion, PUBLIC_AUTHORITY_XPATH, null); - if (publicAuthority == null) { - authData.setPublicAuthority(false); - authData.setPublicAuthorityCode(""); - } - else { - authData.setPublicAuthority(true); - if (! publicAuthority.equalsIgnoreCase("true")) - authData.setPublicAuthorityCode(publicAuthority); - } - return authData; - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java b/id.server/src/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java deleted file mode 100644 index 9f77578fd..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java +++ /dev/null @@ -1,100 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.parser; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.data.SAMLStatus; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parser for the <samlp:Response> returned by the - * GetAuthenticationData web service. - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLResponseParser implements Constants { - /** Element containing the samlResponse */ - private Element samlResponse; - /** Xpath prefix for reaching SAMLP Namespaces */ - private static String SAMLP = SAMLP_PREFIX + ":"; - /** Xpath prefix for reaching SAML Namespaces */ - private static String SAML = SAML_PREFIX + ":"; - /** Xpath prefix for reaching PersonData Namespaces */ - private static String PR = PD_PREFIX + ":"; - /** Xpath expression for reaching the SAMLP:Response element */ - private static final String ROOT = - "/" + SAMLP + "Response/"; - /** Xpath expression for reaching the SAMLP:Status element */ - private static final String STATUS_XPATH = - ROOT + - SAMLP + "Status/"; - /** Xpath expression for reaching the SAMLP:StatusCode_Value attribute */ - private static final String STATUSCODE_XPATH = - STATUS_XPATH + - SAMLP + "StatusCode/@Value"; - /** Xpath expression for reaching the SAMLP:SubStatusCode_Value attribute */ - private static final String SUBSTATUSCODE_XPATH = - STATUS_XPATH + - SAMLP + "StatusCode/" + - SAMLP + "StatusCode/@Value"; - /** Xpath expression for reaching the SAMLP:StatusMessage element */ - private static final String STATUSMESSAGE_XPATH = - STATUS_XPATH + - SAMLP + "StatusMessage"; - /** Xpath expression for reaching the SAML:Assertion element */ - private static String ASSERTION_XPATH = - ROOT + - SAML + "Assertion"; - - /** - * Constructor - * @param samlResponse the <samlp:Response> as a DOM element - */ - public SAMLResponseParser(Element samlResponse) { - this.samlResponse = samlResponse; - } - - /** - * Parses the <samlp:StatusCode> from the <samlp:Response>. - * @return AuthenticationData object - * @throws ParseException on any parsing error - */ - public SAMLStatus parseStatusCode() - throws ParseException { - - SAMLStatus status = new SAMLStatus(); - try { - status.setStatusCode( - XPathUtils.getAttributeValue(samlResponse, STATUSCODE_XPATH, "")); - status.setSubStatusCode( - XPathUtils.getAttributeValue(samlResponse, SUBSTATUSCODE_XPATH, "")); - status.setStatusMessage( - XPathUtils.getElementValue(samlResponse, STATUSMESSAGE_XPATH, "")); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - return status; - } - - /** - * Parses the <saml:Assertion> from the <samlp:Response>. - * @return AuthenticationData object - * @throws ParseException on any parsing error - */ - public AuthenticationData parseAuthenticationData() - throws ParseException { - - Element samlAssertion; - try { - samlAssertion = (Element)XPathUtils.selectSingleNode(samlResponse, ASSERTION_XPATH); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - return new AuthenticationDataAssertionParser(samlAssertion).parseAuthenticationData(); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java b/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java deleted file mode 100644 index 4ab2e2cf7..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java +++ /dev/null @@ -1,71 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.servlet; - -import java.io.IOException; -import java.text.DateFormat; -import java.util.Date; -import java.util.Locale; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import at.gv.egovernment.moa.id.proxy.MOAIDProxyInitializer; -import at.gv.egovernment.moa.id.util.HTTPRequestJSPForwarder; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for updating the MOA-ID Auth configuration from configuration file - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConfigurationServlet extends HttpServlet { - - /** - * Handle a HTTP GET request, used to indicated that the MOA - * configuration needs to be updated (reloaded). - * - * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - - MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance(); - try { - MOAIDProxyInitializer.initialize(); - - String message = msg.getMessage("config.00", new Object[] - { DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.GERMAN).format(new Date())} ); - Logger.info(message); - - HTTPRequestJSPForwarder.forwardNamed(message, "/message-proxy.jsp", getServletContext(), request, response); - } catch (Throwable t) { - String errorMessage = msg.getMessage("config.04", null); - Logger.error(errorMessage, t); - HTTPRequestJSPForwarder.forwardNamed(errorMessage, "/message-proxy.jsp", getServletContext(), request, response); - } - } - - /** - * Do the same as doGet. - * - * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - doGet(request, response); - } - -/** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ -public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); -} - -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java b/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java deleted file mode 100644 index 0080c010e..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java +++ /dev/null @@ -1,35 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.servlet; - -import at.gv.egovernment.moa.id.MOAIDException; - -/** - * Exception thrown while proxying a request to the online application - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ProxyException extends MOAIDException { - - /** - * Constructor for ProxyException. - * @param messageId - * @param parameters - */ - public ProxyException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for ProxyException. - * @param messageId - * @param parameters - * @param wrapped - */ - public ProxyException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java b/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java deleted file mode 100644 index 6d215c35e..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java +++ /dev/null @@ -1,879 +0,0 @@ -package at.gv.egovernment.moa.id.proxy.servlet; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -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 at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.MOAIDException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.ServiceException; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.data.CookieManager; -import at.gv.egovernment.moa.id.proxy.ConnectionBuilder; -import at.gv.egovernment.moa.id.proxy.ConnectionBuilderFactory; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolver; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolverException; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolverFactory; -import at.gv.egovernment.moa.id.proxy.MOAIDProxyInitializer; -import at.gv.egovernment.moa.id.proxy.NotAllowedException; -import at.gv.egovernment.moa.id.proxy.invoke.GetAuthenticationDataInvoker; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; - -/** - * Servlet requested for logging in at an online application, - * and then for proxying requests to the online application. - * @author Paul Ivancsics - * @version $Id$ - */ -public class ProxyServlet extends HttpServlet { - /** Name of the Parameter for the Target */ - private static final String PARAM_TARGET = "Target"; - /** Name of the Parameter for the SAMLArtifact */ - private static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; - - /** Name of the Attribute for marking the session as authenticated*/ - private static final String ATT_AUTHDATAFETCHED = "AuthDataFetched"; - /** Name of the Attribute for the PublicURLPrefix */ - private static final String ATT_PUBLIC_URLPREFIX = "PublicURLPrefix"; - /** Name of the Attribute for the RealURLPrefix */ - private static final String ATT_REAL_URLPREFIX = "RealURLPrefix"; - /** Name of the Attribute for the SSLSocketFactory */ - private static final String ATT_SSL_SOCKET_FACTORY = "SSLSocketFactory"; - /** Name of the Attribute for the LoginHeaders */ - private static final String ATT_LOGIN_HEADERS = "LoginHeaders"; - /** Name of the Attribute for the LoginParameters */ - private static final String ATT_LOGIN_PARAMETERS = "LoginParameters"; - /** Name of the Attribute for the SAMLARTIFACT */ - private static final String ATT_SAML_ARTIFACT = "SamlArtifact"; - /** Name of the Attribute for the state of the browser request for login dialog*/ - private static final String ATT_BROWSERREQU = "BrowserLoginRequest"; - /** Name of the Attribute for the state of the browser request for login dialog*/ - private static final String ATT_OA_CONF = "oaConf"; - /** Name of the Attribute for the Logintype of the OnlineApplication*/ - private static final String ATT_OA_LOGINTYPE = "LoginType"; - /** Name of the Attribute for the number of the try to login into the OnlineApplication*/ - private static final String ATT_OA_LOGINTRY = "LoginTry"; - /** Maximum permitted login tries */ - private static final int MAX_OA_LOGINTRY = 3; - /** Name of the Attribute for authorization value for further connections*/ - private static final String ATT_OA_AUTHORIZATION_HEADER = "authorizationkey"; - /** Name of the Attribute for user binding */ - private static final String ATT_OA_USER_BINDING = "UserBinding"; - /** For extended internal debug messages */ - private static final boolean INTERNAL_DEBUG = false; - /** Message to be given if browser login failed */ - private static final String RET_401_MSG = "Ein Fehler ist aufgetreten

Fehler bei der Anmeldung

Bei der Anmeldung ist ein Fehler aufgetreten.

Fehler bei der Anmeldung.
Prüfen Sie bitte ihre Berechtigung.
Abbruch durch den Benutzer.

"; - - /** - * @see javax.servlet.http.HttpServlet#service(HttpServletRequest, HttpServletResponse) - */ - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - Logger.debug("getRequestURL:" + req.getRequestURL().toString()); - try { - if (req.getParameter(PARAM_SAMLARTIFACT) != null) { - // check if SAML Artifact was already used in this session (in case of page reload) - HttpSession session = req.getSession(); - if (null != session && req.getParameter(PARAM_SAMLARTIFACT).equals(session.getAttribute(ATT_SAML_ARTIFACT))) { - if (session.getAttribute(ATT_BROWSERREQU)==null) { - tunnelRequest(req, resp); - }else{ - login(req, resp); //login after browser login dialog - } - } else - // it is the first time that the SAML Artifact was used - login(req, resp); - } - else - tunnelRequest(req, resp); - } - catch (MOAIDException ex) { - handleError(ex.getMessage(), ex, req, resp); - } - catch (Throwable ex) { - handleError(ex.getMessage(), ex, req, resp); - } - } - - /** - * Login to online application at first call of servlet for a user session.
- *
    - *
  • Acquires authentication data from the MOA-ID Auth component.
  • - *
  • Reads configuration data for the online application.
  • - *
  • Resolves login parameters.
  • - *
  • Sets up an SSLSocketFactory in case of a secure connection to the online application.
  • - *
  • For a stateless online application, stores data in the HttpSession.
  • - *
  • Tunnels the request to the online application.
  • - *
- * @param req - * @param resp - * @throws ConfigurationException when wrong configuration is encountered - * @throws ProxyException when wrong configuration is encountered - * @throws BuildException while building the request for MOA-ID Auth - * @throws ServiceException while invoking MOA-ID Auth - * @throws ParseException while parsing the response from MOA-ID Auth - */ - private void login(HttpServletRequest req, HttpServletResponse resp) throws ConfigurationException, ProxyException, BuildException, ServiceException, ParseException, AuthenticationException { - - HttpSession session = req.getSession(); - String samlArtifact = ""; - Map loginHeaders = null; - Map loginParameters = null; - String publicURLPrefix = ""; - String realURLPrefix = ""; - SSLSocketFactory ssf = null; - String urlRequested = req.getRequestURL().toString(); - OAConfiguration oaConf = null; - String loginType = ""; - String binding = ""; - - if (session.getAttribute(ATT_BROWSERREQU)==null) { - - samlArtifact = req.getParameter(PARAM_SAMLARTIFACT); - Logger.debug("moa-id-proxy login " + PARAM_SAMLARTIFACT + ": " + samlArtifact); - // String target = req.getParameter(PARAM_TARGET); parameter given but not processed - // boolean targetprovided = req.getParameter(PARAM_TARGET) != null; - - // get authentication data from the MOA-ID Auth component - AuthenticationData authData; - try { - authData = new GetAuthenticationDataInvoker().getAuthenticationData(samlArtifact); - } catch (ServiceException ex) { - throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); - } catch (ProxyException ex) { - throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); - } - session.setAttribute(ATT_AUTHDATAFETCHED, "true"); - - // read configuration data - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(urlRequested); - if (oaParam == null) { - throw new ProxyException("proxy.02", new Object[] { urlRequested }); - } - publicURLPrefix = oaParam.getPublicURLPrefix(); - Logger.debug("OA: " + publicURLPrefix); - oaConf = oaParam.getOaConfiguration(); - ConnectionParameter oaConnParam = oaParam.getConnectionParameter(); - realURLPrefix = oaConnParam.getUrl(); - - // resolve login parameters to be forwarded to online application - LoginParameterResolver lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); - String clientIPAddress = req.getRemoteAddr(); - boolean businessService = oaParam.getBusinessService(); - try { - if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { - loginParameters = lpr.getAuthenticationParameters(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); - } else { - loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); - for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { - //extract user-defined bindingValue - String headerKey = (String) iter.next(); - String headerKeyValue = (String) loginHeaders.get(headerKey); - if (headerKey.equalsIgnoreCase("binding")) { - binding = (String) loginHeaders.get(headerKey); - } - for (int i = 1; i <= 3; i++) { - if (headerKey.equalsIgnoreCase("param" + i)) { - int sep = headerKeyValue.indexOf("="); - if (sep>-1) { - if (sep>0) { - String value = ""; - if (headerKeyValue.length()>sep+1) value = headerKeyValue.substring(sep+1); - if (loginParameters == null) loginParameters = new HashMap(); - loginParameters.put(headerKeyValue.substring(0,sep) , value); - } - } else { - loginParameters.put(headerKey, ""); - } - } - } - } - loginHeaders.remove("binding"); - loginHeaders.remove("param1"); - loginHeaders.remove("param2"); - loginHeaders.remove("param3"); - } - } catch (LoginParameterResolverException ex) { - throw new ProxyException("proxy.13", new Object[] { publicURLPrefix }); - } catch (NotAllowedException e) { - throw new ProxyException("proxy.15", new Object[] { }); - } - - // setup SSLSocketFactory for communication with the online application - if (oaConnParam.isHTTPSURL()) { - try { - ssf = SSLUtils.getSSLSocketFactory(proxyConf, oaConnParam); - } catch (Throwable ex) { - throw new ProxyException( - "proxy.05", - new Object[] { oaConnParam.getUrl(), ex.toString()}, - ex); - } - } - - // for stateless online application, store data in HttpSession - loginType = oaConf.getLoginType(); - if ("".equalsIgnoreCase(binding)) { - binding = oaConf.getBinding(); - if ("".equalsIgnoreCase(binding)) binding = "full"; - } - Logger.debug("Login type: " + loginType); - if (loginType.equals(OAConfiguration.LOGINTYPE_STATELESS)) { - int sessionTimeOut = oaParam.getSessionTimeOut(); - if (sessionTimeOut == 0) - sessionTimeOut = 60 * 60; // default 1 h - - session.setMaxInactiveInterval(sessionTimeOut); - session.setAttribute(ATT_PUBLIC_URLPREFIX, publicURLPrefix); - session.setAttribute(ATT_REAL_URLPREFIX, realURLPrefix); - session.setAttribute(ATT_SSL_SOCKET_FACTORY, ssf); - session.setAttribute(ATT_LOGIN_HEADERS, loginHeaders); - session.setAttribute(ATT_LOGIN_PARAMETERS, loginParameters); - session.setAttribute(ATT_SAML_ARTIFACT, samlArtifact); - session.setAttribute(ATT_OA_CONF, oaConf); - session.setAttribute(ATT_OA_LOGINTYPE, loginType); - session.setAttribute(ATT_OA_USER_BINDING, binding); - session.removeAttribute(ATT_BROWSERREQU); - session.removeAttribute(ATT_OA_AUTHORIZATION_HEADER); - session.removeAttribute(ATT_OA_LOGINTRY); - Logger.debug("moa-id-proxy: HTTPSession " + session.getId() + " angelegt"); - } - - } else { - loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); - publicURLPrefix = (String) session.getAttribute(ATT_PUBLIC_URLPREFIX); - realURLPrefix = (String) session.getAttribute(ATT_REAL_URLPREFIX); - ssf = (SSLSocketFactory) session.getAttribute(ATT_SSL_SOCKET_FACTORY); - loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); - loginParameters = (Map) session.getAttribute(ATT_LOGIN_PARAMETERS); - samlArtifact = (String) session.getAttribute(ATT_SAML_ARTIFACT); - oaConf = (OAConfiguration) session.getAttribute(ATT_OA_CONF); - loginType = (String) session.getAttribute(ATT_OA_LOGINTYPE); - binding = (String) session.getAttribute(ATT_OA_USER_BINDING); - session.removeAttribute(ATT_BROWSERREQU); - Logger.debug("moa-id-proxy: HTTPSession " + session.getId() + " aufgenommen"); - } - - try { - int respcode = 0; - - // tunnel request to the online application - respcode = tunnelRequest(req, resp, loginHeaders, loginParameters, publicURLPrefix, realURLPrefix, ssf, binding); - if (respcode == 401) { - if (OAConfiguration.BINDUNG_FULL.equals(binding) && oaConf.getLoginType().equals(OAConfiguration.LOGINTYPE_STATELESS)) { - throw new ProxyException("proxy.12", new Object[] { realURLPrefix }); - } - } - } catch (ProxyException ex) { - throw new ProxyException("proxy.12", new Object[] { realURLPrefix }); - } catch (Throwable ex) { - throw new ProxyException("proxy.04", new Object[] { urlRequested, ex.toString()}, ex); - } - } - - /** - * Tunnels a request to the stateless online application using data stored in the HTTP session. - * @param req HTTP request - * @param resp HTTP response - * @throws IOException if an I/O error occurs - */ - private void tunnelRequest(HttpServletRequest req, HttpServletResponse resp) throws ProxyException, IOException { - - //Logger.debug("Tunnel request (stateless)"); - HttpSession session = req.getSession(false); - - if (session == null) - throw new ProxyException("proxy.07", null); - String publicURLPrefix = (String) session.getAttribute(ATT_PUBLIC_URLPREFIX); - //A session is automatically created when forwarded 1st time to errorpage-proxy.jsp (with the handleError method) - //additional check if publicURLPrefix is OK, if not throw an Exception - if (publicURLPrefix == null) - throw new ProxyException("proxy.07", null); - - String realURLPrefix = (String) session.getAttribute(ATT_REAL_URLPREFIX); - SSLSocketFactory ssf = (SSLSocketFactory) session.getAttribute(ATT_SSL_SOCKET_FACTORY); - Map loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); - Map loginParameters = (Map) session.getAttribute(ATT_LOGIN_PARAMETERS); - String binding = (String) session.getAttribute(ATT_OA_USER_BINDING); - if (publicURLPrefix == null || realURLPrefix == null) - throw new ProxyException("proxy.08", new Object[] { req.getRequestURL().toString()}); - - int respcode = tunnelRequest(req, resp, loginHeaders, loginParameters, publicURLPrefix, realURLPrefix, ssf, binding); - if (respcode == -401) // #tries to login exceeded - throw new ProxyException("proxy.16", new Object[] {realURLPrefix, Integer.toString(MAX_OA_LOGINTRY)}); - } - -/** - * Tunnels a request to the online application using given URL mapping and SSLSocketFactory. - * This method returns the ResponseCode of the request to the online application. - * @param req HTTP request - * @param resp HTTP response - * @param loginHeaders header field/values to be inserted for purposes of authentication; - * may be null - * @param loginParameters parameter name/values to be inserted for purposes of authentication; - * may be null - * @param publicURLPrefix prefix of request URL to be substituted for the realURLPrefix - * @param realURLPrefix prefix of online application URL to substitute the publicURLPrefix - * @param ssf SSLSocketFactory to use - * @throws IOException if an I/O error occurs - */ -private int tunnelRequest(HttpServletRequest req, HttpServletResponse resp, Map loginHeaders, Map loginParameters, String publicURLPrefix, String realURLPrefix, SSLSocketFactory ssf, String binding) - throws IOException { - - String originBinding = binding; - String browserUserID = ""; - String browserPassword = ""; - //URL url = new URL(realURLPrefix); - //String realURLHost = url.getHost(); - if (INTERNAL_DEBUG && !binding.equals("")) Logger.debug("Binding: " + binding); - - // collect headers from request - Map headers = new HashMap(); - for (Enumeration enu = req.getHeaderNames(); enu.hasMoreElements();) { - String headerKey = (String) enu.nextElement(); - String headerKeyValue = req.getHeader(headerKey); - if (INTERNAL_DEBUG) Logger.debug("Incoming:" + headerKey + "=" + headerKeyValue); - //Analyze Basic-Auth-Headers from the client - if (headerKey.equalsIgnoreCase("Authorization")) { - if (headerKeyValue.substring(0,6).equalsIgnoreCase("Basic ")) { - String credentials = headerKeyValue.substring(6); - byte [] bplaintextcredentials = Base64Utils. decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - browserUserID = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); - browserPassword = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - //deactivate following line for security - //if (INTERNAL_DEBUG) Logger.debug("Analyzing authorization-header from browser: " + headerKeyValue + "gives UN:PW=" + browserUserID + ":" + browserPassword ); - } - if (headerKeyValue.substring(0,9).equalsIgnoreCase("Negotiate")) { - //deactivate following line for security - //if (INTERNAL_DEBUG) Logger.debug("Analyzing authorization-header from browser: Found NTLM Aut.: " + headerKeyValue + "gives UN:PW=" + browserUserID + ":" + browserPassword ); - } - } - else - { - /* Headers MUST NOT be repaced according to our Spec. - if (headerKey.equalsIgnoreCase("Host")) { - headerKeyValue = realURLHost; - //headerKeyValue= realURLPrefix.substring(hoststartpos); - if (INTERNAL_DEBUG) Logger.debug("replaced:" + headerKey + "=" + headerKeyValue); - } - */ - headers.put(headerKey, headerKeyValue); - } - } - - - // collect login headers, possibly overwriting headers from request - String authorizationvalue=""; - if (req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER)==null) { - - if (OAConfiguration.BINDUNG_NOMATCH.equals(binding)) { - int loginTry = getLoginTry(req); - Logger.debug("Binding: mode = " + OAConfiguration.BINDUNG_NOMATCH + "(try #" + Integer.toString(loginTry) + ")"); - if (loginTry==1) { - binding = OAConfiguration.BINDUNG_FULL; - } else { - binding = OAConfiguration.BINDUNG_USERNAME; - } - } - - /* Soll auch bei anderen bindings zuerst ein passwort probiert werden können: - //if we have the first Login-Try and we have Binding to Username and a predefined Password we try this one first - // full binding will be covered by next block - if (loginTry==1 && !OAConfiguration.BINDUNG_FULL.equals(binding)) { - //1st try: if we have a password, try this one first - for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { - String headerKey = (String) iter.next(); - String headerKeyValue = (String) loginHeaders.get(headerKey); - if (isBasicAuthenticationHeader(headerKey, headerKeyValue)) { - String credentials = headerKeyValue.substring(6); - byte [] bplaintextcredentials = Base64Utils.decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - String password = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - if (password!=null && !password.equals("")) { - Logger.debug("Binding: found predefined password. Trying full binding first"); - binding = OAConfiguration.BINDUNG_FULL; - break; - } - } - } - } - */ - - - - //we have a connection with not having logged on - if (loginHeaders != null && (browserPassword.length()!=0 || browserUserID.length()!=0 || OAConfiguration.BINDUNG_FULL.equals(binding))) { - for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { - String headerKey = (String) iter.next(); - String headerKeyValue = (String) loginHeaders.get(headerKey); - //customize loginheaders if necessary - if (isBasicAuthenticationHeader(headerKey, headerKeyValue)) - { - if (OAConfiguration.BINDUNG_FULL.equals(binding)) { - authorizationvalue = headerKeyValue; - Logger.debug("Binding: full binding to user established"); - } else { - String credentials = headerKeyValue.substring(6); - byte [] bplaintextcredentials = Base64Utils.decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - String userID = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); - String password = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - String userIDPassword = ":"; - if (OAConfiguration.BINDUNG_USERNAME.equals(binding)) { - Logger.debug("Binding: Access with necessary binding to user"); - userIDPassword = userID + ":" + browserPassword; - } else if (OAConfiguration.BINDUNG_NONE.equals(binding)) { - Logger.debug("Binding: Access without binding to user"); - //If first time - if (browserUserID.length()==0) browserUserID = userID; - if (browserPassword.length()==0) browserPassword = password; - userIDPassword = browserUserID + ":" + browserPassword; - } else { - userIDPassword = userID + ":" + password; - } - credentials = Base64Utils.encode(userIDPassword.getBytes()); - authorizationvalue = "Basic " + credentials; - headerKeyValue = authorizationvalue; - } - } - headers.put(headerKey, headerKeyValue); - } - } - }else{ - //if OA needs Authorization header in each further request - authorizationvalue = (String) req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER); - if (loginHeaders != null) headers.put("Authorization", authorizationvalue); - } - - - Vector parameters = new Vector(); - - for (Enumeration enu = req.getParameterNames(); enu.hasMoreElements();) { - String paramName = (String) enu.nextElement(); - if (!(paramName.equals(PARAM_SAMLARTIFACT) || paramName.equals(PARAM_TARGET))) { - if (INTERNAL_DEBUG) Logger.debug("Req Parameter-put: " + paramName + ":" + req.getParameter(paramName)); - String parameter[] = new String[2]; - parameter[0]= paramName; - parameter[1]= req.getParameter(paramName); - parameters.add(parameter); - } - } - // collect login parameters, possibly overwriting parameters from request - if (loginParameters != null) { - for (Iterator iter = loginParameters.keySet().iterator(); iter.hasNext();) { - String paramName = (String) iter.next(); - if (!(paramName.equals(PARAM_SAMLARTIFACT) || paramName.equals(PARAM_TARGET))) { - if (INTERNAL_DEBUG) Logger.debug("Req Login-Parameter-put: " + paramName + ":" + loginParameters.get(paramName)); - String parameter[] = new String[2]; - parameter[0]= paramName; - parameter[1]= (String) loginParameters.get(paramName); - parameters.add(parameter); - } - } - } - - ConnectionBuilder cb = ConnectionBuilderFactory.getConnectionBuilder(publicURLPrefix); - HttpURLConnection conn = cb.buildConnection(req, publicURLPrefix, realURLPrefix, ssf, parameters); - - // set headers as request properties of URLConnection - for (Iterator iter = headers.keySet().iterator(); iter.hasNext();) { - String headerKey = (String) iter.next(); - String headerValue = (String) headers.get(headerKey); - String LogStr = "Req header " + headerKey + ": " + headers.get(headerKey); - if (isBasicAuthenticationHeader(headerKey, headerValue)) { - String credentials = headerValue.substring(6); - byte [] bplaintextcredentials = Base64Utils. decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - String uid = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); - String pwd = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - //Sollte AuthorizationInfo vom HTTPClient benutzt werden: cb.addBasicAuthorization(publicURLPrefix, uid, pwd); - //deactivate following line for security - //if (INTERNAL_DEBUG && Logger.isDebugEnabled()) LogStr = LogStr + " >UserID:Password< >" + uid + ":" + pwd + "<"; - } - conn.setRequestProperty(headerKey, headerValue); - if (INTERNAL_DEBUG) Logger.debug(LogStr); - } - - StringWriter sb = new StringWriter(); - - // Write out parameters into output stream of URLConnection. - // On GET request, do not send parameters in any case, - // otherwise HttpURLConnection would send a POST. - if (!"get".equalsIgnoreCase(req.getMethod()) && !parameters.isEmpty()) { - boolean firstParam = true; - String parameter[] = new String[2]; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - parameter = (String[]) iter.next(); - String paramName = parameter[0]; - String paramValue = parameter[1]; - if (firstParam) - firstParam = false; - else - sb.write("&"); - sb.write(paramName); - sb.write("="); - sb.write(paramValue); - if (INTERNAL_DEBUG) Logger.debug("Req param " + paramName + ": " + paramValue); - } - } - - // For WebDAV and POST: copy content - if (!"get".equalsIgnoreCase(req.getMethod())) { - if (INTERNAL_DEBUG && !"post".equalsIgnoreCase(req.getMethod())) Logger.debug("---- WEBDAV ---- copying content"); - try { - OutputStream out = conn.getOutputStream(); - InputStream in = req.getInputStream(); - if (!parameters.isEmpty()) out.write(sb.toString().getBytes()); //Parameter nicht mehr mittels Printwriter schreiben - copyStream(in, out, null, req.getMethod()); - out.flush(); - out.close(); - } catch (IOException e) { - if (!"post".equalsIgnoreCase(req.getMethod())) - Logger.debug("---- WEBDAV ---- streamcopy problem"); - else - Logger.debug("---- POST ---- streamcopy problem"); - } - } - - // connect - if (INTERNAL_DEBUG) Logger.debug("Connect Request"); - conn.connect(); - if (INTERNAL_DEBUG) Logger.debug("Connect Response"); - - // check login tries - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { - int loginTry = getLoginTry(req); - req.getSession().setAttribute(ATT_OA_LOGINTRY, Integer.toString(loginTry)); - if (loginTry > MAX_OA_LOGINTRY) { - Logger.debug("Found 401 UNAUTHORIZED, maximum tries exceeded; leaving..."); - cb.disconnect(conn); - return -401; - } - } - - - - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED && OAConfiguration.BINDUNG_FULL.equals(originBinding)) { - Logger.debug("Found 401 UNAUTHORIZED, leaving..."); - cb.disconnect(conn); - return conn.getResponseCode(); - } - - - resp.setStatus(conn.getResponseCode()); - resp.setContentType(conn.getContentType()); - - if (loginHeaders != null && (conn.getResponseCode()==HttpURLConnection.HTTP_OK || conn.getResponseCode()==HttpURLConnection.HTTP_MOVED_TEMP) && req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER)==null) { - req.getSession().setAttribute(ATT_OA_AUTHORIZATION_HEADER, authorizationvalue); - Logger.debug("Login OK. Saving authorization header to remember in further requests"); - } - - // Read response headers - // Omit response header "content-length" if response header "Transfer-encoding: chunked" is set. - // Otherwise, the connection will not be kept alive, resulting in subsequent missing requests. - // See JavaDoc of javax.servlet.http.HttpServlet: - // When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. - Vector respHeaders = new Vector(); - - boolean chunked = false; - String contentLengthKey = null; - String transferEncodingKey = null; - int i = 1; - String headerKey; - String loginType = (String) req.getSession().getAttribute(ATT_OA_LOGINTYPE); - while ((headerKey = conn.getHeaderFieldKey(i)) != null) { - String headerValue = conn.getHeaderField(i); - // Überschrift im Browser-Passworteingabedialog setzen (sonst ist der reale host eingetragen) - if (headerKey.equalsIgnoreCase("WWW-Authenticate") && headerValue.startsWith("Basic realm=\"")) { - headerValue = "Basic realm=\"" + publicURLPrefix + "\""; - if (OAConfiguration.BINDUNG_USERNAME.equals(originBinding) || OAConfiguration.BINDUNG_NOMATCH.equals(originBinding)) { - headerValue = "Basic realm=\"Bitte Passwort eingeben\""; - } else if (OAConfiguration.BINDUNG_NONE.equals(originBinding)) { - headerValue = "Basic realm=\"Bitte Benutzername und Passwort eingeben\""; - } - } - String respHeader[] = new String[2]; - if ((conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) && headerKey.equalsIgnoreCase("content-length")) { - //alter the unauthorized message with template for login - //TODO: supply a special login form on unauthorized messages with bindings!=full - headerValue = Integer.toString(RET_401_MSG.length()); - } - respHeader[0]= headerKey; - respHeader[1]= headerValue; - - if (!(OAConfiguration.BINDUNG_FULL.equals(originBinding) && OAConfiguration.LOGINTYPE_STATELESS.equals(loginType) && headerKey.equalsIgnoreCase("WWW-Authenticate") && headerValue.startsWith("Basic realm=\""))) { - respHeaders.add(respHeader); - if (INTERNAL_DEBUG) Logger.debug("Resp header " + headerKey + ": " + headerValue); - } else { - Logger.debug("Resp header ---REMOVED--- " + headerKey + ": " + headerValue); - } - if (isTransferEncodingChunkedHeader(headerKey, headerValue)) { - chunked = true; - transferEncodingKey = headerKey; - } - if ("content-length".equalsIgnoreCase(headerKey)) - contentLengthKey = headerKey; - i++; - } - if (chunked && contentLengthKey != null) { - respHeaders.remove(transferEncodingKey); - Logger.debug("Resp header " + transferEncodingKey + " REMOVED"); - } - - String headerValue; - String respHeader[] = new String[2]; - - //write out all Responseheaders - for (Iterator iter = respHeaders.iterator(); iter.hasNext();) { - respHeader = (String[]) iter.next(); - headerKey = respHeader[0]; - headerValue = respHeader[1]; - resp.addHeader(headerKey, headerValue); - } - - //Logger.debug(">>>> Copy Content"); - //Logger.debug(" from ()" + conn.getURL()); - //Logger.debug(" to (" + req.getRemoteAddr() + ":"+ ") " +req.getRequestURL()); - - // read response stream - Logger.debug("Resp from " + conn.getURL().toString() + ": status " + conn.getResponseCode()); - // Load content unless the server lets us know that the content is NOT MODIFIED... - if (conn.getResponseCode()!=HttpURLConnection.HTTP_NOT_MODIFIED ) { - BufferedInputStream respIn = new BufferedInputStream(conn.getInputStream()); - //Logger.debug("Got Inputstream"); - BufferedOutputStream respOut = new BufferedOutputStream(resp.getOutputStream()); - //Logger.debug("Got Outputstream"); - - byte [] buffer = new byte[4096]; - if (respOut != null) { - int bytesRead; - while ((bytesRead = respIn.read(buffer)) >= 0) { - if (conn.getResponseCode()!=HttpURLConnection.HTTP_UNAUTHORIZED) respOut.write(buffer, 0, bytesRead); - } - } else { - while (respIn.read(buffer) >= 0); - } - - - /* - int ch; - StringBuffer strBuf = new StringBuffer(""); - while ((ch = respIn.read()) >= 0) { - if (conn.getResponseCode()!=HttpURLConnection.HTTP_UNAUTHORIZED) respOut.write(ch); - strBuf.append((char)ch); - } - Logger.debug("Resp Content:"); - if (strBuf.toString().length()>500) - Logger.debug(strBuf.toString().substring(0,500)); - else - Logger.debug(strBuf.toString()); - */ - - - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { - respOut.write(RET_401_MSG.getBytes()); - } - respOut.flush(); - respOut.close(); - respIn.close(); - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { - Logger.debug("Found 401 UNAUTHORIZED..."); - cb.disconnect(conn); - return conn.getResponseCode(); - } - } else { - //if (conn.getResponseCode()==HttpURLConnection.HTTP_NOT_MODIFIED) - Logger.debug("Found 304 NOT MODIFIED..."); - } - - cb.disconnect(conn); - Logger.debug("Request done"); - - return conn.getResponseCode(); -} - -/** - * Gets the current amount of the login try at the online application - * - * @param req the HttpServletRequest - * @return the number off the current login try - */ -private int getLoginTry(HttpServletRequest req) { - String oa_loginTry = (String) req.getSession().getAttribute(ATT_OA_LOGINTRY); - int loginTry = 1; - if (oa_loginTry!=null) loginTry = Integer.parseInt(oa_loginTry)+1; - return loginTry; -} -/** - * Determines whether a HTTP header is a basic authentication header of the kind "Authorization: Basic ..." - * - * @param headerKey header name - * @param headerValue header value - * @return true for a basic authentication header - */ -private boolean isBasicAuthenticationHeader(String headerKey, String headerValue) { - if (!"authorization".equalsIgnoreCase(headerKey)) - return false; - if (headerValue.length() < "basic".length()) - return false; - String authenticationSchema = headerValue.substring(0, "basic".length()); - return "basic".equalsIgnoreCase(authenticationSchema); -} -/** - * Determines whether a basic authentication header of the kind "Authorization: Basic ..." - * is included in a HTTP request - * @param req HTTP request - * @return true for a basic authentication header provided - */ -private boolean isBasicAuthenticationHeaderProvided(HttpServletRequest req) { - for (Enumeration enu = req.getHeaderNames(); enu.hasMoreElements();) { - String headerKey = (String) enu.nextElement(); - String headerValue = req.getHeader(headerKey); - if (isBasicAuthenticationHeader(headerKey, headerValue)) - return true; - } - return false; -} -/** - * Determines whether a HTTP header is "Transfer-encoding" header with value containing "chunked" - * - * @param headerKey header name - * @param headerValue header value - * @return true for a "Transfer-encoding: chunked" header - */ -private boolean isTransferEncodingChunkedHeader(String headerKey, String headerValue) { - if (!"transfer-encoding".equalsIgnoreCase(headerKey)) - return false; - return headerValue.indexOf("chunked") >= 0 || headerValue.indexOf("Chunked") >= 0 || headerValue.indexOf("CHUNKED") >= 0; -} - -/** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ -public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); - try { - MOAIDProxyInitializer.initialize(); - Logger.info(MOAIDMessageProvider.getInstance().getMessage("proxy.00", null)); - } - catch (Exception ex) { - Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("proxy.06", null), ex); - throw new ServletException(ex); - } -} - -/** - * Handles an error.
- *
    - *
  • Logs the error
  • - *
  • Places error message and exception thrown into the request - * as request attributes (to be used by "/errorpage-proxy.jsp")
  • - *
  • Sets HTTP status 500 (internal server error)
  • - *
- * - * @param errorMessage error message - * @param exceptionThrown exception thrown - * @param req servlet request - * @param resp servlet response - */ -protected void handleError( - String errorMessage, Throwable exceptionThrown, HttpServletRequest req, HttpServletResponse resp) { - - - if(null != errorMessage) { - Logger.error(errorMessage); - req.setAttribute("ErrorMessage", errorMessage ); - } - - if (null != exceptionThrown) { - if(null == errorMessage) errorMessage = exceptionThrown.getMessage(); - Logger.error(errorMessage, exceptionThrown); - //req.setAttribute("ExceptionThrown", exceptionThrown); - } - - //forward this to errorpage-proxy.jsp where the HTML error page is generated - ServletContext context = getServletContext(); - RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-proxy.jsp"); - try { - dispatcher.forward(req, resp); - } catch (ServletException e) { - Logger.error(e); - } catch (IOException e) { - Logger.error(e); - } - -} - - -// * taken from iaik.utils.util.copyStream: -/** - * Reads all data (until EOF is reached) from the given source to the - * destination stream. If the destination stream is null, all data is dropped. - * It uses the given buffer to read data and forward it. If the buffer is - * null, this method allocates a buffer. - * - * @param source The stream providing the data. - * @param destination The stream that takes the data. If this is null, all - * data from source will be read and discarded. - * @param buffer The buffer to use for forwarding. If it is null, the method - * allocates a buffer. - * @exception IOException If reading from the source or writing to the - * destination fails. - */ -private static void copyStream(InputStream source, OutputStream destination, byte[] buffer, String method) throws IOException { - if (source == null) { - throw new NullPointerException("Argument \"source\" must not be null."); - } - if (buffer == null) { - buffer = new byte[4096]; - } - - if (destination != null) { - int bytesRead; - while ((bytesRead = source.read(buffer)) >= 0) { - destination.write(buffer, 0, bytesRead); - //if (method.equalsIgnoreCase("POST")) Logger.debug(buffer.toString()); - } - } else { - while (source.read(buffer) >= 0); - } -} - - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java b/id.server/src/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java deleted file mode 100644 index 954a87e62..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java +++ /dev/null @@ -1,212 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.net.Socket; -import java.security.GeneralSecurityException; -import java.util.Hashtable; - -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; - -import org.apache.axis.components.net.BooleanHolder; -import org.apache.axis.components.net.DefaultSocketFactory; -import org.apache.axis.components.net.SecureSocketFactory; -import org.apache.axis.components.net.TransportClientProperties; -import org.apache.axis.components.net.TransportClientPropertiesFactory; -import org.apache.axis.utils.Messages; -import org.apache.axis.utils.XMLUtils; - -import at.gv.egovernment.moa.logging.Logger; - -/** - * Secure socket factory for Axis webs service clients of the MOA-ID component, - * which are the MOA-SP calls from MOA-ID Auth, - * and the MOA-ID Auth calls from MOA-ID Proxy. - *
Use this initialization code:
- * // ConnectionParameter connParam = ... get from ConfigurationProvider - * AxisSecureSocketFactory.initialize(connParam); - *
See the Apache Axis documentation on how to configure this class - * as the default secure socket factory to be used by Axis. - *
- * This code has been copied from JSSESocketFactory, the - * method initialize() has been added. - * - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class AxisSecureSocketFactory - extends DefaultSocketFactory implements SecureSocketFactory { - - /** Field sslFactory */ - private static SSLSocketFactory sslFactory; - - /** - * Constructor for AxisSecureSocketFactory. - * @param attributes ??? - */ - public AxisSecureSocketFactory(Hashtable attributes) { - super(attributes); - } - /** - * Initializes the factory by setting the connection parameters to be used for - * setting the secure socket factory, and by setting the system property - * axis.socketSecureFactory. - * @param ssf SSLSocketFactory to initialize with - */ - public static void initialize(SSLSocketFactory ssf) - throws IOException, GeneralSecurityException { - - Logger.debug("Initialize AxisSecureSocketFactory"); - sslFactory = ssf; - } - - /** - * creates a secure socket - * - * @param host - * @param port - * @param otherHeaders - * @param useFullURL - * - * @return Socket - * @throws Exception - */ - public Socket create( - String host, - int port, - StringBuffer otherHeaders, - BooleanHolder useFullURL) - throws Exception { - if (port == -1) { - port = 443; - } - - TransportClientProperties tcp = - TransportClientPropertiesFactory.create("https"); - - boolean hostInNonProxyList = - isHostInNonProxyList(host, tcp.getNonProxyHosts()); - - Socket sslSocket = null; - if (tcp.getProxyHost().length() == 0 || hostInNonProxyList) { - // direct SSL connection - sslSocket = sslFactory.createSocket(host, port); - } - else { - - // Default proxy port is 80, even for https - int tunnelPort = - (tcp.getProxyPort().length() != 0) - ? Integer.parseInt(tcp.getProxyPort()) - : 80; - if (tunnelPort < 0) - tunnelPort = 80; - - // Create the regular socket connection to the proxy - Socket tunnel = new Socket(tcp.getProxyHost(), tunnelPort); - - // The tunnel handshake method (condensed and made reflexive) - OutputStream tunnelOutputStream = tunnel.getOutputStream(); - PrintWriter out = - new PrintWriter( - new BufferedWriter(new OutputStreamWriter(tunnelOutputStream))); - - // More secure version... engage later? - // PasswordAuthentication pa = - // Authenticator.requestPasswordAuthentication( - // InetAddress.getByName(tunnelHost), - // tunnelPort, "SOCK", "Proxy","HTTP"); - // if(pa == null){ - // printDebug("No Authenticator set."); - // }else{ - // printDebug("Using Authenticator."); - // tunnelUser = pa.getUserName(); - // tunnelPassword = new String(pa.getPassword()); - // } - out.print( - "CONNECT " - + host - + ":" - + port - + " HTTP/1.0\r\n" - + "User-Agent: AxisClient"); - if (tcp.getProxyUser().length() != 0 - && tcp.getProxyPassword().length() != 0) { - - // add basic authentication header for the proxy - String encodedPassword = - XMLUtils.base64encode( - (tcp.getProxyUser() + ":" + tcp.getProxyPassword()).getBytes()); - - out.print("\nProxy-Authorization: Basic " + encodedPassword); - } - out.print("\nContent-Length: 0"); - out.print("\nPragma: no-cache"); - out.print("\r\n\r\n"); - out.flush(); - InputStream tunnelInputStream = tunnel.getInputStream(); - - if (log.isDebugEnabled()) { - log.debug( - Messages.getMessage( - "isNull00", - "tunnelInputStream", - "" + (tunnelInputStream == null))); - } - String replyStr = ""; - - // Make sure to read all the response from the proxy to prevent SSL negotiation failure - // Response message terminated by two sequential newlines - int newlinesSeen = 0; - boolean headerDone = false; /* Done on first newline */ - - while (newlinesSeen < 2) { - int i = tunnelInputStream.read(); - - if (i < 0) { - throw new IOException("Unexpected EOF from proxy"); - } - if (i == '\n') { - headerDone = true; - ++newlinesSeen; - } - else if (i != '\r') { - newlinesSeen = 0; - if (!headerDone) { - replyStr += String.valueOf((char) i); - } - } - } - if (!replyStr.startsWith("HTTP/1.0 200") - && !replyStr.startsWith("HTTP/1.1 200")) { - throw new IOException( - Messages.getMessage( - "cantTunnel00", - new String[] { tcp.getProxyHost(), "" + tunnelPort, replyStr })); - } - - // End of condensed reflective tunnel handshake method - sslSocket = sslFactory.createSocket(tunnel, host, port, true); - if (log.isDebugEnabled()) { - log.debug( - Messages.getMessage( - "setupTunnel00", - tcp.getProxyHost(), - "" + tunnelPort)); - } - } - - ((SSLSocket) sslSocket).startHandshake(); - if (log.isDebugEnabled()) { - log.debug(Messages.getMessage("createdSSL00")); - } - return sslSocket; - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/util/ECDSAConstants.java b/id.server/src/at/gv/egovernment/moa/id/util/ECDSAConstants.java deleted file mode 100644 index c5dad8bc4..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/ECDSAConstants.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Created on 20.01.2005 - * - * @author rschamberger - * $ID$ - */ -package at.gv.egovernment.moa.id.util; - - -/** - * Class used to define Constants used in Class ECDSAKeyValueConverter - * - * * @author rschamberger - */ -public class ECDSAConstants { - - /* ECDSA Namespace - */ - static String NAMESPACE_ECDSAKEYVALUE_ = "http://www.w3.org/2001/04/xmldsig-more#"; - - /* Schema instance NS - */ - static String NAMESPACE_XSI_ = "http://www.w3.org/2001/XMLSchema-instance"; - - /* ecdsa prefix value - */ - static String NS_PREFIX_ECDSAKEYVALUE_ = "ecdsa"; - - /* namespace namespace - */ - static String NAMESPACE_NAMESPACES_ = "http://www.w3.org/XML/1998/namespace"; - - /* si prefix value - */ - static String NS_PREFIX_XSI_ = "si"; -}; diff --git a/id.server/src/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java b/id.server/src/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java deleted file mode 100644 index 6fb78edb7..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java +++ /dev/null @@ -1,572 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -import iaik.security.ecc.ecdsa.ECDSAParameter; -import iaik.security.ecc.ecdsa.ECPublicKey; -import iaik.security.ecc.math.ecgroup.AffineCoordinate; -import iaik.security.ecc.math.ecgroup.Coordinate; -import iaik.security.ecc.math.ecgroup.CoordinateTypes; -import iaik.security.ecc.math.ecgroup.ECGroupFactory; -import iaik.security.ecc.math.ecgroup.ECPoint; -import iaik.security.ecc.math.ecgroup.EllipticCurve; -import iaik.security.ecc.math.field.Field; -import iaik.security.ecc.math.field.FieldElement; -import iaik.security.ecc.math.field.PrimeField; -import iaik.security.ecc.parameter.ECCParameterFactory; -import iaik.security.ecc.spec.ECCParameterSpec; - -import java.math.BigInteger; -import java.security.PublicKey; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class ECDSAKeyValueConverter -{ - - - //TODO enhance javadoc - - /** - * converter class which can be used to convert ECDSA keys encoded in XML - * to a PublicKey data structure - * @param keyValueElem ECDSAKeyValue Element - * @return ECPublicKey encoded in PublicKey data structure - * @throws Exception - */ - public static PublicKey element2ECDSAPublicKey(Element keyValueElem) throws Exception - { - String ecdsaNS = ECDSAConstants.NAMESPACE_ECDSAKEYVALUE_; - - // Domain parameters - Element domainParams = getChildElement(keyValueElem, ecdsaNS, "DomainParameters", 1); - if (domainParams == null) throw new Exception("Domain parameters must not be implicit."); - - Element namedCurve = getChildElement(domainParams, ecdsaNS, "NamedCurve", 1); - ECCParameterSpec eccParameterSpec; - - if (namedCurve != null) - { - // URL curveNameURN = new URL(namedCurve.getAttributeNS(null, "URN")); - String curveNameOID = namedCurve.getAttributeNS(null, "URN").substring(8); - ECCParameterFactory eccParamFactory = ECCParameterFactory.getInstance(); - // eccParameterSpec = eccParamFactory.getParameterByOID(curveNameURN.getPath().substring(4)); - eccParameterSpec = eccParamFactory.getParameterByOID(curveNameOID); - } - else - { - Element excplicitParams = getChildElement(domainParams, ecdsaNS, "ExplicitParams", 1); - Element fieldParams = getChildElement(excplicitParams, ecdsaNS, "FieldParams", 1); - Element curveParams = getChildElement(excplicitParams, ecdsaNS, "CurveParams", 1); - Element basePointParams = getChildElement(excplicitParams, ecdsaNS, "BasePointParams", 1); - - // Field parameters - String fieldParamsTypeStr = fieldParams.getAttributeNS(ECDSAConstants.NAMESPACE_XSI_, "type"); - String ecdsaNSPrefix = getECDSANSPrefix(fieldParams); - BigInteger p = null; - int fieldParamsType = 0; - final int FIELD_TYPE_PRIME = 1; - final int FIELD_TYPE_TNB = 2; - final int FIELD_TYPE_PNB = 3; - int m = -1, k = -1, k1 = -1, k2 = -1, k3 = -1; - if (fieldParamsTypeStr.equals(ecdsaNSPrefix + ":PrimeFieldParamsType")) - { - fieldParamsType = FIELD_TYPE_PRIME; - String pStr = getChildElementText(fieldParams, ecdsaNS, "P", 1); - p = new BigInteger(pStr, 10); - } - else if (fieldParamsTypeStr.equals(ecdsaNSPrefix + ":TnBFieldParamsType")) - { - fieldParamsType = FIELD_TYPE_TNB; - String mStr = getChildElementText(fieldParams, ecdsaNS, "M", 1); - m = Integer.parseInt(mStr); - String kStr = getChildElementText(fieldParams, ecdsaNS, "K", 1); - k = Integer.parseInt(kStr); - } - else if (fieldParamsTypeStr.equals(ecdsaNSPrefix + ":PnBFieldParamsType")) - { - fieldParamsType = FIELD_TYPE_PNB; - String mStr = getChildElementText(fieldParams, ecdsaNS, "M", 1); - m = Integer.parseInt(mStr); - String k1Str = getChildElementText(fieldParams, ecdsaNS, "K1", 1); - k1 = Integer.parseInt(k1Str); - String k2Str = getChildElementText(fieldParams, ecdsaNS, "K2", 1); - k2 = Integer.parseInt(k2Str); - String k3Str = getChildElementText(fieldParams, ecdsaNS, "K3", 1); - k3 = Integer.parseInt(k3Str); - } - else throw new Exception("Unknown field parameters."); - - // Curve parameters - Element aElem = getChildElement(curveParams, ecdsaNS, "A", 1); - String aStr = aElem.getAttributeNS(null, "Value"); - Element bElem = getChildElement(curveParams, ecdsaNS, "B", 1); - String bStr = bElem.getAttributeNS(null, "Value"); - String seedStr = getChildElementText(curveParams, ecdsaNS, "Seed", 1); - BigInteger seed = (seedStr != null) ? new BigInteger(seedStr, 10) : null; - - // Base point parameters - Element basePoint = getChildElement(basePointParams, ecdsaNS, "BasePoint", 1); - Element basePointXElem = getChildElement(basePoint, ecdsaNS, "X", 1); - String basePointXStr = basePointXElem.getAttributeNS(null, "Value"); - Element basePointYElem = getChildElement(basePoint, ecdsaNS, "Y", 1); - String basePointYStr = basePointYElem.getAttributeNS(null, "Value"); - String orderStr = getChildElementText(basePointParams, ecdsaNS, "Order", 1); - BigInteger order = new BigInteger(orderStr, 10); - String cofactorStr = getChildElementText(basePointParams, ecdsaNS, "Cofactor", 1); - BigInteger cofactor = (cofactorStr != null) ? new BigInteger(cofactorStr, 10) : null; - - if (fieldParamsType == FIELD_TYPE_PRIME) - { - BigInteger a = new BigInteger(aStr, 10); - BigInteger b = new BigInteger(bStr, 10); - BigInteger basePointX = new BigInteger(basePointXStr, 10); - BigInteger basePointY = new BigInteger(basePointYStr, 10); - eccParameterSpec = new ECCParameterSpec(p, cofactor, order, seed, null, a, b, basePointX, - basePointY, null); - } - else - { - int[] irreducible = new int[m/32 + ((m % 32 != 0) ? 1 : 0)]; - if (fieldParamsType == FIELD_TYPE_TNB) - { - irreducible[m/32] = 1 << m % 32; - irreducible[k/32] += 1 << k % 32; - irreducible[0] += 1; - } - else - { - irreducible[m/32] = 1 << m % 32; - irreducible[k3/32] += 1 << k3 % 32; - irreducible[k2/32] += 1 << k2 % 32; - irreducible[k1/32] += 1 << k1 % 32; - irreducible[0] += 1; - } - eccParameterSpec = new ECCParameterSpec(irreducible, cofactor, order, octetString2IntArray(aStr), - octetString2IntArray(bStr), octetString2IntArray(basePointXStr), - octetString2IntArray(basePointYStr), null); - } - } - - // Public key - Element publicKeyElem = getChildElement(keyValueElem, ecdsaNS, "PublicKey", 1); - Element publicKeyXElem = getChildElement(publicKeyElem, ecdsaNS, "X", 1); - String publicKeyXStr = publicKeyXElem.getAttributeNS(null, "Value"); - Element publicKeyYElem = getChildElement(publicKeyElem, ecdsaNS, "Y", 1); - String publicKeyYStr = publicKeyYElem.getAttributeNS(null, "Value"); - - ECDSAParameter ecdsaParams = new ECDSAParameter(eccParameterSpec, CoordinateTypes.PROJECTIVE_COORDINATES); - ECGroupFactory ecGroupFactory = ECGroupFactory.getInstance(); - EllipticCurve eCurve = ecGroupFactory.getCurve(eccParameterSpec.getA(), - eccParameterSpec.getB(), eccParameterSpec.getR(), CoordinateTypes.PROJECTIVE_COORDINATES); - Field field = eCurve.getField(); - - // Detect type of public key field elements - String elementType = publicKeyXElem.getAttributeNS(ECDSAConstants.NAMESPACE_XSI_, "type"); - String elementTypeLocalName = elementType.substring(elementType.indexOf(':') + 1); - int FIELD_TYPE_PRIME = 1, FIELD_TYPE_CHAR_TWO = 2; - int fieldElemType = ("PrimeFieldElemType".equals(elementTypeLocalName)) - ? FIELD_TYPE_PRIME - : FIELD_TYPE_CHAR_TWO; - - FieldElement publicKeyPointX, publicKeyPointY; - if (fieldElemType == FIELD_TYPE_PRIME) - { - -// Value xValue = FieldFactory.getInstance().getPrimeFieldValue(new BigInteger(publicKeyXStr, 10)); -// publicKeyPointX = field.newElement(xValue); - PrimeField pf = (PrimeField) field; - publicKeyPointX = pf.newElement(new BigInteger(publicKeyXStr, 10)); -// Value yValue = FieldFactory.getInstance().getPrimeFieldValue(new BigInteger(publicKeyYStr, 10)); -// publicKeyPointY = field.newElement(yValue); - publicKeyPointY = pf.newElement(new BigInteger(publicKeyYStr, 10)); - } - else - { - publicKeyPointX = field.newElement(octetString2ByteArray(publicKeyXStr)); - publicKeyPointY = field.newElement(octetString2ByteArray(publicKeyYStr)); - } -// ProjectiveCoordinate publicKeyPointCoordinate = new ProjectiveCoordinate(publicKeyPointX, -// publicKeyPointY, field.getONEelement()); - Coordinate publicKeyPointCoordinate = new AffineCoordinate(publicKeyPointX, - publicKeyPointY).toProjective(); - ECPoint publicKeyPoint = eCurve.newPoint(publicKeyPointCoordinate); - ECPublicKey publicKey = new ECPublicKey(ecdsaParams, publicKeyPoint); - - return publicKey; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - /* - public static Element publicKey2ECDSAKeyValueElement(boolean implParams, String curveOID, - ECDSAPublicKey publicKey, Document factoryDoc) - { - String ecdsaNS = ECDSAConstants.NAMESPACE_ECDSAKEYVALUE_; - String ecdsaNSP = ECDSAConstants.NS_PREFIX_ECDSAKEYVALUE_; - String nsNS = ECDSAConstants.NAMESPACE_NAMESPACES_; - String xsiNS = ECDSAConstants.NAMESPACE_XSI_; - String xsiNSP = ECDSAConstants.NS_PREFIX_XSI_; - - ECDSAParameter params = (ECDSAParameter)publicKey.getParameter(); - EllipticCurve curve = params.getG().getCurve(); - Field field = curve.getField(); - int fieldId = curve.getField().getFieldId(); - - Element eCDSAKeyValue = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":ECDSAKeyValue"); - eCDSAKeyValue.setAttributeNS(nsNS, "xmlns:" + ecdsaNSP, ecdsaNS); - eCDSAKeyValue.setAttributeNS(nsNS, "xmlns:" + xsiNSP, xsiNS); - - // Detect field type - int coeffPositions[] = new int[3]; - int fieldType = 0; - String fieldElemTypeString = null; - final int FT_PRIME = 1, FT_TNB = 2, FT_PNB = 3; - if (fieldId == Field.PRIME_FIELD) - { - fieldType = FT_PRIME; - fieldElemTypeString = ecdsaNSP + ":PrimeFieldElemType"; - } - else - { - // Get irreducible polynomal - BinaryField binaryField = (BinaryField)field; - BinaryFieldValue irreducible = binaryField.getIrreducible(); - - // Get coefficients of irreducible polynomal - int order = irreducible.getOrder(); - int coeffCount = 2; - for (int i = 1; i < order - 1; i++) - { - if (irreducible.testBit(i)) - { - coeffPositions[coeffCount - 2] = i; - coeffCount++; - if (coeffCount == 5) break; - } - } - - // Set polynomal type (TNB or - fieldType = (coeffCount == 3) ? FT_TNB : FT_PNB; - fieldElemTypeString = ecdsaNSP + ":CharTwoFieldElemType"; - } - - if (!implParams) - { - Element domainParameters = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":DomainParameters"); - eCDSAKeyValue.appendChild(factoryDoc.createTextNode("\n ")); - eCDSAKeyValue.appendChild(domainParameters); - - if (curveOID != null) - { - // Named curve - Element namedCurve = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":NamedCurve"); - namedCurve.setAttributeNS(null, "URN", "urn:oid:" + curveOID); - domainParameters.appendChild(factoryDoc.createTextNode("\n ")); - domainParameters.appendChild(namedCurve); - domainParameters.appendChild(factoryDoc.createTextNode("\n ")); - } - else - { - // Explicit parameters - Element explicitParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":ExplicitParams"); - - // Field parameters - Element fieldParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":FieldParams"); - explicitParams.appendChild(factoryDoc.createTextNode("\n ")); - explicitParams.appendChild(fieldParams); - - if (fieldType == FT_PRIME) - { - fieldParams.setAttributeNS(xsiNS, xsiNSP + ":type", ecdsaNSP + ":PrimeFieldParamsType"); - Element p = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":P"); - p.appendChild(factoryDoc.createTextNode(curve.getField().getSize().toString(10))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(p); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - } - else if (fieldType == FT_TNB) - { - fieldParams.setAttributeNS(xsiNS, xsiNSP + ":type", ecdsaNSP + ":TnBFieldParamsType"); - Element m = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":M"); - m.appendChild(factoryDoc.createTextNode(Integer.toString(curve.getField().getOrder()))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(m); - - Element k = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K"); - k.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[0], 10))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(k); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - } - else - { - fieldParams.setAttributeNS(xsiNS, xsiNSP + ":type", ecdsaNSP + ":PnBFieldParamsType"); - Element m = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":M"); - m.appendChild(factoryDoc.createTextNode(Integer.toString(curve.getField().getOrder()))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(m); - - Element k1 = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K1"); - k1.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[0]))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(k1); - - Element k2 = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K2"); - k2.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[1]))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(k2); - - Element k3 = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K3"); - k3.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[2]))); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - fieldParams.appendChild(k3); - fieldParams.appendChild(factoryDoc.createTextNode("\n ")); - } - - // Curve parameters - Element curveParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":CurveParams"); - explicitParams.appendChild(factoryDoc.createTextNode("\n ")); - explicitParams.appendChild(curveParams); - - Element a = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":A"); - a.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); - a.setAttributeNS(null, "Value", - (fieldId == Field.PRIME_FIELD) - ? curve.getA().getValue().toBigInt().toString(10) - : evenStringLength(curve.getA().getValue().toBigInt().toString(16))); - curveParams.appendChild(factoryDoc.createTextNode("\n ")); - curveParams.appendChild(a); - - Element b = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":B"); - b.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); - b.setAttributeNS(null, "Value", - (fieldId == Field.PRIME_FIELD) - ? curve.getB().getValue().toBigInt().toString(10) - : evenStringLength(curve.getB().getValue().toBigInt().toString(16))); - curveParams.appendChild(factoryDoc.createTextNode("\n ")); - curveParams.appendChild(b); - - if (params.getS() != null) - { - Element seed = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Seed"); - seed.appendChild(factoryDoc.createTextNode(evenStringLength(params.getS().toString(16)))); - curveParams.appendChild(factoryDoc.createTextNode("\n ")); - curveParams.appendChild(seed); - } - - curveParams.appendChild(factoryDoc.createTextNode("\n ")); - - // Base point params - Element basePointParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":BasePointParams"); - explicitParams.appendChild(factoryDoc.createTextNode("\n ")); - explicitParams.appendChild(basePointParams); - - Element basePoint = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":BasePoint"); - basePointParams.appendChild(factoryDoc.createTextNode("\n ")); - basePointParams.appendChild(basePoint); - - Element x = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":X"); - x.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); - x.setAttributeNS(null, "Value", - (fieldId == Field.PRIME_FIELD) - ? params.getG().getCoordinates().getX().getValue().toBigInt().toString(10) - : evenStringLength(params.getG().getCoordinates().getX().getValue().toBigInt().toString(16))); - basePoint.appendChild(factoryDoc.createTextNode("\n ")); - basePoint.appendChild(x); - - Element y = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Y"); - y.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); - y.setAttributeNS(null, "Value", - (fieldId == Field.PRIME_FIELD) - ? params.getG().getCoordinates().getY().getValue().toBigInt().toString(10) - : evenStringLength(params.getG().getCoordinates().getY().getValue().toBigInt().toString(16))); - basePoint.appendChild(factoryDoc.createTextNode("\n ")); - basePoint.appendChild(y); - basePoint.appendChild(factoryDoc.createTextNode("\n ")); - - Element order = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Order"); - order.appendChild(factoryDoc.createTextNode(params.getR().toString(10))); - basePointParams.appendChild(factoryDoc.createTextNode("\n ")); - basePointParams.appendChild(order); - - if (params.getK() != null) - { - Element cofactor = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Cofactor"); - cofactor.appendChild(factoryDoc.createTextNode(params.getK().toString(10))); - basePointParams.appendChild(factoryDoc.createTextNode("\n ")); - basePointParams.appendChild(cofactor); - } - - basePointParams.appendChild(factoryDoc.createTextNode("\n ")); - explicitParams.appendChild(factoryDoc.createTextNode("\n ")); - - domainParameters.appendChild(factoryDoc.createTextNode("\n ")); - domainParameters.appendChild(explicitParams); - domainParameters.appendChild(factoryDoc.createTextNode("\n ")); - } - } - - // Public key point - Element publicKeyPoint = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":PublicKey"); - - Element publicKeyX = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":X"); - publicKeyX.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); - publicKeyX.setAttributeNS(null, "Value", - (fieldId == Field.PRIME_FIELD) - ? publicKey.getW().getCoordinates().getX().getValue().toBigInt().toString(10) - : evenStringLength(publicKey.getW().getCoordinates().getX().getValue().toBigInt().toString(16))); - publicKeyPoint.appendChild(factoryDoc.createTextNode("\n ")); - publicKeyPoint.appendChild(publicKeyX); - - Element publicKeyY = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Y"); - publicKeyY.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); - publicKeyY.setAttributeNS(null, "Value", - (fieldId == Field.PRIME_FIELD) - ? publicKey.getW().getCoordinates().getY().getValue().toBigInt().toString(10) - : evenStringLength(publicKey.getW().getCoordinates().getY().getValue().toBigInt().toString(16))); - publicKeyPoint.appendChild(factoryDoc.createTextNode("\n ")); - publicKeyPoint.appendChild(publicKeyY); - publicKeyPoint.appendChild(factoryDoc.createTextNode("\n ")); - - eCDSAKeyValue.appendChild(factoryDoc.createTextNode("\n ")); - eCDSAKeyValue.appendChild(publicKeyPoint); - eCDSAKeyValue.appendChild(factoryDoc.createTextNode("\n ")); - - return eCDSAKeyValue; - } - */ - /* ---------------------------------------------------------------------------------------------------- */ - - private static String getECDSANSPrefix(Element element) - { - // FIXXME: Review this function (GK, 11.06.2002) - should return a list of strings, since more than - // one NS prefix can be bound to the ECDSA namespace - - HashMap inScopeNSAttrs = getInScopeNSAttrs(element); - Iterator inScopeNSAttrsIt = inScopeNSAttrs.keySet().iterator(); - while (inScopeNSAttrsIt.hasNext()) - { - Attr currentAttr = (Attr)inScopeNSAttrs.get(inScopeNSAttrsIt.next()); - if (ECDSAConstants.NAMESPACE_ECDSAKEYVALUE_.equals(currentAttr.getValue())) - { - return ("xmlns".equals(currentAttr.getNodeName())) ? "" : currentAttr.getNodeName().substring(6); - } - } - return null; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - // Converts an octet string representation into an int array as needed for the IAIK ECC library - // String: rightmost byte is least significant byte - // IntArray: rightmost byte is LEAST significant byte - private static int[] octetString2IntArray(String octetString) - { - int byteCount = octetString.length()/2; - int[] intArray = new int[byteCount/4 + ((byteCount % 4 != 0) ? 1 : 0)]; - for (int i = 0; i < byteCount; i++) - { - int oSStartPos = octetString.length() - (i + 1) * 2; - int currentByte = Integer.parseInt(octetString.substring(oSStartPos, oSStartPos + 2), 16); - intArray[i/4] += (currentByte & 0xFF) << ((i % 4) * 8); - } - return intArray; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - // Converts an octet string representation into a byte array as needed for the IAIK ECC library - // String: rightmost byte is least significant byte - // ByteArray: rightmost byte is MOST significant byte - private static byte[] octetString2ByteArray(String octetString) - { - int byteCount = octetString.length()/2; - byte[] byteArray = new byte[byteCount]; - for (int i = 0; i < byteCount; i++) - { - int oSStartPos = octetString.length() - (i + 1) * 2; - byteArray[byteCount - i - 1] = (byte) Integer.parseInt(octetString.substring( - oSStartPos, oSStartPos + 2), 16); - } - return byteArray; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - private static String evenStringLength(String hexString) - { - return (hexString.length() % 2 != 0) ? "0" + hexString : hexString; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - private static Element getChildElement(Element parent, String namespace, String localName, - int instance) - { - NodeList namedElements = parent.getElementsByTagNameNS(namespace, localName); - if (namedElements.getLength() < instance) return null; - return (Element)namedElements.item(instance - 1); - } - - /* ---------------------------------------------------------------------------------------------------- */ - - private static String getChildElementText(Element parent, String namespace, String localName, - int instance) - { - Element child = getChildElement(parent, namespace, localName, instance); - if (child == null) return null; - NodeList childNodes = child.getChildNodes(); - int nodeCount = 0; - while (nodeCount < childNodes.getLength()) - { - Node currentNode = childNodes.item(nodeCount); - if (currentNode.getNodeType() == Node.TEXT_NODE) return currentNode.getNodeValue(); - nodeCount++; - } - return null; - } - - /* ---------------------------------------------------------------------------------------------------- */ - - public static HashMap getInScopeNSAttrs(Element element) - { - // Get all ancestors of element - Vector ancestors = new Vector(); - ancestors.add(element); - Node currentAncestor = element; - while ((currentAncestor = currentAncestor.getParentNode()) != null && - currentAncestor.getNodeType() == Node.ELEMENT_NODE) - { - ancestors.add(currentAncestor); - } - - // Scan all ancestors for NS attributes - HashMap inScopeNSAttrs = new HashMap(); - for (int i = ancestors.size() - 1; i >= 0; i--) - { - Element currentAncestorElem = (Element)ancestors.get(i); - NamedNodeMap attrs = currentAncestorElem.getAttributes(); - for (int j = 0; j < attrs.getLength(); j++) - { - Attr currentAttr = (Attr)attrs.item(j); - String currentAttrName = currentAttr.getNodeName(); - if ("xmlns".equals(currentAttrName) || currentAttrName.startsWith("xmlns:")) - { - inScopeNSAttrs.put(currentAttrName, currentAttr); - } - } - } - - // Check if default NS attribute is in list; if value is empty remove it from list - Attr defaultNSAttr = (Attr)inScopeNSAttrs.get("xmlns"); - if (defaultNSAttr != null && "".equals(defaultNSAttr.getValue())) inScopeNSAttrs.remove("xmlns"); - - return inScopeNSAttrs; - } -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java b/id.server/src/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java deleted file mode 100644 index 7c4731555..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Created on 17.02.2004 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package at.gv.egovernment.moa.id.util; - -import java.io.IOException; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import at.gv.egovernment.moa.logging.Logger; - -/** - * @author rschamberger - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class HTTPRequestJSPForwarder { - - /** - * Forwards the HttpServletRequest to a customizable JSP Page and serves the Response.
- *
    - *
  • Logs the message
  • - *
- * - * @param message message text - * @param jspPageURI URI of the JSP page - * @param context the servlet context of the servlet belonging to the req, resp - * @param req servlet request - * @param resp servlet response - */ - public static void forwardNamed( - String message, - String jspPageURI, - ServletContext context, - HttpServletRequest req, - HttpServletResponse resp) { - - if (null != message) { - Logger.info(message); - req.setAttribute("Message", message); - } - - //forward this to the given jsp page where the HTML response is generated - try { - context.getRequestDispatcher(jspPageURI).forward(req, resp); - } catch (IOException e) { - Logger.error(e); - } catch (ServletException e) { - Logger.error(e); - } - } - - /** - * Forwards the HttpServletRequest to the customizable JSP Page 'message.jsp' and serves the Response.
- *
    - *
  • Logs the message
  • - *
- * - * @param message message text - * @param context the servlet context of the servlet belonging to the req, resp - * @param req servlet request - * @param resp servlet response - */ - public static void forwardDefault( - String message, - ServletContext context, - HttpServletRequest req, - HttpServletResponse resp) { - forwardNamed(message, "/message.jsp", context, req, resp); - } -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/util/HTTPUtils.java b/id.server/src/at/gv/egovernment/moa/id/util/HTTPUtils.java deleted file mode 100644 index 035c47eb9..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/HTTPUtils.java +++ /dev/null @@ -1,68 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -/** - * HTTP Utilities - * - * @author Rudolf Schamberger - * @version $Id$ - */ - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.HttpURLConnection; -import java.net.URL; - -import org.apache.regexp.RE; -import org.apache.regexp.RESyntaxException; - -/** - * - * @author Rudolf Schamberger - * - */ -public class HTTPUtils { - - /** - * Utility used to obtainin correct encoded HTTP content. - * Reads a given Content adressed by HTTP-URL into String. - * Content encoding is considered by using the Content-Type HTTP header charset value. - * @param URL HTTP URL to read from. - * @return String representation of content - * @throws IOException on data-reading problems - */ - public static String readHttpURL(String URL) - throws IOException { - - URL url = new URL(URL); - HttpURLConnection conn = (HttpURLConnection)url.openConnection(); - conn.setRequestMethod("GET"); - String contentType = conn.getContentType(); - RE regExp = null; - try { - regExp = new RE("(;.*charset=)(\"*)(.*[^\"])"); - } catch (RESyntaxException e) { - //RESyntaxException is not possible = expr. is costant - } - boolean charsetSupplied = regExp.match(contentType); - String encoding = "ISO-8859-1"; //default HTTP encoding - if (charsetSupplied) { - encoding = regExp.getParen(3); - } - InputStream instream = new BufferedInputStream(conn.getInputStream()); - InputStreamReader isr = new InputStreamReader(instream, encoding); - Reader in = new BufferedReader(isr); - int ch; - StringBuffer buffer = new StringBuffer(); - while ((ch = in.read()) > -1) { - buffer.append((char)ch); - } - in.close(); - conn.disconnect(); - return buffer.toString(); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java b/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java deleted file mode 100644 index 4330133f0..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Created on 01.10.2004 - * - * @author rschamberger - * $ID$ - */ -package at.gv.egovernment.moa.id.util; - -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.StringTokenizer; -import java.util.Vector; - -import javax.servlet.ServletInputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequestWrapper; - -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.URLDecoder; - -/** - * Special ServletRequestWrapper class which provides a more precise implementation of the getParameter* - * family. This implementation cares about the order of the parameters from Query String and HTTP POST - * Body. Use this as Filter class for Servlets which such needs. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class InOrderServletRequestWrapper extends HttpServletRequestWrapper { - - /** - * standard encoding used to decode the URL string. - */ - // - public static final String DEFAULT_CHARACTER_ENCODING = "ISO-8859-1"; - /** - * Vector that stores the order of the query paramters - */ - private Vector queryParamOrder; - - /** - * Hashtable that stores the content of the query paramters - */ - private Hashtable queryParameters; - - /** - * Vector that stores the order of the HTTP body paramters - */ - private Vector bodyParamOrder; - - /** - * Hashtable that stores the content of the HTTP body paramters - */ - private Hashtable bodyParameters; - - /** - * ServletContext - */ - private ServletContext context; - - /** - * Identifier used to identify query parameters - */ - public static final int QUERY_PARAM = 1; - - /** - * Identifier used to identify HTTP body parameters - */ - public static final int BODY_PARAM = 2; - - /** - * @see HttpServletRequestWrapper - */ - public InOrderServletRequestWrapper(final HttpServletRequest request, final ServletContext sContext) { - super(request); - this.context = sContext; - } - - /** - * parses the Query and if availlable also HTTP POST parameters - * - * @param req a HttpServletRequest which should be parsed - */ - protected final void parseParameters(final HttpServletRequest req) - { - queryParamOrder = new Vector(); - queryParameters = new Hashtable(); - bodyParamOrder = new Vector(); - bodyParameters = new Hashtable(); - - //Insert code for Query string parsing - String rawQuery = req.getQueryString(); - queryParameters = tokenize(queryParameters, queryParamOrder, rawQuery, DEFAULT_CHARACTER_ENCODING, true); - - //analyze HTTP Post body parameters - if (req.getMethod().equalsIgnoreCase("POST")) - { - //get body encoding - String enc = req.getCharacterEncoding(); - if (enc == null) enc = DEFAULT_CHARACTER_ENCODING; - - if (req.getContentType().equals("application/x-www-form-urlencoded")) - { - try - { - bodyParameters = parsePostData(bodyParameters, req.getContentLength(), req.getInputStream(), enc); - } - catch (IOException e) - { - context.log("could not open input stream of reqest \n" + e.toString()); - } - } - else - { - //TODO add multipart code - context.log( - "ERROR other Content-Types than 'application/x-www-form-urlencoded' not supported!"); - } - - }// end POST - } - - /** - * parses the HTTP POST parameters - * - * @param ht parameter Hashtable to put parameters in. - * @param length of content - * @param instream the ServletInputStream of the request - * @param encoding encoding of the instream - * - * @return the Hashtable with the parsed data - */ - private Hashtable parsePostData(Hashtable ht, final int length, final ServletInputStream instream, - final String encoding) - { - int inputLen, offset; - byte[] postedBytes = null; - boolean dataRemaining = true; - String postedBody; - - StringBuffer sb = new StringBuffer(); - - if (length <= 0) - { - return null; - } - - postedBytes = new byte[length]; - try - { - offset = 0; - while (dataRemaining) - { - inputLen = instream.read(postedBytes, offset, length - offset); - if (inputLen <= 0) - { - throw new IOException("read error during reading the HTTP POST body"); - } - offset += inputLen; - if ((length - offset) == 0) - { - dataRemaining = false; - } - } - } - catch (IOException e) - { - System.out.println("Exception =" + e); - return null; - } - - postedBody = new String(postedBytes); - Hashtable ht2 = tokenize(ht, bodyParamOrder, postedBody, encoding, false); - return ht2; - } - - - /** - * tokenizes parameter strings - * - * @param ht parameter Hashtable to put parameters in. - * @param order Vector in which the order of the tokenized parameters will be stored. - * @param parameterString String to tokenize. - * @param encoding which will be used to decode the parameterString. - * - * @return the Hashtable with the parsed data - */ - private Hashtable tokenize(Hashtable ht, Vector order, final String parameterString, final String encoding, boolean decode) - { - String[] valArray = null; - - if (null == parameterString) return ht; - - StringTokenizer st = new StringTokenizer(parameterString, "&"); - - String key = null; - String val = null; - - while (st.hasMoreTokens()) - { - String pair = (String) st.nextToken(); - int pos = pair.indexOf('='); - if (pos == -1) - { - throw new IllegalArgumentException(); - } - try - { - if (decode) { - key = URLDecoder.decode(pair.substring(0, pos), encoding); - val = URLDecoder.decode(pair.substring(pos + 1, pair.length()), encoding); - } else { - key = pair.substring(0, pos); - val = pair.substring(pos + 1, pair.length()); - } - //Logger.debug("(" + Integer.toString(key.length()) + "=" + Integer.toString(pair.substring(0, pos).length()) + ")"+key+"|--|"+pair.substring(0, pos)); - //Logger.debug("(" + Integer.toString(val.length()) + "=" + Integer.toString(pair.substring(pos + 1, pair.length()).length()) + ")"+val+"|--|"+pair.substring(pos + 1, pair.length())); - } - catch (Exception e) - { - throw new IllegalArgumentException(); - } - if (ht.containsKey(key)) - { - String oldVals[] = (String[]) ht.get(key); - valArray = new String[oldVals.length + 1]; - for (int i = 0; i < oldVals.length; i++) - { - valArray[i] = oldVals[i]; - } - valArray[oldVals.length] = val; - } - else - { - valArray = new String[1]; - valArray[0] = val; - } - ht.put(key, valArray); - order.addElement(key); - } - return ht; - - } - - /** - * Returns the value of a request parameter as a String, or null if the - * parameter does not exist. Request parameters are extra information sent with the request. For HTTP - * servlets, parameters are contained in the query string or posted form data. - * - *

- * You should only use this method when you are sure the parameter has only one value. If the parameter - * might have more than one value, use {@link #getParameterValues(String, int)}. - * - *

- * If you use this method with a multivalued parameter, the value returned is equal to the first value in - * the array returned by getParameterValues. - * - *

- * If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then - * reading the body directly via {@link #getInputStream} or {@link #getReader}can interfere with the - * execution of this method. - * - * @param name a String containing the name of the parameter whose value is requested - * - * @return a String representing the single value of the parameter - * - * @see #getParameterValues(String, int) - * - */ - public final String getParameter(final String name) { - String val = getParameter(name, QUERY_PARAM); - return (null != val) ? val : getParameter(name, BODY_PARAM); - } - - /** - * Returns the value of a request parameter as a String, or null if the - * parameter does not exist. - * - * @param name a String containing the name of the parameter whose value is requested - * @param parameterType type of parameter - * @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#QUERY_PARAM - * and @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#BODY_PARAM - * @see #getParameterValues(String) - * @return value of the (single) parameter or null if not availlable - **/ - public final String getParameter(final String name, final int parameterType) - { - - Hashtable parameters = (parameterType == QUERY_PARAM) ? queryParameters : bodyParameters; - String[] vals = (String[]) parameters.get(name); - if (vals == null) - { - return null; - } - return vals[0]; - } - - - /** - * Returns an array of String objects containing all of the values the given request - * parameter has, or null if the parameter does not exist. - * - *

- * If the parameter has a single value, the array has a length of 1. - * - * @param name a String containing the name of the parameter whose value is requested - * @param parameterType type of parameter - * @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#QUERY_PARAM - * and @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#BODY_PARAM - * @return an array of String objects containing the parameter's values or null - * - * @see #getParameter - */ - public final String getParameterValues(final String name, final int parameterType) - { - Hashtable parameters = (parameterType == QUERY_PARAM) ? queryParameters : bodyParameters; - String[] vals = (String[]) parameters.get(name); - if (vals == null) - { - return null; - } - String vallist = vals[0]; - for (int i = 1; i < vals.length; i++) - { - vallist = vallist + "," + vals[i]; - } - return vallist; - } - - /** - * - * Returns an Enumeration of String objects containing the names of the - * parameters. If there are no parameters, the method returns an empty - * Enumeration. - * - * @return an Enumeration of String objects, each String - * containing the name of a request parameter; or an empty Enumeration if the - * request has no parameters - * - */ - public final Enumeration getParameterNames() - { - Vector FullParamOrder = new Vector(); - for (Enumeration enu = queryParamOrder.elements(); enu.hasMoreElements();) { - FullParamOrder.addElement(enu.nextElement()); - } - for (Enumeration enu = bodyParamOrder.elements(); enu.hasMoreElements();) { - FullParamOrder.addElement(enu.nextElement()); - } - return FullParamOrder.elements(); - } - - /** - * - * Returns an Enumeration of String objects containing the names of the - * parameters contained in this request. If the request has no parameters, the method returns an empty - * Enumeration. - * @param parameterType type of parameter - * - * @return an Enumeration of String objects, each String - * containing the name of a request parameter; or an empty Enumeration if the - * request has no parameters - * - */ - public final Enumeration getParameterNames(final int parameterType) - { - if (QUERY_PARAM == parameterType) - return queryParamOrder.elements(); - else - return bodyParamOrder.elements(); - } -} //End InOrderServletRequestWrapper \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java b/id.server/src/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java deleted file mode 100644 index d31aa6ec1..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java +++ /dev/null @@ -1,58 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -import java.util.Locale; - -import at.gv.egovernment.moa.util.Messages; - -/** - * A singleton wrapper around a Message object, providing the messages used in MOA-ID. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDMessageProvider { - - /** DEFAULT_MESSAGE_RESOURCES are resources/properties/id_messages */ - private static final String[] DEFAULT_MESSAGE_RESOURCES = - { "resources/properties/id_messages" }; - /** DEFAULT_MESSAGE_LOCALES are "de", "AT" */ - private static final Locale[] DEFAULT_MESSAGE_LOCALES = - new Locale[] { new Locale("de", "AT") }; - /** The instance for our singleton */ - private static MOAIDMessageProvider instance; - /** The Messages */ - private Messages messages; - - /** - * Returns the single instance of MOAIDMessageProvider. - * - * @return the single instance of MOAIDMessageProvider - */ - public static MOAIDMessageProvider getInstance() { - if (instance == null) - instance = new MOAIDMessageProvider(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); - return instance; - } - - /** - * Create a MOAIDMessageProvider. - * - * @param resourceNames The names of the resources containing the messages. - * @param locales The corresponding locales. - */ - protected MOAIDMessageProvider(String[] resourceNames, Locale[] locales) { - this.messages = new Messages(resourceNames, locales); - } - - /** - * Get the message corresponding to a given message ID. - * - * @param messageId The ID of the message. - * @param parameters The parameters to fill in into the message arguments. - * @return The formatted message. - */ - public String getMessage(String messageId, Object[] parameters) { - return messages.getMessage(messageId, parameters); - } - -} diff --git a/id.server/src/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java b/id.server/src/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java deleted file mode 100644 index 3f5fddba2..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java +++ /dev/null @@ -1,62 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; - -/** - * @author rschamberger - * - */ -/** - * A Filter class wich uses the InOrderServletRequestWrapper to provide servlets a more precise - * implementation of the getParameter* family. This implementation cares about the order of the parameters - * from Query String and HTTP POST Body. Use this as Filter class for Servlets which such needs. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class ParameterInOrderFilter implements Filter -{ - - /** - * filterConfig - */ - private FilterConfig filterConfig; - - /** - * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) - */ - public final void init(final FilterConfig config) - { - this.filterConfig = config; - } - - /** - * @see javax.servlet.Filter#destroy() - */ - public final void destroy() - { - }; - - /** - * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, - * javax.servlet.FilterChain) - */ - public final void doFilter(final ServletRequest request, final ServletResponse response, - final FilterChain chain) throws IOException, ServletException - { - InOrderServletRequestWrapper sRequ = new InOrderServletRequestWrapper((HttpServletRequest) request, - filterConfig.getServletContext()); - //parse the Query (and Body) parameters - sRequ.parseParameters((HttpServletRequest) request); - //process the rest of filter chain - chain.doFilter(sRequ, response); - } -} \ No newline at end of file diff --git a/id.server/src/at/gv/egovernment/moa/id/util/Random.java b/id.server/src/at/gv/egovernment/moa/id/util/Random.java deleted file mode 100644 index da75b4213..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/Random.java +++ /dev/null @@ -1,22 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -import java.util.Date; - -/** - * Random number generator used to generate ID's - * @author Paul Ivancsics - * @version $Id$ - */ -public class Random { - - /** random number generator used */ - private static java.util.Random random = new java.util.Random(new Date().getTime()); - /** - * Creates a new random number, to be used as an ID. - * - * @return random long as a String - */ - public static String nextRandom() { - return "" + random.nextLong(); - } -} diff --git a/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java b/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java deleted file mode 100644 index 9fa0803c4..000000000 --- a/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java +++ /dev/null @@ -1,180 +0,0 @@ -package at.gv.egovernment.moa.id.util; - -import iaik.pki.PKIConfiguration; -import iaik.pki.PKIException; -import iaik.pki.PKIFactory; -import iaik.pki.PKIProfile; -import iaik.pki.jsse.IAIKX509TrustManager; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; -import java.security.GeneralSecurityException; -import java.security.Security; -import java.util.HashMap; -import java.util.Map; - -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManager; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; - -import org.apache.regexp.RE; -import org.apache.regexp.RESyntaxException; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.iaik.config.PKIConfigurationImpl; -import at.gv.egovernment.moa.id.iaik.pki.PKIProfileImpl; -import at.gv.egovernment.moa.id.iaik.pki.jsse.MOAIDTrustManager; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Utility for a obtaining a secure socket factory using IAIKX509TrustManager. - * This TrustManager implementation features CRL checking.
- * SSLUtils caches secure socket factories for given ConnectionParameters. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SSLUtils { - - /** SSLSocketFactory store, mapping URL->SSLSocketFactory **/ - private static Map sslSocketFactories = new HashMap(); - - /** - * Initializes the SSLSocketFactory store. - */ - public static void initialize() { - sslSocketFactories = new HashMap(); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - } - - /** - * Creates an SSLSocketFactory which utilizes an - * IAIKX509TrustManager for the given trust store, - * and the given key store. - * - * @param conf configuration provider providing a generic properties pointing - * to trusted CA store and certificate store root - * @param connParam connection parameter containing the client key store settings - * to be used in case of client authentication; - * if connParam.getClientKeyStore() == null, client authentication - * is assumed to be disabled - * @return SSLSocketFactory to be used by an HttpsURLConnection - * @throws IOException thrown while reading key store file - * @throws GeneralSecurityException thrown while creating the socket factory - * @throws ConfigurationException on invalid configuration data - * @throws PKIException while initializing the IAIKX509TrustManager - */ - public static SSLSocketFactory getSSLSocketFactory( - ConfigurationProvider conf, - ConnectionParameter connParam) - throws IOException, GeneralSecurityException, ConfigurationException, PKIException { - - Logger.debug("Get SSLSocketFactory for " + connParam.getUrl()); - // retrieve SSLSocketFactory if already created - SSLSocketFactory ssf = (SSLSocketFactory)sslSocketFactories.get(connParam.getUrl()); - if (ssf != null) - return ssf; - // else create new SSLSocketFactory - String trustStoreURL = conf.getTrustedCACertificates(); - if (trustStoreURL == null) - throw new ConfigurationException( - "config.08", new Object[] {"TrustedCACertificates"}); - String acceptedServerCertURL = connParam.getAcceptedServerCertificates(); - TrustManager[] tms = getTrustManagers(conf, trustStoreURL, acceptedServerCertURL); - KeyManager[] kms = at.gv.egovernment.moa.util.SSLUtils.getKeyManagers( - "pkcs12", connParam.getClientKeyStore(), connParam.getClientKeyStorePassword()); - SSLContext ctx = SSLContext.getInstance("TLS"); - ctx.init(kms, tms, null); - ssf = ctx.getSocketFactory(); - // store SSLSocketFactory - sslSocketFactories.put(connParam.getUrl(), ssf); - return ssf; - } - - /** - * Initializes an IAIKX509TrustManager for a given trust store, - * using configuration data. - * - * @param conf MOA-ID configuration provider - * @param trustStoreURL trust store URL - * @param acceptedServerCertURL file URL pointing to directory containing accepted server SSL certificates - * @return TrustManager array containing the IAIKX509TrustManager - * @throws ConfigurationException on invalid configuration data - * @throws IOException on data-reading problems - * @throws PKIException while initializing the IAIKX509TrustManager - */ - public static TrustManager[] getTrustManagers( - ConfigurationProvider conf, String trustStoreURL, String acceptedServerCertURL) - throws ConfigurationException, PKIException, IOException, GeneralSecurityException { - - PKIConfiguration cfg = null; - if (! PKIFactory.getInstance().isAlreadyConfigured()) - cfg = new PKIConfigurationImpl(conf); - String boolString = conf.getGenericConfigurationParameter(ConfigurationProvider.TRUST_MANAGER_REVOCATION_CHECKING); - //not using BoolUtils because default value hast to be true! - boolean checkRevocation = !("false".equals(boolString) || "0".equals(boolString)); - PKIProfile profile = new PKIProfileImpl(trustStoreURL, checkRevocation); - // This call fixes a bug occuring when PKIConfiguration is - // initialized by the MOA-SP initialization code, in case - // MOA-SP is called by API - MOAIDTrustManager.initializeLoggingContext(); - IAIKX509TrustManager tm = new MOAIDTrustManager(acceptedServerCertURL); - tm.init(cfg, profile); - return new TrustManager[] {tm}; - } - /** - * Reads a file, given by URL, into a byte array, - * securing the connection by IAIKX509TrustManager. - * @param connParam containing URL and accepted server certificates - * @param conf ConfigurationProvider for reading - * @return String representation of content - * @throws ConfigurationException on invalid configuration data - * @throws PKIException on invalid configuration data - * @throws IOException on data-reading problems - * @throws GeneralSecurityException on security issues - */ - public static String readHttpsURL(ConfigurationProvider conf, ConnectionParameter connParam) - throws ConfigurationException, PKIException, IOException, GeneralSecurityException { - - URL url = new URL(connParam.getUrl()); - HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); - conn.setRequestMethod("GET"); - conn.setDoInput(true); - SSLSocketFactory sslSocketFactory = getSSLSocketFactory(conf, connParam); - conn.setSSLSocketFactory(sslSocketFactory); - conn.connect(); - String contentType = conn.getContentType(); - RE regExp = null; - try { - regExp = new RE("(;.*charset=)(\"*)(.*[^\"])"); - } catch (RESyntaxException e) { - //RESyntaxException is not possible = expr. is costant - } - boolean charsetSupplied = regExp.match(contentType); - String encoding = "ISO-8859-1"; //default HTTP encoding - if (charsetSupplied) { - encoding = regExp.getParen(3); - } - InputStream instream = new BufferedInputStream(conn.getInputStream()); - InputStreamReader isr = new InputStreamReader(instream, encoding); - Reader in = new BufferedReader(isr); - int ch; - StringBuffer buffer = new StringBuffer(); - while ((ch = in.read()) > -1) { - buffer.append((char)ch); - } - in.close(); - conn.disconnect(); - return buffer.toString(); - } -} diff --git a/id.server/src/test/MOAIDTestCase.java b/id.server/src/test/MOAIDTestCase.java deleted file mode 100644 index 725fa1386..000000000 --- a/id.server/src/test/MOAIDTestCase.java +++ /dev/null @@ -1,203 +0,0 @@ -package test; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import javax.xml.transform.TransformerException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.StreamUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import iaik.ixsil.algorithms.Transform; -import iaik.ixsil.algorithms.TransformImplExclusiveCanonicalXML; -import iaik.ixsil.exceptions.AlgorithmException; -import iaik.ixsil.exceptions.InitException; -import iaik.ixsil.exceptions.URIException; -import iaik.ixsil.init.IXSILInit; -import iaik.ixsil.util.URI; -import test.at.gv.egovernment.moa.MOATestCase; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDTestCase extends MOATestCase implements Constants { - - public static final String XML_DECL = - ""; - protected static final String nl = "\n"; - - public MOAIDTestCase(String name) { - super(name); - } - - protected void initIxsil() throws InitException, URIException { - IXSILInit.init(new URI("init/properties/init.properties")); - // Switch on debug information - IXSILInit.setPrintDebugLog(true); - } - //STRING <==> STRING - protected void assertXmlEquals(String xml1, String xml2) - throws AlgorithmException, IOException, InitException, URIException{ - initIxsil(); - String canXml1 = canonicalTransform(xml1); - String canXml2 = canonicalTransform(xml2); - assertEquals(canXml1, canXml2); } - // ELEMENT <==> ELEMENT - protected void assertXmlEquals(Element xml1, Element xml2) - throws AlgorithmException, IOException, InitException , URIException, TransformerException{ - initIxsil(); - assertEquals(canonicalTransform(DOMUtils.serializeNode(xml1)),canonicalTransform(DOMUtils.serializeNode(xml2))); - } - // INPUTSTREAM <==> INPUTSTREAM - protected void assertXmlEquals(InputStream xml1, InputStream xml2) - throws AlgorithmException, IOException, InitException , URIException{ - initIxsil(); - assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); - } - // ELEMENT <==> STRING - protected void assertXmlEquals(Element xml1, String xml2) - throws AlgorithmException, IOException, InitException , URIException, TransformerException { - initIxsil(); - assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); - } - // ELEMENT <==> INPUTSTREAM - protected void assertXmlEquals(Element xml1, InputStream xml2) - throws AlgorithmException, IOException, InitException , URIException, TransformerException{ - initIxsil(); - assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); - } - // STRING <==> INPUTSTREAM - protected void assertXmlEquals(String xml1, InputStream xml2) - throws AlgorithmException, IOException, InitException , URIException{ - initIxsil(); - assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); - } - - /** - * Method canonicalTransform. - * @param input as STRING - * @return String - */ - protected String canonicalTransform(String input) - throws AlgorithmException, IOException { - - Transform tr = new TransformImplExclusiveCanonicalXML(); - InputStream s = new ByteArrayInputStream(input.getBytes("UTF-8")); - tr.setInput(s, null); - ByteArrayInputStream transResult = (ByteArrayInputStream) tr.transform(); - return killWhiteSpace(readString(transResult)); - } - /** - * Method canonicalTransform. - * @param input as Element - * @return String - */ - protected String canonicalTransform(Element input) - throws AlgorithmException, IOException { - - Transform tr = new TransformImplExclusiveCanonicalXML(); - tr.setInput(XPathUtils.selectNodeList(input, XPathUtils.ALL_NODES_XPATH), null); - ByteArrayInputStream transResult = (ByteArrayInputStream) tr.transform(); - - return killWhiteSpace(readString(transResult)); - } - - /** - * Method canonicalTransform. - * @param input as InputStream - * @return String - */ - protected String canonicalTransform(InputStream input) - throws AlgorithmException, IOException { - - Transform tr = new TransformImplExclusiveCanonicalXML(); tr.setInput(input, null); - ByteArrayInputStream transResult = (ByteArrayInputStream) tr.transform(); - - return killWhiteSpace(readString(transResult)); - } - - public static String killWhiteSpace(String input) - { - int start=0; - int ende; - String result; - String middle; - result = input; - do { - start = result.indexOf(">", start); - ende = result.indexOf("<", start); - middle = result.substring(start+1,ende).trim(); - result = result.substring(0,start+1) +middle + result.substring(ende,result.length()); - start++; - } while (result.indexOf("<", ende + 1)>0); - - return result; - } - - /** - * Method killExclusive.: The values startsWith and endsWith will be included into the answer. - * @param input - * @param startsWith - * @param endsWith - * @param newValue - * @return String - */ - public static String killExclusive(String input, String startsWith, String endsWith, String newValue) - { - int start=0; - int ende; - String result; - result = input; - do { - start = result.indexOf(startsWith, start) + startsWith.length(); - ende = result.indexOf(endsWith, start); - result = result.substring(0,start) + newValue + result.substring(ende,result.length()); - start++; - } while (result.indexOf(startsWith, ende + 1)>0); - - return result; - } - - /** - * Method killInclusive. : The values startsWith and endsWith will NOT be included into the answer. - * @param input - * @param startsWith - * @param endsWith - * @param newValue - * @return String - */ - public static String killInclusive(String input, String startsWith, String endsWith, String newValue) - { - int start=0; - int ende; - String result; - result = input; - do { - start = result.indexOf(startsWith, start) + startsWith.length(); - ende = result.indexOf(endsWith, start); - result = result.substring(0,start - startsWith.length() ) + newValue + result.substring(ende + endsWith.length(),result.length()); - start++; - } while (result.indexOf(startsWith, ende + 1)>0); - - return result; - } - - protected String readFile(String filename) throws IOException { - return readFile(filename, "UTF-8"); - } - protected String readFile(String filename, String encoding) throws IOException { - return FileUtils.readFile(filename, encoding); - } - protected String readString(InputStream input) throws IOException - { - return StreamUtils.readStream(input, "UTF-8"); - } - -} diff --git a/id.server/src/test/abnahme/A/Test100StartAuthentication.java b/id.server/src/test/abnahme/A/Test100StartAuthentication.java deleted file mode 100644 index 0d72691aa..000000000 --- a/id.server/src/test/abnahme/A/Test100StartAuthentication.java +++ /dev/null @@ -1,171 +0,0 @@ -package test.abnahme.A; - -import test.abnahme.AbnahmeTestCase; -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.auth.WrongParametersException; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class Test100StartAuthentication extends AbnahmeTestCase { - - public Test100StartAuthentication(String name) { - super(name); - } - - public void testA101() throws Exception { - try { - String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL - "gb", //target - "http://localhost:9080/", //oaURL - "file:" + findXmldata("AuthTemplate.html"), - "http://localhost:3495/http-security-layer-request", - null); - htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); - //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); - assertEquals(readXmldata("htmlForm.html"),htmlForm); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA102() throws Exception { - try { - String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL - "gb", //target - "http://localhost:9080/", //oaURL - null, - "http://localhost:3495/http-security-layer-request", null); - htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); - //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); - assertEquals(readXmldata("htmlForm.html"),htmlForm); - - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA103() throws Exception { - try { - String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL - "gb", //target - "http://localhost:9080/", //oaURL - "file:" + findXmldata("AuthTemplate.html"), - null, - null); - htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); - //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); - assertEquals(readXmldata("htmlForm.html"),htmlForm); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA151() throws Exception { - try { - try { - server.startAuthentication(null, //authURL - "gb", //target - "http://localhost:9080/", //oaURL - null, null, null); - //assertEquals("",htmlForm); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (WrongParametersException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA152() throws Exception { - try { - try { - server.startAuthentication("http://localhost:8080/auth", //authURL - "gb", "http://localhost:9080/", //oaURL - null, null, null); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA153() throws Exception { - try { - try { - server.startAuthentication("https://localhost:8443/auth", //authURL - "gb", "http://host_not_in_config/", //oaURL - null, null, null); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA154() throws Exception { - try { - try { - server.startAuthentication("https://localhost:8443/auth", //authURL - "gb", null, //oaURL - null, null, null); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (WrongParametersException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA155() throws Exception { - try { - try { - server.startAuthentication("https://localhost:8443/auth", //authURL - null, "http://localhost:9080/", //oaURL - null, null, null); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (WrongParametersException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - //assertEquals("",htmlForm); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - -} diff --git a/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java b/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java deleted file mode 100644 index 043f51398..000000000 --- a/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java +++ /dev/null @@ -1,369 +0,0 @@ -package test.abnahme.A; - -import java.util.HashMap; -import java.util.Vector; - -import org.w3c.dom.Element; - -import test.abnahme.AbnahmeTestCase; -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; -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.validator.ValidateException; -import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class Test200VerifyIdentityLink extends AbnahmeTestCase { - - public Test200VerifyIdentityLink(String name) { - super(name); - } - - public void testA201() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, parameters); - - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - - VerifyXMLSignatureResponseParser respParser = new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames(), VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, true); - - /* - * HINWEIS: clearSamlAssertion löscht aus einer beliebiegen String-Repräsentation einer XML-Struktur - * AUSSLIESSLICH die Attribute IssueInstand und die AssertionID heraus, von dem her ist diese - * Method hier verwendbar - */ - - assertXmlEquals(clearSamlAssertion(readXmldata("CreateXMLSignatureRequest.xml")), clearSamlAssertion(createXMLSignatureRequest)); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - - } - public void testA251() throws Exception { - try { - startAuthentication(); - String sessionID = "0"; - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA252() throws Exception { - try { - String sessionID = startAuthentication(); - - server.setSecondsSessionTimeOut(-100); - server.cleanup(); - server.setSecondsSessionTimeOut(1000); - - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA253() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA254() throws Exception { - try { - String sessionID = startAuthentication(); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA255() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - } - catch (ParseException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA256() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA257() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA258() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA259() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA260() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA261() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA262() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - new InfoboxReadResponseParser(infoboxReadResponse).parseIdentityLink(); - // System.out.println(infoboxReadResponse); - - try { - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA263() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - - VerifyXMLSignatureResponseParser respParser = new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - - // String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, infoboxReadResponse); - // System.out.println(createXMLSignatureRequest); - // String createXMLSignatureResponse = readFile(TESTDATA_ROOT + "xmldata/standard/"+"CreateXMLSignatureResponse.xml"); - // String samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - Vector identityLinkSigners = new Vector(); - identityLinkSigners.add("CN=TEST,OU=TEST,O=TEST,C=AT"); - try { - VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), identityLinkSigners, VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, true); - System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); - fail(this.getName() + " hat KEINE FEHLER geworfen"); - } - catch (ValidateException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } -} diff --git a/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java b/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java deleted file mode 100644 index 9bf92e54b..000000000 --- a/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java +++ /dev/null @@ -1,609 +0,0 @@ -package test.abnahme.A; - -import java.util.Calendar; -import java.util.HashMap; - -import org.w3c.dom.Element; -import test.abnahme.AbnahmeTestCase; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.ParseException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder; -import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder; -import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -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.data.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; -import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; -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.validator.CreateXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.auth.validator.ValidateException; -import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.util.Random; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ - -public class Test300VerifyAuthBlock extends AbnahmeTestCase { - - public Test300VerifyAuthBlock(String name) { - super(name); - } - - public void testA301() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - //authDataWriter(authData,this.getName()+"new.xml"); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA302() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - //authDataWriter(authData,this.getName()+"new.xml"); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA303() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA304() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA305() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA306() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA307() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA308() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServer(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - - } - - public void testA309() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServerWithoutValidateAuthBlock(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA310() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServerWithoutValidateAuthBlock(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA311() throws Exception { - try { - String sessionID = startAuthentication(); - AuthenticationData authData = initServerWithoutValidateAuthBlock(sessionID); - assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA351() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); - // System.out.println(createXMLSignatureRequest); - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - - // nicht existierende Session.... - try { - server.verifyAuthenticationBlock("0", createXMLSignatureResponse); - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA352() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - server.setSecondsSessionTimeOut(-100); - server.cleanup(); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); - // System.out.println(createXMLSignatureRequest); - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - - // abgelaufene Session.... - server.setSecondsSessionTimeOut(1000); - try { - server.verifyAuthenticationBlock("0", createXMLSignatureResponse); - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA353() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - - // Session for VerifyIdentityLink-Aufruf - try { - - server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - fail(); - } - //NOCH SEHR UNSCHÖN..... (fliegt raus im AuthenticationServer, Methode buildAuthenticationData - // ( IdentityLink identityLink = session.getIdentityLink(); ==> liefert dann NULL... - catch (NullPointerException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA354() throws Exception { - try { - String sessionID = startAuthentication(); - System.out.println(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); - // System.out.println(createXMLSignatureRequest); - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - - // nicht existierende Session.... - - server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - try { - server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA355() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ParseException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA356() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ParseException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA357() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA358() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA359() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA360() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA361() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA362() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA363() throws Exception { - try { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA364() throws Exception { - try { - String sessionID = startAuthentication(); - try { - - initServer(sessionID); - fail(); - } - catch (ValidateException e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - /* public void testA365() throws Exception { - String sessionID = startAuthentication(); - try { - // wegen sinnlosigkeit gestrichen - initServer(sessionID); - fail(); - } - catch (ValidateException e) {System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage()+ "-----------------------");} - }*/ - - public void testA366() throws Exception { - - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) {System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage()+ "-----------------------");} - } - public void testA367() throws Exception { - String sessionID = startAuthentication(); - try { - initServer(sessionID); - fail(); - } - catch (ValidateException e) {System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage()+ "-----------------------");} - } - - - private AuthenticationData initServer(String sessionID) throws Exception { - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, "TrustProfile1"); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); - // System.out.println(createXMLSignatureRequest); - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - // CreateXMLSignatureResponseValidator.getInstance().validate(new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(),"gb","https://localhost:9443/"); - String samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - AuthenticationData authData = server.getAuthenticationData(samlArtifact); - return authData; - } - - private AuthenticationData initServerWithoutValidateAuthBlock(String sessionID) throws Exception { - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, "TrustProfile1"); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); - // System.out.println(createXMLSignatureRequest); - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - // CreateXMLSignatureResponseValidator.getInstance().validate(new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(),"gb","https://localhost:9443/"); - - AuthenticationSession session = AuthenticationServer.getSession(sessionID); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - // parses - CreateXMLSignatureResponse csresp = - new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(); - // validates - new CreateXMLSignatureResponseValidator().validate(csresp, session); - // builds a for a MOA-SPSS call - String[] vtids = authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(); - String tpid = authConf.getMoaSpAuthBlockTrustProfileID(); - Element domVsreq = new VerifyXMLSignatureRequestBuilder().build(csresp, vtids, tpid); - // invokes the call - Element domVsresp = new SignatureVerificationInvoker().verifyXMLSignature(domVsreq); - // parses the - VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponseParser(domVsresp).parseData(); - // validates the - VerifyXMLSignatureResponseValidator.getInstance().validate(vsresp, null, VerifyXMLSignatureResponseValidator.CHECK_AUTH_BLOCK, true); - // compares the public keys from the identityLink with the AuthBlock - - // builds authentication data and stores it together with a SAML artifact - AuthenticationData authData = buildAuthenticationData(session, vsresp); - return authData; - } - private AuthenticationData buildAuthenticationData( - AuthenticationSession session, - VerifyXMLSignatureResponse verifyXMLSigResp) - throws ConfigurationException, BuildException { - - IdentityLink identityLink = session.getIdentityLink(); - AuthenticationData authData = new AuthenticationData(); - authData.setMajorVersion(1); - authData.setMinorVersion(0); - authData.setAssertionID(Random.nextRandom()); - authData.setIssuer(session.getAuthURL()); - authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance())); - String vpkBase64 = new BPKBuilder().buildBPK( - identityLink.getIdentificationValue(), session.getTarget()); - authData.setBPK(vpkBase64); - authData.setGivenName(identityLink.getGivenName()); - authData.setFamilyName(identityLink.getFamilyName()); - authData.setDateOfBirth(identityLink.getDateOfBirth()); - authData.setQualifiedCertificate(verifyXMLSigResp.isQualifiedCertificate()); - authData.setPublicAuthority(verifyXMLSigResp.isPublicAuthority()); - authData.setPublicAuthorityCode(verifyXMLSigResp.getPublicAuthorityCode()); - OAAuthParameter oaParam = - AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( - session.getPublicOAURLPrefix()); - String prPerson = new PersonDataBuilder().build( - identityLink, oaParam.getProvideStammzahl()); - - try { - String ilAssertion = - oaParam.getProvideIdentityLink() ? DOMUtils.serializeNode(identityLink.getSamlAssertion()) : ""; - String authBlock = oaParam.getProvideAuthBlock() ? session.getAuthBlock() : ""; - String samlAssertion = new AuthenticationDataAssertionBuilder().build( - authData, prPerson, authBlock, ilAssertion, session.getBkuURL(), "", false, null); - authData.setSamlAssertion(samlAssertion); - return authData; - } - catch (Throwable ex) { - throw new BuildException( - "builder.00", - new Object[] { "AuthenticationData", ex.getMessage() }, - ex); - } - } -} diff --git a/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java b/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java deleted file mode 100644 index 3db0a6d69..000000000 --- a/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java +++ /dev/null @@ -1,137 +0,0 @@ -package test.abnahme.A; - -import java.util.HashMap; - -import org.w3c.dom.Element; -import test.abnahme.AbnahmeTestCase; - -import at.gv.egovernment.moa.id.AuthenticationException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -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.invoke.SignatureVerificationInvoker; -import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; -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.validator.CreateXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.data.AuthenticationData; - -/** - * @author Stefan Knirsch - * @version $Id$ - */ - -public class Test400GetAuthenticationData extends AbnahmeTestCase { - - private String samlArtifact; - - public Test400GetAuthenticationData(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - String sessionID = startAuthentication(); - AuthenticationSession session = AuthenticationServer.getSession(sessionID); - String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - server.verifyIdentityLink(sessionID, parameters); - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); - Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); - new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); - //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); - // System.out.println(createXMLSignatureRequest); - String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); - CreateXMLSignatureResponseValidator.getInstance().validate(new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(), session); - samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - } - - public void testA401() throws Exception { - try { - - AuthenticationData authData = server.getAuthenticationData(samlArtifact); -// authDataWriter(authData,"NEWA401"); - assertXmlEquals(clearSamlAssertion(authData.getSamlAssertion()), readXmldata("AuthenticationData.xml")); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA451() throws Exception { - try { - try { - AuthenticationData authData = server.getAuthenticationData("AAGu1JFbyGKqJ+3NAonwMu5bNyUc7kooeMK6bxeXBbnK6NL0DfuVJsGi"); - authDataWriter(authData, "A45"); - if (authData != null) - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA452() throws Exception { - try { - server.getAuthenticationData(samlArtifact); - try { - server.getAuthenticationData(samlArtifact); - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA453() throws Exception { - try { - server.setSecondsAuthDataTimeOut(-1000); - server.cleanup(); - try { - server.getAuthenticationData(samlArtifact); - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA454() throws Exception { - try { - try { - server.getAuthenticationData("blabla123"); - fail(); - } - catch (AuthenticationException e) { - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - -} diff --git a/id.server/src/test/abnahme/A/Test500StartAuthenticationServlet.java b/id.server/src/test/abnahme/A/Test500StartAuthenticationServlet.java deleted file mode 100644 index f4f37a871..000000000 --- a/id.server/src/test/abnahme/A/Test500StartAuthenticationServlet.java +++ /dev/null @@ -1,305 +0,0 @@ -package test.abnahme.A; - -import java.io.OutputStream; -import java.net.URL; -import java.security.Security; - -import javax.net.ssl.SSLSocketFactory; - -import test.abnahme.AbnahmeTestCase; - -import at.gv.egovernment.moa.util.StreamUtils; -import at.gv.egovernment.moa.util.URLEncoder; - -import com.sun.net.ssl.HostnameVerifier; -import com.sun.net.ssl.HttpsURLConnection; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class Test500StartAuthenticationServlet extends AbnahmeTestCase { - - private String testdataRoot = TESTDATA_ROOT + "xmldata/standard/"; - SSLSocketFactory ssf; - public Test500StartAuthenticationServlet(String name) { - super(name); - } - protected void setUp() throws Exception { - super.setUp(); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); - } - - public void testA501() throws Exception { - //NUR einmal für alle folgenden Testfälle - //---------------------------------------- - - //---------------------------------------- - - try { - String targetURL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(targetURL, "GET"); - conn.connect(); - int resultCode = conn.getResponseCode(); - String contentType = conn.getHeaderField("Content-Type"); - if (resultCode != 200) - fail("Wrong HTTP-Code"); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) - fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); - conn.disconnect(); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA502() throws Exception { - try { - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - int resultCode = conn.getResponseCode(); - String contentType = conn.getHeaderField("Content-Type"); - if (resultCode != 200) - fail("Wrong HTTP-Code: expected '200' and was '" + resultCode + "'"); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) - fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - - conn.disconnect(); - - URL = parseDataURL(result); - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - System.out.println("File gelesen, Daten in Outputstream einpflegen"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes("UTF-8")); - out.flush(); - out.close(); - - System.out.println("Verbinden zu " + URL); - conn.connect(); - resultCode = conn.getResponseCode(); - System.out.println("resultCode :" + resultCode); - String redirectLoc = conn.getHeaderField("Location"); - System.out.println("redirectLoc :" + redirectLoc); - // Austausch von VerifyIdentityLink in der POST-URL durch VerifyAuthBlock... rest MUSS gleich sein! - if (!killInclusive(URL, "VerifyI", "Link", "VerifyAuthBlock").equals(redirectLoc)) - fail("Wrong Redirect-Location: expected " + URL + " and was " + conn.getHeaderField("Location")); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/xml")) - fail("Wrong contentType: expected text/xml and was " + conn.getHeaderField("Content-Type")); - conn.disconnect(); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA503() throws Exception { - try { - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - - assertEquals(200,conn.getResponseCode()); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) - fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - URL = parseDataURL(result); - - conn.disconnect(); - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - String redirectLoc = conn.getHeaderField("Location"); - // Austausch von VerifyIdentityLink in der POST-URL durch VerifyAuthBlock... rest MUSS gleich sein! - if (!killInclusive(URL, "VerifyI", "Link", "VerifyAuthBlock").equals(redirectLoc)) - fail("Wrong Redirect-Location: expected " + URL + " and was " + conn.getHeaderField("Location")); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/xml")) - fail("Wrong contentType: expected text/xml and was " + conn.getHeaderField("Content-Type")); - conn.disconnect(); - - conn = giveConnection(redirectLoc, "POST"); - System.out.println("Redirect Location: " + redirectLoc); - String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - out = conn.getOutputStream(); - out.write(("XMLResponse=" +createXMLSignatureResponse).getBytes()); - out.flush(); - out.close(); - - System.out.println("Sending Data to " + redirectLoc); - conn.connect(); - - redirectLoc = conn.getHeaderField("Location"); - System.out.println("redirectLoc: " + redirectLoc); - /* RandomAccessFile raf = new RandomAccessFile("C://503.xml", "rw"); - raf.write(StreamUtils.readStream(conn.getInputStream())); - raf.close();*/ - conn.disconnect(); - assertEquals(302, conn.getResponseCode()); - assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA551() throws Exception { - try { - String targetURL = getURL("https://localhost:8443/moa-id-auth/", "gb", ""); - HttpsURLConnection conn = giveConnection(targetURL, "GET"); - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - assertTrue(result.indexOf("Die Angabe der Parameter ist unvollständig") >= 0); - conn.disconnect(); - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: Die Angabe der Parameter ist unvollständig.\n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA552() throws Exception { - try { - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - int resultCode = conn.getResponseCode(); - assertEquals(200, resultCode); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) - fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); - conn.disconnect(); - URL = "https://localhost:8443/moa-id-auth/" + "VerifyIdentityLink?MOASessionID=0000"; - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - assertTrue(result.indexOf("MOASessionID ist unbekannt") >= 0); - System.out.println("Fehler in testA552 erfolgreich abgefangen: MOASessionID ist unbekannt"); - conn.disconnect(); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testA553() throws Exception { - try { - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - int resultCode = conn.getResponseCode(); - assertEquals(200,resultCode); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) - fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - String MOASessionID = parseSessionIDFromForm(result); - URL = parseDataURL(result); - conn.disconnect(); - - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - result = new String(StreamUtils.readStream(conn.getInputStream())); - String redirectLoc = conn.getHeaderField("Location"); - // Austausch von VerifyIdentityLink in der POST-URL durch VerifyAuthBlock... rest MUSS gleich sein! - if (!killInclusive(URL, "VerifyI", "Link", "VerifyAuthBlock").equals(redirectLoc)) - fail("Wrong Redirect-Location: expected " + URL + " and was " + conn.getHeaderField("Location")); - if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/xml")) - fail("Wrong contentType: expected text/xml and was " + conn.getHeaderField("Content-Type")); - conn.disconnect(); - conn = giveConnection(redirectLoc + "XXX", "POST"); - System.out.println("Redirect Location: " + redirectLoc + "XXX"); - String createXMLSignatureResponse = "XMLResponse=" + URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - - out = conn.getOutputStream(); - out.write(new String("MOASessionID=" + MOASessionID + "&").getBytes()); - out.write(createXMLSignatureResponse.getBytes("UTF-8")); - out.flush(); - out.close(); - System.out.println("Sending Data to " + redirectLoc); - conn.connect(); - resultCode = conn.getResponseCode(); - - result = new String(StreamUtils.readStream(conn.getInputStream())); - conn.disconnect(); - assertEquals(200, resultCode); - assertTrue(result.indexOf("MOASessionID ist unbekannt") >= 0); - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - private String parseDataURL(String input) { - String ret = getSubString(input.substring(input.indexOf("DataURL"), input.length()), "value=\"", "\""); - return ret; - } - - private String getSubString(String input, String startsWith, String endsWith) { - return input.substring(input.indexOf(startsWith) + startsWith.length(), input.indexOf(endsWith, input.indexOf(startsWith) + startsWith.length())); - } - private String getURL(String authURL, String target, String oaURL) { - return authURL + "StartAuthentication?Target=" + target + "&OA=" + oaURL; - } - private String parseSessionIDFromForm(String htmlForm) { - String parName = "MOASessionID="; - assertTrue("HTML Form enthält keine SessionID", htmlForm.indexOf(parName) >= 0); - int i1 = htmlForm.indexOf(parName) + parName.length(); - int i2 = htmlForm.indexOf("\"", i1); - assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); - return htmlForm.substring(i1, i2); - } - - private class HostnameVerifierHack implements HostnameVerifier { - public boolean verify(String arg0, String arg1) { - return true; - } - } - private HttpsURLConnection giveConnection(String targetURL, String requestMethod) throws Exception { - URL url = new URL(targetURL); - HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); - conn.setRequestMethod(requestMethod); - conn.setDoInput(true); - conn.setDoOutput(true); - conn.setUseCaches(false); - conn.setAllowUserInteraction(false); - conn.setHostnameVerifier(new HostnameVerifierHack()); - return conn; - } - -} \ No newline at end of file diff --git a/id.server/src/test/abnahme/A/Test600GetAuthenticationDataService.java b/id.server/src/test/abnahme/A/Test600GetAuthenticationDataService.java deleted file mode 100644 index b44852346..000000000 --- a/id.server/src/test/abnahme/A/Test600GetAuthenticationDataService.java +++ /dev/null @@ -1,281 +0,0 @@ -package test.abnahme.A; - -import java.io.OutputStream; -import java.net.URL; -import java.security.Security; -import java.util.Calendar; -import java.util.Vector; - -import javax.xml.namespace.QName; -import javax.xml.rpc.Call; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceFactory; - -import org.apache.axis.message.SOAPBodyElement; -import org.w3c.dom.Element; - -import com.sun.net.ssl.HostnameVerifier; -import com.sun.net.ssl.HttpsURLConnection; - -import test.abnahme.AbnahmeTestCase; - -import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; -import at.gv.egovernment.moa.util.StreamUtils; -import at.gv.egovernment.moa.util.URLDecoder; -import at.gv.egovernment.moa.util.URLEncoder; - -/** - * @author Stefan Knirsch - * @version $Id$ - */ - -public class Test600GetAuthenticationDataService extends AbnahmeTestCase { - - private String moaSessionID; - private String samlArtifact; - private static final QName SERVICE_QNAME = new QName("SignatureCreation"); - - public Test600GetAuthenticationDataService(String name) { - super(name); - } - - protected void setUp() throws Exception { - super.setUp(); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); - } - - public void testA601() throws Exception { - try { - - // Anmelden - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - String MOASessionID = parseSessionIDFromForm(result); - conn.disconnect(); - - URL = parseDataURL(result); - // Verify Identity Link - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - String redirectLoc = conn.getHeaderField("Location"); - conn.disconnect(); - //Verify Auth Block - conn = giveConnection(redirectLoc, "POST"); - String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - out = conn.getOutputStream(); - out.write(("MOASessionID=" + moaSessionID + "&XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); - out.flush(); - out.close(); - conn.connect(); - redirectLoc = conn.getHeaderField("Location"); - samlArtifact = parseSamlArtifact(redirectLoc); - System.out.println("SamlArtifact: " + samlArtifact); - conn.disconnect(); - - assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); - - conn = null; - - SAMLRequestBuilder srb = new SAMLRequestBuilder(); - - Element erg = doCall(srb.build(moaSessionID,URLDecoder.decode(samlArtifact, "UTF-8"))); - result = DOMUtils.serializeNode(erg); - result = killInclusive(result,"IssueInstant=\"","\"",""); - result = killInclusive(result,"AssertionID=\"","\"",""); - result = killInclusive(result,"ResponseID=\"","\"",""); - -// writeXmldata("GetAuthenticationDataWebServiceResponse.xml", result.getBytes("UTF-8")); - - assertEquals(result,readXmldata("GetAuthenticationDataWebServiceResponse.xml")); - - System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA651() throws Exception { - try { - - // Anmelden - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - String MOASessionID = parseSessionIDFromForm(result); - conn.disconnect(); - - URL = parseDataURL(result); - // Verify Identity Link - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - String redirectLoc = conn.getHeaderField("Location"); - conn.disconnect(); - //Verify Auth Block - conn = giveConnection(redirectLoc, "POST"); - String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - out = conn.getOutputStream(); - out.write(("MOASessionID=" + moaSessionID + "&XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); - out.flush(); - out.close(); - conn.connect(); - redirectLoc = conn.getHeaderField("Location"); - samlArtifact = "AAGu1JFbyGKqJ+3NAonwMu5bNyUc7kooeMK6bxeXBbnK6NL0DfuVJsGi"; - System.out.println("SamlArtifact: " + samlArtifact); - conn.disconnect(); - - assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); - - conn = null; - - SAMLRequestBuilder srb = new SAMLRequestBuilder(); - Element samlPRequest = srb.build(moaSessionID,samlArtifact); - - assertTrue(DOMUtils.serializeNode(doCall(samlPRequest)).indexOf("unbekanntes SAML-Artifakt")!=-1); - - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: Fehler beim Abholen der Anmeldedaten, unbekanntes SAML-Artifakt\n-----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testA652() throws Exception { - try { - - // Anmelden - String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - String MOASessionID = parseSessionIDFromForm(result); - conn.disconnect(); - - URL = parseDataURL(result); - // Verify Identity Link - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - String redirectLoc = conn.getHeaderField("Location"); - conn.disconnect(); - //Verify Auth Block - conn = giveConnection(redirectLoc, "POST"); - String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - out = conn.getOutputStream(); - out.write(("MOASessionID=" + moaSessionID + "&XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); - out.flush(); - out.close(); - conn.connect(); - redirectLoc = conn.getHeaderField("Location"); - samlArtifact = parseSamlArtifact(redirectLoc); - System.out.println("SamlArtifact: " + samlArtifact); - conn.disconnect(); - - assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); - - conn = null; - String request = - "" + - ""; - - Element samlPRequest = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - - assertTrue(DOMUtils.serializeNode(doCall(samlPRequest)).indexOf("Fehlerhaftes Requestformat")!=-1); -// writeXmldata("GetAuthenticationDataWebServiceResponse.xml", result.getBytes("UTF-8")); - System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: Fehlerhaftes Requestformat\n-----------------------"); } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - protected Element doCall(Element request) - throws Exception { - QName serviceName = new QName("GetAuthenticationData"); - String endPoint = "http://localhost:8080/moa-id-auth/services/GetAuthenticationData"; - Service service = ServiceFactory.newInstance().createService(serviceName); - Call call = service.createCall(); - SOAPBodyElement body = - new SOAPBodyElement(request); - SOAPBodyElement[] params = new SOAPBodyElement[] {body}; - Vector responses; - SOAPBodyElement response; - - call.setTargetEndpointAddress(endPoint); - responses = (Vector) call.invoke(params); - response = (SOAPBodyElement) responses.get(0); - - return response.getAsDOM(); - } - - private String parseDataURL(String input) - { - return getSubString(input.substring(input.indexOf("DataURL"),input.length()),"value=\"","\""); - } - private String parseSamlArtifact(String input) - { - return getSubString(input+"@@@","SAMLArtifact=","@@@"); - } - private String getSubString(String input, String startsWith, String endsWith) - { - return input.substring(input.indexOf(startsWith)+startsWith.length(), input.indexOf(endsWith, input.indexOf(startsWith)+startsWith.length())); - } - private String getURL(String authURL, String target, String oaURL) - { - return authURL + "StartAuthentication?Target=" + target + "&OA=" + oaURL; - } - private String parseSessionIDFromForm(String htmlForm) { - String parName = "MOASessionID="; - assertTrue( - "HTML Form enthält keine SessionID", - htmlForm.indexOf(parName) >= 0); - int i1 = htmlForm.indexOf(parName) + parName.length(); - int i2 = htmlForm.indexOf("\"", i1); - assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); - return htmlForm.substring(i1, i2); - } - private HttpsURLConnection giveConnection(String targetURL, String requestMethod) throws Exception { - HttpsURLConnection conn = (HttpsURLConnection) new URL(targetURL).openConnection(); - conn.setRequestMethod(requestMethod); - conn.setDoInput(true); - conn.setDoOutput(true); - conn.setUseCaches(false); - conn.setAllowUserInteraction(false); - conn.setHostnameVerifier(new HostnameVerifierHack()); - return conn; - } - private class HostnameVerifierHack implements HostnameVerifier { - public boolean verify(String arg0, String arg1) { - return true; - } - } -} diff --git a/id.server/src/test/abnahme/A/Test700SelectBKU.java b/id.server/src/test/abnahme/A/Test700SelectBKU.java deleted file mode 100644 index 9cfa47033..000000000 --- a/id.server/src/test/abnahme/A/Test700SelectBKU.java +++ /dev/null @@ -1,63 +0,0 @@ -package test.abnahme.A; - -import test.abnahme.AbnahmeTestCase; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class Test700SelectBKU extends AbnahmeTestCase { - - public Test700SelectBKU(String name) { - super(name); - } - - public void testA701() throws Exception { - try { - String form = server.selectBKU( - "https://localhost:8443/auth", - "gb", - "https://localhost:9443/", - "file:" + getTestCaseDirectory() + "BKUSelectionTemplate.html", - "file:" + getTestCaseDirectory() + "Template.html"); - //writeXmldata("SelectBKUForm_out.html", form.getBytes()); - assertEqualsIgnoreSessionID(readXmldata("SelectBKUForm.html"), form); - } - catch (Exception ex) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + ex.getLocalizedMessage()); - throw ex; - } - } - public void testA702() throws Exception { - try { - String form = server.selectBKU( - "https://localhost:8443/auth", - "gb", - "https://localhost:9443/", - null, - null); - //writeXmldata("SelectBKUForm_out.html", form.getBytes()); - assertEqualsIgnoreSessionID(readXmldata("SelectBKUForm.html"), form); - } - catch (Exception ex) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + ex.getLocalizedMessage()); - throw ex; - } - } - public void testA703() throws Exception { - try { - String form = server.selectBKU( - "https://localhost:8443/auth", - "gb", - "https://localhost:9443/", - null, - null); - //writeXmldata("SelectBKUForm_out.html", form.getBytes()); - assertEqualsIgnoreSessionID(readXmldata("SelectBKUForm.html"), form); - } - catch (Exception ex) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + ex.getLocalizedMessage()); - throw ex; - } - } -} diff --git a/id.server/src/test/abnahme/AbnahmeTestCase.java b/id.server/src/test/abnahme/AbnahmeTestCase.java deleted file mode 100644 index e0e6fc183..000000000 --- a/id.server/src/test/abnahme/AbnahmeTestCase.java +++ /dev/null @@ -1,163 +0,0 @@ -package test.abnahme; - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; - -import test.MOAIDTestCase; - -import at.gv.egovernment.moa.id.MOAIDException; -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.data.AuthenticationData; - -/** - * Base class for MOA ID test cases. - * - * Provides some utility functions. - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class AbnahmeTestCase extends MOAIDTestCase { - - protected static final String TESTDATA_ROOT = "data/abnahme-test/"; - protected static final String TESTDATA_XMLDATA = "data/abnahme-test/xmldata/"; - protected static final String AUTH_ENDPOINT = "http://localhost:8080/moa-id-auth/"; - protected AuthenticationServer server; - - /** - * Constructor for MOATestCase. - * @param arg0 - */ - public AbnahmeTestCase(String name) { - super(name); - } - /** - * Set up a transaction context with a test configuration. - */ - protected void setUp() throws Exception { - - System.out.print("--------S-T-A-R-T----V-O-N----"); - System.out.print(getName().toUpperCase().substring(4,getName().length())); - System.out.print("-----------------------------\n"); - - // Set moa.spss.server.configuration property - System.setProperty("moa.spss.server.configuration",TESTDATA_ROOT + "conf/moa/ConfigurationTest.xml"); - - // Set moa.id.configuration property - String pathname = findXmldata("Configuration.xml"); - System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, pathname); - System.out.println("Konfiguration " + pathname); - AuthConfigurationProvider.reload(); - - server = AuthenticationServer.getInstance(); - } - /** Test case z.B. "A153" */ - protected String getID() { - return getName().toUpperCase().substring(4,getName().length()); - } - /** Test group z.B. "A100" */ - protected String getTestGroup() { - return getID().substring(0, 2) + "00"; - } - /** Test case data directory */ - protected String getTestCaseDirectory() { - return getTestGroupDirectory() + getID() + "/"; - } - /** Test group data directory */ - protected String getTestGroupDirectory() { - return TESTDATA_XMLDATA + getTestGroup() + "/"; - } - /** Finds a file in the xmldata directory */ - protected String findXmldata(String filename) { - String pathname = getTestCaseDirectory() + filename; - if (! new File(pathname).exists()) { - pathname = getTestGroupDirectory() + filename; - if (! new File(pathname).exists()) { - pathname = TESTDATA_XMLDATA + filename; - } - } - return pathname; - } - /** Finds and reads a file in the xmldata directory */ - protected String readXmldata(String filename) throws IOException { - String pathname = findXmldata(filename); - System.out.println("Read file " + pathname); - return readFile(pathname); - } - protected void writeXmldata(String filename, byte[] content) throws Exception { - String pathname = getTestCaseDirectory() + filename; - System.out.println("Write file " + pathname); - RandomAccessFile raf = new RandomAccessFile(pathname, "rw"); - byte[] data = content; - raf.write(data); - raf.setLength(data.length); - raf.close(); - } - - /** - * Creates a session using standard parameters, - * and returns the session ID. - */ - protected String startAuthentication() throws MOAIDException { - return startAuthentication("https://localhost:9443/"); - } - /** - * Creates a session using standard parameters, - * and returns the session ID. - */ - protected String startAuthentication(String oaURL) throws MOAIDException { - String htmlForm = AuthenticationServer.getInstance().startAuthentication( - "https://localhost:8443/auth", - "gb", - oaURL, - null, - null, - null); - String sessionID = parseSessionIDFromForm(htmlForm); - return sessionID; - } - private String parseSessionIDFromForm(String htmlForm) { - String parName = "MOASessionID="; - assertTrue( - "HTML Form enthält keine SessionID", - htmlForm.indexOf(parName) >= 0); - int i1 = htmlForm.indexOf(parName) + parName.length(); - int i2 = i1; - while(i2 < htmlForm.length() && - (htmlForm.charAt(i2) == '-' || (htmlForm.charAt(i2) >= '0' && htmlForm.charAt(i2) <= '9'))) - i2++; - assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); - return htmlForm.substring(i1, i2); - } - protected String clearSessionID(String htmlForm) { - String sessionID = parseSessionIDFromForm(htmlForm); - int i1 = htmlForm.indexOf(sessionID); - int i2 = i1 + sessionID.length(); - return htmlForm.substring(0, i1) + htmlForm.substring(i2); - } - protected void assertEqualsIgnoreSessionID(String s1, String s2) { - String ss1 = clearSessionID(s1); - String ss2 = clearSessionID(s2); - assertEquals(ss1, ss2); - } - protected void authDataWriter(AuthenticationData authData, String filename) throws Exception - { - writeXmldata("AuthenticationDataNEW.xml", clearSamlAssertion(authData.getSamlAssertion()).getBytes("UTF-8")); - } - - /** - * clearSamlAssertion löscht aus einer beliebiegen String-Repräsentation einer XML-Struktur - * AUSSLIESSLICH die Attribute 'IssueInstant' und 'AssertionID' heraus. - * @param samlAssertion - * @return String - */ - protected String clearSamlAssertion(String samlAssertion) - { - String result = killInclusive(samlAssertion,"IssueInstant='", "'",""); - result = killInclusive(result,"AssertionID='", "'",""); - return result; - } -} \ No newline at end of file diff --git a/id.server/src/test/abnahme/AllTests.java b/id.server/src/test/abnahme/AllTests.java deleted file mode 100644 index 56a38be28..000000000 --- a/id.server/src/test/abnahme/AllTests.java +++ /dev/null @@ -1,49 +0,0 @@ -package test.abnahme; - -import junit.awtui.TestRunner; -import junit.framework.*; - -import test.abnahme.A.Test100StartAuthentication; -import test.abnahme.A.Test200VerifyIdentityLink; -import test.abnahme.A.Test300VerifyAuthBlock; -import test.abnahme.A.Test400GetAuthenticationData; -import test.abnahme.A.Test500StartAuthenticationServlet; -import test.abnahme.A.Test600GetAuthenticationDataService; -import test.abnahme.A.Test700SelectBKU; -import test.abnahme.C.Test100Konfiguration; -import test.abnahme.P.Test100LoginParameterResolver; - - - - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(Test100StartAuthentication.class); - suite.addTestSuite(Test200VerifyIdentityLink.class); - suite.addTestSuite(Test300VerifyAuthBlock.class); - suite.addTestSuite(Test400GetAuthenticationData.class); - suite.addTestSuite(Test500StartAuthenticationServlet.class); - suite.addTestSuite(Test600GetAuthenticationDataService.class); - suite.addTestSuite(Test700SelectBKU.class); - - suite.addTestSuite(Test100LoginParameterResolver.class); - - suite.addTestSuite(Test100Konfiguration.class); - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/id.server/src/test/abnahme/C/Test100Konfiguration.java b/id.server/src/test/abnahme/C/Test100Konfiguration.java deleted file mode 100644 index 7da5a7449..000000000 --- a/id.server/src/test/abnahme/C/Test100Konfiguration.java +++ /dev/null @@ -1,60 +0,0 @@ -package test.abnahme.C; - -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; - -import test.abnahme.AbnahmeTestCase; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ - -public class Test100Konfiguration extends AbnahmeTestCase { - - public Test100Konfiguration(String name) { - super(name); - } - - public void testC001() throws Exception { - try { - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testC002() throws Exception { - try { - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testC003() throws Exception { - try { - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - public void testC051() throws Exception { - try { - // Set moa.id.configuration property - String pathname = findXmldata("ConfigurationC051.xml"); - System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, pathname); - System.out.println("Konfiguration " + pathname); - AuthConfigurationProvider.reload(); - } - catch (Exception e) { - System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); - } - // AuthConfigurationProvider.getInstance().getBKUConnectionParameter().getAcceptedServerCertificates() - } -} diff --git a/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java b/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java deleted file mode 100644 index 21958a367..000000000 --- a/id.server/src/test/abnahme/P/Test100LoginParameterResolver.java +++ /dev/null @@ -1,146 +0,0 @@ -package test.abnahme.P; -import java.util.Map; - -import sun.misc.BASE64Decoder; -import test.abnahme.AbnahmeTestCase; - -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolver; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolverFactory; -import at.gv.egovernment.moa.util.Base64Utils; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ - -public class Test100LoginParameterResolver extends AbnahmeTestCase { - - private static final String CLIENT_IP_ADDRESS = "56.246.75.11"; - private OAConfiguration oaConf; - private LoginParameterResolver lpr; - - public Test100LoginParameterResolver(String name) { - super(name); - } - - private void setUp(String publicURLPrefix) - throws Exception { - - // get configuration data - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(publicURLPrefix); - oaConf = oaParam.getOaConfiguration(); - System.out.println("Parameterübergabe: " + oaConf.getAuthType()); - - // get login parameter resolver - LoginParameterResolverFactory.initialize(); - lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); - } - public void testP101() throws Exception { - try { - // read configuration and set up LoginParameterResolver - setUp("https://testP101:9443/"); - if (! oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) - fail(); - - // assemble authentication data - AuthenticationData authData = new AuthenticationData(); - authData.setFamilyName("Huber"); - authData.setGivenName("Hugo"); - - // resolve login headers - Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); - - // validate login headers - assertEquals(1, loginHeaders.keySet().size()); - System.out.println("Header Authorization: " + loginHeaders.get("Authorization")); - System.out.println("Decoded UserID:Password " + - new String(new BASE64Decoder().decodeBuffer(((String)loginHeaders.get("Authorization")).substring(6)))); - String userIDPassword = "Hugo:Huber"; - String credentials = Base64Utils.encode(userIDPassword.getBytes()); - assertEquals("Basic " + credentials, loginHeaders.get("Authorization")); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - - } - public void testP102() throws Exception { - try { - // read configuration and set up LoginParameterResolver - setUp("https://testP102:9443/"); - if (! oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) - fail(); - - // assemble authentication data - AuthenticationData authData = new AuthenticationData(); - String DATE_OF_BIRTH = "1963-12-29"; - String VPK = "kp6hOq6LRAkLtrqm6EvDm6bMwJw="; - authData.setDateOfBirth(DATE_OF_BIRTH); - authData.setBPK(VPK); - - // resolve login parameters - Map loginParameters = lpr.getAuthenticationParameters(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); - - // validate login headers - assertEquals(2, loginParameters.keySet().size()); - System.out.println("Param1: " + loginParameters.get("Param1")); - System.out.println("Param2: " + loginParameters.get("Param2")); - assertEquals(DATE_OF_BIRTH, loginParameters.get("Param1")); - assertEquals(VPK, loginParameters.get("Param2")); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } - - public void testP103() throws Exception { - try { - // read configuration and set up LoginParameterResolver - setUp("https://localhost:9443/"); - if (! oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) - fail(); - - // assemble authentication data - AuthenticationData authData = new AuthenticationData(); - boolean PUBLIC_AUTH = true; - String BKZ = "FinanzamtWien23Leitstelle"; - boolean QUAL_CERT = false; - String STAMMZAHL = "3456789012"; - authData.setPublicAuthority(PUBLIC_AUTH); - authData.setPublicAuthorityCode(BKZ); - authData.setQualifiedCertificate(QUAL_CERT); - authData.setIdentificationValue(STAMMZAHL); - - // resolve login headers - Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); - - // validate login headers - assertEquals(5, loginHeaders.keySet().size()); - System.out.println("Header Param1: " + loginHeaders.get("Param1")); - System.out.println("Header Param2: " + loginHeaders.get("Param2")); - System.out.println("Header Param3: " + loginHeaders.get("Param3")); - System.out.println("Header Param4: " + loginHeaders.get("Param4")); - System.out.println("Header Param5: " + loginHeaders.get("Param5")); - assertEquals(String.valueOf(PUBLIC_AUTH), loginHeaders.get("Param1")); - assertEquals(BKZ, loginHeaders.get("Param2")); - assertEquals(String.valueOf(QUAL_CERT), loginHeaders.get("Param3")); - assertEquals(STAMMZAHL, loginHeaders.get("Param4")); - assertEquals(CLIENT_IP_ADDRESS, loginHeaders.get("Param5")); - System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); - } - catch (Exception e) { - System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); - throw e; - } - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/AllTests.java b/id.server/src/test/at/gv/egovernment/moa/id/AllTests.java deleted file mode 100644 index 69ed3d12b..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/AllTests.java +++ /dev/null @@ -1,41 +0,0 @@ -package test.at.gv.egovernment.moa.id; - -import test.at.gv.egovernment.moa.id.auth.AuthenticationServerTest; -import test.at.gv.egovernment.moa.id.auth.servlet.GetAuthenticationDataServiceTest; -import test.at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationTest; -import test.at.gv.egovernment.moa.id.config.auth.MOAIDAuthConfigurationProviderTest; -import test.at.gv.egovernment.moa.id.config.proxy.MOAIDProxyConfigurationProviderTest; - -import junit.awtui.TestRunner; -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(AuthenticationServerTest.class); - suite.addTest(test.at.gv.egovernment.moa.id.auth.builder.AllTests.suite()); - suite.addTest(test.at.gv.egovernment.moa.id.auth.parser.AllTests.suite()); - suite.addTestSuite(GetAuthenticationDataServiceTest.class); - suite.addTestSuite(SignatureVerificationTest.class); - suite.addTestSuite(MOAIDAuthConfigurationProviderTest.class); - suite.addTestSuite(MOAIDProxyConfigurationProviderTest.class); - suite.addTest(test.at.gv.egovernment.moa.id.proxy.AllTests.suite()); - - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/UnitTestCase.java b/id.server/src/test/at/gv/egovernment/moa/id/UnitTestCase.java deleted file mode 100644 index 8309a4f7e..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/UnitTestCase.java +++ /dev/null @@ -1,35 +0,0 @@ -package test.at.gv.egovernment.moa.id; - -import test.MOAIDTestCase; - -import at.gv.egovernment.moa.id.config.ConfigurationProvider; - -/** - * Base class for MOA ID test cases. - * - * Provides some utility functions. - * - * @author Patrick Peck - * @version $Id$ - */ -public class UnitTestCase extends MOAIDTestCase { - - protected static final String TESTDATA_ROOT = "data/test/"; - - /** - * Constructor for MOATestCase. - * @param arg0 - */ - public UnitTestCase(String name) { - super(name); - } - /** - * Set up a transaction context with a test configuration. - */ - protected void setUp() throws Exception { - System.setProperty( - ConfigurationProvider.CONFIG_PROPERTY_NAME, - TESTDATA_ROOT + "conf/ConfigurationTest.xml"); - } - -} \ No newline at end of file diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java deleted file mode 100644 index 5acb23dc2..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth; - -import java.util.HashMap; - -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.data.AuthenticationData; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationServerTest extends UnitTestCase { - - public AuthenticationServerTest(String name) { - super(name); - } - - public void testStandard() throws Exception { - doTest( - "standard", - "https://localhost:8443/auth", - "gb", - "https://localhost:9443/", - null, - null); - } - public void doTest(String testdataDirectory, String authURL, String target, String oaURL, String bkuURL, String templateURL) throws Exception { - String testdataRoot = TESTDATA_ROOT + "xmldata/" + testdataDirectory + "/"; - AuthenticationServer server = AuthenticationServer.getInstance(); - String htmlForm = server.startAuthentication(authURL, target, oaURL, templateURL, bkuURL, null); - String sessionID = parseSessionIDFromForm(htmlForm); - String infoboxReadResponse = readFile(TESTDATA_ROOT + "xmldata/testperson1/" + "InfoboxReadResponse.xml"); - HashMap parameters = new HashMap(1); - parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); - - String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, parameters); - String createXMLSignatureRequestShould = readFile(testdataRoot + "CreateXMLSignatureRequest.xml"); - assertXmlEquals(createXMLSignatureRequestShould, createXMLSignatureRequest); - String createXMLSignatureResponse = readFile(testdataRoot + "CreateXMLSignatureResponse.xml"); - String samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); - AuthenticationData authData = server.getAuthenticationData(samlArtifact); - String authDataShould = readFile(testdataRoot + "AuthenticationDataAssertion.xml"); - assertXmlEquals(authDataShould, authData.getSamlAssertion()); - } - private String parseSessionIDFromForm(String htmlForm) { - String parName = "MOASessionID="; - assertTrue("HTML Form enthält keine SessionID", htmlForm.indexOf(parName) >= 0); - int i1 = htmlForm.indexOf(parName) + parName.length(); - int i2 = htmlForm.indexOf("\"", i1); - assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); - return htmlForm.substring(i1, i2); - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java deleted file mode 100644 index 81cdfb9f8..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth; - -import java.security.KeyStore; -import java.util.Enumeration; - -import test.at.gv.egovernment.moa.id.UnitTestCase; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.util.KeyStoreUtils; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDAuthInitialiserTest extends UnitTestCase { - - public MOAIDAuthInitialiserTest(String name) { - super(name); - } - - public void testInit() throws Exception - { -// System.setProperty( -// ConfigurationProvider.CONFIG_PROPERTY_NAME,"C://Programme/ApacheGroup/abnahme/conf/moa-id/SampleMOAIDConfiguration.xml"); -// System.setProperty( -// ConfigurationProvider.CONFIG_PROPERTY_NAME,"D://Daten/_Projects/moa_id_maengel/SampleMOAIDConfiguration.xml"); - SSLUtils.initialize(); - - try { - KeyStore s = KeyStoreUtils.loadKeyStore("pkcs12","file:C:/Programme/ApacheGroup/abnahme/cert/keystore.p12","changeit"); - System.out.println(s.getProvider().getClass().getName()); - Enumeration aliases = s.aliases(); - while (aliases.hasMoreElements()) { - String element = (String) aliases.nextElement(); - System.out.print(element+":"); - System.out.println(s.getCertificate(element).getPublicKey().getAlgorithm()); - System.out.println(s.getCertificate(element).getType()); - } - - - System.out.println(s.getCertificate("pc41408").getPublicKey().getFormat()); - - } - catch (Exception e) {e.printStackTrace();}; - - } - - } diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java deleted file mode 100644 index 2940f0ec7..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java +++ /dev/null @@ -1,33 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import junit.awtui.TestRunner; -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author patrick - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - -// suite.addTestSuite(AuthenticationBlockAssertionBuilderTest.class); - suite.addTestSuite(CreateXMLSignatureBuilderTest.class); -// suite.addTestSuite(GetIdentityLinkFormBuilderTest.class); -// suite.addTestSuite(InfoboxReadRequestBuilderTest.class); -// suite.addTestSuite(PersonDataBuilderTest.class); -// suite.addTestSuite(SAMLArtifactBuilderTest.class); - - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java deleted file mode 100644 index 8cc8797ef..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationBlockAssertionBuilderTest extends UnitTestCase { - private static final String nl = "\n"; - private static final String ISSUER = "Hugo Mustermann"; - private static final String ISSUE_INSTANT = "2003-03-15T22:50:21+01:00"; - private static final String AUTH_URL = "https://auth.moa.gv.at/"; - private static final String TARGET = "Grundbuch"; - private static final String OA_URL = "https://grundbuch.gv.at/"; - private static final String GEB_DAT = "2004-01-02"; - - // wird auch von CreateXMLSignatureBuilderTest verwendet ! - public static final String ASSERTION_SHOULD = -"" + nl + -" " + nl + -" " + nl + -" " + AUTH_URL + "" + nl + -" " + nl + -" " + nl + -" " + TARGET + "" + nl + -" " + nl + -" " + nl + -" " + OA_URL + "" + nl + -" " + nl + -" " + nl + -""; - - public AuthenticationBlockAssertionBuilderTest(String name) { - super(name); - } - - public void testBuild() throws Exception { - AuthenticationBlockAssertionBuilder builder = new AuthenticationBlockAssertionBuilder(); - String assertionBuilt = builder.buildAuthBlock(ISSUER, ISSUE_INSTANT, AUTH_URL, TARGET, "", "", OA_URL, GEB_DAT, null, null); - assertionBuilt = XML_DECL + assertionBuilt; - String assertionShould = XML_DECL + ASSERTION_SHOULD; - assertXmlEquals(assertionShould, assertionBuilt); - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java deleted file mode 100644 index 1f4890dc9..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java +++ /dev/null @@ -1,105 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.id.auth.builder.CreateXMLSignatureRequestBuilder; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class CreateXMLSignatureBuilderTest extends UnitTestCase { - private static final String nl = "\n"; - public static final String TRANSFORMS_INFO = - " " + nl + - " " + nl + - " " + nl + - " " + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + - " " + nl + - " " + nl + - " " + nl + - " text/html" + nl + - " " + nl + - " " + nl; - public static final String REQUEST_SHOULD = -"" + nl + -"" + nl + -" SecureSignatureKeypair" + nl + -" " + nl + -" " + nl + -TRANSFORMS_INFO + -" " + nl + -" " + nl + -" " + nl + -" " + AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD + "" + nl + -" " + nl + -" /saml:Assertion" + nl + -" " + nl + -""; - - - public static final String TRANSFORMS_INFO_SL12 = - " " + nl + - " " + nl + - " " + nl + - " " + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + -"" + nl + - " " + nl + - " " + nl + - " " + nl + - " text/html" + nl + - " " + nl + - " " + nl; - public static final String REQUEST_SHOULD_SL12 = -"" + nl + -"" + nl + -" SecureSignatureKeypair" + nl + -" " + nl + -" " + nl + -TRANSFORMS_INFO_SL12 + -" " + nl + -" " + nl + -" " + nl + -" " + AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD + "" + nl + -" " + nl + -" /saml:Assertion" + nl + -" " + nl + -""; - - - - - public CreateXMLSignatureBuilderTest(String name) { - super(name); - } - - public void testBuild() throws Exception { - // test build for Security Layer version 1.1 and 1.0 - String request = new CreateXMLSignatureRequestBuilder().build( - AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD, "SecureSignatureKeypair", - new String[] {TRANSFORMS_INFO}, - false); - assertXmlEquals(REQUEST_SHOULD, request); - // test build for Security Layer version 1.2 - String requestSL12 = new CreateXMLSignatureRequestBuilder().build( - AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD, "SecureSignatureKeypair", - new String[] {TRANSFORMS_INFO}, - true); - assertXmlEquals(REQUEST_SHOULD_SL12, requestSL12); - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java deleted file mode 100644 index c146984d0..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import java.text.MessageFormat; - -import junit.framework.TestCase; - -import at.gv.egovernment.moa.id.auth.builder.CertInfoVerifyXMLSignatureRequestBuilder; -import at.gv.egovernment.moa.id.auth.builder.GetIdentityLinkFormBuilder; -import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilder; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class GetIdentityLinkFormBuilderTest extends TestCase { - private static String nl = "\n"; - public static String FORM = - "" + nl + - "" + nl + - "" + nl + - "Auslesen der Personenbindung" + nl + - "" + nl + - "" + nl + - "

" + nl + - " " + nl + - " " + nl + - " " + nl + - "
" + nl + - "
" + nl + - " " + nl + - " " + nl + - " " + nl + - "
" + nl + - "" + nl + - ""; - public static String BKU = - "http://localhost:3495/http-security-layer-request"; - - public void testBuild() throws Exception { - String xmlRequest = new InfoboxReadRequestBuilder().build(false, false, null); - String dataURL = "https://1.2.3.4/auth/VerifyIdentityLink?MOASessionID=1234567"; - String infoRequest = new CertInfoVerifyXMLSignatureRequestBuilder().build(false); - String infoDataURL = "https://1.2.3.4/auth/StartAuthentication?Target=gb&OA=https://oa.gv.at/"; - String form = new GetIdentityLinkFormBuilder().build(null, null, xmlRequest, dataURL, infoRequest, infoDataURL, null); - String formShould = MessageFormat.format( - FORM, new Object[] { BKU, xmlRequest, dataURL, infoRequest, infoDataURL }); - assertEquals(formShould, form); - } - public void testBuildCustomBKU() throws Exception { - String xmlRequest = new InfoboxReadRequestBuilder().build(false, false, null); - String dataURL = "https://1.2.3.4/auth/AuthServlet/StartAuthentication?MOASessionID=1234567"; - String infoRequest = new CertInfoVerifyXMLSignatureRequestBuilder().build(false); - String infoDataURL = "https://1.2.3.4/auth/StartAuthentication?Target=gb&OA=https://oa.gv.at/"; - String bkuURL = "http://bku.at/"; - String form = new GetIdentityLinkFormBuilder().build(null, bkuURL, xmlRequest, dataURL, infoRequest, infoDataURL, null); - String formShould = MessageFormat.format( - FORM, new Object[] { bkuURL, xmlRequest, dataURL, infoRequest, infoDataURL }); - assertEquals(formShould, form); - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java deleted file mode 100644 index 24d01f96f..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import org.w3c.dom.Document; -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilder; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class InfoboxReadRequestBuilderTest extends UnitTestCase implements Constants { - - public InfoboxReadRequestBuilderTest(String name) { - super(name); - } - - public void testBuild() throws Exception { - InfoboxReadRequestBuilder builder = new InfoboxReadRequestBuilder(); - String xmlBuilt = builder.build(false, false, null); - Document docBuilt = DOMUtils.parseDocument(xmlBuilt, false, ALL_SCHEMA_LOCATIONS, null); - String xmlBuiltSerialized = DOMUtils.serializeNode(docBuilt); - // xmlShould was generated by Hot:Sign Tester - String xmlShould = "IdentityLink"; - assertXmlEquals(xmlShould, xmlBuiltSerialized); - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java deleted file mode 100644 index 504679fd5..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; -import at.gv.egovernment.moa.util.Constants; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class PersonDataBuilderTest extends UnitTestCase implements Constants { - - /** - * Constructor for PersonDataBuilderTest. - */ - public PersonDataBuilderTest(String arg) { - super(arg); - } - public void testBuild() throws Exception { - String xmlInfoboxReadResponse = readFile("data/test/xmldata/testperson1/InfoboxReadResponse.xml"); - IdentityLink il = new InfoboxReadResponseParser(xmlInfoboxReadResponse).parseIdentityLink(); - String xmlPersonData = new PersonDataBuilder().build(il, true); - String xmlPersonDataShould = "123456789012http://reference.e-government.gv.at/names/persondata/20020228#zmr-zahlHermannMuster1968-10-22"; - assertPersonDataEquals(xmlPersonDataShould, xmlPersonData); - } - public void testBuildNoZMRZahl() throws Exception { - String xmlInfoboxReadResponse = readFile("data/test/xmldata/testperson1/InfoboxReadResponse.xml"); - IdentityLink il = new InfoboxReadResponseParser(xmlInfoboxReadResponse).parseIdentityLink(); - String xmlPersonData = new PersonDataBuilder().build(il, false); - String xmlPersonDataShould = XML_DECL + "HermannMuster1968-10-22"; - assertPersonDataEquals(xmlPersonDataShould, xmlPersonData); - } - private void assertPersonDataEquals(String s1, String s2) throws Exception { - String ss1 = insertPrNS(s1); - String ss2 = insertPrNS(s2); - assertXmlEquals(ss1, ss2); - } - private String insertPrNS(String xmlPersonData) { - int startNS = xmlPersonData.indexOf("Person") + "Person".length() + 1; - String s = - xmlPersonData.substring(0, startNS) + - "xmlns:pr=\"" + PD_NS_URI + "\" " + - "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + - xmlPersonData.substring(startNS); - return s; - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java deleted file mode 100644 index 3ec73ee4c..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import at.gv.egovernment.moa.id.BuildException; -import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder; -import at.gv.egovernment.moa.util.Base64Utils; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLArtifactBuilderTest extends UnitTestCase { - - private static final String AUTH_URL = "https://moa.gv.at/auth/"; - private static final String SESSION_ID_1 = "123456"; - private static final String SESSION_ID_2 = "123457"; - private static final String SESSION_ID_3 = "1234567"; - - private SAMLArtifactBuilder builder; - private byte[] artifact1; - private byte[] artifact2; - private byte[] artifact3; - - public SAMLArtifactBuilderTest(String name) { - super(name); - } - protected void setUp() throws Exception { - builder = new SAMLArtifactBuilder(); - artifact1 = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_1), false); - artifact2 = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_2), false); - artifact3 = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_3), false); - } - - public void testBuildArtifactLength() throws BuildException { - assertEquals(42, artifact1.length); - assertEquals(42, artifact2.length); - assertEquals(42, artifact3.length); - } - public void testBuildSameArtifact() throws Exception { - byte[] artifact1Clone = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_1), false); - assertEquals(new String(artifact1), new String(artifact1Clone)); - } - public void testBuildDifferentArtifacts() throws BuildException { - String msg = "SAML Artifacts should be different"; - assertFalse(msg, new String(artifact1).equals(new String(artifact2))); - assertFalse(msg, new String(artifact1).equals(new String(artifact3))); - assertFalse(msg, new String(artifact3).equals(new String(artifact2))); - } - - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java deleted file mode 100644 index 5b3bb5906..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java +++ /dev/null @@ -1,93 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.builder; - -import java.io.FileInputStream; -import java.io.RandomAccessFile; - -import org.w3c.dom.Element; -import test.at.gv.egovernment.moa.id.auth.invoke.MOASPSSTestCase; - -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -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.parser.CreateXMLSignatureResponseParser; -import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; -import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; - - - -/** - * Test case for the signature verification web service. - * - * This test requires a running SignatureVerification web service. - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class VerifyXMLSignatureRequestBuilderTest extends MOASPSSTestCase { - - - private SignatureVerificationInvoker caller; - - public VerifyXMLSignatureRequestBuilderTest(String name) { - super(name); - } - - public void setUp() { - System.setProperty( - ConfigurationProvider.CONFIG_PROPERTY_NAME, - "data/test/conf/ConfigurationTest.xml"); - caller = new SignatureVerificationInvoker(); - } - - public void testVerifyXMLSignatureRequestBuilderIdentityLink() throws Exception { - - RandomAccessFile infoBox = new RandomAccessFile( - "data/test/xmldata/testperson1/InfoboxReadResponse.xml","r"); - byte[] b = new byte[(int) infoBox.length()]; - infoBox.read(b); - infoBox.close(); - String xmlInfoboxReadResponse = new String(b, "UTF-8"); - - - RandomAccessFile vr = new RandomAccessFile( - "data/test/xmldata/standard/VerifyXMLSignatureRequestIdentityLink.xml","r"); - b = new byte[(int) vr.length()]; - vr.read(b); - vr.close(); - String xmlResponse = new String(b, "UTF-8"); - - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - - Element requestBuild = vsrb.build(idl, authConf.getMoaSpIdentityLinkTrustProfileID()); - - assertXmlEquals(requestBuild, xmlResponse); - - } - - public void testVerifyXMLSignature2() throws Exception { - - RandomAccessFile s = new RandomAccessFile("data/test/xmldata/standard/CreateXMLSignatureResponse.xml","r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - s.close(); - String xmlCreateXMLSignatureResponse = new String(b, "UTF-8"); - - CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); - CreateXMLSignatureResponse csr = cXMLsrp.parseResponse(); - - VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - - Element request = vsrb.build(csr, authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(), authConf.getMoaSpIdentityLinkTrustProfileID()); - - // check the result - assertXmlEquals(request, new FileInputStream("data/test/xmldata/standard/VerifyXMLSignatureRequestCreateXML.xml")); - - } - } diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java deleted file mode 100644 index 7ae6f70ef..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java +++ /dev/null @@ -1,38 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.invoke; - -import java.security.Security; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/** - * Base class for end-to-end tests of MOA web-services. - * - * Initializes the test system and provides some properties. - * - * @author Patrick Peck - * @version $Id$ - */ -public class MOASPSSTestCase extends UnitTestCase { - - public MOASPSSTestCase(String name) { - super(name); - } - - - protected void setupSSL() { - System.setProperty("javax.net.debug", "all"); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty( - "java.protocol.handler.pkgs", - "com.sun.net.ssl.internal.www.protocol"); - System.setProperty( - "javax.net.ssl.keyStore", - "data/test/security/client.keystore"); - System.setProperty("javax.net.ssl.keyStorePassword", "changeit"); - System.setProperty( - "javax.net.ssl.trustStore", - "data/test/security/client.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java deleted file mode 100644 index 0648163d5..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java +++ /dev/null @@ -1,166 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.invoke; - -import java.io.RandomAccessFile; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -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.data.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; -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.invoke.SignatureVerificationInvoker; -import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.util.DOMUtils; - - - -/** - * Test case for the signature verification web service. - * - * This test requires a running SignatureVerification web service. - * - * @author Patrick Peck - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SignatureVerificationTest extends MOASPSSTestCase { - - - private SignatureVerificationInvoker caller; - - public SignatureVerificationTest(String name) { - super(name); - } - - public void setUp() { -System.setProperty( - ConfigurationProvider.CONFIG_PROPERTY_NAME, - "data/test/conf/ConfigurationTest.xml"); - caller = new SignatureVerificationInvoker(); - } - -/* public void testVerifyCMSSignature() throws Exception { - Element request = - parseXml("data/test/xml/VCSQ000.xml").getDocumentElement(); - Element result; - - // call the service - result = caller.verifyXMLSignature(request); - - // check the result - assertEquals("VerifyCMSSignatureResponse", result.getTagName()); - }*/ - - public void testVerifyXMLSignature1() throws Exception { - - //Momentan zeigt die Konfiguration als Endpunkt aus localhost:8081 zum - //Protokollieren per TCPMon... der ECHT Endpunkt ist 10.16.46.108:8080 - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/testperson1/InfoboxReadResponse.xml","r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlInfoboxReadResponse =new String(b,"UTF8"); - - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); - IdentityLink idl = irrp.parseIdentityLink(); - VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - - Element request = vsrb.build(idl, authConf.getMoaSpIdentityLinkTrustProfileID()); - s =new RandomAccessFile("D://PatricksVerifyXMLSignatureRequestWithInfoboxReadResponse.xml","rw"); - s.write(DOMUtils.serializeNode(request).getBytes("UTF-8")); - s.close(); -// Element request = DOMUtils.parseDocument(vsrb.build(xmlInfoboxReadResponse,"TrustProfile1"),false,null,null).getDocumentElement(); -// Element request = DOMUtils.parseDocument(xmlInfoboxReadResponse,false,null,null).getDocumentElement(); -// call the service - Element response = caller.verifyXMLSignature(request); - VerifyXMLSignatureResponseParser vParser = new VerifyXMLSignatureResponseParser(response); - VerifyXMLSignatureResponse vData = vParser.parseData(); - VerifyXMLSignatureResponseValidator vValidate = VerifyXMLSignatureResponseValidator.getInstance(); - vValidate.validate(vData, authConf.getIdentityLinkX509SubjectNames(), VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, true); - vValidate.validateCertificate(vData,idl); - - // check the result - assertXmlEquals(response, request); - - } - - public void testVerifyXMLSignature2() throws Exception { - // Prüft den 2. Aufruf mit dem CreateXMLSIgnatureResponse als Parameter - //Momentan zeigt die Konfiguration als Endpunkt aus localhost:8081 zum - //Protokollieren per TCPMon... der ECHT Endpunkt ist 10.16.46.108:8080 - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/standard/CreateXMLSignatureResponse.xml","r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlCreateXMLSignatureResponse = new String(b, "UTF8"); - - CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); -// CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); - CreateXMLSignatureResponse csr = cXMLsrp.parseResponse(); - - VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - - Element request = vsrb.build(csr, authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(), authConf.getMoaSpIdentityLinkTrustProfileID()); - // Element request = DOMUtils.parseDocument(vsrb.build(xmlInfoboxReadResponse,"TrustProfile1"),false,null,null).getDocumentElement(); -// Element request = DOMUtils.parseDocument(xmlInfoboxReadResponse,false,null,null).getDocumentElement(); - Element result; -/*s =new RandomAccessFile("D://PatricksVerifyXMLSignatureRequestWithAuthBlock.xml","rw"); - s.write(DOMUtils.serializeNode(request).getBytes("UTF-8")); - s.close();*/ - // call the service - result = caller.verifyXMLSignature(request); - // check the result - assertEquals("VerifyXMLSignatureResponse", result.getTagName()); - - } - - - public void testParseCreateXMLSignatureResponse() throws Exception { - - //Später soll die Datei direkt vom Server geholt werden... - - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/standard/CreateXMLSignatureResponse.xml", - - "r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlCreateXMLSignatureResponse = new String(b, "UTF-8"); - - CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); - CreateXMLSignatureResponse csr = cXMLsrp.parseResponse(); - - } - - public void testParseVerifyXMLSignatureResponse() throws Exception { - - //Später soll die Datei direkt vom Server geholt werden... - - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/standard/VerifyXMLSignaterResponse.xml", - - "r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlVerifyXMLSignatureResponse = new String(b, "UTF-8"); - - VerifyXMLSignatureResponseParser vXMLsrp = new VerifyXMLSignatureResponseParser(xmlVerifyXMLSignatureResponse); - VerifyXMLSignatureResponse vsr = vXMLsrp.parseData(); - - } - - - } diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java deleted file mode 100644 index 84f5110b0..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.parser; - -import junit.awtui.TestRunner; -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(IdentityLinkAssertionParserTest.class); - suite.addTestSuite(SAMLArtifactParserTest.class); - - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java deleted file mode 100644 index c29c1eedf..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java +++ /dev/null @@ -1,137 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.parser; - -import iaik.security.rsa.RSAPublicKey; - -import java.io.FileOutputStream; -import java.io.RandomAccessFile; -import java.security.PublicKey; - -import org.w3c.dom.Document; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.util.ECDSAKeyValueConverter; -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.validator.IdentityLinkValidator; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class IdentityLinkAssertionParserTest extends UnitTestCase { - - IdentityLinkAssertionParser ilap; - - public IdentityLinkAssertionParserTest(String name) { - super(name); - } - - public void setUp() { - try { - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/testperson1/InfoboxReadResponse.xml", - "r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlInfoboxReadResponse = new String(b, "UTF-8"); - - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); - ilap = new IdentityLinkAssertionParser(irrp.parseSAMLAssertion()); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public void testParseIdentityLink() throws Exception { - IdentityLink idl = ilap.parseIdentityLink(); - System.out.println(idl.getGivenName()); - System.out.println(idl.getFamilyName()); - System.out.println(idl.getDateOfBirth()); - System.out.println(idl.getIdentificationValue()); - - VerifyXMLSignatureRequestBuilder vx = new VerifyXMLSignatureRequestBuilder(); - - // Element zurück bekommen: vx.build(idl.getSamlAssertion()); - - IdentityLinkValidator idVali = IdentityLinkValidator.getInstance(); - idVali.validate(idl); - - } - -// public void testParseIdentityLinkECC() throws Exception { -// RandomAccessFile s = -// new RandomAccessFile( -// "data/test/xmldata/IL.ResponseToRequest.01.ECDSA.xml", -// "r"); -// byte[] b = new byte[(int) s.length()]; -// s.read(b); -// String xmlInfoboxReadResponse = new String(b); -// InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); -// String SAML = irrp.parseSAMLAssertion(); -// ilap = new IdentityLinkAssertionParser(SAML); -// IdentityLink idl = ilap.parseIdentityLink(); -// System.out.println(idl.getGivenName()); -// System.out.println(idl.getFamilyName()); -// System.out.println(idl.getDateOfBirth()); -// System.out.println(idl.getIdentificationValue()); -// -// VerifyXMLSignatureRequestBuilder vx = new VerifyXMLSignatureRequestBuilder(); -// -// // Element zurück bekommen: vx.build(idl.getSamlAssertion()); -// -// IdentityLinkValidator idVali = IdentityLinkValidator.getInstance(); -// idVali.validate(idl); -// -// } - - public void testRSAPublicKeys() throws Exception { - if (ilap.getPublicKeys()[0].getClass().getName().equals("iaik.security.rsa.RSAPublicKey")) - { - - for (int i = 0; i < ilap.getPublicKeys().length; i++) { - RSAPublicKey result = (RSAPublicKey)ilap.getPublicKeys()[i]; - System.out.println("RSA Public Key No" + i); - System.out.println("Modulus: " + result.getModulus()); - System.out.println("Exponent: " + result.getPublicExponent()); - } - - } - } - - public void testECDSAPublicKeys() throws Exception { - - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/ECDSAKeyExample.xml", - "r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String ecdsaKey = new String(b, "UTF-8"); - Document e = DOMUtils.parseDocument(ecdsaKey,true,Constants.ALL_SCHEMA_LOCATIONS, null); - PublicKey p = ECDSAKeyValueConverter.element2ECDSAPublicKey(e.getDocumentElement()); - - } - - - public void testDsigCertificates() throws Exception { - - String[] result = ilap.getCertificates(); - for (int i = 0; i < result.length; i++) { - - System.out.println("DSIG Certificate Length: " + result[i].length() + " No" + i + "\n" + result[i]); - FileOutputStream raf = new FileOutputStream("data/test/certs/cert" + i + ".cer"); - raf.write(result[i].getBytes()); - raf.flush(); - raf.close(); - } - - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java deleted file mode 100644 index 9a878be2c..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.parser; - -import java.io.RandomAccessFile; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.auth.data.IdentityLink; -import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; -import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class InfoboxReadResponseParserTest extends UnitTestCase { - - IdentityLinkAssertionParser ilap; - - public InfoboxReadResponseParserTest(String name) { - super(name); - } - - public void setUp() { - } - - public void testParseInfoboxReadResponse() throws Exception { - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/testperson1/InfoboxReadResponse.xml", - "r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlInfoboxReadResponse = new String(b, "UTF-8"); - - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); - ilap = new IdentityLinkAssertionParser(irrp.parseSAMLAssertion()); - - IdentityLink idl = ilap.parseIdentityLink(); - System.out.println(idl.getGivenName()); - System.out.println(idl.getFamilyName()); - System.out.println(idl.getDateOfBirth()); - System.out.println(idl.getIdentificationValue()); - - } - - public void testParseInfoboxReadResponseError() throws Exception { - RandomAccessFile s = - new RandomAccessFile( - "data/test/xmldata/ErrorResponse.xml", - "r"); - byte[] b = new byte[(int) s.length()]; - s.read(b); - String xmlInfoboxReadResponse = new String(b, "UTF-8"); - - InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); - ilap = new IdentityLinkAssertionParser(irrp.parseSAMLAssertion()); - - IdentityLink idl = ilap.parseIdentityLink(); - System.out.println(idl.getGivenName()); - System.out.println(idl.getFamilyName()); - System.out.println(idl.getDateOfBirth()); - System.out.println(idl.getIdentificationValue()); - - } - - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java deleted file mode 100644 index 992e799bd..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.parser; - -import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder; -import at.gv.egovernment.moa.id.auth.parser.SAMLArtifactParser; -import at.gv.egovernment.moa.id.util.Random; -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLArtifactParserTest extends UnitTestCase { - - private static String URL1 = "http://moa.gv.at/auth"; - private static String URL2 = "https://moa.gv.at/auth"; - - public SAMLArtifactParserTest(String name) { - super(name); - } - - public void testParseTypeCode() throws Exception { - String sessionID = Random.nextRandom(); - String samlArtifact = new SAMLArtifactBuilder().build(URL1, sessionID); - byte[] typeCode = new SAMLArtifactParser(samlArtifact).parseTypeCode(); - assertEquals(typeCode[0], 0); - assertEquals(typeCode[1], 1); - } - public void testParseAssertionHandleSameSessionID() throws Exception { - // SAML artifacts for different authURL's but same sessionID MUST give same assertion handle - String sessionID = Random.nextRandom(); - String samlArtifact1 = new SAMLArtifactBuilder().build(URL1, sessionID); - String samlArtifact2 = new SAMLArtifactBuilder().build(URL2, sessionID); - String assertionHandle1 = new SAMLArtifactParser(samlArtifact1).parseAssertionHandle(); - String assertionHandle2 = new SAMLArtifactParser(samlArtifact2).parseAssertionHandle(); - assertEquals(assertionHandle1, assertionHandle2); - } - public void testParseAssertionHandleSameURL() throws Exception { - // SAML artifacts for same authURL but different sessionID's MUST give different assertion handles - String sessionID1 = Random.nextRandom(); - String sessionID2 = Random.nextRandom(); - String samlArtifact1 = new SAMLArtifactBuilder().build(URL1, sessionID1); - String samlArtifact2 = new SAMLArtifactBuilder().build(URL1, sessionID2); - String assertionHandle1 = new SAMLArtifactParser(samlArtifact1).parseAssertionHandle(); - String assertionHandle2 = new SAMLArtifactParser(samlArtifact2).parseAssertionHandle(); - assertFalse(assertionHandle1.equals(assertionHandle2)); - } - public void testParseAssertionHandleSameSAMLArtifact() throws Exception { - // SAML artifact parsed twice MUST give same assertion handle each time - String sessionID = Random.nextRandom(); - String samlArtifact = new SAMLArtifactBuilder().build(URL1, sessionID); - String assertionHandle1 = new SAMLArtifactParser(samlArtifact).parseAssertionHandle(); - String assertionHandle2 = new SAMLArtifactParser(samlArtifact).parseAssertionHandle(); - assertEquals(assertionHandle1, assertionHandle2); - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java b/id.server/src/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java deleted file mode 100644 index c78651fdb..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java +++ /dev/null @@ -1,91 +0,0 @@ -package test.at.gv.egovernment.moa.id.auth.servlet; - -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.auth.servlet.GetAuthenticationDataService; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Test case instantiates GetAuthenticationDataService and calls the Request() method. - * It DOES NOT call the web service via Axis. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class GetAuthenticationDataServiceTest extends UnitTestCase implements Constants { - - private GetAuthenticationDataService service; - - public GetAuthenticationDataServiceTest(String arg0) { - super(arg0); - } - protected void setUp() throws Exception { - service = new GetAuthenticationDataService(); - } - - public void testService2Requests() throws Exception { - String requestString = - "" + - "" + - "123" + - ""; - Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - Element response = service.Request(new Element[] {request, request})[0]; - assertStatus(response, "samlp:Requester", "samlp:TooManyResponses"); - } - public void testServiceNoSAMLArtifact() throws Exception { - String requestString = - "" + - "" + - "123" + - ""; - Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - Element response = service.Request(new Element[] {request})[0]; - assertStatus(response, "samlp:Requester", null); - } - public void testService2SAMLArtifacts() throws Exception { - String requestString = - "" + - "" + - "123" + - "456" + - ""; - Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - Element response = service.Request(new Element[] {request})[0]; - assertStatus(response, "samlp:Requester", "samlp:TooManyResponses"); - } - public void testServiceWrongFormat() throws Exception { - String requestString = - "" + - "" + - ""; - Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - Element response = service.Request(new Element[] {request})[0]; - assertStatus(response, "samlp:Requester", null); - } - public void testServiceWrongSAMLArtifact() throws Exception { - String requestString = - "" + - "" + - "WRONGARTIFACT" + - ""; - Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - Element response = service.Request(new Element[] {request})[0]; - assertStatus(response, "samlp:Requester", "samlp:ResourceNotRecognized"); - } - private void assertStatus(Element response, String statusCodeShould, String subStatusCodeShould) throws Exception { - Element statusCodeNode = (Element)XPathUtils.selectSingleNode(response, "//samlp:StatusCode"); - String statusCode = statusCodeNode.getAttribute("Value"); - Element subStatusCodeNode = (Element)XPathUtils.selectSingleNode(statusCodeNode, "//samlp:StatusCode/samlp:StatusCode"); - String subStatusCode = subStatusCodeNode == null ? null : subStatusCodeNode.getAttribute("Value"); - System.out.println(statusCode + subStatusCode); - assertEquals(statusCodeShould, statusCode); - assertEquals(subStatusCodeShould, subStatusCode); - } - - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java deleted file mode 100644 index 655c33fd9..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java +++ /dev/null @@ -1,112 +0,0 @@ -package test.at.gv.egovernment.moa.id.config.auth; - -import java.util.Map; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; - -/** - * @author Stefan Knirsch - * @version $Id$ - */ -public class MOAIDAuthConfigurationProviderTest extends UnitTestCase { - private AuthConfigurationProvider provider; - - /** - * Constructor for MOAAuthConfigTest. - * @param name - */ - public MOAIDAuthConfigurationProviderTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - - provider = - new AuthConfigurationProvider(TESTDATA_ROOT + "conf/ConfigurationTest.xml"); - - } - public void testGetTransformsInfoFileNames() { - String[] transformsInfoFileNames; - transformsInfoFileNames = provider.getTransformsInfoFileNames(); -// for (int i = 0; i < transformsInfoFileNames.length; i++) { -// System.out.println( -// "getTransformsInfoFileNames: " + transformsInfoFileNames[i]); - assertEquals(transformsInfoFileNames[0],"http://StringsecLayerTranformsInfo1"); - assertEquals(transformsInfoFileNames[1],"http://StringsecLayerTranformsInfo2"); -// } - - } - - public void testGetMOASPConnectionParameters() { - ConnectionParameter cp; - cp = provider.getMoaSpConnectionParameter(); - assertEquals(cp.getUrl(),"MOA-SP-URL"); - assertEquals(cp.getAcceptedServerCertificates(),"http://AcceptedServerCertificates"); - assertEquals(cp.getClientKeyStorePassword(),"Keystore Pass"); - assertEquals(cp.getClientKeyStore(),"URLtoClientKeystoreAUTH"); -/* System.out.println(); - System.out.println("getMoaSpConnectionParameter :" + cp.getUrl()); - System.out.println( - "getMoaSpConnectionParameter :" + cp.getAcceptedServerCertificates()); - System.out.println( - "getMoaSpConnectionParameter :" + cp.getClientKeyStorePassword()); - System.out.println( - "getMoaSpConnectionParameter :" + cp.getClientKeyStore());*/ - } - public void testGetMoaSpIdentityLinkTrustProfileID() { - - assertEquals(provider.getMoaSpIdentityLinkTrustProfileID(),"StringVerifyIdentiyLinkTrustID"); - - } - public void testGetMoaSpAuthBlockTrustProfileID() { - assertEquals(provider.getMoaSpAuthBlockTrustProfileID(),"StringVerifyAuthBlockTransformID"); - } - - public void testGetMoaSpAuthBlockVerifyTransformsInfoIDs() { - String[] result = provider.getMoaSpAuthBlockVerifyTransformsInfoIDs(); - assertEquals(result[0],"StringVerifyTransformsInfoID1"); - assertEquals(result[1],"StringVerifyTransformsInfoID2"); - - } - - public void testGetOnlineApplicationAuthParameter() { - OAAuthParameter[] result = provider.getOnlineApplicationParameters(); - - assertEquals(result[0].getPublicURLPrefix(),"StringOALoginURL"); - assertEquals(result[0].getProvideStammzahl(),false); - assertEquals(result[0].getProvideAuthBlock(),false); - assertEquals(result[0].getProvideIdentityLink(),false); - - assertEquals(result[1].getPublicURLPrefix(),"StringOALoginURL2"); - assertEquals(result[1].getProvideStammzahl(),true); - assertEquals(result[1].getProvideAuthBlock(),true); - assertEquals(result[1].getProvideIdentityLink(),true); - - -/* for (int i = 0; i < result.length; i++) { - System.out.println(); - System.out.println("getOnlineApplicationParameters Url: " + result[i].getUrl()); - System.out.println("getOnlineApplicationParameters ProvideStammzahl: " + result[i].getProvideStammzahl()); - System.out.println("getOnlineApplicationParameters ProvideAuthBlock: " + result[i].getProvideAuthBlock()); - System.out.println("getOnlineApplicationParameters ProvideIdentityLink: " + result[i].getProvideIdentityLink()); - }*/ - } - - public void testGetGenericConfiguration() { - Map result = provider.getGenericConfiguration(); - assertEquals(result.containsKey("Generic Name 1"),true); - assertEquals(result.containsKey("Generic Name 2"),true); - assertEquals(result.get("Generic Name 1"),"Value1"); - assertEquals(result.get("Generic Name 2"),"Value2"); - /* for (Iterator iter = result.keySet().iterator(); iter.hasNext();) { - String element = (String) iter.next(); - System.out.println("getGenericConfiguration Key:" + element); - System.out.println("getGenericConfiguration Value:" + result.get(element)); - }*/ - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java b/id.server/src/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java deleted file mode 100644 index ec6a65581..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java +++ /dev/null @@ -1,127 +0,0 @@ -package test.at.gv.egovernment.moa.id.config.proxy; - -import java.util.Map; - -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - - - -/** - * @author Stefan Knirsch - * @version $Id$ - */ -public class MOAIDProxyConfigurationProviderTest extends UnitTestCase { - private ProxyConfigurationProvider provider; - - /** - * Constructor for MOAProxyConfigTest. - * @param name - */ - public MOAIDProxyConfigurationProviderTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - - provider = -// new ProxyConfigurationProvider(TESTDATA_ROOT + "conf/ConfigurationTest.xml"); - new ProxyConfigurationProvider("data/deploy/conf/moa-id/ConfigurationTest.xml"); - } - public void testGetAuthComponentConnectionParameter() - { - ConnectionParameter cp; - cp = provider.getAuthComponentConnectionParameter(); - assertEquals(cp.getUrl(),"AuthComponentURL"); - assertEquals( cp.getAcceptedServerCertificates(),"http://www.altova.com"); - assertEquals(cp.getClientKeyStorePassword(),"String"); - assertEquals(cp.getClientKeyStore(),"http://www.altova.com"); - /* System.out.println(); - System.out.println("getProxyComponentConnectionParameter :" + cp.getUrl()); - System.out.println( - "getProxyComponentConnectionParameter :" + cp.getAcceptedServerCertificates()); - System.out.println( - "getProxyComponentConnectionParameter :" + cp.getClientKeyStorePassword()); - System.out.println( - "getProxyComponentConnectionParameter :" + cp.getClientKeyStore());*/ -} - - public void testGetOAProxyParameter() { - OAProxyParameter[] result = provider.getOnlineApplicationParameters(); - - assertEquals("http://localhost:9080/", result[0].getPublicURLPrefix()); - assertEquals("file:data/test/conf/OAConfParamAuth.xml", result[0].getConfigFileURL()); - assertEquals(10, result[0].getSessionTimeOut()); - assertEquals("StringloginParameterResolverImpl1", result[0].getLoginParameterResolverImpl()); - assertEquals("StringconnectionBuilderImpl1", result[0].getConnectionBuilderImpl()); - - assertEquals("ProxyComponentURL", result[0].getConnectionParameter().getUrl()); - assertEquals("url:AcceptedServerCertificates", result[0].getConnectionParameter().getAcceptedServerCertificates()); - assertEquals("URL:toClientKeystoreOA", result[0].getConnectionParameter().getClientKeyStore()); - assertEquals("ClientKeystoreOAPAss", result[0].getConnectionParameter().getClientKeyStorePassword()); - - assertEquals("StringOALoginURL2", result[1].getPublicURLPrefix()); - assertEquals("file:data/test/conf/OAConfHeaderAuth.xml", result[1].getConfigFileURL()); - assertEquals(20, result[1].getSessionTimeOut()); - assertEquals("StringloginParameterResolverImpl2",result[1].getLoginParameterResolverImpl()); - assertEquals("StringconnectionBuilderImpl2", result[1].getConnectionBuilderImpl()); - - assertEquals("ProxyComponentURL2", result[1].getConnectionParameter().getUrl()); - assertEquals("url:AcceptedServerCertificates2", result[1].getConnectionParameter().getAcceptedServerCertificates()); - assertEquals("URL:toClientKeystoreOA2", result[1].getConnectionParameter().getClientKeyStore()); - assertEquals("ClientKeystoreOAPAss2", result[1].getConnectionParameter().getClientKeyStorePassword()); - - assertEquals("StringOALoginURL3", result[2].getPublicURLPrefix()); - assertEquals("file:data/test/conf/OAConfBasicAuth.xml", result[2].getConfigFileURL()); - assertEquals(20, result[2].getSessionTimeOut()); - assertEquals("StringloginParameterResolverImpl3",result[2].getLoginParameterResolverImpl()); - assertEquals("StringconnectionBuilderImpl3", result[2].getConnectionBuilderImpl()); - - assertEquals("ProxyComponentURL3", result[2].getConnectionParameter().getUrl()); - assertEquals("url:AcceptedServerCertificates3", result[2].getConnectionParameter().getAcceptedServerCertificates()); - assertEquals("URL:toClientKeystoreOA3", result[2].getConnectionParameter().getClientKeyStore()); - assertEquals("ClientKeystoreOAPAss3", result[2].getConnectionParameter().getClientKeyStorePassword()); - } - - public void testGetGenericConfiguration() { - Map result = provider.getGenericConfiguration(); - assertEquals(true, result.containsKey("authenticationSessionTimeOut")); - assertEquals(true, result.containsKey("authenticationDataTimeOut")); - assertEquals("600", result.get("authenticationSessionTimeOut")); - assertEquals("120", result.get("authenticationDataTimeOut")); - } - - public void testOAConfigurationProvider() throws Exception - { - OAProxyParameter[] result = provider.getOnlineApplicationParameters(); - // für jeden Parameter müsste theoretisch bereits ein Provider instanziiert worden sein, - // aus diesem Grund braucht man NICHT mehr die File-URL anzugeben, PublicURLPrefix reicht - - // sollte ParamAuth sein - OAConfiguration oac1 = result[0].getOaConfiguration(); - assertEquals(OAConfiguration.PARAM_AUTH, oac1.getAuthType()); - assertEquals("MOADateOfBirth", oac1.getParamAuthMapping().get("Param1")); - assertEquals("MOABPK", oac1.getParamAuthMapping().get("Param2")); - // sollte HeaderAuth sein - OAConfiguration oac2 = result[1].getOaConfiguration(); - assertEquals(OAConfiguration.HEADER_AUTH, oac2.getAuthType()); - assertEquals("MOAPublicAuthority", oac2.getHeaderAuthMapping().get("Param1")); - assertEquals("MOABKZ", oac2.getHeaderAuthMapping().get("Param2")); - assertEquals("MOAQualifiedCertificate", oac2.getHeaderAuthMapping().get("Param3")); - assertEquals("MOAStammzahl", oac2.getHeaderAuthMapping().get("Param4")); - assertEquals("MOAIPAddress", oac2.getHeaderAuthMapping().get("Param5")); - - // sollte BasicAuth sein - OAConfiguration oac3 = result[2].getOaConfiguration(); - assertEquals(OAConfiguration.BASIC_AUTH, oac3.getAuthType()); - assertEquals("MOAGivenName", oac3.getBasicAuthUserIDMapping()); - assertEquals("MOAFamilyName", oac3.getBasicAuthPasswordMapping()); - //Fehlerfall: - - - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/proxy/AllTests.java b/id.server/src/test/at/gv/egovernment/moa/id/proxy/AllTests.java deleted file mode 100644 index 2dd6cd35e..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/proxy/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -package test.at.gv.egovernment.moa.id.proxy; - -import test.at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilderTest; -import test.at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParserTest; -import junit.awtui.TestRunner; -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author Paul Ivancsics - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(SAMLRequestBuilderTest.class); - suite.addTestSuite(SAMLResponseParserTest.class); - - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java b/id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java deleted file mode 100644 index aec14ce1c..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java +++ /dev/null @@ -1,462 +0,0 @@ -package test.at.gv.egovernment.moa.id.proxy.builder; - -import java.io.PrintStream; -import java.util.ArrayList; - -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -import at.gv.egovernment.moa.util.Base64Utils; - -/** - * @author Administrator - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - */ -public class DOMTreeCompare { - - boolean debug = true; - - private static PrintStream Log = null; - - static - { - Log = System.out; - } - - public boolean compareElements(Element root1, Element root2) - { - //Log.println("----- Compare Elements:"+root1.getNodeName()+" "+root2.getNodeName()); - filterTree(root1); - filterTree(root2); - return compareNodes(root1,root2,0,"root/",false); - } - - private boolean compareNodes(Node n1, Node n2, int level,String path,boolean attribute) - { - /*try { - Log.println(DOMUtils.serializeNode(n1)); - } - catch(Exception e) - { - e.printStackTrace(); - }*/ - boolean equal = false; - //Log.println("----- Compare Node "+level+":"+n1+" "+n2); - //Log.println("----- Compare Node "+level+":"+n1.getNodeName()+" "+n2.getNodeName()); - //Log.println("----- Checking:"+path+getPathString(n1)); - NodeList nl1 = n1.getChildNodes(); - NodeList nl2 = n2.getChildNodes(); - - int size1 = nl1.getLength(); - int size2 = nl2.getLength(); - - if(debug)display_one(n1); - if(debug)display_one(n2); - - - if(debug) - if(n1.getNodeName().equals("Base64Content") && n2.getNodeName().equals("Base64Content")) - { - try { - Log.println("CONT:"+new String(Base64Utils.decode(strip(n1.getChildNodes().item(0).getNodeValue()),false))); - Log.println("CONT:"+new String(Base64Utils.decode(strip(n2.getChildNodes().item(0).getNodeValue()),false))); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - if(size1 != size2) - { - Log.println("----- Anzahl der Kinder nicht gleich:"+path+getPathString(n1)+":"+getPathString(n2)); - return false; - } - - equal = compareNodeExact(n1,n2,level,path+getPathString(n1)+"/"); - if(!equal) - { - Log.println("----- Knoten sind nicht identisch:"+path+getPathString(n1)); - return false; - } - - if(n1.hasAttributes() || n2.hasAttributes()) - { - equal = compareNodeAttriubtes(n1,n2,level+1,path+getPathString(n1)+"/(a)"); - if(!equal) - { - Log.println("----- Attribute stimmen nicht überein:"+path+getPathString(n1)); - return false; - } - } - if(size1==0) - { - return true; - } - - for(int counter=0;counter" + - "" + samlArtifact + "" + - ""; - Element request = new SAMLRequestBuilder().build(requestID, samlArtifact); - Element requestShould = DOMUtils.parseDocument(REQUEST_SHOULD, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - assertTrue(new SAMLRequestCompare().compareElements(requestShould, request)); - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java b/id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java deleted file mode 100644 index 5685129a1..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java +++ /dev/null @@ -1,19 +0,0 @@ -package test.at.gv.egovernment.moa.id.proxy.builder; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLRequestCompare extends test.at.gv.egovernment.moa.id.proxy.builder.DOMTreeCompare { - - - /* - * @see at.gv.egovernment.moa.util.SAMLRequestCompare#specialAttributes(java.lang.String, java.lang.String) - */ - public boolean specialAttributes(String path,String attr1_name,String value1,String attr2_name,String value2) { - if(attr1_name.equals("IssueInstant")) - return true; - return false; - } - -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java b/id.server/src/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java deleted file mode 100644 index 68b5d4ee3..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java +++ /dev/null @@ -1,180 +0,0 @@ -package test.at.gv.egovernment.moa.id.proxy.parser; - -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.id.UnitTestCase; - -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.data.SAMLStatus; -import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLResponseParserTest extends UnitTestCase { - - public SAMLResponseParserTest(String arg0) { - super(arg0); - } - - public void testParse() throws Exception { - String samlResponse = - "" + - "" + - "" + - "" + - "Ollas leiwand" + - "" + -"" + - "" + - "" + - "MTk2OC0xMC0yMmdi" + - "" + - "http://reference.e-government.gv.at/namespace/moa/20020822#cm" + - "" + - "" + - "" + - "" + - "http://localhost:8080/moa-id-auth/" + - "" + - "" + - "gb" + - "" + - "" + - "https://localhost:9443/" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "urn:oasis:names:tc:SAML:1.0:cm:sender-vouches" + - "" + - "" + - "" + - "123456789012" + - "http://reference.e-government.gv.at/names/persondata/20020228#zmr-zahl" + - "" + - "" + - "Hermann" + - "Muster" + - "" + - "1968-10-22" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "0v1Ftf7WXgoexx0Jo/GrlExHOHnQIEQ5FFSjptLRd5BN1mZYRg2S9KfOMbHSCsiPm8AwjAEwE5EM A6P18Z/YyTIuP7fNGzckbB5PYIgNMHL8/TYJhHA8CjamsBrEfYDXivE8iAvALg5I9RMLZADmzL7a f2daYYuO8dycQw3xg6U=" + - "AQAB" + - "" + - "" + - "" + - "" + - "" + - "" + - "i2qa56X4fpYeXqFLXAcQljGU3+DWnVgNrAxI9gn2bMeFWtLXE2SFa6qvl9EymUl0noBlFn0q9DWp AsyeLnRhzCAXJeSxiwsUEloOvcQCV0DfW2UVq0Y9bVlJ8KifJ2AS+5BxZ21mkc/VYx5Qz6EYjPrn pIpdAwR9sw5xnIvTySc=" + - "AQAB" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "not(ancestor-or-self::pr:Identification)" + - "" + - "" + - "" + - "" + - "s7TfoZrYo36OMdlxGxuIfAw/wr8=" + - "" + - "" + - "" + - "" + - "ancestor-or-self::dsig:Manifest" + - "" + - "" + - "" + - "dO+RSn4xLHT3cuq8uopFtZyUBqo=" + - "" + - "" + - "MFbZ5wA5cq0UezYFDXted5uqXubWFxxRwZawGh73XEAGxAbJsT/IEQmrTQThPRHNWW5RPGxVlPDz 5BmjberdaWlgJlbyKf3b/WpNNJYptQ7ijrXlsQoCzjfiQy37NEfvHEcxHQOA6sa42C+dFKsKIvmP 3mZkRYWJDxxsVzI7E+Y=" + - "" + - "" + - "MIIDaDCCAtWgAwIBAgIBADAJBgUrDgMCHQUAMIGOMQswCQYDVQQGEwJBVDE9MDsG A1UEChQ0QnVuZGVzbWluaXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5n IHVuZCBTcG9ydDEjMCEGA1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMx GzAZBgNVBAMTEk1PQSBUZXN0IENBIC0gUm9vdDAeFw0wMzAyMTExNTE5NDRaFw0w MzEyMzEyMjU5MzBaMIGOMQswCQYDVQQGEwJBVDE9MDsGA1UEChQ0QnVuZGVzbWlu aXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5nIHVuZCBTcG9ydDEjMCEG A1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMxGzAZBgNVBAMTEk1PQSBU ZXN0IENBIC0gUm9vdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAjHuFphE3 +UkTe2OcIFWUDLzhPl1j2dH4sMPAhDK09/0i+aWrdtQW9yHktu/7+LTiCiPeevT0 lGMGDcWMSoSm66tYmpxei6YojCFIaVdJFtXZ7x1o7e7jTDVRLMfdZ5lI1sQ7loIY hOE0OmlYOkn4AI6xMtJtsca45rV8wW7qm8kCAwEAAaOB2zCB2DAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjBdBgNVHSAEVjBUMFIGDCsGAQQBlRIBAnsB ATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0IGlzdCBudXIgZvxy IFRlc3R6d2Vja2UgZ2VlaWduZXQuMB0GA1UdDgQWBBRDC612dCgZetTmAKyV6DII NkOoYTAWBgcqKAAKAQEBBAsMCUJNT0xTLUlLVDAfBgNVHSMEGDAWgBRDC612dCgZ etTmAKyV6DIINkOoYTAJBgUrDgMCHQUAA4GBAHj0xBNWGYLijaocjOX1AkL+r+G2 fZsX4z3S/2eEvtUp+EUHaOPMLTS0MIP1nwj5f4ZluAIrDLXihqMdi4xRv0W6QYbN aDxICNz3/QbrzMlFPeC8odesdRlT+GGswX0ZGUtVIZm1HVhxRk5ZEW2pr2afo5c0 Btxup/kgjGMnnS7C" + - "MIIDiTCCAvagAwIBAgIBADAJBgUrDgMCHQUAMIGOMQswCQYDVQQGEwJBVDE9MDsG A1UEChQ0QnVuZGVzbWluaXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5n IHVuZCBTcG9ydDEjMCEGA1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMx GzAZBgNVBAMTEk1PQSBUZXN0IENBIC0gUm9vdDAeFw0wMzAyMTExNTI1MTRaFw0w MzEyMzEyMjU5MzBaMIGZMQswCQYDVQQGEwJBVDE9MDsGA1UEChQ0QnVuZGVzbWlu aXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5nIHVuZCBTcG9ydDEjMCEG A1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMxJjAkBgNVBAMTHU1PQSBU ZXN0IENBIC0gU2lnbmF0dXJkaWVuc3RlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQCw7ULOYSNji09Ein7Ar4j3Rjxjq05spBmZDmbSomEZMnGEtVTyIRzKc8ia 2kcXUMz5MEoFaVmvqRim31m20T21uvHFIs86gqzC/prOAz7V7HWok5F+9M/5gR1S BvpdqiEAXYeRXFPiOe8XSmpwhic7+n2jfuoBeYiRBEMGoP1DkwIDAQABo4HxMIHu MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgHGMBEGCWCGSAGG+EIB AQQEAwIBAjBdBgNVHSAEVjBUMFIGDCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwIC MDQaMkRpZXNlcyBaZXJ0aWZpa2F0IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2Vl aWduZXQuMB0GA1UdDgQWBBSeRWvUfxEjKZSfxImJr/fpBDtMmTAWBgcqKAAKAQEB BAsMCUJNT0xTLUlLVDAfBgNVHSMEGDAWgBRDC612dCgZetTmAKyV6DIINkOoYTAJ BgUrDgMCHQUAA4GBAIMa4C2z3SbkcjEiMNAsHKaKUCJkBbMtNaab6U/cwwYmG6nl ga7xyEmbfY2SKzOqkcIwuv83Tma3rcr1f+OLUeGUaGLHt2Pl1a/s8BZGQZHWvLXv 7hV4RceEUHzVGAfvDD8iBJqBmfq/z/fBPFsgSup4nO1YECkDYfQ+sqCIP4ik" + - "MIIDZzCCAtSgAwIBAgIBADAJBgUrDgMCHQUAMIGZMQswCQYDVQQGEwJBVDE9MDsG A1UEChQ0QnVuZGVzbWluaXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5n IHVuZCBTcG9ydDEjMCEGA1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMx JjAkBgNVBAMTHU1PQSBUZXN0IENBIC0gU2lnbmF0dXJkaWVuc3RlMB4XDTAzMDIx MTE1MzI0NVoXDTAzMDgxMTE0MzI0NVowgYUxCzAJBgNVBAYTAkFUMSYwJAYDVQQK FB1CdW5kZXNtaW5pc3Rlcml1bSBm/HIgSW5uZXJlczEgMB4GA1UECxMXWmVudHJh bGVzIE1lbGRlcmVnaXN0ZXIxLDAqBgNVBAMTI1Rlc3QgU2lnbmF0dXJkaWVuc3Qg UGVyc29uZW5iaW5kdW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEzkpk QjbGjZwssN1+vMBE/ALMcA8LWFcILI3uxXaTSWGfTiLo9ECfzjuwYJG7FjEaeWrW nPEcp4VfMNocrm3T7Hw/ikpE5/+FsfTzD4MpIwwUPd/CUfA5vDNXK5CiP7qKKR1e vATO2s6lfDul+CS/eEbwzKmUQvZGrJggxg2m5wIDAQABo4HYMIHVMAwGA1UdEwEB /wQCMAAwDgYDVR0PAQH/BAQDAgbAMF0GA1UdIARWMFQwUgYMKwYBBAGVEgECAwEB MEIwQAYIKwYBBQUHAgIwNBoyRGllc2VzIFplcnRpZmlrYXQgaXN0IG51ciBm/HIg VGVzdHp3ZWNrZSBnZWVpZ25ldC4wHQYDVR0OBBYEFIpEyv43H3EtiGr4I7Z34bWj v2z6MBYGByooAAoBAQEECwwJQk1PTFMtSUtUMB8GA1UdIwQYMBaAFJ5Fa9R/ESMp lJ/EiYmv9+kEO0yZMAkGBSsOAwIdBQADgYEAfMBJRy/kp8HQa0lGIBfFrWNpxVPv RsIu+N4IiFrswrsoQoMAh6IqNyzSdq7rJC08xsDkXe5HOwkb+2zGKYoC3aQ/J/zr BGkg6ec4tOaS/VSdEQeTL1L30r2faTffWLUV3GrzL7pM7jN470hB1w8F6Hc3LCI7 kFfp23o/juVtJNw=" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "BqzfCB7dNg4G3u4YaxpD1tALdKI=" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "123456789012" + - "http://reference.e-government.gv.at/names/persondata/20020228#zmr-zahl" + - "" + - "" + - "Hermann" + - "Muster" + - "" + - "1968-10-22" + - "" + - "" + - "" + - "" + - "true" + - "" + - "" + -"" + - ""; - - Element samlResponseElem = - DOMUtils.parseDocument(samlResponse, true, Constants.ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - SAMLResponseParser parser = new SAMLResponseParser(samlResponseElem); - SAMLStatus status = parser.parseStatusCode(); - assertEquals("samlp:Success", status.getStatusCode()); - assertEquals("samlp:Success", status.getSubStatusCode()); - assertEquals("Ollas leiwand", status.getStatusMessage()); - AuthenticationData authData = parser.parseAuthenticationData(); - assertEquals(1, authData.getMajorVersion()); - assertEquals(0, authData.getMinorVersion()); - assertEquals("-4633313027464114584", authData.getAssertionID()); - assertEquals("http://localhost:8080/moa-id-auth/", authData.getIssuer()); - assertEquals("2003-04-02T14:55:42+02:00", authData.getIssueInstant()); - assertEquals("123456789012", authData.getIdentificationValue()); - assertEquals("MTk2OC0xMC0yMmdi", authData.getBPK()); - assertEquals("Hermann", authData.getGivenName()); - assertEquals("Muster", authData.getFamilyName()); - assertEquals("1968-10-22", authData.getDateOfBirth()); - assertTrue(authData.isQualifiedCertificate()); - assertFalse(authData.isPublicAuthority()); - } -} diff --git a/id.server/src/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java b/id.server/src/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java deleted file mode 100644 index 351ca0bd5..000000000 --- a/id.server/src/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package test.at.gv.egovernment.moa.id.util; - -import iaik.pki.jsse.IAIKX509TrustManager; - -import java.net.URL; -import java.security.Security; - -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLSocketFactory; - -import com.sun.net.ssl.HttpsURLConnection; - -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; -import at.gv.egovernment.moa.id.util.SSLUtils; -import test.at.gv.egovernment.moa.id.UnitTestCase; - -/* - * @author Paul Ivancsics - * @version $Id$ - */ -public class SSLUtilsTest extends UnitTestCase { - - public SSLUtilsTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - //System.setProperty("javax.net.debug", "all"); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - IAIKX509TrustManager.initLog(new LoggerConfigImpl("file:" + TESTDATA_ROOT + "conf/log4j.properties")); - System.setProperty("https.cipherSuites", "SSL_DHE_DSS_WITH_DES_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,SSL_RSA_WITH_DES_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_EXPORT_WITH_RC4_40_MD5"); - } - - public void testVerisignOK() throws Exception { - doTestOA("conf/ConfigurationTest.xml", "http://verisign.moa.gv.at/", true, null); - } - public void testATrustOK() throws Exception { - doTestOA("conf/ConfigurationTest.xml", "http://a-trust.moa.gv.at/", true, null); - } - public void testBaltimoreOK() throws Exception { - doTestOA("conf/ConfigurationTest.xml", "http://baltimore.moa.gv.at/", true, null); - } - public void testCIOOK() throws Exception { - doTestOA("conf/ConfigurationTest.xml", "http://cio.moa.gv.at/", true, null); - } - public void testMOASPOK() throws Exception { - System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, - TESTDATA_ROOT + "conf/ConfigurationTest.xml"); - ConnectionParameter connParam = AuthConfigurationProvider.getInstance().getMoaSpConnectionParameter(); - doTest(connParam, true, null); - } - private void doTestOA(String configFile, String publicURLPrefix, boolean shouldOK, String exMessageFragment) throws Exception { - System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, - TESTDATA_ROOT + configFile); - ProxyConfigurationProvider proxyConf = - ProxyConfigurationProvider.getInstance(); - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(publicURLPrefix); - ConnectionParameter connParam = oaParam.getConnectionParameter(); - doTest(connParam, shouldOK, exMessageFragment); - } - private void doTest(ConnectionParameter connParam, boolean shouldOK, String exMessageFragment) throws Exception { - SSLUtils.initialize(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); - SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(authConf, connParam); - URL url = new URL(connParam.getUrl()); - HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); - conn.setRequestMethod("GET"); - conn.setDoInput(true); - conn.setDoOutput(true); - conn.setUseCaches(false); - conn.setAllowUserInteraction(false); - conn.setSSLSocketFactory(ssf); - try { - conn.connect(); - assertTrue(shouldOK); - assertEquals(200, conn.getResponseCode()); - conn.disconnect(); - } - catch (SSLException ex) { - ex.printStackTrace(); - assertFalse(shouldOK); - assertTrue(ex.getMessage().indexOf(exMessageFragment) >= 0); - } - } - -} diff --git a/id.server/src/test/lasttest/Dispatcher.java b/id.server/src/test/lasttest/Dispatcher.java deleted file mode 100644 index ad8f10fb4..000000000 --- a/id.server/src/test/lasttest/Dispatcher.java +++ /dev/null @@ -1,64 +0,0 @@ -package test.lasttest; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class Dispatcher extends Thread { - private LasttestClient parent = null; - private int max; - private int turns; - private int turn_counter; - private int turn; - private int time; - private long sum; - private int turnnum; - - public Dispatcher(LasttestClient parent, int max, int turns, int time, long sum) { - this.parent = parent; - this.max = max; - this.turns = turns; - this.time = time; - this.sum = sum; - turnnum=0; - } - - public void run() { - this.setPriority(Thread.NORM_PRIORITY + 1); - System.out.println("Dispatcher wird gestartet..."); - TestThread[] old_reqs = buildRequests(0); - for (turn_counter = 0; turns == 0 ? true : (turn_counter < turns); turn_counter++) { - try { -// LasttestClient.Log.write(("Starte Durchlauf " + turn_counter + "\n").getBytes()); - } - catch (Exception e) {} - -// System.out.println("Starte Durchlauf " + turn_counter); - turn = turn_counter; - if (turns == 0) - turn_counter--; - TestThread[] reqs = buildRequests(turn_counter); - for (int counter = 0; counter < max; counter++) { - old_reqs[counter].start(); - } - old_reqs = reqs; - try { - Thread.sleep(time); - } - catch (Exception e) { - e.printStackTrace(); - } - } - parent.stop = true; - } - - public TestThread[] buildRequests(int turnNo) { - TestThread[] ret = new TestThread[max]; - for (int counter = 0; counter < max; counter++) { -// turnnum ++; - ret[counter] = new TestThread(parent, turnNo); - } - return ret; - } -} diff --git a/id.server/src/test/lasttest/HostnameVerifierHack.java b/id.server/src/test/lasttest/HostnameVerifierHack.java deleted file mode 100644 index cf34b621a..000000000 --- a/id.server/src/test/lasttest/HostnameVerifierHack.java +++ /dev/null @@ -1,13 +0,0 @@ -package test.lasttest; - -import com.sun.net.ssl.HostnameVerifier; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class HostnameVerifierHack implements HostnameVerifier{ - public boolean verify(String arg0, String arg1) { - return true; - }} diff --git a/id.server/src/test/lasttest/LasttestClient.java b/id.server/src/test/lasttest/LasttestClient.java deleted file mode 100644 index bad5161ba..000000000 --- a/id.server/src/test/lasttest/LasttestClient.java +++ /dev/null @@ -1,218 +0,0 @@ -package test.lasttest; - -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.security.Security; -import java.util.Date; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.StreamUtils; -import at.gv.egovernment.moa.util.URLDecoder; -import at.gv.egovernment.moa.util.URLEncoder; -import com.sun.net.ssl.HttpsURLConnection; - -/** - * @author Sven - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. - * - * Aufruf: Requestdatei (==null), ServerURL, Anzahl der Requests pro Sekunde, Anzahl der Wiederholungen - * z.b. "data/CX0/TestGeneratorCX0.001.Req.xml" "http://127.0.0.1:8080/" 5 100 - * - * ==> GEÄNDERT: ersten 2 Parameter gekillt... nur noch 5 100 - */ -public class LasttestClient { - - protected static final String TESTDATA_ROOT = "data/abnahme-test/"; - protected static final String MOA_AUTH_SERVER = "https://localhost:8443/moa-id-auth/"; - protected AuthenticationServer server; - - public int max_thread_count = 300; - public int thread_counter = 0; - public int error_count = 0; - public int turns = 0; - public long sum = 0; - public long max = 0; - public long min = Long.MAX_VALUE; - - public static PrintStream Log = null; - - public boolean stop = false; - - public static final String trustStore = "javax.net.ssl.trustStore"; - public static final String trustStorePassword = "javax.net.ssl.trustStorePassword"; - public static final String handler = "java.protocol.handler.pkgs"; - - public void startTest(int req_per_second, int turns, int time) throws Exception { - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); - - System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, TESTDATA_ROOT + "xmldata/L000/Configuration.xml"); - - AuthConfigurationProvider.reload(); - - this.turns = turns; - - boolean result = new TestThread(this,0).doRequest(0);// doTestRequest(); - if (result) { - System.out.println("TestRequest OK. Lasttest wird gestartet."); - sum=0; - max=0; - Dispatcher dp = new Dispatcher(this, req_per_second, turns, time, sum); - dp.start(); - while (!stop) { - try { - Log.println(new String(("Checking Stop Condition ...(Running " + thread_counter + ", Min " + (min) + ", Max " + (max) + ", " + new Date(System.currentTimeMillis()) + ")"))); - Log.flush(); - } - catch (Exception e) {} - - System.out.println("Checking Stop Condition ...(Running " + thread_counter + ", Min " + (min) + ", Max " + (max) + ", " + new Date(System.currentTimeMillis()) + ")"); - Thread.sleep(10000); - } - System.out.println("Fehler:" + error_count + " (Running " + thread_counter + ", Min " + (min) + ", Max " + (max) + ", " + new Date(System.currentTimeMillis()) + ")"); - } - else { - System.out.println("TestRequest lieferte einen Fehler. Lasttest wird nicht gestartet."); - } - } - - - public boolean doTestRequest() throws Exception { - - try { - - TestThread tt = new TestThread(null,0); - - // Anmelden - String URL = tt.getURL(MOA_AUTH_SERVER, "gb", "http://10.16.126.28:9080/moa-id-proxy/"); - HttpsURLConnection conn = tt.giveConnection(URL, "GET"); - - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - String MOASessionID = tt.parseSessionIDFromForm(result); - conn.disconnect(); - - URL = tt.parseDataURL(result); - // Verify Identity Link - conn = tt.giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - String infoboxReadResponse = tt.readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - String redirectLoc = conn.getHeaderField("Location"); - conn.disconnect(); - //Verify Auth Block - conn = tt.giveConnection(redirectLoc, "POST"); - String createXMLSignatureResponse = URLEncoder.encode(tt.readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - out = conn.getOutputStream(); - out.write(("XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); - out.flush(); - out.close(); - conn.connect(); - redirectLoc = conn.getHeaderField("Location"); - String samlArtifact = tt.parseSamlArtifact(redirectLoc); - System.out.println("SamlArtifact: " + samlArtifact); - - conn.disconnect(); - - conn = null; - - SAMLRequestBuilder srb = new SAMLRequestBuilder(); - - Element erg = tt.doCall(srb.build(MOASessionID, URLDecoder.decode(samlArtifact, "UTF-8")),MOA_AUTH_SERVER); - result = DOMUtils.serializeNode(erg); - if (result.indexOf("saml:Assertion")<0) - { - System.err.println("Falsche Antwort vom Webservice:\n" + result); - throw new Exception("Falsche Antwort vom Webservice"); - - } - } - catch (Exception e) { - System.err.println("------ FEHLER IN LASTTEST :" + e.getLocalizedMessage()); - throw e; - } - - return true; - - } - - public String replaceString(String input, String oldPart, String newPart) throws Exception { - String erg = null; - - //First Part - erg = input.substring(0, input.indexOf(oldPart)); - //Insert new Part - erg += newPart; - - //insert REST - erg += input.substring(input.indexOf(oldPart) + oldPart.length(), input.length()); - - return erg; - } - - public static void main(String[] args) throws Exception { - Log = new PrintStream(new FileOutputStream("C:/Lasttest.log")); - int time = 0; - int sek = 0; - int turns = 0; - - if (args.length != 3) { - System.out.println("Parameteranzahl falsch. Bitte verwenden Sie die Syntax "); - return; - } - - try { - sek = Integer.parseInt(args[0]); - time = Integer.parseInt(args[2]); - if (args[1].equals("INF")) { - turns = 0; - } - else - turns = Integer.parseInt(args[1]); - } - catch (NumberFormatException e) { - System.out.println("Einer der Parameter (Requestanzahl oder Testanzahl) ist keine Zahl !"); - return; - } - - System.out.println("Starte Lastest mit folgenden Parametern ..."); - System.out.println("ServerURL: " + MOA_AUTH_SERVER); - double reqPerSek = sek*1000; - System.out.println("Requests pro Sekunde: " + reqPerSek/time); - System.out.println("Durchläufe: " + (turns == 0 ? "INF" : turns + "")); - - Log.println("Starte Lastest mit folgenden Parametern ..."); - Log.println("ServerURL: " + MOA_AUTH_SERVER); - Log.println("Requests pro Sekunde: " + reqPerSek / time); - Log.println("Durchläufe: " + (turns == 0 ? "INF" : turns + "")); - - - try { - LasttestClient lc = new LasttestClient(); - //lc.startTest("data/CX0/TestGeneratorCX0.001.Req.xml","http://161.106.2.255:8080/",10,1000); - lc.startTest(sek, turns, time); - } - catch (Exception e) { - e.printStackTrace(); - } - } -} - diff --git a/id.server/src/test/lasttest/TestThread.java b/id.server/src/test/lasttest/TestThread.java deleted file mode 100644 index 0d2973c7f..000000000 --- a/id.server/src/test/lasttest/TestThread.java +++ /dev/null @@ -1,251 +0,0 @@ -package test.lasttest; - -import java.io.OutputStream; -import java.net.URL; -import java.util.Vector; - -import javax.xml.namespace.QName; -import javax.xml.rpc.Call; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceFactory; - -import org.apache.axis.message.SOAPBodyElement; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; -import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.StreamUtils; -import at.gv.egovernment.moa.util.URLDecoder; -import at.gv.egovernment.moa.util.URLEncoder; -import com.sun.net.ssl.HttpsURLConnection; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ -public class TestThread extends Thread { - private LasttestClient parent = null; - private int turn_no; - private Dispatcher disp = null; - - public TestThread( LasttestClient parent, int durchlauf_nr) { - turn_no = durchlauf_nr; - this.parent = parent; - - } - - protected Element doCall(Element request, String server) throws Exception { - - /* QName serviceName = new QName("GetAuthenticationData"); - - String endPoint = server + "services/GetAuthenticationData"; - Service service = ServiceFactory.newInstance().createService(serviceName); - Call call = service.createCall(); - SOAPBodyElement body = new SOAPBodyElement(request); - SOAPBodyElement[] params = new SOAPBodyElement[] { body }; - Vector responses; - SOAPBodyElement response; - - - System.out.println(DOMUtils.serializeNode(body.getAsDOM())); - call.setTargetEndpointAddress(endPoint); - System.out.println("Rufe WS auf: " + endPoint); - responses = (Vector) call.invoke(params); - System.out.println("WS aufgerufen."); - response = (SOAPBodyElement) responses.get(0); - System.out.println(DOMUtils.serializeNode(response.getAsDOM())); - return response.getAsDOM();*/ - - QName serviceName = new QName("GetAuthenticationData"); - String endPoint = server + "services/GetAuthenticationData"; - Service service = ServiceFactory.newInstance().createService(serviceName); - Call call = service.createCall(); - - System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); - System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); - SOAPBodyElement body = new SOAPBodyElement(request); - SOAPBodyElement[] params = new SOAPBodyElement[] { body }; - Vector responses; - SOAPBodyElement response; - - call.setTargetEndpointAddress(endPoint); - responses = (Vector) call.invoke(params); - response = (SOAPBodyElement) responses.get(0); - return response.getAsDOM(); - } - - public boolean doRequest(int turnNo) throws Exception { - long start = System.currentTimeMillis(); - - try { - LasttestClient.Log.write(("Starte Durchlauf " + turnNo + "\n").getBytes()); - } - catch (Exception e) {} - - System.out.println("Starte Durchlauf " + turnNo); - // Anmelden - String URL = getURL(LasttestClient.MOA_AUTH_SERVER, "gb", "http://10.16.126.28:9080/moa-id-proxy/"); - HttpsURLConnection conn = giveConnection(URL, "GET"); - conn.connect(); - String result = new String(StreamUtils.readStream(conn.getInputStream())); - /* - * FOR DEBUG ONLY - */ - // System.out.println(URL); - // System.out.println(result); - //---------------- - - String MOASessionID = parseSessionIDFromForm(result); - conn.disconnect(); - - URL = parseDataURL(result); - // Verify Identity Link - conn = giveConnection(URL, "POST"); - conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); - String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); - OutputStream out = conn.getOutputStream(); - out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); - out.flush(); - out.close(); - conn.connect(); - - /* - * FOR DEBUG ONLY - */ - // System.out.println(URL); - // System.out.println(new String(StreamUtils.readStream(conn.getInputStream()))); - //---------------- - - String redirectLoc = conn.getHeaderField("Location"); - conn.disconnect(); - //Verify Auth Block - conn = giveConnection(redirectLoc, "POST"); - String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); - out = conn.getOutputStream(); - out.write(("XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); - out.flush(); - out.close(); - conn.connect(); - redirectLoc = conn.getHeaderField("Location"); - - /* - * FOR DEBUG ONLY - */ - // System.out.println(redirectLoc); - // System.out.println(new String(StreamUtils.readStream(conn.getInputStream()))); - //---------------- - String samlArtifact = parseSamlArtifact(redirectLoc); - - // System.out.println("SamlArtifact: " + samlArtifact); - - AxisSecureSocketFactory.initialize(conn.getSSLSocketFactory()); - conn.disconnect(); - - conn = null; - - SAMLRequestBuilder srb = new SAMLRequestBuilder(); - - doCall(srb.build(MOASessionID, URLDecoder.decode(samlArtifact, "UTF-8")), LasttestClient.MOA_AUTH_SERVER); - // writeXmldata("GetAuthenticationDataWebServiceResponse.xml", result.getBytes("UTF-8")); - - long end = System.currentTimeMillis(); - long diff = end - start; - parent.sum +=diff; - if (parent.max < diff) { - parent.max = diff; - } - if (parent.min > diff) { - parent.min = diff; - } - if (turnNo>0) { - long totalmem = Runtime.getRuntime().totalMemory(); - long freemem = Runtime.getRuntime().freeMemory(); - try { - LasttestClient.Log.write(new String("Ende Durchlauf: " + turnNo + " ==> Dauer:" + diff + " Schnitt: " + (parent.sum/turnNo/2) + " Total-Mem: " + totalmem + " Free-Mem: " + freemem + "\n").getBytes()); - LasttestClient.Log.flush(); - } - catch (Exception e) {} - System.out.println(new String("Ende Durchlauf: " + turnNo + " ==> Dauer:" + diff + " Schnitt: " + (parent.sum/turnNo/2) + " Total-Mem: " + totalmem + " Free-Mem: " + freemem)); - } - return true; - - } - - public String getSubString(String input, String startsWith, String endsWith) { - return input.substring(input.indexOf(startsWith) + startsWith.length(), input.indexOf(endsWith, input.indexOf(startsWith) + startsWith.length())); - } - - public String getURL(String authURL, String target, String oaURL) { - return authURL + "StartAuthentication?Target=" + target + "&OA=" + oaURL; - } - - public HttpsURLConnection giveConnection(String targetURL, String requestMethod) throws Exception { - HttpsURLConnection conn = (HttpsURLConnection) new URL(targetURL).openConnection(); - conn.setRequestMethod(requestMethod); - conn.setDoInput(true); - conn.setDoOutput(true); - conn.setUseCaches(false); - conn.setAllowUserInteraction(false); - conn.setHostnameVerifier(new HostnameVerifierHack()); - return conn; - } - - public String killInclusive(String input, String startsWith, String endsWith, String newValue) { - int start = 0; - int ende; - String result; - result = input; - do { - start = result.indexOf(startsWith, start) + startsWith.length(); - ende = result.indexOf(endsWith, start); - result = result.substring(0, start - startsWith.length()) + newValue + result.substring(ende + endsWith.length(), result.length()); - start++; - } - while (result.indexOf(startsWith, ende + 1) > 0); - - return result; - } - - public String parseDataURL(String input) { - return getSubString(input.substring(input.indexOf("DataURL"), input.length()), "value=\"", "\""); - } - - public String parseSamlArtifact(String input) { -// System.out.println(input); - return getSubString(input + "@@@", "SAMLArtifact=", "@@@"); - } - - public String parseSessionIDFromForm(String htmlForm) { - String parName = "MOASessionID="; - int i1 = htmlForm.indexOf(parName) + parName.length(); - int i2 = htmlForm.indexOf("\"", i1); - return htmlForm.substring(i1, i2); - } - - public String readXmldata(String filename) throws Exception { - - return FileUtils.readFile(LasttestClient.TESTDATA_ROOT + "xmldata/L000/" + filename, "UTF-8"); - } - - /** - * @see java.lang.Runnable#run() - */ - public void run() { - parent.thread_counter++; - - try { - if (!doRequest(turn_no)) { - parent.error_count++; - } - } - catch (Exception e) { - e.printStackTrace(); - parent.error_count++; - } - parent.thread_counter--; - } - -} diff --git a/id.templates/.project b/id.templates/.project deleted file mode 100644 index 055d6569e..000000000 --- a/id.templates/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - id.templates - - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.ibm.etools.ctc.serviceprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - com.ibm.etools.ctc.javaprojectnature - - diff --git a/id.templates/build.xml b/id.templates/build.xml deleted file mode 100644 index 696616eaa..000000000 --- a/id.templates/build.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - Time (hhmm): ${TSTAMP} - - - - - - - - - - - - - - - - diff --git a/id.templates/html/SampleBKUSelectionTemplate.html b/id.templates/html/SampleBKUSelectionTemplate.html deleted file mode 100644 index 5536226a8..000000000 --- a/id.templates/html/SampleBKUSelectionTemplate.html +++ /dev/null @@ -1,52 +0,0 @@ - - - -MOA ID - Auswahl der B&uuuml;rgerkartenumgebung - - - - - - - - -Organisation XY -

Auswahl der Bürgerkartenumgebung

-

-

Sie haben sich für Anmeldung mit Ihrer Bürgerkarte entschieden. Da es verschiedene Formen der Bürgerkarte gibt, müssen Sie nun wählen, welche Sie bei der Anmeldung verwenden wollen.

-

Auswahl der Bürgerkarte

-
- - - -
-

- - - - -

Hinweise:

-
    -
  • -

    Wollen Sie eine A-Trust Bürgerkarte erwerben? Hier finden Sie Informationen - dazu: A-Trust - Bürgerkarte. Bei der Anmeldung mit der A-Trust Bürgerkarte - benötigen Sie eine funktionsfähige Bürgerkartensoftware sowie - einen passenden Kartenleser.

    -
  • -
  • -

    Wollen Sie ein A1-Signatur erwerben? Wenden Sie sich an 0800-664 680 um - Informationen zur A1-Signatur zu erhalten. - Hier finden Sie ebenfalls Informationen dazu: A1-Signatur. - Bei der Anmeldung mit der A1-Signatur wird keine Bürgerkartensoftware und - kein Kartenleser benötigt.

    -
  • -
-
Valid HTML 4.01!
-

 

- - - - diff --git a/id.templates/html/SampleLogo.gif b/id.templates/html/SampleLogo.gif deleted file mode 100644 index 4b7c682b1..000000000 Binary files a/id.templates/html/SampleLogo.gif and /dev/null differ diff --git a/id.templates/html/SampleTemplate.html b/id.templates/html/SampleTemplate.html deleted file mode 100644 index e9756a036..000000000 --- a/id.templates/html/SampleTemplate.html +++ /dev/null @@ -1,62 +0,0 @@ - - - -MOA ID - Identifizierter Zugang mit Bürgerkarte - - - - - - - - -Organisation XY -

Sicherer Zugang zur Online-Anwendung mit Bürgerkarte

-

- -Der identifizierte Zugang erfolgt über die Module für Online Applikationen (MOA) unter Verwendung einer Bürgerkarte und deren Signaturfunktion. - -

-

Wenn Sie in Folge die Schaltfläche "Anmeldung mit Bürgerkarte" -aktivieren, so werden zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese -signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.

- - -
-
- - - - -
-
-
- - - - -
-

- - -
- -
Valid HTML 4.01!
-

 

- - - diff --git a/id.templates/html/css/display.css b/id.templates/html/css/display.css deleted file mode 100644 index fc6da85b0..000000000 --- a/id.templates/html/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/html/css/main.css b/id.templates/html/css/main.css deleted file mode 100644 index bcad5589c..000000000 --- a/id.templates/html/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/html/valid-html401.gif b/id.templates/html/valid-html401.gif deleted file mode 100644 index 1270561e1..000000000 Binary files a/id.templates/html/valid-html401.gif and /dev/null differ diff --git a/id.templates/web.xml b/id.templates/web.xml deleted file mode 100644 index 6954e9c87..000000000 --- a/id.templates/web.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - Sample MOA-ID Templates - >Sample MOA-ID Templates - - diff --git a/id/oa/src/main/webapp/WEB-INF/web.xml b/id/oa/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..13158fdaa --- /dev/null +++ b/id/oa/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + + + + Sample OA + MOA Sample OA + + diff --git a/id/oa/src/main/webapp/auth.jsp b/id/oa/src/main/webapp/auth.jsp new file mode 100644 index 000000000..0b563a83e --- /dev/null +++ b/id/oa/src/main/webapp/auth.jsp @@ -0,0 +1,48 @@ + + +MOA ID Auth Sample Login + + +<% /** assumes moa-id-auth and oa in the same servlet container, + and moa-id-proxy on a different fixed location */ + String authUrlPath = + request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + "/moa-id-auth/"; + String proxyUrlPath = "http://10.16.126.28:9080/moa-id-proxy/"; + String oaUrlPath = + request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + "/oa/"; + String params = + "Target=gb&" + + "OA=" + proxyUrlPath + "index.jsp"; + String urlStartAuth = + authUrlPath + + "StartAuthentication?" + + params; + String templateParam = + "&Template=" + oaUrlPath + "AuthTemplate.jsp"; + String urlStartAuthCustom = + urlStartAuth + + templateParam; + String urlSelectBKU = + authUrlPath + + "SelectBKU?" + + params; + String urlSelectBKUCustom = + urlSelectBKU + + templateParam + + "&BKUSelectionTemplate=" + oaUrlPath + "BKUSelectionTemplate.jsp"; +%> +Log in to sample application +
+Log in to sample application using custom form +
+Choose BKU (HTMLComplete or HTMLSelect) and log in +
+Choose BKU (HTMLSelect) using custom form and log in +
+">Wrong parameters example + + \ No newline at end of file diff --git a/id/oa/src/main/webapp/chooseBKU.jsp b/id/oa/src/main/webapp/chooseBKU.jsp new file mode 100644 index 000000000..0135b6fdf --- /dev/null +++ b/id/oa/src/main/webapp/chooseBKU.jsp @@ -0,0 +1,19 @@ + + +BKU Auswahl + + +

BKU Auswahl

+

+

"> + + +
+

+ + \ No newline at end of file diff --git a/id/oa/src/main/webapp/form.jsp b/id/oa/src/main/webapp/form.jsp new file mode 100644 index 000000000..d439fa84d --- /dev/null +++ b/id/oa/src/main/webapp/form.jsp @@ -0,0 +1,20 @@ +<%@ page import="java.util.*" %> + + +Sample Online Application + + +

Sample Form

+

+

+<% String param1 = request.getParameter("param1"); + if (param1 == null) param1 = ""; %> +Input some text: + +
Previous text input: <%=param1%>
+ +
+

+

Back

+ + \ No newline at end of file diff --git a/id/oa/src/main/webapp/getBKUSelectTag.jsp b/id/oa/src/main/webapp/getBKUSelectTag.jsp new file mode 100644 index 000000000..028dbd348 --- /dev/null +++ b/id/oa/src/main/webapp/getBKUSelectTag.jsp @@ -0,0 +1,6 @@ + diff --git a/id/oa/src/main/webapp/index.jsp b/id/oa/src/main/webapp/index.jsp new file mode 100644 index 000000000..35e49d743 --- /dev/null +++ b/id/oa/src/main/webapp/index.jsp @@ -0,0 +1,60 @@ +<%@ page import="java.util.*,javax.servlet.http.*,sun.misc.BASE64Decoder" %> + + +Sample Online Application + + +

Sample Online Application

+ +

Request headers: + + <% + /* collect parameters from request */ + for (Enumeration headers = request.getHeaderNames(); headers.hasMoreElements(); ) { + String key = (String) headers.nextElement(); + String value = request.getHeader(key); %> + + <% } %> +
<%=key%><%=value%>
+

+ +<% String query=request.getQueryString(); %> +

QueryString: "<%=query%>" +

+ +

Request parameters: + + <% + /* collect parameters from request */ + for (Enumeration params = request.getParameterNames(); params.hasMoreElements(); ) { + String name = (String) params.nextElement(); + String value = request.getParameter(name); %> + + <% } %> +
<%=name%><%=value%>
+

+ +

Cookies: + + <% + /* collect attributes from request */ + Cookie[] cookies = request.getCookies(); + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + Cookie cookie = cookies[i]; %> + + <% } + } %> +
<%=cookie.getName()%><%=cookie.getValue()%>
+

+ +<% String authHeader = request.getHeader("Authorization"); + if (authHeader != null) { + authHeader = authHeader.substring(authHeader.indexOf(" ")+1); + String decAuthHeader = new String(new BASE64Decoder().decodeBuffer(authHeader)); +%> +

Basic authentication credentials: <%=decAuthHeader%>

+<% } %> +

Form sample

+ + \ No newline at end of file diff --git a/id/oa/src/main/webapp/stateful_login.jsp b/id/oa/src/main/webapp/stateful_login.jsp new file mode 100644 index 000000000..eaede507f --- /dev/null +++ b/id/oa/src/main/webapp/stateful_login.jsp @@ -0,0 +1,29 @@ +<%@ page import="javax.servlet.http.*" %> +<% + /* check request's remote IP address - must be moa-id-proxy's address */ + String remoteIPAddress = request.getRemoteAddr(); + if (! "127.0.0.1".equals(remoteIPAddress)) { /* Substitute "127.0.0.1" for moa-id-proxy's IP address */ + response.setStatus(403); + return; + } + + /* store authentication data in cookies */ + String fn = request.getParameter("FamilyName"); + String gn = request.getParameter("GivenName"); + /* set cookie domain and cookie path ! */ + String cookieDomain = ".test.test"; /* Set this to the common domain of moa-id-proxy and of the online application */ + String cookiePath = request.getContextPath(); /* Set this to the context path of the online application */ + + Cookie cfn = new Cookie("familyname", fn); + cfn.setDomain(cookieDomain); + cfn.setPath(cookiePath); + response.addCookie(cfn); + + Cookie cgn = new Cookie("givenname", gn); + cgn.setDomain(cookieDomain); + cgn.setPath(cookiePath); + response.addCookie(cgn); + + /* redirect to online application's start page */ + response.sendRedirect("http://oa.test.test:8080/oa/index.jsp"); /* Substitute for URL in online application */ +%> diff --git a/id/server/auth/src/main/webapp/WEB-INF/server-config.wsdd b/id/server/auth/src/main/webapp/WEB-INF/server-config.wsdd new file mode 100644 index 000000000..0f0eb49d1 --- /dev/null +++ b/id/server/auth/src/main/webapp/WEB-INF/server-config.wsdd @@ -0,0 +1,29 @@ + + + + + + + + + urn:oasis:names:tc:SAML:1.0:protocol + + + /resources/wsdl/MOA-ID-1.x.wsdl + + + + + + + + + + + + + + diff --git a/id/server/auth/src/main/webapp/WEB-INF/web.xml b/id/server/auth/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..603758fb8 --- /dev/null +++ b/id/server/auth/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,113 @@ + + + + MOA ID Auth + MOA ID Authentication Service + + SelectBKU + SelectBKU + Select Bürgerkartenartenumgebung + at.gv.egovernment.moa.id.auth.servlet.SelectBKUServlet + + + StartAuthentication + StartAuthentication + Start authentication process + at.gv.egovernment.moa.id.auth.servlet.StartAuthenticationServlet + 0 + + + VerifyIdentityLink + VerifyIdentityLink + Verify identity link coming from security layer + at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet + + + VerifyAuthBlock + VerifyAuthBlock + Verify AUTH block coming from security layer + at.gv.egovernment.moa.id.auth.servlet.VerifyAuthenticationBlockServlet + + + ConfigurationUpdate + ConfigurationUpdate + Update MOA-ID Auth configuration from the configuration file + at.gv.egovernment.moa.id.auth.servlet.ConfigurationServlet + + + AxisServlet + Apache-Axis Servlet + + org.apache.axis.transport.http.AxisServlet + + + + + + jspservlet + org.apache.jasper.servlet.JspServlet + + + + + + jspservlet + /errorpage-auth.jsp + + + + jspservlet + /message-auth.jsp + + + + SelectBKU + /SelectBKU + + + StartAuthentication + /StartAuthentication + + + VerifyIdentityLink + /VerifyIdentityLink + + + VerifyAuthBlock + /VerifyAuthBlock + + + ConfigurationUpdate + /ConfigurationUpdate + + + AxisServlet + /services/* + + + 30 + + + 500 + /errorpage.jsp + + + + ConfigurationUpdate + /ConfigurationUpdate + + + moa-admin + + + + BASIC + UserDatabase + + + + The role that is required to log in to the moa Application + + moa-admin + + diff --git a/id/server/auth/src/main/webapp/errorpage-auth.jsp b/id/server/auth/src/main/webapp/errorpage-auth.jsp new file mode 100644 index 000000000..07f3e7f69 --- /dev/null +++ b/id/server/auth/src/main/webapp/errorpage-auth.jsp @@ -0,0 +1,50 @@ + +<%@ page contentType="text/html; charset=UTF-8" %> + + +Ein Fehler ist aufgetreten + +<% Throwable exceptionThrown = (Throwable)request.getAttribute("ExceptionThrown"); + String errorMessage = (String)request.getAttribute("ErrorMessage"); + String wrongParameters = (String)request.getAttribute("WrongParameters"); +%> + + +

Fehler bei der Anmeldung

+

Bei der Anmeldung ist ein Fehler aufgetreten.

+ +<% if (errorMessage != null) { %> +

+<%= errorMessage%>
+

+<% } %> +<% if (exceptionThrown != null) { %> +

+<%= exceptionThrown.getMessage()%> +

+<% } %> +<% if (wrongParameters != null) { %> +

Die Angabe der Parameter ist unvollständig.

+ <%= wrongParameters %>
+

+ Beispiele für korrekte Links zur MOA-ID Authentisierung sind: +

+

+<a href="https://<MOA-URL>/StartAuthentication?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>"> +

+

+<a href="https://<MOA-URL>/SelectBKU?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> +

+

+Im Falle einer Applikation aus dem privatwirtschaftlichen Bereich (type="businessService") entfällt die Angabe des Target Parameters: +

+

+<a href="https://<MOA-URL>/StartAuthentication?OA=<OA-URL>&Template=<Template-URL>"> +

+

+<a href="https://<MOA-URL>/SelectBKU?OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> +

+

Die Angabe der Parameter "Template" und "BKUSelectionTemplate" ist optional.

+<% } %> + + \ No newline at end of file diff --git a/id/server/auth/src/main/webapp/index.jsp b/id/server/auth/src/main/webapp/index.jsp new file mode 100644 index 000000000..733ba317f --- /dev/null +++ b/id/server/auth/src/main/webapp/index.jsp @@ -0,0 +1,40 @@ + + +MOA ID Auth Sample Login + + +<% + String urlPath = + request.getScheme() + "://" + + request.getServerName() + ":" + request.getServerPort() + + request.getContextPath() + "/"; + String params = + "Target=gb&" + + "OA=https://localhost:8443/moa-id-proxy/index.jsp"; + String urlStartAuth = + urlPath + + "StartAuthentication?" + + params; + String templateParam = + "&Template=http://localhost:18080/oa/AuthTemplate.jsp"; + String urlStartAuthCustom = + urlStartAuth + + templateParam; + String urlSelectBKU = + urlPath + + "SelectBKU?" + + params; + String urlSelectBKUCustom = + urlSelectBKU + + templateParam + + "&BKUSelectionTemplate=http://localhost:18080/oa/BKUSelectionTemplate.jsp"; +%> +Log in to sample application +
+Log in to sample application using custom form +
+Choose BKU (HTMLComplete or HTMLSelect) and log in +
+Choose BKU (HTMLSelect) using custom form and log in + + \ No newline at end of file diff --git a/id/server/auth/src/main/webapp/message-auth.jsp b/id/server/auth/src/main/webapp/message-auth.jsp new file mode 100644 index 000000000..0c28c1ba7 --- /dev/null +++ b/id/server/auth/src/main/webapp/message-auth.jsp @@ -0,0 +1,20 @@ + +<%@ page contentType="text/html; charset=UTF-8" %> + + +MOA-ID AUTH + +<% String message = (String)request.getAttribute("Message"); +%> + + +

MOA-ID AUTH

+ +<% if (message != null) { %> +

+<%= message%>
+

+<% } %> + + + \ No newline at end of file diff --git a/id/server/data/deploy/conf/Catalina/localhost/proxy.xml b/id/server/data/deploy/conf/Catalina/localhost/proxy.xml new file mode 100644 index 000000000..eef60b953 --- /dev/null +++ b/id/server/data/deploy/conf/Catalina/localhost/proxy.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/MOAIdentities.xsd b/id/server/data/deploy/conf/moa-id/MOAIdentities.xsd new file mode 100644 index 000000000..91c7a6cc0 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/MOAIdentities.xsd @@ -0,0 +1,59 @@ + + + + + + MOAIdentities provides a mapping from identities to parameters used in the XMLLoginParameterResolver of MOA-ID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleIdentities.xml b/id/server/data/deploy/conf/moa-id/SampleIdentities.xml new file mode 100644 index 000000000..fc6dc2ccf --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleIdentities.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + 1 + + + + + + + 1 + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml new file mode 100644 index 000000000..f8dbd4b13 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindung + + + + MOAIDBuergerkarteAuthentisierungsDaten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + + + + + + + + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml new file mode 100644 index 000000000..51d62bd72 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindung + + + + MOAIDBuergerkarteAuthentisierungsDaten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + + + + + + + + + + + + + + + + + + + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml new file mode 100644 index 000000000..8a9898792 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindungMitTestkarten + + + + + MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT + + + + + + + + + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml new file mode 100644 index 000000000..b859fe758 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindungMitTestkarten + + + + + MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT + + + + + + + + + + + + + + + + + + + + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml new file mode 100644 index 000000000..e5b49bbe1 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindung + + + + MOAIDBuergerkarteAuthentisierungsDaten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + + + + + + + + + + + + 468924i + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml new file mode 100644 index 000000000..4e7a8ae54 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfigurationProxy.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindung + + + + MOAIDBuergerkarteAuthentisierungsDaten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + + + + + + + + + + + + + + + + + + + + + + + + 468924i + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml new file mode 100644 index 000000000..1d5c410ec --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKs.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindungMitTestkarten + + + + + MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT + + + + + + + + + + + + + 468924i + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml new file mode 100644 index 000000000..2afa97e77 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/SampleMOAWIDConfiguration_withTestBKsProxy.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindungMitTestkarten + + + + + MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten + + + MOAIDTransformAuthBlockText + MOAIDTransformAuthBlockText_deprecated + + + + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + CN=Test Signaturdienst Personenbindung,OU=IKT-Stabsstelle des Bundes,O=Bundeskanzleramt,C=AT + + + + + + + + + + + + + + + + + + + + + + + + + 468924i + + Lokale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte" nur für diese Online Applikation<--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/log4j.properties b/id/server/data/deploy/conf/moa-id/log4j.properties new file mode 100644 index 000000000..debdb146c --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/log4j.properties @@ -0,0 +1,25 @@ +# commons-logging setup +org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory + +# define log4j root loggers +log4j.rootLogger=info, stdout, R +log4j.logger.moa=info +log4j.logger.moa.spss.server=info +log4j.logger.iaik.server=info +log4j.logger.moa.id.auth=info +log4j.logger.moa.id.proxy=info + +# configure the stdout appender +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +#log4j.appender.stdout.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n +log4j.appender.stdout.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20.20c | %10t | %m%n + +# configure the rolling file appender (R) +log4j.appender.R=org.apache.log4j.RollingFileAppender +log4j.appender.R.File=${catalina.home}/logs/moa-id.log +log4j.appender.R.MaxFileSize=10000KB +log4j.appender.R.MaxBackupIndex=1 +log4j.appender.R.layout=org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %t | %m%n + diff --git a/id/server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml b/id/server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml new file mode 100644 index 000000000..fc99cea79 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/oa/BasicOAConfiguration.xml @@ -0,0 +1,9 @@ + + + + stateless + + MOAFamilyName + MOAGivenName + + diff --git a/id/server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml b/id/server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml new file mode 100644 index 000000000..4d34c3646 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/oa/HeaderOAConfiguration.xml @@ -0,0 +1,10 @@ + + + + stateless + + +
+
+
+
diff --git a/id/server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml b/id/server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml new file mode 100644 index 000000000..979faca95 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/oa/ParamOAConfiguration.xml @@ -0,0 +1,10 @@ + + + + stateless + + + + + + diff --git a/id/server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml b/id/server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml new file mode 100644 index 000000000..edbfe7aa5 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/oa/SampleOAConfiguration.xml @@ -0,0 +1,9 @@ + + + + stateless + + MOAFamilyName + MOAGivenName + + diff --git a/id/server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml b/id/server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml new file mode 100644 index 000000000..2cff3bd67 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/oa/SamplewbPKOAConfiguration.xml @@ -0,0 +1,9 @@ + + + + stateless + + MOAWBPK + MOAGivenName + + diff --git a/id/server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt b/id/server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt new file mode 100644 index 000000000..01f724cc4 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/sampleTemplates/LIESMICH_TEMPLATES.txt @@ -0,0 +1,21 @@ +TEMPLATES: +========== +Zweck: +------ +Mithilfe von Templates können Sie das Aussehen der Seiten +"Auswahl der Bürgerkartenumgebung" sowie "Anmeldung mit Bürgerkarte" +anpassen. Damit können Sie zusätzliche Hintergrundinformationen (Wozu +dient die Anmeldung, etc.) zu diesen Seiten hinzufügen und das Layout an +Ihre sonstigen Anwendungen anpassen. + +Wenn Sie in den Beispielkonfigurationsdateien die Elmente +"AuthComponent/Templates" oder "OnlineApplication/AuthComponent/Templates" +aktivieren, dann werden die in diesem Verzeichnis enthaltenen Beispieltemplates +geladen. Es sind dies sehr einfache Templates, die nur das Laden über die +Konfigurationsdatei demonstrieren sollen. (Das Laden der Templates über +die Konfigurationsdatei steht erst ab Version 1.3.1 zur Verfügung). +Etwas aufwendigere Templates (mit CSS) finden Sie als eigene Webapplikation im +Verzeichnis "/auth/templates" der entpackten Distribution. + +Nähere Informationen zu den Templates finden Sie im MOA-ID-Konfigurationshandbuch. + diff --git a/id/server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html b/id/server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html new file mode 100644 index 000000000..2f2ea6552 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/sampleTemplates/SampleBKUSelectionTemplate.html @@ -0,0 +1,44 @@ + + + +MOA ID - Auswahl der B&uuuml;rgerkartenumgebung + + + + + + + +

Auswahl der Bürgerkartenumgebung

+ +

+

Sie haben sich für Anmeldung mit Ihrer Bürgerkarte entschieden. Da es verschiedene Formen der Bürgerkarte gibt, müssen Sie nun wählen, welche Sie bei der Anmeldung verwenden wollen.

+

Auswahl der Bürgerkarte

+
+ + + +
+

+ + + + +

Hinweise:

+
    +
  • +

    Bei der Anmeldung mit einer A-Trust Bürgerkarte oder Ihrer + E-CARD benötigen Sie + eine funktionsfähige Bürgerkartensoftware sowie einen passenden Kartenleser.

    +
  • +
  • +

    Bei der Anmeldung mit der A1-Signatur über Ihr Handy wird keine Bürgerkartensoftware und + kein Kartenleser benötigt.

    +
  • +
+ +

 

+ + + + diff --git a/id/server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html b/id/server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html new file mode 100644 index 000000000..83a6639e6 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/sampleTemplates/SampleTemplate.html @@ -0,0 +1,56 @@ + + + +MOA ID - Identifizierter Zugang mit Bürgerkarte + + + + + + + +

Sicherer Zugang zur Online-Anwendung mit Bürgerkarte

+ +

+ +Der identifizierte Zugang erfolgt über die Module für Online Applikationen (MOA) unter Verwendung einer Bürgerkarte und deren Signaturfunktion. + +

+

Wenn Sie in Folge die Schaltfläche "Anmeldung mit Bürgerkarte" +aktivieren, so werden Sie zur Signatur der Anmeldedaten aufgefordert. Wenn Sie diese +signieren, so werden Sie zur Online-Anwendung weitergeleitet und angemeldet.

+ + +
+
+ + + + +
+
+
+ + + + +
+

+ + +
+ + + diff --git a/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml new file mode 100644 index 000000000..915a6bf2f --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock.xml @@ -0,0 +1,105 @@ + + + + + + + + + Signatur der Anmeldedaten + + + +

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name: + + +
+ Geburtsdatum: + + .. +
+ Applikation: + + +
+ Geschäftsbereich: + + +
+ Anmeldeserver: + + +
+ Datum: + + .. +
+ Uhrzeit: + + :: +
+ wbPK (*): + + +
+ +

+


+
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+ + application/xhtml+xml + +
diff --git a/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml new file mode 100644 index 000000000..5089140b4 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText.xml @@ -0,0 +1,44 @@ + + + + + + + + + Signatur der Anmeldedaten + + + +

Signatur der Anmeldedaten

+

+

Mit meiner elektronischen Signatur beantrage ich, + + , +geboren am +.., den Zugang zur gesicherten Anwendung.

+

+

Datum und Uhrzeit: .., :: +

+ +

wbPK(*): +

+

+


+
(*) wbPK: Das wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+ + application/xhtml+xml + +
diff --git a/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml new file mode 100644 index 000000000..07d926d14 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlockText_deprecated.xml @@ -0,0 +1,49 @@ + + + + + + + + + + Signatur der Anmeldedaten + + +

Signatur der Anmeldedaten

+

+

Mit meiner elektronischen Signatur beantrage ich, , + geboren am + . + . + , + den Zugang zur gesicherten Anwendung.

+

+

Datum und Uhrzeit: + . + . + , + : + : + +

+ +

wbPK(*): +

+

+


+
(*) wbPK: Das wirtschaftsbereichsspezifische + Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens + berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+ + text/html + +
diff --git a/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml new file mode 100644 index 000000000..05f91750c --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/transforms/TransformsInfoAuthBlock_deprecated.xml @@ -0,0 +1,107 @@ + + + + + + + + + + Signatur der Anmeldedaten + + +

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name: + + +
+ Geburtsdatum: + + . + . + +
+ Applikation: + + +
+ Geschäftsbereich: + + +
+ Anmeldeserver: + + +
+ Datum: + + . + . + +
+ Uhrzeit: + + : + : + +
+ wbPK (*): + + +
+ +

+


+
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen + Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige + Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+ + text/html + +
diff --git a/id/server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml b/id/server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml new file mode 100644 index 000000000..008a59d8e --- /dev/null +++ b/id/server/data/deploy/conf/moa-spss/SampleMOASPSSConfiguration.xml @@ -0,0 +1,79 @@ + + + + + + + true + true + + + certstore + + + + + + pkix + + + CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT + 536 + + chaining + + + + MOAIDBuergerkartePersonenbindung + trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten + + + MOAIDBuergerkarteAuthentisierungsDaten + trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten + + + MOAIDBuergerkartePersonenbindungMitTestkarten + trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten + + + MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten + trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten + + + + true + 0 + + CRL + OCSP + + + false + 365 + + + jdbc:url + fully.qualified.classname + + + + + + + MOAIDTransformAuthBlock + profiles/MOAIDTransformAuthBlock.xml + + + MOAIDTransformAuthBlock_deprecated + profiles/MOAIDTransformAuthBlock_deprecated.xml + + + MOAIDTransformAuthBlockText + profiles/MOAIDTransformAuthBlockText.xml + + + MOAIDTransformAuthBlockText_deprecated + profiles/MOAIDTransformAuthBlockText_deprecated.xml + + + diff --git a/id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 b/id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 new file mode 100644 index 000000000..8827ed99c Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden(pwd=allekunden).p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der b/id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der new file mode 100644 index 000000000..332aa817a Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der differ diff --git a/id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 b/id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 new file mode 100644 index 000000000..4499ab52b Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der b/id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der new file mode 100644 index 000000000..63ba5cce5 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der differ diff --git a/id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 b/id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 new file mode 100644 index 000000000..5b7631133 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2(pwd=kunde2).p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der b/id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der new file mode 100644 index 000000000..4f87134e7 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der differ diff --git a/id/server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 b/id/server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 new file mode 100644 index 000000000..c5a43deca Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/keys/customerBMI/moa-signaturdienst-strafregisterbescheinigung.p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml new file mode 100644 index 000000000..6ed91ddc3 --- /dev/null +++ b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock.xml @@ -0,0 +1,103 @@ + + + + + + + + + + Signatur der Anmeldedaten + + + +

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name: + + +
+ Geburtsdatum: + + .. +
+ Applikation: + + +
+ Geschäftsbereich: + + +
+ Anmeldeserver: + + +
+ Datum: + + .. +
+ Uhrzeit: + + :: +
+ wbPK (*): + + +
+ +

+


+
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+
diff --git a/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml new file mode 100644 index 000000000..b116152c8 --- /dev/null +++ b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText.xml @@ -0,0 +1,42 @@ + + + + + + + + + + Signatur der Anmeldedaten + + + +

Signatur der Anmeldedaten

+

+

Mit meiner elektronischen Signatur beantrage ich, + + , +geboren am +.., den Zugang zur gesicherten Anwendung.

+

+

Datum und Uhrzeit: .., :: +

+ +

wbPK(*): +

+

+


+
(*) wbPK: Das wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+
diff --git a/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml new file mode 100644 index 000000000..10854242e --- /dev/null +++ b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlockText_deprecated.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + Signatur der Anmeldedaten + + +

Signatur der Anmeldedaten

+

+

Mit meiner elektronischen Signatur beantrage ich, , + geboren am + . + . + , + den Zugang zur gesicherten Anwendung.

+

+

Datum und Uhrzeit: + . + . + , + : + : + +

+ +

wbPK(*): +

+

+


+
(*) wbPK: Das wirtschaftsbereichsspezifische + Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens + berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+
diff --git a/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml new file mode 100644 index 000000000..0c079da71 --- /dev/null +++ b/id/server/data/deploy/conf/moa-spss/profiles/MOAIDTransformAuthBlock_deprecated.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + Signatur der Anmeldedaten + + +

Bitte bestätigen Sie mit Ihrer Unterschrift folgende Angaben:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name: + + +
+ Geburtsdatum: + + . + . + +
+ Applikation: + + +
+ Geschäftsbereich: + + +
+ Anmeldeserver: + + +
+ Datum: + + . + . + +
+ Uhrzeit: + + : + : + +
+ wbPK (*): + + +
+ +

+


+
(*): Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) wird aus den jeweiligen + Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige + Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+ + +
+
+
+ +
+
diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 b/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 new file mode 100644 index 000000000..33f76bf9c Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1(pwd=kunde1).p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der b/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der new file mode 100644 index 000000000..b6091332c Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/moa-ssl-kunde1.der differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore b/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore new file mode 100644 index 000000000..9c6c55359 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/customer1/trustedServers(pwd=servers).keystore differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 b/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 new file mode 100644 index 000000000..ec7bf8e48 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2(pwd=kunde2).p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der b/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der new file mode 100644 index 000000000..20bc38e14 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/moa-ssl-kunde2.der differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore b/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore new file mode 100644 index 000000000..d32a22f0f Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/customer2/trustedServers(pwd=servers).keystore differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 b/id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 new file mode 100644 index 000000000..af524d060 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server(pwd=server).p12 differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der b/id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der new file mode 100644 index 000000000..c3b3003d9 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/server/moa-ssl-server.der differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore b/id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore new file mode 100644 index 000000000..780e58934 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/tomcat(pwd=server).keystore differ diff --git a/id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore b/id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore new file mode 100644 index 000000000..908e00b42 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/sslKeys/tomcat/trustedClients(pwd=clients).keystore differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer new file mode 100644 index 000000000..d361d919f Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer new file mode 100644 index 000000000..ad13d7b28 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer new file mode 100644 index 000000000..f9f27442b Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer new file mode 100644 index 000000000..b6f39e354 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer new file mode 100644 index 000000000..f9fef65fc Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer new file mode 100644 index 000000000..36a442b89 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer new file mode 100644 index 000000000..836ba3767 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Enc-01-SN0450(CertifiedKeypair_alt).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer new file mode 100644 index 000000000..28cb48bb0 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-TrustSignTest-Sig-01-SN0588(SecureSignatureKeypair_alt).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer new file mode 100644 index 000000000..b7d4b08a6 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer new file mode 100644 index 000000000..69de75609 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer new file mode 100644 index 000000000..8c434777e Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer new file mode 100644 index 000000000..efa28178e Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer new file mode 100644 index 000000000..33e776369 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der new file mode 100644 index 000000000..d3c213711 --- /dev/null +++ b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCACrypt-SN04(CertifiedKeypair).der @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDljCCAwOgAwIBAgIBBDAJBgUrDgMCHQUAMHQxCzAJBgNVBAYTAkFUMSwwKgYD +VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE +CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMRcwFQYDVQQDEw5UZXN0IENBIC0gUm9v +dDAeFw0wNDA1MTgxMzQ1NTdaFw0wOTEyMzEyMjU5MzBaMIGGMQswCQYDVQQGEwJB +VDEsMCoGA1UEChMjU3RhYnN0ZWxsZSBJS1QtU3RyYXRlZ2llIGRlcyBCdW5kZXMx +HjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczEpMCcGA1UEAxQgVGVzdCBD +QSAtIFZlcnNjaGz8c3NlbHVuZyBC/HJnZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0A +MIGJAoGBALmykoSgYUpJiaK5NlC5jTcMQikEIB6kOdS7e82DBbT5G13zQeuiNBA2 +KzLMPMBK62Go+ZV8w94N5cSm2auuempVAHNF80ao9G3wYgK0xOVZXvf/145o8TIw +StPPckmVPL2OPa8/DIB8tqNjblFxy+XcBnTQMLKaxYSzwA/zULoNAgMBAAGjggEr +MIIBJzAOBgNVHQ8BAf8EBAMCAcYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4E +FgQUjRMKvtgH3PngerFS/Rt+vuEDbLMwXQYDVR0gBFYwVDBSBgwrBgEEAZUSAQID +AQEwQjBABggrBgEFBQcCAjA0GjJEaWVzZXMgWmVydGlmaWthdCBpc3QgbnVyIGb8 +ciBUZXN0endlY2tlIGdlZWlnbmV0LjA5BgNVHR8EMjAwMC6gLKAqhihodHRwOi8v +bGFicy5jaW8uZ3YuYXQvdGVtcC9jcmxzL3Jvb3QuY3JsMBQGByooAAoBAQEECQwH +QktBLUlLVDARBglghkgBhvhCAQEEBAMCAQIwHwYDVR0jBBgwFoAUZWxSwiqQLpxu +4vk3Op4dYHG46XswCQYFKw4DAh0FAAOBgQAnuY7RPFXLpO2hb3h1B0cy5p861j6E +eD+c/ZKAGqIh4kh3A65D8Zl90GSv9vV4L03dnN5hc7rm/bwKzDI57/PI2dL0H/S4 +OOl4tt4fZmjN8Xrv3oJxNEa+6AJ8TGCcouc/Eqxnpc0SxkP6UQrA8J8RM/8fk05U +DAyTZbTQ5wPIhA== +-----END CERTIFICATE----- diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der new file mode 100644 index 000000000..807fa786c Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/Stabsstelle-TestCASig-SN03(SecureSignatureKeypair).der differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer new file mode 100644 index 000000000..fc5bd433b Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN16f8(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer new file mode 100644 index 000000000..f3cf5e676 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Enc-01SN4848(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer new file mode 100644 index 000000000..28fbdf42f Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN16f9(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer new file mode 100644 index 000000000..c9da41583 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/a-sign-TEST-Premium-Sig-01SN484a(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenMitTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer new file mode 100644 index 000000000..d361d919f Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011130-20041130.SerNo01f6(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer new file mode 100644 index 000000000..ad13d7b28 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20011215-20041215.SerNo021e(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer new file mode 100644 index 000000000..f9f27442b Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo0291(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer new file mode 100644 index 000000000..b6f39e354 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20020207-20050207.SerNo210d(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer new file mode 100644 index 000000000..f9fef65fc Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-01.20041201-20141201.SerNoE243(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer new file mode 100644 index 000000000..36a442b89 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-Qual-02.20041203-20141203.SerNoE248(SecureSignatureKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01-20011201-20041201.SerNo0213(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer new file mode 100644 index 000000000..b7d4b08a6 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20010427-20040427.SerNo006f(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0213(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer new file mode 100644 index 000000000..69de75609 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20011212-20041212.SerNo0218(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer new file mode 100644 index 000000000..8c434777e Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer new file mode 100644 index 000000000..efa28178e Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-01.20041201-20141201.SerNoe242(CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer new file mode 100644 index 000000000..33e776369 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom.A1 Signatur.20040326-20140326.SerNo6646(SecureSignatureKeypair_CertifiedKeypair).cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkarteAuthentisierungsDatenOhneTestkarten/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer new file mode 100644 index 000000000..5171276f4 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungMitTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer differ diff --git a/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer new file mode 100644 index 000000000..5171276f4 Binary files /dev/null and b/id/server/data/deploy/conf/moa-spss/trustprofiles/MOAIDBuergerkartePersonenbindungOhneTestkarten/a-sign-corporate-light-03-20051114-20151114.SerNo01AAED.cer differ diff --git a/id/server/data/deploy/templates/LIESMICH_TEMPLATES.txt b/id/server/data/deploy/templates/LIESMICH_TEMPLATES.txt new file mode 100644 index 000000000..e23ebad6e --- /dev/null +++ b/id/server/data/deploy/templates/LIESMICH_TEMPLATES.txt @@ -0,0 +1,39 @@ +TEMPLATES: +========== +Zweck: +------ +Mithilfe von Templates können Sie das Aussehen der Seiten +"Auswahl der Bürgerkartenumgebung" sowie "Anmeldung mit Bürgerkarte" +anpassen. Damit können Sie zusätzliche Hintergrundinformationen (Wozu +dient die Anmeldung, etc.) zu diesen Seiten hinzufügen und das Layout an +Ihre sonstigen Anwendungen anpassen. + +Wird kein Template mit den Parametern Template und BKUSelectionTemplate +angegeben, so wird defaultmäßig jew. eine schlichte "neutrale" Variante +angezeigt. + +Bei der Erstellung von Template muss die Form gemäß MOA-ID Dokumentation +Abschnitt: "Aufruf von MOA-ID" (id-anwendung_1.htm) eingehalten werden. + +Templates können Grundsätzlich von jeder HTTP Adresse abgerufen +werden, d.h. sie können auf einen belibigen Webserver abgelegt werden. + + +Anwendung des Beispiels: +------------------------ +Wenn Sie keinen anderen Webserver zum Ablegen der Templates verwenden möchten, +so kann die Webcontainer Fähigkeit von Tomcat für die Ablage der HTML-Templates +genutzt werden. Ein einfaches Beispiel mit den beiden Templates +"SampleBKUSelectionTemplate.html" sowie "SampleTemplate.html" findet sich im +WAR Archiv moaid-templates.war + + +Wenn dieses WAR Archiv in das webapps Verzeichnis von Tomcat gestellt wird, so +wird diese automatisch entpackt und deployed. In Folge können Sie die Template +Dateien per Parameter beim Aufruf von MOA-ID angeben. + +Beispiel Link mit Einsatz von Template: +https://localhost:8443/moa-id-auth/SelectBKU?Target=Test-Bereich&OA=https://localhost:8443/&BKUSelectionTemplate=http://localhost:8080/moaid-templates/SampleBKUSelectionTemplate.html&Template=http://localhost:8080/moaid-templates/SampleTemplate.html + + +Sie können diese beiden Templates als Vorlage für eigene Designs verwenden. \ No newline at end of file diff --git a/id/server/data/deploy/templates/moaid-templates.war b/id/server/data/deploy/templates/moaid-templates.war new file mode 100644 index 000000000..72b034d5c Binary files /dev/null and b/id/server/data/deploy/templates/moaid-templates.war differ diff --git a/id/server/data/deploy/tomcat/server.mod_jk.xml b/id/server/data/deploy/tomcat/server.mod_jk.xml new file mode 100644 index 000000000..b32cf7844 --- /dev/null +++ b/id/server/data/deploy/tomcat/server.mod_jk.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/data/deploy/tomcat/server.xml b/id/server/data/deploy/tomcat/server.xml new file mode 100644 index 000000000..2fd7b6439 --- /dev/null +++ b/id/server/data/deploy/tomcat/server.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar b/id/server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar new file mode 100644 index 000000000..62c7645b9 Binary files /dev/null and b/id/server/data/deploy/tomcat/tomcat-util-4.1.27-patched/tomcat-util.jar differ diff --git a/id/server/data/deploy/tomcat/unix/tomcat-start.sh b/id/server/data/deploy/tomcat/unix/tomcat-start.sh new file mode 100644 index 000000000..6dc0289d5 --- /dev/null +++ b/id/server/data/deploy/tomcat/unix/tomcat-start.sh @@ -0,0 +1,28 @@ +#! /bin/bash + +export JAVA_HOME= +export CATALINA_HOME= +export CATALINA_BASE=$CATALINA_HOME + +CONFIG_OPT=-Dmoa.id.configuration=$CATALINA_BASE/conf/moa-id/SampleMOAIDConfiguration.xml +LOGGING_OPT=-Dlog4j.configuration=file:$CATALINA_BASE/conf/moa-id/log4j.properties +SPSS_OPT=-Dmoa.spss.server.configuration=$CATALINA_BASE/conf/moa-spss/SampleMOASPSSConfiguration.xml + +#TRUST_STORE_OPT=-Djavax.net.ssl.trustStore=$CATALINA_BASE/conf/moa-spss/keys/clients/trustedMOAClients-password=changeit.keystore +#TRUST_STORE_PASS_OPT=-Djavax.net.ssl.trustStorePassword=changeit +#TRUST_STORE_TYPE_OPT=-Djavax.net.ssl.trustStoreType=jks + +export CATALINA_OPTS="$CONFIG_OPT $LOGGING_OPT $SPSS_OPT $TRUST_STORE_OPT $TRUST_STORE_PASS_OPT $TRUST_STORE_TYPE_OPT" + +echo CATALINA_HOME: $CATALINA_HOME +echo CATALINA_BASE: $CATALINA_BASE +echo CATALINA_OPTS: $CATALINA_OPTS + +echo +echo Moving old log files to logs\backup +mv logs/*.out logs/backup +mv logs/*.txt logs/backup +mv logs/*.log logs/backup + +cd $CATALINA_HOME +./bin/startup.sh diff --git a/id/server/data/deploy/tomcat/unix/tomcat-stop.sh b/id/server/data/deploy/tomcat/unix/tomcat-stop.sh new file mode 100644 index 000000000..82e4ffcfe --- /dev/null +++ b/id/server/data/deploy/tomcat/unix/tomcat-stop.sh @@ -0,0 +1,7 @@ +#! /bin/bash + +export JAVA_HOME= +export CATALINA_HOME= + +cd $CATALINA_HOME +./bin/shutdown.sh \ No newline at end of file diff --git a/id/server/data/deploy/tomcat/uriworkermap.properties b/id/server/data/deploy/tomcat/uriworkermap.properties new file mode 100644 index 000000000..32b4c1f50 --- /dev/null +++ b/id/server/data/deploy/tomcat/uriworkermap.properties @@ -0,0 +1,9 @@ +# a sample mod_jk uriworkermap.properties file for mapping +# MOA-ID-AUTH and MOA-ID-PROXY web service requests to workers +# +# omit the mappings you don't need + +#/moa-id-auth/*=moaworker + +#forward all requests to tomcat (e.g.) +/*=moaworker \ No newline at end of file diff --git a/id/server/data/deploy/tomcat/win32/startTomcat.bat b/id/server/data/deploy/tomcat/win32/startTomcat.bat new file mode 100644 index 000000000..f6ebc3613 --- /dev/null +++ b/id/server/data/deploy/tomcat/win32/startTomcat.bat @@ -0,0 +1,26 @@ +rem ---------------------------------------------------------------------------------------------- +rem Modify these entries according to your needs + +rem JDK home directory (no trailing path separator) +set JAVA_HOME= + +rem Tomcat 4.1.x home directory (no trailing path separator) +set CATALINA_HOME= + +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/data/deploy/tomcat/win32/stopTomcat.bat b/id/server/data/deploy/tomcat/win32/stopTomcat.bat new file mode 100644 index 000000000..09dd83f2d --- /dev/null +++ b/id/server/data/deploy/tomcat/win32/stopTomcat.bat @@ -0,0 +1,13 @@ +rem ---------------------------------------------------------------------------------------------- +rem Modify these entries according to your needs + +rem JDK home directory (no trailing path separator) +set JAVA_HOME= + +rem Tomcat 4.1.x home directory (no trailing path separator) +set CATALINA_HOME= + +rem ---------------------------------------------------------------------------------------------- + +cd %CATALINA_HOME% +bin\catalina.bat stop \ No newline at end of file diff --git a/id/server/data/deploy/tomcat/workers.properties b/id/server/data/deploy/tomcat/workers.properties new file mode 100644 index 000000000..9350ddc77 --- /dev/null +++ b/id/server/data/deploy/tomcat/workers.properties @@ -0,0 +1,6 @@ +# a sample workers.properties file defining a single mod_jk worker + +worker.list=moaworker +worker.moaworker.type=ajp13 +worker.moaworker.host=localhost +worker.moaworker.port=8009 diff --git a/id/server/doc/Architektur ID.vsd b/id/server/doc/Architektur ID.vsd new file mode 100644 index 000000000..d4678007a Binary files /dev/null and b/id/server/doc/Architektur ID.vsd differ diff --git a/id/server/doc/MOA ID 1.x.wsdl b/id/server/doc/MOA ID 1.x.wsdl new file mode 100644 index 000000000..06daae8f1 --- /dev/null +++ b/id/server/doc/MOA ID 1.x.wsdl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/doc/MOA-ID Feinspezifikation.doc b/id/server/doc/MOA-ID Feinspezifikation.doc new file mode 100644 index 000000000..e71ffa8e6 Binary files /dev/null and b/id/server/doc/MOA-ID Feinspezifikation.doc differ diff --git a/id/server/doc/MOA-ID-Configuration-1.2.xsd b/id/server/doc/MOA-ID-Configuration-1.2.xsd new file mode 100644 index 000000000..4b018db64 --- /dev/null +++ b/id/server/doc/MOA-ID-Configuration-1.2.xsd @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter der + Authentisierungs-Komponente + + + + + enthält Konfigurationsparameter der + Proxy-Komponente + + + + + + enthält Parameter für die Kommunikation zw. + Proxykomponente und Authenttisierungskomponente + + + + + + enthält Parameter für die SOAP-Verbindung von der + Proxy-Komponente zur Auth-Komponente (vgl. + AuthComponent/MOA-SP/ConnectionParameter) + + + + + + + + + + + enthält Parameter für die OA + + + + + + + + + + + + + spezifiziert den Algorithmus ("pkix" oder "chaining") für die + Zertifikatspfadvalidierung + + + + + + ein vom SystemDefaultMode abweichender ChiningMode kann + für jeden TrustAnchor gesetzt werden + + + + + + + + + + + + + + + + verweist auf ein Verzeichnis, das vertrauenswürdige CA + (Zwischen-CA, Wurzel-CA) Zertifikate enthält. + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter für die Kommunikation mit dem + Security-Layer + + + + + + das Attribut filename verweist auf eine Datei mit globalem + Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo + werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks + inkludiert + + + + + + + + + + + enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA + SP Modul + + + + + + enthält Parameter für die SOAP-Verbindung von der + AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; + wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; + wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben + werden; wird das Element nicht verwendet dann wird MOA-SP über das API + aufgerufen + + + + + enthält Parameter für die Ãœberprüfung der + Personenbindung + + + + + + + + + + enthält Parameter für die Ãœberprüfung des + AUTH-Blocks + + + + + + + + + + + + + + enthält Informationen über akzeptierte Signers des + IdentityLinks + + + + + + akzeptierte Signer des IdentityLinks werden per + X509SubjectName (Kodierung nach RFC 2253) identifiziert + + + + + + + + + + + + + enthält Parameter über die OA, die die + Authentisierungs-Komponente betreffen + + + + + + + + + + enthält Parameter über die OA, die die Proxy-Komponente + betreffen + + + + + + enthält Parameter über die OA, die die Proxy-Komponente + betreffen + + + + + + + + + + + + + + + + + URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der + TLS-Verbindung enthält (keine CA-Zertifikate) + + + + + + + + + + + + URL zu einem KeyStore, der den privaten Schlüssel, der für + die TLS-Client-Authentisierung verwendetwird, enthält + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/doc/MOA-ID-Configuration-1.3.xsd b/id/server/doc/MOA-ID-Configuration-1.3.xsd new file mode 100644 index 000000000..66c6e1832 --- /dev/null +++ b/id/server/doc/MOA-ID-Configuration-1.3.xsd @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter der + Authentisierungs-Komponente + + + + + enthält Konfigurationsparameter der + Proxy-Komponente + + + + + + enthält Parameter für die Kommunikation zw. + Proxykomponente und Authenttisierungskomponente + + + + + + enthält Parameter für die SOAP-Verbindung von der + Proxy-Komponente zur Auth-Komponente (vgl. + AuthComponent/MOA-SP/ConnectionParameter) + + + + + + + + + + + enthält Parameter für die OA + + + + + + + + + + + + + + + + + + + + + spezifiziert den Algorithmus ("pkix" oder "chaining") für die + Zertifikatspfadvalidierung + + + + + + ein vom SystemDefaultMode abweichender ChiningMode kann + für jeden TrustAnchor gesetzt werden + + + + + + + + + + + + + + + + verweist auf ein Verzeichnis, das vertrauenswürdige CA + (Zwischen-CA, Wurzel-CA) Zertifikate enthält. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter für die Kommunikation mit dem + Security-Layer + + + + + + + + + + enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA + SP Modul + + + + + + enthält Parameter für die SOAP-Verbindung von der + AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; + wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; + wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben + werden; wird das Element nicht verwendet dann wird MOA-SP über das API + aufgerufen + + + + + enthält Parameter für die Ãœberprüfung der + Personenbindung + + + + + + + + + + enthält Parameter für die Ãœberprüfung des + AUTH-Blocks + + + + + + + + + + + + + + enthält Informationen über akzeptierte Signers des + IdentityLinks + + + + + + akzeptierte Signer des IdentityLinks werden per + X509SubjectName (Kodierung nach RFC 2253) identifiziert + + + + + + + + + + das Attribut filename verweist auf eine Datei mit globalem + Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo + werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks + inkludiert + + + + + + + + + + + + das Attribut URL spezifiziert die Lage des Templates + + + + + + + + + enthält Parameter über die OA, die die + Authentisierungs-Komponente betreffen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter über die OA, die die Proxy-Komponente + betreffen + + + + + + enthält Parameter über die OA, die die Proxy-Komponente + betreffen + + + + + + + + + + + + + + + + + + URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der + TLS-Verbindung enthält (keine CA-Zertifikate) + + + + + + + + + + + + URL zu einem KeyStore, der den privaten Schlüssel, der für + die TLS-Client-Authentisierung verwendetwird, enthält + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/doc/MOA-ID-Configuration-1.4.xsd b/id/server/doc/MOA-ID-Configuration-1.4.xsd new file mode 100644 index 000000000..66a9c0ed4 --- /dev/null +++ b/id/server/doc/MOA-ID-Configuration-1.4.xsd @@ -0,0 +1,505 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter der + Authentisierungs-Komponente + + + + + enthält Konfigurationsparameter der + Proxy-Komponente + + + + + + enthält Parameter für die Kommunikation zw. + Proxykomponente und Authenttisierungskomponente + + + + + + enthält Parameter für die SOAP-Verbindung von der + Proxy-Komponente zur Auth-Komponente (vgl. + AuthComponent/MOA-SP/ConnectionParameter) + + + + + + + + + + + enthält Parameter für die OA + + + + + + + + + + + + + + + + + + + + + + spezifiziert den Algorithmus ("pkix" oder "chaining") für die + Zertifikatspfadvalidierung + + + + + + ein vom SystemDefaultMode abweichender ChiningMode kann + für jeden TrustAnchor gesetzt werden + + + + + + + + + + + + + + + + verweist auf ein Verzeichnis, das vertrauenswürdige CA + (Zwischen-CA, Wurzel-CA) Zertifikate enthält. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter für die Kommunikation mit dem + Security-Layer + + + + + + + + + + enthält Konfiguratiosnparameter für die Kommunikation mit dem MOA + SP Modul + + + + + + enthält Parameter für die SOAP-Verbindung von der + AUTH-Komponente zu MOA-SP; das Attribut URL enthält den Endpunkt des Server; + wird das Schema "https" verwendet müssen die Kind-Elemente angegeben werden; + wird das Schema "http" verwendet dürfen keine Kind-Elemente angegeben + werden; wird das Element nicht verwendet dann wird MOA-SP über das API + aufgerufen + + + + + enthält Parameter für die Ãœberprüfung der + Personenbindung + + + + + + + + + + enthält Parameter für die Ãœberprüfung des + AUTH-Blocks + + + + + + + + + + + + + + enthält Informationen über akzeptierte Signers des + IdentityLinks + + + + + + akzeptierte Signer des IdentityLinks werden per + X509SubjectName (Kodierung nach RFC 2253) identifiziert + + + + + + + + enthält Defaultparameter für die Ãœberprüfung weiterer Infoboxen + + + + + + + das Attribut filename verweist auf eine Datei mit globalem + Element TransformsInfo vom Typ sl10:TransformsInfo; diese TransformsInfo + werden in den CreateXMLSignatureRequest für die Signatur des AUTH-Blocks + inkludiert + + + + + + + + + + + + das Attribut URL spezifiziert die Lage des Templates + + + + + + Verifikation zusätzlicher Infoboxen + + + + + Optionales DefaultTrustprofil für die Ãœberprüfung aller weiteren Infoboxen + + + + + + + + + + Parameter für Ãœberprüfung weiterer Infoboxen + + + + + + optionalervName, der für Fehlermeldungen verwendet werden soll; + z.B.: "Stellvertretungen" für "Mandates"; fehlt dieser Parameter, dann wird + das Identifier-Attribut verwendet + + + + + TrustProfil, das für die Ãœberprüfung der Infobox + verwendet werden soll + + + + + Validatorklasse, die für die Prüfung der Infobox + verwendet werden soll; muss gesetzt werden, wenn Package- und Klassenname + vom Default Package- und Klassennamen abweichen + + + + + + Infobox spezifische Parameter, die der jeweiligen Prüfapplikation + übergeben werden + + + + + + + + + + + + + + + + + + + Spezifiziert die Lage von XML Schemas + + + + + + + + + + + + + + + + enthält Parameter über die OA, die die + Authentisierungs-Komponente betreffen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter über die OA, die die Proxy-Komponente + betreffen + + + + + + enthält Parameter über die OA, die die Proxy-Komponente + betreffen + + + + + + + + + + + + + + + + + + URL zu einem Verzeichnis, das akzeptierte Server-Zertifikate der + TLS-Verbindung enthält (keine CA-Zertifikate) + + + + + + + + + + + + URL zu einem KeyStore, der den privaten Schlüssel, der für + die TLS-Client-Authentisierung verwendetwird, enthält + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/doc/MOA_ID_1.2_20040315.pdf b/id/server/doc/MOA_ID_1.2_20040315.pdf new file mode 100644 index 000000000..0c89c2730 Binary files /dev/null and b/id/server/doc/MOA_ID_1.2_20040315.pdf differ diff --git a/id/server/doc/MOA_ID_1.3_20060315.pdf b/id/server/doc/MOA_ID_1.3_20060315.pdf new file mode 100644 index 000000000..c9b0d160c Binary files /dev/null and b/id/server/doc/MOA_ID_1.3_20060315.pdf differ diff --git a/id/server/doc/MOA_ID_1.4_20070802.pdf b/id/server/doc/MOA_ID_1.4_20070802.pdf new file mode 100644 index 000000000..a3a2f1177 Binary files /dev/null and b/id/server/doc/MOA_ID_1.4_20070802.pdf differ diff --git a/id/server/doc/OID-1-0-3.pdf b/id/server/doc/OID-1-0-3.pdf new file mode 100644 index 000000000..4beab3e41 Binary files /dev/null and b/id/server/doc/OID-1-0-3.pdf differ diff --git a/id/server/doc/api-doc/allclasses-frame.html b/id/server/doc/api-doc/allclasses-frame.html new file mode 100644 index 000000000..114c4b426 --- /dev/null +++ b/id/server/doc/api-doc/allclasses-frame.html @@ -0,0 +1,35 @@ + + + + + + +All Classes + + + + + +All Classes +
+ + + + + +
AuthenticationData +
+AuthenticationException +
+AuthenticationServer +
+ConnectionBuilder +
+LoginParameterResolver +
+OAConfiguration +
+
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html new file mode 100644 index 000000000..313defcbc --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html @@ -0,0 +1,171 @@ + + + + + + +MOA ID API: Class AuthenticationException + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.id +
+Class AuthenticationException

+
+at.gv.egovernment.moa.id.AuthenticationException
+
+
+
+
public class AuthenticationException
+ +

+Exception thrown during handling of AuthenticationSession +

+


+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
AuthenticationException(String messageId, + Object[] parameters) + +
+          Constructor for AuthenticationException.
+  + + + +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+AuthenticationException

+
+public AuthenticationException(String messageId,
+                               Object[] parameters)
+
+
Constructor for AuthenticationException.
+
Parameters:
messageId -  
+
+
+ + + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html new file mode 100644 index 000000000..7aaad7c68 --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html @@ -0,0 +1,259 @@ + + + + + + +MOA ID API: Class AuthenticationServer + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.id.auth +
+Class AuthenticationServer

+
+java.lang.Object
+  |
+  +--at.gv.egovernment.moa.id.auth.AuthenticationServer
+
+
+
+
public class AuthenticationServer
extends Object
+ +

+API for MOA ID Authentication Service.
+ AuthenticationSession is stored in a session store and retrieved + by giving the session ID. +

+


+ +

+ + + + + + + + + + +
+Field Summary
+  + + + + + + + + + + +
+Constructor Summary
AuthenticationServer() + +
+          Constructor for AuthenticationServer.
+  + + + + + + + + + + + + + + + +
+Method Summary
+ AuthenticationDatagetAuthenticationData(String samlArtifact) + +
+          Retrieves AuthenticationData indexed by the SAML artifact. +
+static AuthenticationServergetInstance() + +
+          Returns the single instance of AuthenticationServer.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, +equals, +finalize, +getClass, +hashCode, +notify, +notifyAll, +toString, +wait, +wait, +wait
+  +

+ + + + + + + + +
+Field Detail
+ + + + + + + + +
+Constructor Detail
+ +

+AuthenticationServer

+
+public AuthenticationServer()
+
+
Constructor for AuthenticationServer.
+ + + + + + + + +
+Method Detail
+ +

+getInstance

+
+public static AuthenticationServer getInstance()
+
+
Returns the single instance of AuthenticationServer.
+
Returns:
the single instance of AuthenticationServer
+
+
+
+ +

+getAuthenticationData

+
+public AuthenticationData getAuthenticationData(String samlArtifact)
+                                         throws AuthenticationException
+
+
Retrieves AuthenticationData indexed by the SAML artifact. + The AuthenticationData is deleted from the store upon end of this call.
+
Returns:
AuthenticationData
+
+
+
+ + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html new file mode 100644 index 000000000..ece0242d9 --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html @@ -0,0 +1,114 @@ + + + + + + +MOA ID API: Uses of Class at.gv.egovernment.moa.id.auth.AuthenticationServer + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.auth.AuthenticationServer

+
+ + + + + +
+Uses of AuthenticationServer in at.gv.egovernment.moa.id.auth
+  +

+ + + + + + + + + +
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationServer
+static AuthenticationServerAuthenticationServer.getInstance() + +
+          Returns the single instance of AuthenticationServer.
+  +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html new file mode 100644 index 000000000..96ff7f4af --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html @@ -0,0 +1,194 @@ + + + + + + +MOA ID API: Uses of Class at.gv.egovernment.moa.id.AuthenticationException + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.AuthenticationException

+
+ + + + + +
+Uses of AuthenticationException in at.gv.egovernment.moa.id.auth
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.auth that throw AuthenticationException
+ StringAuthenticationServer.selectBKU(String authURL, + String target, + String oaURL, + String bkuSelectionTemplateURL, + String templateURL) + +
+          Processes request to select a BKU. +
+ StringAuthenticationServer.startAuthentication(String authURL, + String target, + String oaURL, + String templateURL, + String bkuURL, + String sessionID) + +
+          Processes the beginning of an authentication session. +
+ StringAuthenticationServer.verifyIdentityLink(String sessionID, + String xmlInfoboxReadResponse) + +
+          Processes an <InfoboxReadResponse> sent by the + security layer implementation.
+ + Validates given <InfoboxReadResponse> + Parses identity link enclosed in <InfoboxReadResponse> + Verifies identity link by calling the MOA SP component + Checks certificate authority of identity link + Stores identity link in the session + Creates an authentication block to be signed by the user + Creates and returns a <CreateXMLSignatureRequest> + containg the authentication block, meant to be returned to the + security layer implementation +
+ StringAuthenticationServer.verifyAuthenticationBlock(String sessionID, + String xmlCreateXMLSignatureReadResponse) + +
+          Processes a <CreateXMLSignatureResponse> sent by the + security layer implementation.
+ + Validates given <CreateXMLSignatureResponse> + Parses <CreateXMLSignatureResponse> for error codes + Parses authentication block enclosed in + <CreateXMLSignatureResponse> + Verifies authentication block by calling the MOA SP component + Creates authentication data + Creates a corresponding SAML artifact + Stores authentication data in the authentication data store + indexed by the SAML artifact + Deletes authentication session + Returns the SAML artifact, encoded BASE64 +
+ AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) + +
+          Retrieves AuthenticationData indexed by the SAML artifact. +
+static at.gv.egovernment.moa.id.auth.data.AuthenticationSessionAuthenticationServer.getSession(String id) + +
+          Retrieves a session from the session store.
+  +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html new file mode 100644 index 000000000..ec020b79d --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html @@ -0,0 +1,526 @@ + + + + + + +MOA ID API: Class OAConfiguration + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.id.config.proxy +
+Class OAConfiguration

+
+java.lang.Object
+  |
+  +--at.gv.egovernment.moa.id.config.proxy.OAConfiguration
+
+
+
+
public class OAConfiguration
extends Object
+ +

+Holds configuration data concerning an online application for use by the MOA-ID Proxy component. + These include the login type (stateful or stateless), the HTTP authentication type, + and information needed to add authentication parameters or headers for a URL connection + to the remote online application. +

+

+
See Also:
MOAIDConfiguration-1.1.xsd, element Configuration
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static StringBASIC_AUTH + +
+           
+static StringHEADER_AUTH + +
+           
+static StringLOGINTYPE_STATEFUL + +
+           
+static StringLOGINTYPE_STATELESS + +
+           
+static StringPARAM_AUTH + +
+           
+  + + + + + + + + + + +
+Constructor Summary
OAConfiguration() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ StringgetAuthType() + +
+          Returns the authType.
+ StringgetBasicAuthPasswordMapping() + +
+          Returns the basicAuthPasswordMapping.
+ StringgetBasicAuthUserIDMapping() + +
+          Returns the basicAuthUserIDMapping.
+ MapgetHeaderAuthMapping() + +
+          Returns the headerAuthMapping.
+ StringgetLoginType() + +
+          Returns the loginType.
+ MapgetParamAuthMapping() + +
+          Returns the paramAuthMapping.
+ voidsetAuthType(String authLoginType) + +
+          Sets the authType.
+ voidsetBasicAuthPasswordMapping(String basicAuthPassword) + +
+          Sets the basicAuthPasswordMapping.
+ voidsetBasicAuthUserIDMapping(String basicAuthUserID) + +
+          Sets the basicAuthUserIDMapping.
+ voidsetHeaderAuthMapping(HashMap headerAuth) + +
+          Sets the headerAuthMapping.
+ voidsetLoginType(String loginType) + +
+          Sets the loginType.
+ voidsetParamAuthMapping(HashMap paramAuth) + +
+          Sets the paramAuthMapping.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, +equals, +finalize, +getClass, +hashCode, +notify, +notifyAll, +toString, +wait, +wait, +wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+LOGINTYPE_STATEFUL

+
+public static final String LOGINTYPE_STATEFUL
+
+
+
+ +

+LOGINTYPE_STATELESS

+
+public static final String LOGINTYPE_STATELESS
+
+
+
+ +

+BASIC_AUTH

+
+public static final String BASIC_AUTH
+
+
+
+ +

+HEADER_AUTH

+
+public static final String HEADER_AUTH
+
+
+
+ +

+PARAM_AUTH

+
+public static final String PARAM_AUTH
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+OAConfiguration

+
+public OAConfiguration()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getBasicAuthPasswordMapping

+
+public String getBasicAuthPasswordMapping()
+
+
Returns the basicAuthPasswordMapping.
+
Returns:
String
+
+
+
+ +

+getBasicAuthUserIDMapping

+
+public String getBasicAuthUserIDMapping()
+
+
Returns the basicAuthUserIDMapping.
+
Returns:
String
+
+
+
+ +

+getHeaderAuthMapping

+
+public Map getHeaderAuthMapping()
+
+
Returns the headerAuthMapping.
+
Returns:
HashMap
+
+
+
+ +

+getLoginType

+
+public String getLoginType()
+
+
Returns the loginType.
+
Returns:
String
+
+
+
+ +

+getParamAuthMapping

+
+public Map getParamAuthMapping()
+
+
Returns the paramAuthMapping.
+
Returns:
HashMap
+
+
+
+ +

+setBasicAuthPasswordMapping

+
+public void setBasicAuthPasswordMapping(String basicAuthPassword)
+
+
Sets the basicAuthPasswordMapping.
+
Parameters:
basicAuthPasswordMapping - The basicAuthPasswordMapping to set
+
+
+
+ +

+setBasicAuthUserIDMapping

+
+public void setBasicAuthUserIDMapping(String basicAuthUserID)
+
+
Sets the basicAuthUserIDMapping.
+
Parameters:
basicAuthUserIDMapping - The basicAuthUserIDMapping to set
+
+
+
+ +

+setHeaderAuthMapping

+
+public void setHeaderAuthMapping(HashMap headerAuth)
+
+
Sets the headerAuthMapping.
+
Parameters:
headerAuthMapping - The headerAuthMapping to set
+
+
+
+ +

+setLoginType

+
+public void setLoginType(String loginType)
+
+
Sets the loginType.
+
Parameters:
loginType - The loginType to set
+
+
+
+ +

+setParamAuthMapping

+
+public void setParamAuthMapping(HashMap paramAuth)
+
+
Sets the paramAuthMapping.
+
Parameters:
paramAuthMapping - The paramAuthMapping to set
+
+
+
+ +

+getAuthType

+
+public String getAuthType()
+
+
Returns the authType.
+
Returns:
String
+
+
+
+ +

+setAuthType

+
+public void setAuthType(String authLoginType)
+
+
Sets the authType.
+
Parameters:
authType - The authType to set
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html new file mode 100644 index 000000000..c41742f7a --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html @@ -0,0 +1,126 @@ + + + + + + +MOA ID API: Uses of Class at.gv.egovernment.moa.id.config.proxy.OAConfiguration + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.config.proxy.OAConfiguration

+
+ + + + + +
+Uses of OAConfiguration in at.gv.egovernment.moa.id.proxy
+  +

+ + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.proxy with parameters of type OAConfiguration
+ MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+  +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html new file mode 100644 index 000000000..0a0906e25 --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html @@ -0,0 +1,751 @@ + + + + + + +MOA ID API: Class AuthenticationData + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.id.data +
+Class AuthenticationData

+
+java.lang.Object
+  |
+  +--at.gv.egovernment.moa.id.data.AuthenticationData
+
+
+
+
public class AuthenticationData
extends Object
+ +

+Encapsulates authentication data contained in a <saml:Assertion>. +

+


+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
AuthenticationData() + +
+          Constructor for AuthenticationData.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ StringgetAssertionID() + +
+          Returns the assertionID.
+ StringgetDateOfBirth() + +
+          Returns the dateOfBirth.
+ StringgetFamilyName() + +
+          Returns the familyName.
+ StringgetGivenName() + +
+          Returns the givenName.
+ StringgetIdentificationValue() + +
+          Returns the identificationValue.
+ StringgetIssueInstant() + +
+          Returns the issueInstant.
+ StringgetIssuer() + +
+          Returns the issuer.
+ intgetMajorVersion() + +
+          Returns the majorVersion.
+ intgetMinorVersion() + +
+          Returns the minorVersion.
+ StringgetPublicAuthorityCode() + +
+          Returns the publicAuthorityCode.
+ StringgetSamlAssertion() + +
+          Returns the samlAssertion.
+ DategetTimestamp() + +
+          Returns the timestamp.
+ StringgetVPK() + +
+          Returns the vpk.
+ booleanisPublicAuthority() + +
+          Returns the publicAuthority.
+ booleanisQualifiedCertificate() + +
+          Returns the qualifiedCertificate.
+ voidsetAssertionID(String assertionID) + +
+          Sets the assertionID.
+ voidsetDateOfBirth(String dateOfBirth) + +
+          Sets the dateOfBirth.
+ voidsetFamilyName(String gamilyName) + +
+          Sets the familyName.
+ voidsetGivenName(String givenName) + +
+          Sets the givenName.
+ voidsetIdentificationValue(String identificationValue) + +
+          Sets the identificationValue.
+ voidsetIssueInstant(String issueInstant) + +
+          Sets the issueInstant.
+ voidsetIssuer(String issuer) + +
+          Sets the issuer.
+ voidsetMajorVersion(int majorVersion) + +
+          Sets the majorVersion.
+ voidsetMinorVersion(int minorVersion) + +
+          Sets the minorVersion.
+ voidsetPublicAuthority(boolean publicAuthority) + +
+          Sets the publicAuthority.
+ voidsetPublicAuthorityCode(String publicAuthorityIdentification) + +
+          Sets the publicAuthorityCode.
+ voidsetQualifiedCertificate(boolean qualifiedCertificate) + +
+          Sets the qualifiedCertificate.
+ voidsetSamlAssertion(String samlAssertion) + +
+          Sets the samlAssertion.
+ voidsetVPK(String vpk) + +
+          Sets the vpk.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, +equals, +finalize, +getClass, +hashCode, +notify, +notifyAll, +toString, +wait, +wait, +wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+AuthenticationData

+
+public AuthenticationData()
+
+
Constructor for AuthenticationData.
+ + + + + + + + +
+Method Detail
+ +

+getMinorVersion

+
+public int getMinorVersion()
+
+
Returns the minorVersion.
+
Returns:
int
+
+
+
+ +

+isPublicAuthority

+
+public boolean isPublicAuthority()
+
+
Returns the publicAuthority.
+
Returns:
boolean
+
+
+
+ +

+getPublicAuthorityCode

+
+public String getPublicAuthorityCode()
+
+
Returns the publicAuthorityCode.
+
Returns:
String
+
+
+
+ +

+isQualifiedCertificate

+
+public boolean isQualifiedCertificate()
+
+
Returns the qualifiedCertificate.
+
Returns:
boolean
+
+
+
+ +

+getVPK

+
+public String getVPK()
+
+
Returns the vpk.
+
Returns:
String
+
+
+
+ +

+setMinorVersion

+
+public void setMinorVersion(int minorVersion)
+
+
Sets the minorVersion.
+
Parameters:
minorVersion - The minorVersion to set
+
+
+
+ +

+setPublicAuthority

+
+public void setPublicAuthority(boolean publicAuthority)
+
+
Sets the publicAuthority.
+
Parameters:
publicAuthority - The publicAuthority to set
+
+
+
+ +

+setPublicAuthorityCode

+
+public void setPublicAuthorityCode(String publicAuthorityIdentification)
+
+
Sets the publicAuthorityCode.
+
Parameters:
publicAuthorityCode - The publicAuthorityCode to set
+
+
+
+ +

+setQualifiedCertificate

+
+public void setQualifiedCertificate(boolean qualifiedCertificate)
+
+
Sets the qualifiedCertificate.
+
Parameters:
qualifiedCertificate - The qualifiedCertificate to set
+
+
+
+ +

+setVPK

+
+public void setVPK(String vpk)
+
+
Sets the vpk.
+
Parameters:
vpk - The vpk to set
+
+
+
+ +

+getAssertionID

+
+public String getAssertionID()
+
+
Returns the assertionID.
+
Returns:
String
+
+
+
+ +

+getDateOfBirth

+
+public String getDateOfBirth()
+
+
Returns the dateOfBirth.
+
Returns:
String
+
+
+
+ +

+getFamilyName

+
+public String getFamilyName()
+
+
Returns the familyName.
+
Returns:
String
+
+
+
+ +

+getGivenName

+
+public String getGivenName()
+
+
Returns the givenName.
+
Returns:
String
+
+
+
+ +

+getIdentificationValue

+
+public String getIdentificationValue()
+
+
Returns the identificationValue.
+
Returns:
String
+
+
+
+ +

+getIssueInstant

+
+public String getIssueInstant()
+
+
Returns the issueInstant.
+
Returns:
String
+
+
+
+ +

+getIssuer

+
+public String getIssuer()
+
+
Returns the issuer.
+
Returns:
String
+
+
+
+ +

+getMajorVersion

+
+public int getMajorVersion()
+
+
Returns the majorVersion.
+
Returns:
int
+
+
+
+ +

+setAssertionID

+
+public void setAssertionID(String assertionID)
+
+
Sets the assertionID.
+
Parameters:
assertionID - The assertionID to set
+
+
+
+ +

+setDateOfBirth

+
+public void setDateOfBirth(String dateOfBirth)
+
+
Sets the dateOfBirth.
+
Parameters:
dateOfBirth - The dateOfBirth to set
+
+
+
+ +

+setFamilyName

+
+public void setFamilyName(String gamilyName)
+
+
Sets the familyName.
+
Parameters:
familyName - The familyName to set
+
+
+
+ +

+setGivenName

+
+public void setGivenName(String givenName)
+
+
Sets the givenName.
+
Parameters:
givenName - The givenName to set
+
+
+
+ +

+setIdentificationValue

+
+public void setIdentificationValue(String identificationValue)
+
+
Sets the identificationValue.
+
Parameters:
identificationValue - The identificationValue to set
+
+
+
+ +

+setIssueInstant

+
+public void setIssueInstant(String issueInstant)
+
+
Sets the issueInstant.
+
Parameters:
issueInstant - The issueInstant to set
+
+
+
+ +

+setIssuer

+
+public void setIssuer(String issuer)
+
+
Sets the issuer.
+
Parameters:
issuer - The issuer to set
+
+
+
+ +

+setMajorVersion

+
+public void setMajorVersion(int majorVersion)
+
+
Sets the majorVersion.
+
Parameters:
majorVersion - The majorVersion to set
+
+
+
+ +

+getSamlAssertion

+
+public String getSamlAssertion()
+
+
Returns the samlAssertion.
+
Returns:
String
+
+
+
+ +

+setSamlAssertion

+
+public void setSamlAssertion(String samlAssertion)
+
+
Sets the samlAssertion.
+
Parameters:
samlAssertion - The samlAssertion to set
+
+
+
+ +

+getTimestamp

+
+public Date getTimestamp()
+
+
Returns the timestamp.
+
Returns:
Date
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html new file mode 100644 index 000000000..1822504b5 --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html @@ -0,0 +1,152 @@ + + + + + + +MOA ID API: Uses of Class at.gv.egovernment.moa.id.data.AuthenticationData + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.data.AuthenticationData

+
+ + + + + +
+Uses of AuthenticationData in at.gv.egovernment.moa.id.auth
+  +

+ + + + + + + + + +
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationData
+ AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) + +
+          Retrieves AuthenticationData indexed by the SAML artifact. +
+  +

+ + + + + +
+Uses of AuthenticationData in at.gv.egovernment.moa.id.proxy
+  +

+ + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.proxy with parameters of type AuthenticationData
+ MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+  +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html new file mode 100644 index 000000000..7d9bcef1d --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html @@ -0,0 +1,204 @@ + + + + + + +MOA ID API: Interface ConnectionBuilder + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.id.proxy +
+Interface ConnectionBuilder

+
+
+
public interface ConnectionBuilder
+ +

+Builder for URLConnection objects used to forward requests + to the remote online application. +

+


+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ HttpURLConnectionbuildConnection(javax.servlet.http.HttpServletRequest request, + String publicURLPrefix, + String realURLPrefix, + javax.net.ssl.SSLSocketFactory sslSocketFactory) + +
+          Builds an HttpURLConnection to a URL which is derived + from an HttpServletRequest URL, by substitution of a + public URL prefix for the real URL prefix.
+ The HttpURLConnection has been created by URL.openConnection(), but + it has not yet been connected to by URLConnection.connect().
+ The field settings of the HttpURLConnection are: + + allowUserInteraction = false + doInput = true + doOutput = true + requestMethod = request.getMethod() + useCaches = false +
+  +

+ + + + + + + + + + + + + + +
+Method Detail
+ +

+buildConnection

+
+public HttpURLConnection buildConnection(javax.servlet.http.HttpServletRequest request,
+                                         String publicURLPrefix,
+                                         String realURLPrefix,
+                                         javax.net.ssl.SSLSocketFactory sslSocketFactory)
+                                  throws IOException
+
+
Builds an HttpURLConnection to a URL which is derived + from an HttpServletRequest URL, by substitution of a + public URL prefix for the real URL prefix.
+ The HttpURLConnection has been created by URL.openConnection(), but + it has not yet been connected to by URLConnection.connect().
+ The field settings of the HttpURLConnection are: +
    +
  • allowUserInteraction = false
  • +
  • doInput = true
  • +
  • doOutput = true
  • +
  • requestMethod = request.getMethod()
  • +
  • useCaches = false
  • +
+
Parameters:
request - the incoming request which shall be forwarded
publicURLPrefix - the public URL prefix to be substituted by the real URL prefix
realURLPrefix - the URL prefix to substitute the public URL prefix
sslSocketFactory - factory to be used for creating an SSL socket in case + of a URL for scheme "https:"; +
if null, the default SSL socket factory would be used
Returns:
a URLConnection created by URL.openConnection(), connecting to + the requested URL with publicURLPrefix substituted by realURLPrefix
Throws:
IOException - if an I/O exception occurs during opening the connection
See Also:
URL.openConnection(), +com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory()
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html new file mode 100644 index 000000000..717ab1ee6 --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html @@ -0,0 +1,364 @@ + + + + + + +MOA ID API: Interface LoginParameterResolver + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.id.proxy +
+Interface LoginParameterResolver

+
+
+
public interface LoginParameterResolver
+ +

+Determines authentication parameters and headers to be added to a URLConnection + to the remote online application. + Utilizes OAConfiguration and AuthenticationData. +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static StringMOABKZ + +
+           
+static StringMOADateOfBirth + +
+           
+static StringMOAFamilyName + +
+           
+static StringMOAGivenName + +
+          Constants used in MOAIDConfiguration-1.1.xsd, type MOAAuthDataType, + naming predicates used by the LoginParameterResolver.
+static StringMOAIPAddress + +
+           
+static StringMOAPublicAuthority + +
+           
+static StringMOAQualifiedCertificate + +
+           
+static StringMOAVPK + +
+           
+static StringMOAZMRZahl + +
+           
+  + + + + + + + + + + + + + + + + + + +
+Method Summary
+ MapgetAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapgetAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+  +

+ + + + + + + + +
+Field Detail
+ +

+MOAGivenName

+
+public static final String MOAGivenName
+
+
Constants used in MOAIDConfiguration-1.1.xsd, type MOAAuthDataType, + naming predicates used by the LoginParameterResolver.
+
+ +

+MOAFamilyName

+
+public static final String MOAFamilyName
+
+
+
+ +

+MOADateOfBirth

+
+public static final String MOADateOfBirth
+
+
+
+ +

+MOAVPK

+
+public static final String MOAVPK
+
+
+
+ +

+MOAPublicAuthority

+
+public static final String MOAPublicAuthority
+
+
+
+ +

+MOABKZ

+
+public static final String MOABKZ
+
+
+
+ +

+MOAQualifiedCertificate

+
+public static final String MOAQualifiedCertificate
+
+
+
+ +

+MOAZMRZahl

+
+public static final String MOAZMRZahl
+
+
+
+ +

+MOAIPAddress

+
+public static final String MOAIPAddress
+
+
+ + + + + + + + + + + +
+Method Detail
+ +

+getAuthenticationHeaders

+
+public Map getAuthenticationHeaders(OAConfiguration oaConf,
+                                    AuthenticationData authData,
+                                    String clientIPAddress)
+
+
Returns authentication headers to be added to a URLConnection.
+
Parameters:
authConf - configuration data
authData - authentication data
clientIPAddress - client IP address
Returns:
A map, the keys being header names and values being corresponding header values. +
In case of authentication type "basic-auth", header fields + username and password. +
In case of authentication type "header-auth", header fields + derived from parameter mapping and authentication data provided. +
Otherwise, an empty map.
+
+
+
+ +

+getAuthenticationParameters

+
+public Map getAuthenticationParameters(OAConfiguration oaConf,
+                                       AuthenticationData authData,
+                                       String clientIPAddress)
+
+
Returns request parameters to be added to a URLConnection.
+
Parameters:
authConf - configuration data
authData - authentication data
clientIPAddress - client IP address
Returns:
A map, the keys being parameter names and values being corresponding parameter values. +
In case of authentication type "param-auth", parameters + derived from parameter mapping and authentication data provided. +
Otherwise, an empty map.
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html new file mode 100644 index 000000000..c40b34e9f --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html @@ -0,0 +1,91 @@ + + + + + + +MOA ID API: Uses of Interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Uses of Interface
at.gv.egovernment.moa.id.proxy.ConnectionBuilder

+
+No usage of at.gv.egovernment.moa.id.proxy.ConnectionBuilder +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html new file mode 100644 index 000000000..9bad43a2a --- /dev/null +++ b/id/server/doc/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html @@ -0,0 +1,91 @@ + + + + + + +MOA ID API: Uses of Interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Uses of Interface
at.gv.egovernment.moa.id.proxy.LoginParameterResolver

+
+No usage of at.gv.egovernment.moa.id.proxy.LoginParameterResolver +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/deprecated-list.html b/id/server/doc/api-doc/deprecated-list.html new file mode 100644 index 000000000..78f7d881f --- /dev/null +++ b/id/server/doc/api-doc/deprecated-list.html @@ -0,0 +1,89 @@ + + + + + + +MOA ID API: Deprecated List + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Deprecated API

+
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/help-doc.html b/id/server/doc/api-doc/help-doc.html new file mode 100644 index 000000000..79438069d --- /dev/null +++ b/id/server/doc/api-doc/help-doc.html @@ -0,0 +1,142 @@ + + + + + + +MOA ID API: API Help + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
+
+

+Class/Interface

+
+ +

+Each class, interface, inner class and inner interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Inner Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+

+Use

+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/index-all.html b/id/server/doc/api-doc/index-all.html new file mode 100644 index 000000000..a66b0252e --- /dev/null +++ b/id/server/doc/api-doc/index-all.html @@ -0,0 +1,422 @@ + + + + + + +MOA ID API: Index + + + + + + + + + + + + + + + + + +
+ +
+ + +A B C G H I L M O P R S V
+

+A

+
+
AuthenticationData - class at.gv.egovernment.moa.id.data.AuthenticationData.
Encapsulates authentication data contained in a <saml:Assertion>.
AuthenticationData() - +Constructor for class at.gv.egovernment.moa.id.data.AuthenticationData +
Constructor for AuthenticationData. +
AuthenticationException - class at.gv.egovernment.moa.id.AuthenticationException.
Exception thrown during handling of AuthenticationSession
AuthenticationException(String, Object[]) - +Constructor for class at.gv.egovernment.moa.id.AuthenticationException +
Constructor for AuthenticationException. +
AuthenticationServer - class at.gv.egovernment.moa.id.auth.AuthenticationServer.
API for MOA ID Authentication Service.
+ AuthenticationSession is stored in a session store and retrieved + by giving the session ID.
AuthenticationServer() - +Constructor for class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Constructor for AuthenticationServer. +
+
+

+B

+
+
BASIC_AUTH - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
buildConnection(HttpServletRequest, String, String, SSLSocketFactory) - +Method in interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder +
Builds an HttpURLConnection to a URL which is derived + from an HttpServletRequest URL, by substitution of a + public URL prefix for the real URL prefix.
+ The HttpURLConnection has been created by URL.openConnection(), but + it has not yet been connected to by URLConnection.connect().
+ The field settings of the HttpURLConnection are: + + allowUserInteraction = false + doInput = true + doOutput = true + requestMethod = request.getMethod() + useCaches = false + +
+
+

+C

+
+
cleanup() - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Cleans up expired session and authentication data stores. +
ConnectionBuilder - interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder.
Builder for URLConnection objects used to forward requests + to the remote online application.
+
+

+G

+
+
getAssertionID() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the assertionID. +
getAuthenticationData(String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Retrieves AuthenticationData indexed by the SAML artifact. + +
getAuthenticationHeaders(OAConfiguration, AuthenticationData, String) - +Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Returns authentication headers to be added to a URLConnection. +
getAuthenticationParameters(OAConfiguration, AuthenticationData, String) - +Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Returns request parameters to be added to a URLConnection. +
getAuthType() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the authType. +
getBasicAuthPasswordMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the basicAuthPasswordMapping. +
getBasicAuthUserIDMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the basicAuthUserIDMapping. +
getDateOfBirth() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the dateOfBirth. +
getFamilyName() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the familyName. +
getGivenName() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the givenName. +
getHeaderAuthMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the headerAuthMapping. +
getIdentificationValue() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the identificationValue. +
getInstance() - +Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Returns the single instance of AuthenticationServer. +
getIssueInstant() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the issueInstant. +
getIssuer() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the issuer. +
getLoginType() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the loginType. +
getMajorVersion() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the majorVersion. +
getMinorVersion() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the minorVersion. +
getParamAuthMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the paramAuthMapping. +
getPublicAuthorityCode() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the publicAuthorityCode. +
getSamlAssertion() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the samlAssertion. +
getSession(String) - +Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Retrieves a session from the session store. +
getTimestamp() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the timestamp. +
getVPK() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the vpk. +
+
+

+H

+
+
HEADER_AUTH - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
+
+

+I

+
+
isPublicAuthority() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the publicAuthority. +
isQualifiedCertificate() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the qualifiedCertificate. +
+
+

+L

+
+
LoginParameterResolver - interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver.
Determines authentication parameters and headers to be added to a URLConnection + to the remote online application. +
LOGINTYPE_STATEFUL - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
LOGINTYPE_STATELESS - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
+
+

+M

+
+
MOABKZ - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOADateOfBirth - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOAFamilyName - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOAGivenName - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constants used in MOAIDConfiguration-1.1.xsd, type MOAAuthDataType, + naming predicates used by the LoginParameterResolver. +
MOAIPAddress - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOAPublicAuthority - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOAQualifiedCertificate - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOAVPK - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
MOAZMRZahl - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
+
+

+O

+
+
OAConfiguration - class at.gv.egovernment.moa.id.config.proxy.OAConfiguration.
Holds configuration data concerning an online application for use by the MOA-ID Proxy component. +
OAConfiguration() - +Constructor for class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
+
+

+P

+
+
PARAM_AUTH - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
+
+

+R

+
+
REQ_START_AUTHENTICATION - +Static variable in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Request name at.gv.egovernment.moa.id.auth.servlet.StartAuthenticationServlet is mapped to +
REQ_VERIFY_AUTH_BLOCK - +Static variable in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Request name at.gv.egovernment.moa.id.auth.servlet.VerifyAuthenticationBlockServlet is mapped to +
REQ_VERIFY_IDENTITY_LINK - +Static variable in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Request name at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet is mapped to +
+
+

+S

+
+
selectBKU(String, String, String, String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes request to select a BKU. + +
setAssertionID(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the assertionID. +
setAuthType(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the authType. +
setBasicAuthPasswordMapping(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the basicAuthPasswordMapping. +
setBasicAuthUserIDMapping(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the basicAuthUserIDMapping. +
setDateOfBirth(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the dateOfBirth. +
setFamilyName(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the familyName. +
setGivenName(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the givenName. +
setHeaderAuthMapping(HashMap) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the headerAuthMapping. +
setIdentificationValue(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the identificationValue. +
setIssueInstant(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the issueInstant. +
setIssuer(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the issuer. +
setLoginType(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the loginType. +
setMajorVersion(int) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the majorVersion. +
setMinorVersion(int) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the minorVersion. +
setParamAuthMapping(HashMap) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the paramAuthMapping. +
setPublicAuthority(boolean) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the publicAuthority. +
setPublicAuthorityCode(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the publicAuthorityCode. +
setQualifiedCertificate(boolean) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the qualifiedCertificate. +
setSamlAssertion(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the samlAssertion. +
setSecondsAuthDataTimeOut(long) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Sets the authDataTimeOut. +
setSecondsSessionTimeOut(long) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Sets the sessionTimeOut. +
setVPK(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the vpk. +
startAuthentication(String, String, String, String, String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes the beginning of an authentication session. + +
+
+

+V

+
+
verifyAuthenticationBlock(String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes a <CreateXMLSignatureResponse> sent by the + security layer implementation.
+ + Validates given <CreateXMLSignatureResponse> + Parses <CreateXMLSignatureResponse> for error codes + Parses authentication block enclosed in + <CreateXMLSignatureResponse> + Verifies authentication block by calling the MOA SP component + Creates authentication data + Creates a corresponding SAML artifact + Stores authentication data in the authentication data store + indexed by the SAML artifact + Deletes authentication session + Returns the SAML artifact, encoded BASE64 + +
verifyIdentityLink(String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes an <InfoboxReadResponse> sent by the + security layer implementation.
+ + Validates given <InfoboxReadResponse> + Parses identity link enclosed in <InfoboxReadResponse> + Verifies identity link by calling the MOA SP component + Checks certificate authority of identity link + Stores identity link in the session + Creates an authentication block to be signed by the user + Creates and returns a <CreateXMLSignatureRequest> + containg the authentication block, meant to be returned to the + security layer implementation + +
+
+A B C G H I L M O P R S V + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/index.html b/id/server/doc/api-doc/index.html new file mode 100644 index 000000000..7eb5deff7 --- /dev/null +++ b/id/server/doc/api-doc/index.html @@ -0,0 +1,22 @@ + + + + + + +MOA ID API + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to <A HREF="at/gv/egovernment/moa/id/data/AuthenticationData.html">Non-frame version.</A> + diff --git a/id/server/doc/api-doc/overview-tree.html b/id/server/doc/api-doc/overview-tree.html new file mode 100644 index 000000000..bcd54df75 --- /dev/null +++ b/id/server/doc/api-doc/overview-tree.html @@ -0,0 +1,101 @@ + + + + + + +MOA ID API: Class Hierarchy + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Hierarchy For All Packages

+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/package-list b/id/server/doc/api-doc/package-list new file mode 100644 index 000000000..e69de29bb diff --git a/id/server/doc/api-doc/packages.html b/id/server/doc/api-doc/packages.html new file mode 100644 index 000000000..f5dd01736 --- /dev/null +++ b/id/server/doc/api-doc/packages.html @@ -0,0 +1,26 @@ + + + + + + +MOA ID API + + + + + +
+ +
+ +
+
+The front page has been renamed.Please see: +
+          Frame version +
+          Non-frame version.
+ + + diff --git a/id/server/doc/api-doc/serialized-form.html b/id/server/doc/api-doc/serialized-form.html new file mode 100644 index 000000000..09311e7c2 --- /dev/null +++ b/id/server/doc/api-doc/serialized-form.html @@ -0,0 +1,89 @@ + + + + + + +Serialized Form + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Serialized Form

+
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/id/server/doc/api-doc/stylesheet.css b/id/server/doc/api-doc/stylesheet.css new file mode 100644 index 000000000..74a3534ae --- /dev/null +++ b/id/server/doc/api-doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Table colors */ +#TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +#TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +#TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +#FrameTitleFont { font-size: normal; font-family: normal } +#FrameHeadingFont { font-size: normal; font-family: normal } +#FrameItemFont { font-size: normal; font-family: normal } + +/* Example of smaller, sans-serif font in frames */ +/* #FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ + +/* Navigation bar fonts and colors */ +#NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ +#NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ +#NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +#NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +#NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +#NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/id/server/doc/bku-auswahl.20030408.pdf b/id/server/doc/bku-auswahl.20030408.pdf new file mode 100644 index 000000000..39efe315f Binary files /dev/null and b/id/server/doc/bku-auswahl.20030408.pdf differ diff --git a/id/server/doc/cs-sstc-schema-assertion-01.xsd b/id/server/doc/cs-sstc-schema-assertion-01.xsd new file mode 100644 index 000000000..8bc5af147 --- /dev/null +++ b/id/server/doc/cs-sstc-schema-assertion-01.xsd @@ -0,0 +1,194 @@ + + + + + + + Document identifier: cs-sstc-schema-assertion-01 + Location: http://www.oasis-open.org/committees/security/docs/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/doc/cs-sstc-schema-protocol-01.xsd b/id/server/doc/cs-sstc-schema-protocol-01.xsd new file mode 100644 index 000000000..ecad05b0f --- /dev/null +++ b/id/server/doc/cs-sstc-schema-protocol-01.xsd @@ -0,0 +1,127 @@ + + + + + + + + Document identifier: cs-sstc-schema-protocol-01 + Location: http://www.oasis-open.org/committees/security/docs/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/doc/moa-id.htm b/id/server/doc/moa-id.htm new file mode 100644 index 000000000..82e5adc19 --- /dev/null +++ b/id/server/doc/moa-id.htm @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/id/server/doc/moa_id/api-doc/allclasses-frame.html b/id/server/doc/moa_id/api-doc/allclasses-frame.html new file mode 100644 index 000000000..9e051d7b1 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/allclasses-frame.html @@ -0,0 +1,44 @@ + + + + + + +All Classes (MOA ID API) + + + + + + + + + + +All Classes +
+ + + + + +
AuthenticationData +
+AuthenticationException +
+AuthenticationServer +
+ConnectionBuilder +
+LoginParameterResolver +
+LoginParameterResolverException +
+NotAllowedException +
+OAConfiguration +
+
+ + + diff --git a/id/server/doc/moa_id/api-doc/allclasses-noframe.html b/id/server/doc/moa_id/api-doc/allclasses-noframe.html new file mode 100644 index 000000000..dc5c0fb5f --- /dev/null +++ b/id/server/doc/moa_id/api-doc/allclasses-noframe.html @@ -0,0 +1,44 @@ + + + + + + +All Classes (MOA ID API) + + + + + + + + + + +All Classes +
+ + + + + +
AuthenticationData +
+AuthenticationException +
+AuthenticationServer +
+ConnectionBuilder +
+LoginParameterResolver +
+LoginParameterResolverException +
+NotAllowedException +
+OAConfiguration +
+
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html new file mode 100644 index 000000000..a11ad6242 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/AuthenticationException.html @@ -0,0 +1,251 @@ + + + + + + +AuthenticationException (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id +
+Class AuthenticationException

+
+java.lang.Object
+  extended byMOAIDException
+      extended byat.gv.egovernment.moa.id.AuthenticationException
+
+
+
+
public class AuthenticationException
extends MOAIDException
+ +

+Exception thrown during handling of AuthenticationSession +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Constructor Summary
AuthenticationException(String messageId, + Object[] parameters) + +
+          Constructor for AuthenticationException.
AuthenticationException(String messageId, + Object[] parameters, + Throwable wrapped) + +
+          Constructor for AuthenticationException.
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+AuthenticationException

+
+public AuthenticationException(String messageId,
+                               Object[] parameters)
+
+
Constructor for AuthenticationException. +

+

Parameters:
messageId -
+
+ +

+AuthenticationException

+
+public AuthenticationException(String messageId,
+                               Object[] parameters,
+                               Throwable wrapped)
+
+
Constructor for AuthenticationException. +

+

Parameters:
messageId -
parameters -
wrapped -
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html new file mode 100644 index 000000000..b5be8a054 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/AuthenticationServer.html @@ -0,0 +1,631 @@ + + + + + + +AuthenticationServer (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.auth +
+Class AuthenticationServer

+
+java.lang.Object
+  extended byat.gv.egovernment.moa.id.auth.AuthenticationServer
+
+
+
+
public class AuthenticationServer
extends Object
+ +

+API for MOA ID Authentication Service.
+ AuthenticationSession is stored in a session store and retrieved + by giving the session ID. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
AuthenticationServer() + +
+          Constructor for AuthenticationServer.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidcleanup() + +
+          Cleans up expired session and authentication data stores.
+static voiddebugOutputXMLFile(String filename, + org.w3c.dom.Element rootElem) + +
+          Writes an XML structure to file for debugging purposes, encoding UTF-8.
+static voiddebugOutputXMLFile(String filename, + String xmlString) + +
+          Writes an XML structure to file for debugging purposes, encoding UTF-8.
+ AuthenticationDatagetAuthenticationData(String samlArtifact) + +
+          Retrieves AuthenticationData indexed by the SAML artifact. +
+static AuthenticationServergetInstance() + +
+          Returns the single instance of AuthenticationServer.
+static AuthenticationSessiongetSession(String id) + +
+          Retrieves a session from the session store.
+ StringselectBKU(String authURL, + String target, + String oaURL, + String bkuSelectionTemplateURL, + String templateURL) + +
+          Processes request to select a BKU. +
+ voidsetSecondsAuthDataTimeOut(long seconds) + +
+          Sets the authDataTimeOut.
+ voidsetSecondsSessionTimeOut(long seconds) + +
+          Sets the sessionTimeOut.
+ StringstartAuthentication(String authURL, + String target, + String oaURL, + String templateURL, + String bkuURL, + String sessionID) + +
+          Processes the beginning of an authentication session. +
+ StringverifyAuthenticationBlock(String sessionID, + String xmlCreateXMLSignatureReadResponse) + +
+          Processes a <CreateXMLSignatureResponse> sent by the + security layer implementation.
+ StringverifyIdentityLink(String sessionID, + String xmlInfoboxReadResponse) + +
+          Processes an <InfoboxReadResponse> sent by the + security layer implementation.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+AuthenticationServer

+
+public AuthenticationServer()
+
+
Constructor for AuthenticationServer. +

+

+ + + + + + + + +
+Method Detail
+ +

+getInstance

+
+public static AuthenticationServer getInstance()
+
+
Returns the single instance of AuthenticationServer. +

+

+ +
Returns:
the single instance of AuthenticationServer
+
+
+
+ +

+selectBKU

+
+public String selectBKU(String authURL,
+                        String target,
+                        String oaURL,
+                        String bkuSelectionTemplateURL,
+                        String templateURL)
+                 throws WrongParametersException,
+                        AuthenticationException,
+                        ConfigurationException,
+                        BuildException
+
+
Processes request to select a BKU. +
Processing depends on value of AuthConfigurationProvider#getBKUSelectionType. +
For bkuSelectionType==HTMLComplete, a returnURI for the + "BKU Auswahl" service is returned. +
For bkuSelectionType==HTMLSelect, an HTML form for BKU selection is returned. +

+

+
Parameters:
authURL - base URL of MOA-ID Auth component
target - "Geschäftsbereich"
oaURL - online application URL requested
bkuSelectionTemplateURL - template for BKU selection form to be used + in case of HTMLSelect; may be null
templateURL - URL providing an HTML template for the HTML form to be used + for call startAuthentication +
Returns:
for bkuSelectionType==HTMLComplete, the returnURI for the + "BKU Auswahl" service; + for bkuSelectionType==HTMLSelect, an HTML form for BKU selection +
Throws: +
WrongParametersException - upon missing parameters +
AuthenticationException - when the configured BKU selection service cannot be reached, + and when the given bkuSelectionTemplateURL cannot be reached +
ConfigurationException - on missing configuration data +
BuildException - while building the HTML form
+
+
+
+ +

+startAuthentication

+
+public String startAuthentication(String authURL,
+                                  String target,
+                                  String oaURL,
+                                  String templateURL,
+                                  String bkuURL,
+                                  String sessionID)
+                           throws WrongParametersException,
+                                  AuthenticationException,
+                                  ConfigurationException,
+                                  BuildException
+
+
Processes the beginning of an authentication session. +
    +
  • Starts an authentication session
  • +
  • Creates an <InfoboxReadRequest>
  • +
  • Creates an HTML form for querying the identity link from the + security layer implementation. +
    Form parameters include +
      +
    • the <InfoboxReadRequest>
    • +
    • the data URL where the security layer implementation sends it response to
    • +
    +
+

+

+
Parameters:
authURL - URL of the servlet to be used as data URL
target - "Geschäftsbereich" of the online application requested
oaURL - online application URL requested
bkuURL - URL of the "Bürgerkartenumgebung" to be used; + may be null; in this case, the default location will be used
templateURL - URL providing an HTML template for the HTML form generated +
Returns:
HTML form +
Throws: +
AuthenticationException +
WrongParametersException +
ConfigurationException +
BuildException
See Also:
GetIdentityLinkFormBuilder, +InfoboxReadRequestBuilder
+
+
+
+ +

+verifyIdentityLink

+
+public String verifyIdentityLink(String sessionID,
+                                 String xmlInfoboxReadResponse)
+                          throws AuthenticationException,
+                                 ParseException,
+                                 ConfigurationException,
+                                 ValidateException,
+                                 ServiceException
+
+
Processes an <InfoboxReadResponse> sent by the + security layer implementation.
+
    +
  • Validates given <InfoboxReadResponse>
  • +
  • Parses identity link enclosed in <InfoboxReadResponse>
  • +
  • Verifies identity link by calling the MOA SP component
  • +
  • Checks certificate authority of identity link
  • +
  • Stores identity link in the session
  • +
  • Creates an authentication block to be signed by the user
  • +
  • Creates and returns a <CreateXMLSignatureRequest> + containg the authentication block, meant to be returned to the + security layer implementation
  • +
+

+

+
Parameters:
sessionID - ID of associated authentication session data
xmlInfoboxReadResponse - String representation of the + <InfoboxReadResponse> +
Returns:
String representation of the <CreateXMLSignatureRequest> +
Throws: +
AuthenticationException +
ParseException +
ConfigurationException +
ValidateException +
ServiceException
+
+
+
+ +

+verifyAuthenticationBlock

+
+public String verifyAuthenticationBlock(String sessionID,
+                                        String xmlCreateXMLSignatureReadResponse)
+                                 throws AuthenticationException,
+                                        BuildException,
+                                        ParseException,
+                                        ConfigurationException,
+                                        ServiceException,
+                                        ValidateException
+
+
Processes a <CreateXMLSignatureResponse> sent by the + security layer implementation.
+
    +
  • Validates given <CreateXMLSignatureResponse>
  • +
  • Parses <CreateXMLSignatureResponse> for error codes
  • +
  • Parses authentication block enclosed in + <CreateXMLSignatureResponse>
  • +
  • Verifies authentication block by calling the MOA SP component
  • +
  • Creates authentication data
  • +
  • Creates a corresponding SAML artifact
  • +
  • Stores authentication data in the authentication data store + indexed by the SAML artifact
  • +
  • Deletes authentication session
  • +
  • Returns the SAML artifact, encoded BASE64
  • +
+

+

+
Parameters:
sessionID - session ID of the running authentication session
xmlCreateXMLSignatureReadResponse - String representation of the + <CreateXMLSignatureResponse> +
Returns:
SAML artifact needed for retrieving authentication data, encoded BASE64 +
Throws: +
AuthenticationException +
BuildException +
ParseException +
ConfigurationException +
ServiceException +
ValidateException
+
+
+
+ +

+getAuthenticationData

+
+public AuthenticationData getAuthenticationData(String samlArtifact)
+                                         throws AuthenticationException
+
+
Retrieves AuthenticationData indexed by the SAML artifact. + The AuthenticationData is deleted from the store upon end of this call. +

+

+ +
Returns:
AuthenticationData +
Throws: +
AuthenticationException
+
+
+
+ +

+getSession

+
+public static AuthenticationSession getSession(String id)
+                                        throws AuthenticationException
+
+
Retrieves a session from the session store. +

+

+
Parameters:
id - session ID +
Returns:
AuthenticationSession stored with given session ID, + null if session ID unknown +
Throws: +
AuthenticationException
+
+
+
+ +

+cleanup

+
+public void cleanup()
+
+
Cleans up expired session and authentication data stores. +

+

+
+
+
+
+ +

+setSecondsSessionTimeOut

+
+public void setSecondsSessionTimeOut(long seconds)
+
+
Sets the sessionTimeOut. +

+

+
+
+
+
+ +

+setSecondsAuthDataTimeOut

+
+public void setSecondsAuthDataTimeOut(long seconds)
+
+
Sets the authDataTimeOut. +

+

+
+
+
+
+ +

+debugOutputXMLFile

+
+public static void debugOutputXMLFile(String filename,
+                                      org.w3c.dom.Element rootElem)
+
+
Writes an XML structure to file for debugging purposes, encoding UTF-8. +

+

+
Parameters:
filename - file name
rootElem - root element in DOM tree
+
+
+
+ +

+debugOutputXMLFile

+
+public static void debugOutputXMLFile(String filename,
+                                      String xmlString)
+
+
Writes an XML structure to file for debugging purposes, encoding UTF-8. +

+

+
Parameters:
filename - file name
xmlString - XML string
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html new file mode 100644 index 000000000..53f0912b1 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/class-use/AuthenticationServer.html @@ -0,0 +1,172 @@ + + + + + + +Uses of Class at.gv.egovernment.moa.id.auth.AuthenticationServer (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.auth.AuthenticationServer

+
+ + + + + + + + + +
+Packages that use AuthenticationServer
at.gv.egovernment.moa.id.auth  
+  +

+ + + + + +
+Uses of AuthenticationServer in at.gv.egovernment.moa.id.auth
+  +

+ + + + + + + + + +
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationServer
+static AuthenticationServerAuthenticationServer.getInstance() + +
+          Returns the single instance of AuthenticationServer.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html new file mode 100644 index 000000000..013ac6e16 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +at.gv.egovernment.moa.id.auth (MOA ID API) + + + + + + + + + + + +at.gv.egovernment.moa.id.auth + + + + +
+Classes  + +
+AuthenticationServer
+ + + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html new file mode 100644 index 000000000..1fadccfd1 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-summary.html @@ -0,0 +1,148 @@ + + + + + + +at.gv.egovernment.moa.id.auth (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package at.gv.egovernment.moa.id.auth +

+ + + + + + + + + +
+Class Summary
AuthenticationServerAPI for MOA ID Authentication Service.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html new file mode 100644 index 000000000..ed050ad9e --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-tree.html @@ -0,0 +1,145 @@ + + + + + + +at.gv.egovernment.moa.id.auth Class Hierarchy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package at.gv.egovernment.moa.id.auth +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html new file mode 100644 index 000000000..54bd8b9fb --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/auth/package-use.html @@ -0,0 +1,162 @@ + + + + + + +Uses of Package at.gv.egovernment.moa.id.auth (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
at.gv.egovernment.moa.id.auth

+
+ + + + + + + + + +
+Packages that use at.gv.egovernment.moa.id.auth
at.gv.egovernment.moa.id.auth  
+  +

+ + + + + + + + +
+Classes in at.gv.egovernment.moa.id.auth used by at.gv.egovernment.moa.id.auth
AuthenticationServer + +
+          API for MOA ID Authentication Service.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html new file mode 100644 index 000000000..d844f1ac0 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/class-use/AuthenticationException.html @@ -0,0 +1,228 @@ + + + + + + +Uses of Class at.gv.egovernment.moa.id.AuthenticationException (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.AuthenticationException

+
+ + + + + + + + + +
+Packages that use AuthenticationException
at.gv.egovernment.moa.id.auth  
+  +

+ + + + + +
+Uses of AuthenticationException in at.gv.egovernment.moa.id.auth
+  +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.auth that throw AuthenticationException
+ StringAuthenticationServer.selectBKU(String authURL, + String target, + String oaURL, + String bkuSelectionTemplateURL, + String templateURL) + +
+          Processes request to select a BKU. +
+ StringAuthenticationServer.startAuthentication(String authURL, + String target, + String oaURL, + String templateURL, + String bkuURL, + String sessionID) + +
+          Processes the beginning of an authentication session. +
+ StringAuthenticationServer.verifyIdentityLink(String sessionID, + String xmlInfoboxReadResponse) + +
+          Processes an <InfoboxReadResponse> sent by the + security layer implementation.
+ StringAuthenticationServer.verifyAuthenticationBlock(String sessionID, + String xmlCreateXMLSignatureReadResponse) + +
+          Processes a <CreateXMLSignatureResponse> sent by the + security layer implementation.
+ AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) + +
+          Retrieves AuthenticationData indexed by the SAML artifact. +
+static AuthenticationSessionAuthenticationServer.getSession(String id) + +
+          Retrieves a session from the session store.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html new file mode 100644 index 000000000..afeb1a482 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.html @@ -0,0 +1,613 @@ + + + + + + +OAConfiguration (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.config.proxy +
+Class OAConfiguration

+
+java.lang.Object
+  extended byat.gv.egovernment.moa.id.config.proxy.OAConfiguration
+
+
+
+
public class OAConfiguration
extends Object
+ +

+Holds configuration data concerning an online application for use by the MOA-ID Proxy component. + These include the login type (stateful or stateless), the HTTP authentication type, + and information needed to add authentication parameters or headers for a URL connection + to the remote online application. +

+ +

+

+
See Also:
MOAIDConfiguration-1.1.xsd, element Configuration
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static StringBASIC_AUTH + +
+          Constant for an auth method
+static StringHEADER_AUTH + +
+          Constant for an auth method
+static StringLOGINTYPE_STATEFUL + +
+          Constant for an login method
+static StringLOGINTYPE_STATELESS + +
+          Constant for an login method
+static StringPARAM_AUTH + +
+          Constant for an auth method
+  + + + + + + + + + + +
+Constructor Summary
OAConfiguration() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ StringgetAuthType() + +
+          Returns the authType.
+ StringgetBasicAuthPasswordMapping() + +
+          Returns the basicAuthPasswordMapping.
+ StringgetBasicAuthUserIDMapping() + +
+          Returns the basicAuthUserIDMapping.
+ MapgetHeaderAuthMapping() + +
+          Returns the headerAuthMapping.
+ StringgetLoginType() + +
+          Returns the loginType.
+ MapgetParamAuthMapping() + +
+          Returns the paramAuthMapping.
+ voidsetAuthType(String authLoginType) + +
+          Sets the authType.
+ voidsetBasicAuthPasswordMapping(String basicAuthPassword) + +
+          Sets the basicAuthPasswordMapping.
+ voidsetBasicAuthUserIDMapping(String basicAuthUserID) + +
+          Sets the basicAuthUserIDMapping.
+ voidsetHeaderAuthMapping(HashMap headerAuth) + +
+          Sets the headerAuthMapping.
+ voidsetLoginType(String loginType) + +
+          Sets the loginType.
+ voidsetParamAuthMapping(HashMap paramAuth) + +
+          Sets the paramAuthMapping.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+LOGINTYPE_STATEFUL

+
+public static final String LOGINTYPE_STATEFUL
+
+
Constant for an login method +

+

+
See Also:
Constant Field Values
+
+
+ +

+LOGINTYPE_STATELESS

+
+public static final String LOGINTYPE_STATELESS
+
+
Constant for an login method +

+

+
See Also:
Constant Field Values
+
+
+ +

+BASIC_AUTH

+
+public static final String BASIC_AUTH
+
+
Constant for an auth method +

+

+
See Also:
Constant Field Values
+
+
+ +

+HEADER_AUTH

+
+public static final String HEADER_AUTH
+
+
Constant for an auth method +

+

+
See Also:
Constant Field Values
+
+
+ +

+PARAM_AUTH

+
+public static final String PARAM_AUTH
+
+
Constant for an auth method +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+OAConfiguration

+
+public OAConfiguration()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getBasicAuthPasswordMapping

+
+public String getBasicAuthPasswordMapping()
+
+
Returns the basicAuthPasswordMapping. +

+

+ +
Returns:
String
+
+
+
+ +

+getBasicAuthUserIDMapping

+
+public String getBasicAuthUserIDMapping()
+
+
Returns the basicAuthUserIDMapping. +

+

+ +
Returns:
String
+
+
+
+ +

+getHeaderAuthMapping

+
+public Map getHeaderAuthMapping()
+
+
Returns the headerAuthMapping. +

+

+ +
Returns:
HashMap
+
+
+
+ +

+getLoginType

+
+public String getLoginType()
+
+
Returns the loginType. +

+

+ +
Returns:
String
+
+
+
+ +

+getParamAuthMapping

+
+public Map getParamAuthMapping()
+
+
Returns the paramAuthMapping. +

+

+ +
Returns:
HashMap
+
+
+
+ +

+setBasicAuthPasswordMapping

+
+public void setBasicAuthPasswordMapping(String basicAuthPassword)
+
+
Sets the basicAuthPasswordMapping. +

+

+
+
+
+
+ +

+setBasicAuthUserIDMapping

+
+public void setBasicAuthUserIDMapping(String basicAuthUserID)
+
+
Sets the basicAuthUserIDMapping. +

+

+
+
+
+
+ +

+setHeaderAuthMapping

+
+public void setHeaderAuthMapping(HashMap headerAuth)
+
+
Sets the headerAuthMapping. +

+

+
+
+
+
+ +

+setLoginType

+
+public void setLoginType(String loginType)
+
+
Sets the loginType. +

+

+
Parameters:
loginType - The loginType to set
+
+
+
+ +

+setParamAuthMapping

+
+public void setParamAuthMapping(HashMap paramAuth)
+
+
Sets the paramAuthMapping. +

+

+
+
+
+
+ +

+getAuthType

+
+public String getAuthType()
+
+
Returns the authType. +

+

+ +
Returns:
String
+
+
+
+ +

+setAuthType

+
+public void setAuthType(String authLoginType)
+
+
Sets the authType. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html new file mode 100644 index 000000000..5e33084ad --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/class-use/OAConfiguration.html @@ -0,0 +1,184 @@ + + + + + + +Uses of Class at.gv.egovernment.moa.id.config.proxy.OAConfiguration (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.config.proxy.OAConfiguration

+
+ + + + + + + + + +
+Packages that use OAConfiguration
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + +
+Uses of OAConfiguration in at.gv.egovernment.moa.id.proxy
+  +

+ + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.proxy with parameters of type OAConfiguration
+ MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html new file mode 100644 index 000000000..442356ce1 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +at.gv.egovernment.moa.id.config.proxy (MOA ID API) + + + + + + + + + + + +at.gv.egovernment.moa.id.config.proxy + + + + +
+Classes  + +
+OAConfiguration
+ + + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html new file mode 100644 index 000000000..482aecc48 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-summary.html @@ -0,0 +1,149 @@ + + + + + + +at.gv.egovernment.moa.id.config.proxy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package at.gv.egovernment.moa.id.config.proxy +

+ + + + + + + + + +
+Class Summary
OAConfigurationHolds configuration data concerning an online application for use by the MOA-ID Proxy component. +
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html new file mode 100644 index 000000000..e66568757 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-tree.html @@ -0,0 +1,145 @@ + + + + + + +at.gv.egovernment.moa.id.config.proxy Class Hierarchy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package at.gv.egovernment.moa.id.config.proxy +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html new file mode 100644 index 000000000..184fcb226 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/config/proxy/package-use.html @@ -0,0 +1,163 @@ + + + + + + +Uses of Package at.gv.egovernment.moa.id.config.proxy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
at.gv.egovernment.moa.id.config.proxy

+
+ + + + + + + + + +
+Packages that use at.gv.egovernment.moa.id.config.proxy
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + + + + +
+Classes in at.gv.egovernment.moa.id.config.proxy used by at.gv.egovernment.moa.id.proxy
OAConfiguration + +
+          Holds configuration data concerning an online application for use by the MOA-ID Proxy component. +
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html new file mode 100644 index 000000000..d6bc30647 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/AuthenticationData.html @@ -0,0 +1,906 @@ + + + + + + +AuthenticationData (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.data +
+Class AuthenticationData

+
+java.lang.Object
+  extended byat.gv.egovernment.moa.id.data.AuthenticationData
+
+
+
+
public class AuthenticationData
extends Object
+ +

+Encapsulates authentication data contained in a <saml:Assertion>. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + +
+Constructor Summary
AuthenticationData() + +
+          Constructor for AuthenticationData.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ StringgetAssertionID() + +
+          Returns the assertionID.
+ StringgetDateOfBirth() + +
+          Returns the dateOfBirth.
+ StringgetFamilyName() + +
+          Returns the familyName.
+ StringgetGivenName() + +
+          Returns the givenName.
+ StringgetIdentificationType() + +
+          Returns the identificationType
+ StringgetIdentificationValue() + +
+          Returns the identificationValue.
+ StringgetIssueInstant() + +
+          Returns the issueInstant.
+ StringgetIssuer() + +
+          Returns the issuer.
+ intgetMajorVersion() + +
+          Returns the majorVersion.
+ intgetMinorVersion() + +
+          Returns the minorVersion.
+ StringgetPBK() + +
+          Returns the bPK.
+ StringgetPublicAuthorityCode() + +
+          Returns the publicAuthorityCode.
+ StringgetSamlAssertion() + +
+          Returns the samlAssertion.
+ DategetTimestamp() + +
+          Returns the timestamp.
+ booleanisPublicAuthority() + +
+          Returns the publicAuthority.
+ booleanisQualifiedCertificate() + +
+          Returns the qualifiedCertificate.
+ voidsetAssertionID(String assertionID) + +
+          Sets the assertionID.
+ voidsetDateOfBirth(String dateOfBirth) + +
+          Sets the dateOfBirth.
+ voidsetFamilyName(String gamilyName) + +
+          Sets the familyName.
+ voidsetGivenName(String givenName) + +
+          Sets the givenName.
+ voidsetIdentificationType(String identificationType) + +
+          Sets the identificationType.
+ voidsetIdentificationValue(String identificationValue) + +
+          Sets the identificationValue.
+ voidsetIssueInstant(String issueInstant) + +
+          Sets the issueInstant.
+ voidsetIssuer(String issuer) + +
+          Sets the issuer.
+ voidsetMajorVersion(int majorVersion) + +
+          Sets the majorVersion.
+ voidsetMinorVersion(int minorVersion) + +
+          Sets the minorVersion.
+ voidsetPBK(String bPK) + +
+          Sets the bPK.
+ voidsetPublicAuthority(boolean publicAuthority) + +
+          Sets the publicAuthority.
+ voidsetPublicAuthorityCode(String publicAuthorityIdentification) + +
+          Sets the publicAuthorityCode.
+ voidsetQualifiedCertificate(boolean qualifiedCertificate) + +
+          Sets the qualifiedCertificate.
+ voidsetSamlAssertion(String samlAssertion) + +
+          Sets the samlAssertion.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+AuthenticationData

+
+public AuthenticationData()
+
+
Constructor for AuthenticationData. +

+

+ + + + + + + + +
+Method Detail
+ +

+getMinorVersion

+
+public int getMinorVersion()
+
+
Returns the minorVersion. +

+

+ +
Returns:
int
+
+
+
+ +

+isPublicAuthority

+
+public boolean isPublicAuthority()
+
+
Returns the publicAuthority. +

+

+ +
Returns:
boolean
+
+
+
+ +

+getPublicAuthorityCode

+
+public String getPublicAuthorityCode()
+
+
Returns the publicAuthorityCode. +

+

+ +
Returns:
String
+
+
+
+ +

+isQualifiedCertificate

+
+public boolean isQualifiedCertificate()
+
+
Returns the qualifiedCertificate. +

+

+ +
Returns:
boolean
+
+
+
+ +

+getPBK

+
+public String getPBK()
+
+
Returns the bPK. +

+

+ +
Returns:
String
+
+
+
+ +

+setMinorVersion

+
+public void setMinorVersion(int minorVersion)
+
+
Sets the minorVersion. +

+

+
Parameters:
minorVersion - The minorVersion to set
+
+
+
+ +

+setPublicAuthority

+
+public void setPublicAuthority(boolean publicAuthority)
+
+
Sets the publicAuthority. +

+

+
Parameters:
publicAuthority - The publicAuthority to set
+
+
+
+ +

+setPublicAuthorityCode

+
+public void setPublicAuthorityCode(String publicAuthorityIdentification)
+
+
Sets the publicAuthorityCode. +

+

+
+
+
+
+ +

+setQualifiedCertificate

+
+public void setQualifiedCertificate(boolean qualifiedCertificate)
+
+
Sets the qualifiedCertificate. +

+

+
Parameters:
qualifiedCertificate - The qualifiedCertificate to set
+
+
+
+ +

+setPBK

+
+public void setPBK(String bPK)
+
+
Sets the bPK. +

+

+
Parameters:
bPK - The bPK to set
+
+
+
+ +

+getAssertionID

+
+public String getAssertionID()
+
+
Returns the assertionID. +

+

+ +
Returns:
String
+
+
+
+ +

+getDateOfBirth

+
+public String getDateOfBirth()
+
+
Returns the dateOfBirth. +

+

+ +
Returns:
String
+
+
+
+ +

+getFamilyName

+
+public String getFamilyName()
+
+
Returns the familyName. +

+

+ +
Returns:
String
+
+
+
+ +

+getGivenName

+
+public String getGivenName()
+
+
Returns the givenName. +

+

+ +
Returns:
String
+
+
+
+ +

+getIdentificationValue

+
+public String getIdentificationValue()
+
+
Returns the identificationValue. +

+

+ +
Returns:
String
+
+
+
+ +

+getIdentificationType

+
+public String getIdentificationType()
+
+
Returns the identificationType +

+

+ +
Returns:
String
+
+
+
+ +

+getIssueInstant

+
+public String getIssueInstant()
+
+
Returns the issueInstant. +

+

+ +
Returns:
String
+
+
+
+ +

+getIssuer

+
+public String getIssuer()
+
+
Returns the issuer. +

+

+ +
Returns:
String
+
+
+
+ +

+getMajorVersion

+
+public int getMajorVersion()
+
+
Returns the majorVersion. +

+

+ +
Returns:
int
+
+
+
+ +

+setAssertionID

+
+public void setAssertionID(String assertionID)
+
+
Sets the assertionID. +

+

+
Parameters:
assertionID - The assertionID to set
+
+
+
+ +

+setDateOfBirth

+
+public void setDateOfBirth(String dateOfBirth)
+
+
Sets the dateOfBirth. +

+

+
Parameters:
dateOfBirth - The dateOfBirth to set
+
+
+
+ +

+setFamilyName

+
+public void setFamilyName(String gamilyName)
+
+
Sets the familyName. +

+

+
+
+
+
+ +

+setGivenName

+
+public void setGivenName(String givenName)
+
+
Sets the givenName. +

+

+
Parameters:
givenName - The givenName to set
+
+
+
+ +

+setIdentificationValue

+
+public void setIdentificationValue(String identificationValue)
+
+
Sets the identificationValue. +

+

+
Parameters:
identificationValue - The identificationValue to set
+
+
+
+ +

+setIdentificationType

+
+public void setIdentificationType(String identificationType)
+
+
Sets the identificationType. +

+

+
Parameters:
identificationType - The identificationType to set
+
+
+
+ +

+setIssueInstant

+
+public void setIssueInstant(String issueInstant)
+
+
Sets the issueInstant. +

+

+
Parameters:
issueInstant - The issueInstant to set
+
+
+
+ +

+setIssuer

+
+public void setIssuer(String issuer)
+
+
Sets the issuer. +

+

+
Parameters:
issuer - The issuer to set
+
+
+
+ +

+setMajorVersion

+
+public void setMajorVersion(int majorVersion)
+
+
Sets the majorVersion. +

+

+
Parameters:
majorVersion - The majorVersion to set
+
+
+
+ +

+getSamlAssertion

+
+public String getSamlAssertion()
+
+
Returns the samlAssertion. +

+

+ +
Returns:
String
+
+
+
+ +

+setSamlAssertion

+
+public void setSamlAssertion(String samlAssertion)
+
+
Sets the samlAssertion. +

+

+
Parameters:
samlAssertion - The samlAssertion to set
+
+
+
+ +

+getTimestamp

+
+public Date getTimestamp()
+
+
Returns the timestamp. +

+

+ +
Returns:
Date
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html new file mode 100644 index 000000000..44c47942a --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/class-use/AuthenticationData.html @@ -0,0 +1,214 @@ + + + + + + +Uses of Class at.gv.egovernment.moa.id.data.AuthenticationData (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.data.AuthenticationData

+
+ + + + + + + + + + + + + +
+Packages that use AuthenticationData
at.gv.egovernment.moa.id.auth  
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + +
+Uses of AuthenticationData in at.gv.egovernment.moa.id.auth
+  +

+ + + + + + + + + +
Methods in at.gv.egovernment.moa.id.auth that return AuthenticationData
+ AuthenticationDataAuthenticationServer.getAuthenticationData(String samlArtifact) + +
+          Retrieves AuthenticationData indexed by the SAML artifact. +
+  +

+ + + + + +
+Uses of AuthenticationData in at.gv.egovernment.moa.id.proxy
+  +

+ + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.proxy with parameters of type AuthenticationData
+ MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html new file mode 100644 index 000000000..b3be4f39a --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +at.gv.egovernment.moa.id.data (MOA ID API) + + + + + + + + + + + +at.gv.egovernment.moa.id.data + + + + +
+Classes  + +
+AuthenticationData
+ + + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html new file mode 100644 index 000000000..28b8dd351 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-summary.html @@ -0,0 +1,148 @@ + + + + + + +at.gv.egovernment.moa.id.data (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package at.gv.egovernment.moa.id.data +

+ + + + + + + + + +
+Class Summary
AuthenticationDataEncapsulates authentication data contained in a <saml:Assertion>.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html new file mode 100644 index 000000000..6911edcdb --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-tree.html @@ -0,0 +1,145 @@ + + + + + + +at.gv.egovernment.moa.id.data Class Hierarchy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package at.gv.egovernment.moa.id.data +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html new file mode 100644 index 000000000..c90a703c9 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/data/package-use.html @@ -0,0 +1,181 @@ + + + + + + +Uses of Package at.gv.egovernment.moa.id.data (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
at.gv.egovernment.moa.id.data

+
+ + + + + + + + + + + + + +
+Packages that use at.gv.egovernment.moa.id.data
at.gv.egovernment.moa.id.auth  
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + + + + +
+Classes in at.gv.egovernment.moa.id.data used by at.gv.egovernment.moa.id.auth
AuthenticationData + +
+          Encapsulates authentication data contained in a <saml:Assertion>.
+  +

+ + + + + + + + +
+Classes in at.gv.egovernment.moa.id.data used by at.gv.egovernment.moa.id.proxy
AuthenticationData + +
+          Encapsulates authentication data contained in a <saml:Assertion>.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html new file mode 100644 index 000000000..9c4352356 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +at.gv.egovernment.moa.id (MOA ID API) + + + + + + + + + + + +at.gv.egovernment.moa.id + + + + +
+Classes  + +
+AuthenticationException
+ + + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html new file mode 100644 index 000000000..3750976f2 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-summary.html @@ -0,0 +1,148 @@ + + + + + + +at.gv.egovernment.moa.id (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package at.gv.egovernment.moa.id +

+ + + + + + + + + +
+Class Summary
AuthenticationExceptionException thrown during handling of AuthenticationSession
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html new file mode 100644 index 000000000..ebf3b1498 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-tree.html @@ -0,0 +1,147 @@ + + + + + + +at.gv.egovernment.moa.id Class Hierarchy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package at.gv.egovernment.moa.id +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html new file mode 100644 index 000000000..bc895c974 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/package-use.html @@ -0,0 +1,162 @@ + + + + + + +Uses of Package at.gv.egovernment.moa.id (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
at.gv.egovernment.moa.id

+
+ + + + + + + + + +
+Packages that use at.gv.egovernment.moa.id
at.gv.egovernment.moa.id.auth  
+  +

+ + + + + + + + +
+Classes in at.gv.egovernment.moa.id used by at.gv.egovernment.moa.id.auth
AuthenticationException + +
+          Exception thrown during handling of AuthenticationSession
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html new file mode 100644 index 000000000..398be7e71 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.html @@ -0,0 +1,249 @@ + + + + + + +ConnectionBuilder (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.proxy +
+Interface ConnectionBuilder

+
+
+
public interface ConnectionBuilder
+ +

+Builder for URLConnection objects used to forward requests + to the remote online application. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ HttpURLConnectionbuildConnection(javax.servlet.http.HttpServletRequest request, + String publicURLPrefix, + String realURLPrefix, + javax.net.ssl.SSLSocketFactory sslSocketFactory, + Map parameters) + +
+          Builds an HttpURLConnection to a URL which is derived + from an HttpServletRequest URL, by substitution of a + public URL prefix for the real URL prefix.
+  +

+ + + + + + + + + + + + + + +
+Method Detail
+ +

+buildConnection

+
+public HttpURLConnection buildConnection(javax.servlet.http.HttpServletRequest request,
+                                         String publicURLPrefix,
+                                         String realURLPrefix,
+                                         javax.net.ssl.SSLSocketFactory sslSocketFactory,
+                                         Map parameters)
+                                  throws IOException
+
+
Builds an HttpURLConnection to a URL which is derived + from an HttpServletRequest URL, by substitution of a + public URL prefix for the real URL prefix.
+ The HttpURLConnection has been created by URL.openConnection(), but + it has not yet been connected to by URLConnection.connect().
+ The field settings of the HttpURLConnection are: +
    +
  • allowUserInteraction = false
  • +
  • doInput = true
  • +
  • doOutput = true
  • +
  • requestMethod = request.getMethod()
  • +
  • useCaches = false
  • +
+

+

+
Parameters:
request - the incoming request which shall be forwarded
publicURLPrefix - the public URL prefix to be substituted by the real URL prefix
realURLPrefix - the URL prefix to substitute the public URL prefix
sslSocketFactory - factory to be used for creating an SSL socket in case + of a URL for scheme "https:"; +
if null, the default SSL socket factory would be used
parameters - parameters to be forwarded +
Returns:
a URLConnection created by URL.openConnection(), connecting to + the requested URL with publicURLPrefix substituted by realURLPrefix +
Throws: +
IOException - if an I/O exception occurs during opening the connection
See Also:
URL.openConnection(), +com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory()
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html new file mode 100644 index 000000000..0b2926e55 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.html @@ -0,0 +1,506 @@ + + + + + + +LoginParameterResolver (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.proxy +
+Interface LoginParameterResolver

+
+
+
public interface LoginParameterResolver
+ +

+Determines authentication parameters and headers to be added to a URLConnection + to the remote online application. + Utilizes OAConfiguration and AuthenticationData. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static StringMOABKZ + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOABPK + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOADateOfBirth + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOAFamilyName + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOAGivenName + +
+          Constants used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, + naming predicates used by the LoginParameterResolver.
+static StringMOAIdentificationValueType + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOAIPAddress + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOAPublicAuthority + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOAQualifiedCertificate + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+static StringMOAStammzahl + +
+          Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType
+  + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidconfigure(String configuration) + +
+           
+ MapgetAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapgetAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+  +

+ + + + + + + + +
+Field Detail
+ +

+MOAGivenName

+
+public static final String MOAGivenName
+
+
Constants used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, + naming predicates used by the LoginParameterResolver. +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOAFamilyName

+
+public static final String MOAFamilyName
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOADateOfBirth

+
+public static final String MOADateOfBirth
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOABPK

+
+public static final String MOABPK
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOAPublicAuthority

+
+public static final String MOAPublicAuthority
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOABKZ

+
+public static final String MOABKZ
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOAQualifiedCertificate

+
+public static final String MOAQualifiedCertificate
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOAStammzahl

+
+public static final String MOAStammzahl
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOAIdentificationValueType

+
+public static final String MOAIdentificationValueType
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+
+ +

+MOAIPAddress

+
+public static final String MOAIPAddress
+
+
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +

+

+
See Also:
Constant Field Values
+
+ + + + + + + + + + + +
+Method Detail
+ +

+getAuthenticationHeaders

+
+public Map getAuthenticationHeaders(OAConfiguration oaConf,
+                                    AuthenticationData authData,
+                                    String clientIPAddress)
+                             throws LoginParameterResolverException,
+                                    NotAllowedException
+
+
Returns authentication headers to be added to a URLConnection. +

+

+
Parameters:
oaConf - configuration data
authData - authentication data
clientIPAddress - client IP address +
Returns:
A map, the keys being header names and values being corresponding header values. +
In case of authentication type "basic-auth", header fields + username and password. +
In case of authentication type "header-auth", header fields + derived from parameter mapping and authentication data provided. +
Otherwise, an empty map. +
Throws: +
LoginParameterResolverException +
NotAllowedException
+
+
+
+ +

+getAuthenticationParameters

+
+public Map getAuthenticationParameters(OAConfiguration oaConf,
+                                       AuthenticationData authData,
+                                       String clientIPAddress)
+                                throws LoginParameterResolverException
+
+
Returns request parameters to be added to a URLConnection. +

+

+
Parameters:
oaConf - configuration data
authData - authentication data
clientIPAddress - client IP address +
Returns:
A map, the keys being parameter names and values being corresponding parameter values. +
In case of authentication type "param-auth", parameters + derived from parameter mapping and authentication data provided. +
Otherwise, an empty map. +
Throws: +
LoginParameterResolverException
+
+
+
+ +

+configure

+
+public void configure(String configuration)
+               throws LoginParameterResolverException,
+                      NotAllowedException
+
+
+ +
Throws: +
LoginParameterResolverException +
NotAllowedException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html new file mode 100644 index 000000000..fd4dd84d2 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.html @@ -0,0 +1,251 @@ + + + + + + +LoginParameterResolverException (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.proxy +
+Class LoginParameterResolverException

+
+java.lang.Object
+  extended byMOAIDException
+      extended byat.gv.egovernment.moa.id.proxy.LoginParameterResolverException
+
+
+
+
public class LoginParameterResolverException
extends MOAIDException
+ +

+Exception thrown while proxying a request to the online application +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Constructor Summary
LoginParameterResolverException(String messageId, + Object[] parameters) + +
+          Constructor for LoginParameterResolverException.
LoginParameterResolverException(String messageId, + Object[] parameters, + Throwable wrapped) + +
+          Constructor for LoginParameterResolverException.
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+LoginParameterResolverException

+
+public LoginParameterResolverException(String messageId,
+                                       Object[] parameters)
+
+
Constructor for LoginParameterResolverException. +

+

Parameters:
messageId -
parameters -
+
+ +

+LoginParameterResolverException

+
+public LoginParameterResolverException(String messageId,
+                                       Object[] parameters,
+                                       Throwable wrapped)
+
+
Constructor for LoginParameterResolverException. +

+

Parameters:
messageId -
parameters -
wrapped -
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html new file mode 100644 index 000000000..7c01bd12f --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/NotAllowedException.html @@ -0,0 +1,253 @@ + + + + + + +NotAllowedException (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +at.gv.egovernment.moa.id.proxy +
+Class NotAllowedException

+
+java.lang.Object
+  extended byMOAIDException
+      extended byat.gv.egovernment.moa.id.proxy.NotAllowedException
+
+
+
+
public class NotAllowedException
extends MOAIDException
+ +

+Exception thrown while proxying a request to the online application + Reason for this exception: the dedicated LoginParameterResolver does + not allow access to the desired ressource. +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + +
+Constructor Summary
NotAllowedException(String messageId, + Object[] parameters) + +
+          Constructor for NotAllowedException.
NotAllowedException(String messageId, + Object[] parameters, + Throwable wrapped) + +
+          Constructor for NotAllowedException.
+  + + + + + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + + + + +
+Constructor Detail
+ +

+NotAllowedException

+
+public NotAllowedException(String messageId,
+                           Object[] parameters)
+
+
Constructor for NotAllowedException. +

+

Parameters:
messageId -
parameters -
+
+ +

+NotAllowedException

+
+public NotAllowedException(String messageId,
+                           Object[] parameters,
+                           Throwable wrapped)
+
+
Constructor for NotAllowedException. +

+

Parameters:
messageId -
parameters -
wrapped -
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html new file mode 100644 index 000000000..69af13810 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/ConnectionBuilder.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
at.gv.egovernment.moa.id.proxy.ConnectionBuilder

+
+No usage of at.gv.egovernment.moa.id.proxy.ConnectionBuilder +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html new file mode 100644 index 000000000..aca06fa02 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolver.html @@ -0,0 +1,136 @@ + + + + + + +Uses of Interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Interface
at.gv.egovernment.moa.id.proxy.LoginParameterResolver

+
+No usage of at.gv.egovernment.moa.id.proxy.LoginParameterResolver +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html new file mode 100644 index 000000000..ccd7d50cf --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/LoginParameterResolverException.html @@ -0,0 +1,192 @@ + + + + + + +Uses of Class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.proxy.LoginParameterResolverException

+
+ + + + + + + + + +
+Packages that use LoginParameterResolverException
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + +
+Uses of LoginParameterResolverException in at.gv.egovernment.moa.id.proxy
+  +

+ + + + + + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.proxy that throw LoginParameterResolverException
+ MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ MapLoginParameterResolver.getAuthenticationParameters(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns request parameters to be added to a URLConnection.
+ voidLoginParameterResolver.configure(String configuration) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html new file mode 100644 index 000000000..fa0e1f24e --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/class-use/NotAllowedException.html @@ -0,0 +1,182 @@ + + + + + + +Uses of Class at.gv.egovernment.moa.id.proxy.NotAllowedException (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Class
at.gv.egovernment.moa.id.proxy.NotAllowedException

+
+ + + + + + + + + +
+Packages that use NotAllowedException
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + +
+Uses of NotAllowedException in at.gv.egovernment.moa.id.proxy
+  +

+ + + + + + + + + + + + + +
Methods in at.gv.egovernment.moa.id.proxy that throw NotAllowedException
+ MapLoginParameterResolver.getAuthenticationHeaders(OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress) + +
+          Returns authentication headers to be added to a URLConnection.
+ voidLoginParameterResolver.configure(String configuration) + +
+           
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html new file mode 100644 index 000000000..a8afe874e --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-frame.html @@ -0,0 +1,47 @@ + + + + + + +at.gv.egovernment.moa.id.proxy (MOA ID API) + + + + + + + + + + + +at.gv.egovernment.moa.id.proxy + + + + +
+Interfaces  + +
+ConnectionBuilder +
+LoginParameterResolver
+ + + + + + +
+Classes  + +
+LoginParameterResolverException +
+NotAllowedException
+ + + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html new file mode 100644 index 000000000..9c6f09843 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-summary.html @@ -0,0 +1,175 @@ + + + + + + +at.gv.egovernment.moa.id.proxy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package at.gv.egovernment.moa.id.proxy +

+ + + + + + + + + + + + + +
+Interface Summary
ConnectionBuilderBuilder for URLConnection objects used to forward requests + to the remote online application.
LoginParameterResolverDetermines authentication parameters and headers to be added to a URLConnection + to the remote online application. +
+  + +

+ + + + + + + + + + + + + +
+Class Summary
LoginParameterResolverExceptionException thrown while proxying a request to the online application
NotAllowedExceptionException thrown while proxying a request to the online application + Reason for this exception: the dedicated LoginParameterResolver does + not allow access to the desired ressource.
+  + +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html new file mode 100644 index 000000000..90e057ebc --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-tree.html @@ -0,0 +1,154 @@ + + + + + + +at.gv.egovernment.moa.id.proxy Class Hierarchy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package at.gv.egovernment.moa.id.proxy +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html new file mode 100644 index 000000000..a8c6c026b --- /dev/null +++ b/id/server/doc/moa_id/api-doc/at/gv/egovernment/moa/id/proxy/package-use.html @@ -0,0 +1,170 @@ + + + + + + +Uses of Package at.gv.egovernment.moa.id.proxy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Uses of Package
at.gv.egovernment.moa.id.proxy

+
+ + + + + + + + + +
+Packages that use at.gv.egovernment.moa.id.proxy
at.gv.egovernment.moa.id.proxy  
+  +

+ + + + + + + + + + + +
+Classes in at.gv.egovernment.moa.id.proxy used by at.gv.egovernment.moa.id.proxy
LoginParameterResolverException + +
+          Exception thrown while proxying a request to the online application
NotAllowedException + +
+          Exception thrown while proxying a request to the online application + Reason for this exception: the dedicated LoginParameterResolver does + not allow access to the desired ressource.
+  +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/constant-values.html b/id/server/doc/moa_id/api-doc/constant-values.html new file mode 100644 index 000000000..bc145c359 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/constant-values.html @@ -0,0 +1,262 @@ + + + + + + +Constant Field Values (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Constant Field Values

+
+
+Contents + + + + + + +
+at.gv.*
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
at.gv.egovernment.moa.id.config.proxy.OAConfiguration
+public static final StringBASIC_AUTH"basic"
+public static final StringHEADER_AUTH"header"
+public static final StringLOGINTYPE_STATEFUL"stateful"
+public static final StringLOGINTYPE_STATELESS"stateless"
+public static final StringPARAM_AUTH"param"
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
at.gv.egovernment.moa.id.proxy.LoginParameterResolver
+public static final StringMOABKZ"MOABKZ"
+public static final StringMOABPK"MOABPK"
+public static final StringMOADateOfBirth"MOADateOfBirth"
+public static final StringMOAFamilyName"MOAFamilyName"
+public static final StringMOAGivenName"MOAGivenName"
+public static final StringMOAIdentificationValueType"MOAIdentificationValueType"
+public static final StringMOAIPAddress"MOAIPAddress"
+public static final StringMOAPublicAuthority"MOAPublicAuthority"
+public static final StringMOAQualifiedCertificate"MOAQualifiedCertificate"
+public static final StringMOAStammzahl"MOAStammzahl"
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/deprecated-list.html b/id/server/doc/moa_id/api-doc/deprecated-list.html new file mode 100644 index 000000000..d760f28ee --- /dev/null +++ b/id/server/doc/moa_id/api-doc/deprecated-list.html @@ -0,0 +1,134 @@ + + + + + + +Deprecated List (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Deprecated API

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/help-doc.html b/id/server/doc/moa_id/api-doc/help-doc.html new file mode 100644 index 000000000..bbdccd6b5 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/help-doc.html @@ -0,0 +1,193 @@ + + + + + + +API Help (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Overview

+
+ +

+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

+

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+

+Use

+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/index-all.html b/id/server/doc/moa_id/api-doc/index-all.html new file mode 100644 index 000000000..b6ccf5c68 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/index-all.html @@ -0,0 +1,462 @@ + + + + + + +Index (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +A B C D G H I L M N O P S V
+

+A

+
+
AuthenticationData - class at.gv.egovernment.moa.id.data.AuthenticationData.
Encapsulates authentication data contained in a <saml:Assertion>.
AuthenticationData() - +Constructor for class at.gv.egovernment.moa.id.data.AuthenticationData +
Constructor for AuthenticationData. +
AuthenticationException - class at.gv.egovernment.moa.id.AuthenticationException.
Exception thrown during handling of AuthenticationSession
AuthenticationException(String, Object[]) - +Constructor for class at.gv.egovernment.moa.id.AuthenticationException +
Constructor for AuthenticationException. +
AuthenticationException(String, Object[], Throwable) - +Constructor for class at.gv.egovernment.moa.id.AuthenticationException +
Constructor for AuthenticationException. +
AuthenticationServer - class at.gv.egovernment.moa.id.auth.AuthenticationServer.
API for MOA ID Authentication Service.
AuthenticationServer() - +Constructor for class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Constructor for AuthenticationServer. +
at.gv.egovernment.moa.id - package at.gv.egovernment.moa.id
 
at.gv.egovernment.moa.id.auth - package at.gv.egovernment.moa.id.auth
 
at.gv.egovernment.moa.id.config.proxy - package at.gv.egovernment.moa.id.config.proxy
 
at.gv.egovernment.moa.id.data - package at.gv.egovernment.moa.id.data
 
at.gv.egovernment.moa.id.proxy - package at.gv.egovernment.moa.id.proxy
 
+
+

+B

+
+
BASIC_AUTH - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Constant for an auth method +
buildConnection(HttpServletRequest, String, String, SSLSocketFactory, Map) - +Method in interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder +
Builds an HttpURLConnection to a URL which is derived + from an HttpServletRequest URL, by substitution of a + public URL prefix for the real URL prefix. +
+
+

+C

+
+
ConnectionBuilder - interface at.gv.egovernment.moa.id.proxy.ConnectionBuilder.
Builder for URLConnection objects used to forward requests + to the remote online application.
cleanup() - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Cleans up expired session and authentication data stores. +
configure(String) - +Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
  +
+
+

+D

+
+
debugOutputXMLFile(String, Element) - +Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Writes an XML structure to file for debugging purposes, encoding UTF-8. +
debugOutputXMLFile(String, String) - +Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Writes an XML structure to file for debugging purposes, encoding UTF-8. +
+
+

+G

+
+
getAssertionID() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the assertionID. +
getAuthType() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the authType. +
getAuthenticationData(String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Retrieves AuthenticationData indexed by the SAML artifact. + +
getAuthenticationHeaders(OAConfiguration, AuthenticationData, String) - +Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Returns authentication headers to be added to a URLConnection. +
getAuthenticationParameters(OAConfiguration, AuthenticationData, String) - +Method in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Returns request parameters to be added to a URLConnection. +
getBasicAuthPasswordMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the basicAuthPasswordMapping. +
getBasicAuthUserIDMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the basicAuthUserIDMapping. +
getDateOfBirth() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the dateOfBirth. +
getFamilyName() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the familyName. +
getGivenName() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the givenName. +
getHeaderAuthMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the headerAuthMapping. +
getIdentificationType() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the identificationType +
getIdentificationValue() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the identificationValue. +
getInstance() - +Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Returns the single instance of AuthenticationServer. +
getIssueInstant() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the issueInstant. +
getIssuer() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the issuer. +
getLoginType() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the loginType. +
getMajorVersion() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the majorVersion. +
getMinorVersion() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the minorVersion. +
getPBK() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the bPK. +
getParamAuthMapping() - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Returns the paramAuthMapping. +
getPublicAuthorityCode() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the publicAuthorityCode. +
getSamlAssertion() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the samlAssertion. +
getSession(String) - +Static method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Retrieves a session from the session store. +
getTimestamp() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the timestamp. +
+
+

+H

+
+
HEADER_AUTH - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Constant for an auth method +
+
+

+I

+
+
isPublicAuthority() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the publicAuthority. +
isQualifiedCertificate() - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Returns the qualifiedCertificate. +
+
+

+L

+
+
LOGINTYPE_STATEFUL - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Constant for an login method +
LOGINTYPE_STATELESS - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Constant for an login method +
LoginParameterResolver - interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver.
Determines authentication parameters and headers to be added to a URLConnection + to the remote online application. +
LoginParameterResolverException - class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException.
Exception thrown while proxying a request to the online application
LoginParameterResolverException(String, Object[]) - +Constructor for class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException +
Constructor for LoginParameterResolverException. +
LoginParameterResolverException(String, Object[], Throwable) - +Constructor for class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException +
Constructor for LoginParameterResolverException. +
+
+

+M

+
+
MOABKZ - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOABPK - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOADateOfBirth - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOAFamilyName - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOAGivenName - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constants used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, + naming predicates used by the LoginParameterResolver. +
MOAIPAddress - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOAIdentificationValueType - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOAPublicAuthority - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOAQualifiedCertificate - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
MOAStammzahl - +Static variable in interface at.gv.egovernment.moa.id.proxy.LoginParameterResolver +
Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType +
+
+

+N

+
+
NotAllowedException - class at.gv.egovernment.moa.id.proxy.NotAllowedException.
Exception thrown while proxying a request to the online application + Reason for this exception: the dedicated LoginParameterResolver does + not allow access to the desired ressource.
NotAllowedException(String, Object[]) - +Constructor for class at.gv.egovernment.moa.id.proxy.NotAllowedException +
Constructor for NotAllowedException. +
NotAllowedException(String, Object[], Throwable) - +Constructor for class at.gv.egovernment.moa.id.proxy.NotAllowedException +
Constructor for NotAllowedException. +
+
+

+O

+
+
OAConfiguration - class at.gv.egovernment.moa.id.config.proxy.OAConfiguration.
Holds configuration data concerning an online application for use by the MOA-ID Proxy component. +
OAConfiguration() - +Constructor for class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
  +
+
+

+P

+
+
PARAM_AUTH - +Static variable in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Constant for an auth method +
+
+

+S

+
+
selectBKU(String, String, String, String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes request to select a BKU. + +
setAssertionID(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the assertionID. +
setAuthType(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the authType. +
setBasicAuthPasswordMapping(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the basicAuthPasswordMapping. +
setBasicAuthUserIDMapping(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the basicAuthUserIDMapping. +
setDateOfBirth(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the dateOfBirth. +
setFamilyName(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the familyName. +
setGivenName(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the givenName. +
setHeaderAuthMapping(HashMap) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the headerAuthMapping. +
setIdentificationType(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the identificationType. +
setIdentificationValue(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the identificationValue. +
setIssueInstant(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the issueInstant. +
setIssuer(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the issuer. +
setLoginType(String) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the loginType. +
setMajorVersion(int) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the majorVersion. +
setMinorVersion(int) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the minorVersion. +
setPBK(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the bPK. +
setParamAuthMapping(HashMap) - +Method in class at.gv.egovernment.moa.id.config.proxy.OAConfiguration +
Sets the paramAuthMapping. +
setPublicAuthority(boolean) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the publicAuthority. +
setPublicAuthorityCode(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the publicAuthorityCode. +
setQualifiedCertificate(boolean) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the qualifiedCertificate. +
setSamlAssertion(String) - +Method in class at.gv.egovernment.moa.id.data.AuthenticationData +
Sets the samlAssertion. +
setSecondsAuthDataTimeOut(long) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Sets the authDataTimeOut. +
setSecondsSessionTimeOut(long) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Sets the sessionTimeOut. +
startAuthentication(String, String, String, String, String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes the beginning of an authentication session. + +
+
+

+V

+
+
verifyAuthenticationBlock(String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes a <CreateXMLSignatureResponse> sent by the + security layer implementation. +
verifyIdentityLink(String, String) - +Method in class at.gv.egovernment.moa.id.auth.AuthenticationServer +
Processes an <InfoboxReadResponse> sent by the + security layer implementation. +
+
+A B C D G H I L M N O P S V + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/index.html b/id/server/doc/moa_id/api-doc/index.html new file mode 100644 index 000000000..61c644160 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/index.html @@ -0,0 +1,26 @@ + + + + + + +MOA ID API + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/id/server/doc/moa_id/api-doc/overview-frame.html b/id/server/doc/moa_id/api-doc/overview-frame.html new file mode 100644 index 000000000..58e79621c --- /dev/null +++ b/id/server/doc/moa_id/api-doc/overview-frame.html @@ -0,0 +1,50 @@ + + + + + + +Overview (MOA ID API) + + + + + + + + + + + + + + + +
+
+ + + + + +
All Classes +

+ +Packages +
+at.gv.egovernment.moa.id +
+at.gv.egovernment.moa.id.auth +
+at.gv.egovernment.moa.id.config.proxy +
+at.gv.egovernment.moa.id.data +
+at.gv.egovernment.moa.id.proxy +
+

+ +

+  + + diff --git a/id/server/doc/moa_id/api-doc/overview-summary.html b/id/server/doc/moa_id/api-doc/overview-summary.html new file mode 100644 index 000000000..0d16ca82c --- /dev/null +++ b/id/server/doc/moa_id/api-doc/overview-summary.html @@ -0,0 +1,165 @@ + + + + + + +Overview (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +


+
+

+

MOA ID API

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Packages
at.gv.egovernment.moa.id 
at.gv.egovernment.moa.id.auth 
at.gv.egovernment.moa.id.config.proxy 
at.gv.egovernment.moa.id.data 
at.gv.egovernment.moa.id.proxy 
+ +


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/overview-tree.html b/id/server/doc/moa_id/api-doc/overview-tree.html new file mode 100644 index 000000000..583aeddde --- /dev/null +++ b/id/server/doc/moa_id/api-doc/overview-tree.html @@ -0,0 +1,155 @@ + + + + + + +Class Hierarchy (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For All Packages

+
+
+
Package Hierarchies:
at.gv.egovernment.moa.id, at.gv.egovernment.moa.id.auth, at.gv.egovernment.moa.id.config.proxy, at.gv.egovernment.moa.id.data, at.gv.egovernment.moa.id.proxy
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/package-list b/id/server/doc/moa_id/api-doc/package-list new file mode 100644 index 000000000..4cafbedb3 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/package-list @@ -0,0 +1,5 @@ +at.gv.egovernment.moa.id +at.gv.egovernment.moa.id.auth +at.gv.egovernment.moa.id.config.proxy +at.gv.egovernment.moa.id.data +at.gv.egovernment.moa.id.proxy diff --git a/id/server/doc/moa_id/api-doc/packages.html b/id/server/doc/moa_id/api-doc/packages.html new file mode 100644 index 000000000..dc4a5e004 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/packages.html @@ -0,0 +1,37 @@ + + + + + + + (MOA ID API) + + + + + + + + + + + +
+ +
+ +
+
+The front page has been relocated.Please see: +
+          Frame version +
+          Non-frame version.
+ + + diff --git a/id/server/doc/moa_id/api-doc/resources/inherit.gif b/id/server/doc/moa_id/api-doc/resources/inherit.gif new file mode 100644 index 000000000..c814867a1 Binary files /dev/null and b/id/server/doc/moa_id/api-doc/resources/inherit.gif differ diff --git a/id/server/doc/moa_id/api-doc/serialized-form.html b/id/server/doc/moa_id/api-doc/serialized-form.html new file mode 100644 index 000000000..feb57f861 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/serialized-form.html @@ -0,0 +1,169 @@ + + + + + + +Serialized Form (MOA ID API) + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Serialized Form

+
+ + + + + +
+Class at.gv.egovernment.moa.id.AuthenticationException extends MOAIDException implements Serializable
+ +

+ +

+


+ + + + + +
+Class at.gv.egovernment.moa.id.proxy.LoginParameterResolverException extends MOAIDException implements Serializable
+ +

+ +

+


+ + + + + +
+Class at.gv.egovernment.moa.id.proxy.NotAllowedException extends MOAIDException implements Serializable
+ +

+ +

+


+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/id/server/doc/moa_id/api-doc/stylesheet.css b/id/server/doc/moa_id/api-doc/stylesheet.css new file mode 100644 index 000000000..14c3737e8 --- /dev/null +++ b/id/server/doc/moa_id/api-doc/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/id/server/doc/moa_id/examples/BKUSelectionTemplate.html b/id/server/doc/moa_id/examples/BKUSelectionTemplate.html new file mode 100644 index 000000000..5536226a8 --- /dev/null +++ b/id/server/doc/moa_id/examples/BKUSelectionTemplate.html @@ -0,0 +1,52 @@ + + + +MOA ID - Auswahl der B&uuuml;rgerkartenumgebung + + + + + + + + +Organisation XY +

Auswahl der Bürgerkartenumgebung

+

+

Sie haben sich für Anmeldung mit Ihrer Bürgerkarte entschieden. Da es verschiedene Formen der Bürgerkarte gibt, müssen Sie nun wählen, welche Sie bei der Anmeldung verwenden wollen.

+

Auswahl der Bürgerkarte

+
+ + + +
+

+ + + + +

Hinweise:

+
    +
  • +

    Wollen Sie eine A-Trust Bürgerkarte erwerben? Hier finden Sie Informationen + dazu: A-Trust + Bürgerkarte. Bei der Anmeldung mit der A-Trust Bürgerkarte + benötigen Sie eine funktionsfähige Bürgerkartensoftware sowie + einen passenden Kartenleser.

    +
  • +
  • +

    Wollen Sie ein A1-Signatur erwerben? Wenden Sie sich an 0800-664 680 um + Informationen zur A1-Signatur zu erhalten. + Hier finden Sie ebenfalls Informationen dazu: A1-Signatur. + Bei der Anmeldung mit der A1-Signatur wird keine Bürgerkartensoftware und + kein Kartenleser benötigt.

    +
  • +
+
Valid HTML 4.01!
+

 

+ + + + diff --git a/id/server/doc/moa_id/examples/ChainingModes.txt b/id/server/doc/moa_id/examples/ChainingModes.txt new file mode 100644 index 000000000..820b60d06 --- /dev/null +++ b/id/server/doc/moa_id/examples/ChainingModes.txt @@ -0,0 +1,6 @@ + + + CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT + 536 + + diff --git a/id/server/doc/moa_id/examples/IdentityLinkSigners.txt b/id/server/doc/moa_id/examples/IdentityLinkSigners.txt new file mode 100644 index 000000000..15269ad79 --- /dev/null +++ b/id/server/doc/moa_id/examples/IdentityLinkSigners.txt @@ -0,0 +1,9 @@ + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + \ 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 new file mode 100644 index 000000000..587ef5e97 --- /dev/null +++ b/id/server/doc/moa_id/examples/LoginServletExample.txt @@ -0,0 +1,171 @@ +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(); + + // zusammenstellen und in einen DOM-Baum umwandeln + String samlRequest = + "" + + samlArtifact + + ""; + 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); + + // als DOM-Baum holen + Document responseDocument = response.getAsDocument(); + Element samlResponse = responseDocument.getDocumentElement(); + + // 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); + + // auslesen + Attr statusCodeAttr = (Attr)getNode(samlResponse, "/samlp:Response/samlp:Status/samlp:StatusCode/@Value"); + String samlStatusCode = statusCodeAttr.getValue(); + System.out.println("StatusCode: " + samlStatusCode); + + // auslesen + if ("samlp:Success".equals(samlStatusCode)) { + Element samlAssertion = (Element)getNode(samlResponse, "/samlp:Response/saml:Assertion"); + + // FamilyName aus der 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 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 new file mode 100644 index 000000000..09e60c6f1 --- /dev/null +++ b/id/server/doc/moa_id/examples/SampleMOAIDVerifyInfoboxesConfiguration.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + Globale Templates zum Anpassen der Seiten "Auswahl der Bürgerkartenumgebung" und + "Anmeldung mit Bürgerkarte"<--> + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindung + + + + MOAIDBuergerkarteAuthentisierungsDaten + + MOAIDTransformAuthBlockText + Auskommentieren, falls die in der Beispiel-Onlineapplikation definierte Transformationverwendet wird:<--> + + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + + + + GlobalVIDefaultTrust + + + + Beispiel Infobox B + GlobalInfoboxBTrust + + + + + + content1 + content2 + + content3a + content3b + + + + + + + + + + + + + + + LocalOA1DefaultTrust + + + + Demo Infobox B + oa1.validate.InfoboxBValidator + + + + + + + + Demo Infobox C + LocalInfoboxOA1CTrust + + + + + + + + + + + + + + LocalInfoboxOA2ATrust + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/doc/moa_id/examples/Template.html b/id/server/doc/moa_id/examples/Template.html new file mode 100644 index 000000000..5074f5beb --- /dev/null +++ b/id/server/doc/moa_id/examples/Template.html @@ -0,0 +1,50 @@ + + + +MOA ID - Identifizierter Zugang mit Bürgerkarte + + + +Organisation XY +

Sicherer Zugang zur Online-Anwendung mit Bürgerkarte

+

+ +Der identifizierte Zugang erfolgt über die Module für Online Applikationen (MOA) unter Verwendung einer Bürgerkarte und deren Signaturfunktion. + +

+

Wenn Sie in Folge die Schaltfläche "Anmeldung mit Bürgerkarte" +aktivieren, so werden zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese +signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.

+ + +
+
+ + + + + +
+
+
+ + + + + +
+ + + diff --git a/id/server/doc/moa_id/examples/TransformsInfoAuthBlock.txt b/id/server/doc/moa_id/examples/TransformsInfoAuthBlock.txt new file mode 100644 index 000000000..edbde0073 --- /dev/null +++ b/id/server/doc/moa_id/examples/TransformsInfoAuthBlock.txt @@ -0,0 +1,35 @@ + + + + + + + + + Signatur der Anmeldedaten + + +

Signatur der Anmeldedaten

+

+

Mit meiner elektronischen Signatur beantrage ich, , +geboren am +.., den Zugang zur gesicherten Anwendung.

+

+

Datum und Uhrzeit: .., ::

+ +

wbPK(*):

+

+
+ (*) wbPK: Das Wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Buergers und des Wirtschaftsunternehmens berechnet und ermoeglicht eine eindeutige Zuordnung des Buergers zum Wirtschaftsunternehmen. +
+ + +
+
+
+ +
+ + text/html + +
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 new file mode 100644 index 000000000..db43b0c1d --- /dev/null +++ b/id/server/doc/moa_id/examples/conf/MOA-ID-Configuration.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + MOAIDBuergerkartePersonenbindung + + + + MOAIDBuergerkarteAuthentisierungsDaten + + MOAIDTransformAuthBlockText + + + + + + + CN=zmr,OU=BMI-IV-2,O=BMI,C=AT + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission + + T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + certs/ca-certs + + + + + + + + + + + + + + diff --git a/id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml b/id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml new file mode 100644 index 000000000..fc99cea79 --- /dev/null +++ b/id/server/doc/moa_id/examples/conf/OAConfBasicAuth.xml @@ -0,0 +1,9 @@ + + + + stateless + + MOAFamilyName + MOAGivenName + + diff --git a/id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml b/id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml new file mode 100644 index 000000000..4d34c3646 --- /dev/null +++ b/id/server/doc/moa_id/examples/conf/OAConfHeaderAuth.xml @@ -0,0 +1,10 @@ + + + + stateless + + +
+
+
+
diff --git a/id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml b/id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml new file mode 100644 index 000000000..979faca95 --- /dev/null +++ b/id/server/doc/moa_id/examples/conf/OAConfParamAuth.xml @@ -0,0 +1,10 @@ + + + + stateless + + + + + + 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 new file mode 100644 index 000000000..1ccca10c1 --- /dev/null +++ b/id/server/doc/moa_id/examples/moa-id-env.sh.txt @@ -0,0 +1,15 @@ +rem insert Tomcat 4.1.x home directory (no trailing path separator) +set CATALINA_HOME= + +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 new file mode 100644 index 000000000..29588120c --- /dev/null +++ b/id/server/doc/moa_id/examples/startTomcat.bat.txt @@ -0,0 +1,26 @@ +rem ---------------------------------------------------------------------------------------------- +rem Modify these entries according to your needs + +rem JDK home directory (no trailing path separator) +set JAVA_HOME= + +rem Tomcat 4.1.x home directory (no trailing path separator) +set CATALINA_HOME= + +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 new file mode 100644 index 000000000..effc21637 --- /dev/null +++ b/id/server/doc/moa_id/faqs.htm @@ -0,0 +1,217 @@ + + + FAQs - Häufig gestellte Fragen + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + + + + + + +
+
FAQs
+
+ +
+ +
+
FAQs - Häufig gestellte Fragen
+

Frage 1 + Mit dem Internet Explorer kommt es bei einer Anmeldung an der lokal + installierten Version von MOA-ID zu Fehlern beim Redirect. Warum?

+

Frage 2 + Wenn die Proxy-Komponente lokal läuft und per TLS/SSL aufgerufen + wird, kommt es zu einer Fehlermeldung. Wie kann dies verhindert werden?

+

Frage 3 + Es soll serverseitig lediglich starke TLS/SSL Verschlüsselung (>100 + Bit) unterstützt werden. Wie kann dies erzwungen werden?

+

Frage 4 Beim Starten von + MOA ID bzw. MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: + iaik.asn1.structures.Name. Was kann der Fehler sein?

+

Frage 5 Ich möchte + MOA in einer Umgebung betreiben, die einen Internet-Zugang nur über + einen Proxy erlaubt. Funktioniert das?

+

Frage 6 Tomcat: Wärend + des Betriebs kommt es zu org.apache.commons.logging.LogConfigurationException. + Wie kann dies verhindert werden?

+
+

+

Frage 1

+

Q: Mit dem Internet Explorer kommt es bei einer Anmeldung + an der lokal installierten Version von MOA-ID zu Fehlern beim Redirect. + Warum?

+

A: Aufgrund eines Fehlers in Microsofts Internet + Explorer schlägt der (lokale) Redirect auf dem lokal installierten + Tomcat fehl.

+

Als Workaround empfiehlt es sich, zum lokalen Testen einen + alternativen Browser wie Opera, + Mozilla oder Netscape + 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.

+
+

Frage 2

+

Q: Wenn die Proxy-Komponente lokal läuft und + per TLS/SSL aufgerufen wird, kommt es zu einer Fehlermeldung. Wie kann + dies verhindert werden?

+

A: Wenn in der Konfiguration statt 'localhost' der + eigene Rechnername verwendet wird, funktioniert die Proxy-Komponente + wie gewohnt.
+
+ 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.

+
+

Frage 3

+

Q: Es soll serverseitig lediglich starke TLS/SSL + Verschlüsselung (>100 Bit) unterstützt werden. Wie kann + dies erzwungen werden?

+

A: Tomcat bietet (bis dato) keine einfache Möglichkeit + die serverseitig verwendeten TLS/SSL Verschlüsselungsalgorithmen + zu konfigurieren. Daher empfiehlt es sich in diesem Fall, einen Web-Server + wie Apache oder den Microsoft Internet-Information-Server für das + SSL-Handling vorzuschalten und dort in der jeweiligen Konfiguration + starke Verschlüsselung zu erzwingen.

+
+ +

Frage 4

+ Q:
Beim Starten von MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: + iaik.asn1.structures.Name. Was kann der Fehler sein? +

A: 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ü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ützt, wird PKCS7.getCertificate() verwendet, und + es kommt zu einer ClassCastException.

+

Wird MOA ü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ö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üssen die Einträge +

+  security.provider.1=sun.security.provider.Sun
+  security.provider.2=com.sun.rsajca.Provider  
+
+ durch folgenden Eintrag ergänzt werden: +
+  security.provider.3=iaik.security.provider.IAIK
+
+

+ +
+

Frage 5

+
+

Q: Ich möchte MOA in einer Umgebung betreiben, + die einen Internet-Zugang nur über einen Proxy erlaubt. Funktioniert + das?

+

A: Ja, zumindest für Zugriffe über HTTP. + Sie müssen dazu die nachfolgenden JAVA System-Properties setzen:

+
+

http.proxyHost=<proxyhost>
+ http.proxyPort=<proxyport>
+ http.nonProxyHosts="<exceptionhosts>"

+
+

<proxyhost> gibt den Namen oder die IP-Adresse des + Proxies an.

+

<proxyport> gibt den Port des Proxies an.

+

<exceptionhosts> enthält eine Liste von Rechnernamen, + die nicht über den Proxy laufen sollen. Jedenfalls müssen + sie hier localhost angeben. Einzelne Namen sind durch eine + Pipe (|) zu trennen. Bitte beachten Sie, dass IP-Addressen + nicht angegeben werden dürfen, sowie die verpflichtend zu verwendenen + Anführungszeichen.

+
+
+

Frage 6

+

Q: Tomcat: Wärend des Betriebs kommt es zu org.apache.commons.logging.LogConfigurationException. + Wie kann dies verhindert werden?

+

org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: + org.apache.commons.logging.LogConfigurationException
+ : Class org.apache.commons.logging.impl.Jdk14Logger does not implement + Log

+

A: 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.

+

 

+
  
+ + + + + + + +

+
+
+
© 2003
+
+
+ + +
+ + \ No newline at end of file diff --git a/id/server/doc/moa_id/id-admin.htm b/id/server/doc/moa_id/id-admin.htm new file mode 100644 index 000000000..19fa3562c --- /dev/null +++ b/id/server/doc/moa_id/id-admin.htm @@ -0,0 +1,317 @@ + + + MOA ID-Administration + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
MOA-ID

+
+ Übersicht
+ + + +
+ +
+
+
MOA ID-Administration v.1.4
+

+Die Komponenten des Moduls Identifikation (MOA-ID), MOA-ID-AUTH und MOA-ID-PROXY, sind als plattformunabhängige Webapplikationen ausgelegt. +MOA-ID-AUTH ist die Basiskomponente des Moduls, und MOA-ID-PROXY ist eine optionale Zusatzkomponente. +Für den Betrieb dieser Webapplikationen wird eine Java Virtual Machine und ein Java Servlet Container vorausgesetzt. +

+Dieses Handbuch beschreibt die Installation und Konfiguration von MOA-ID-AUTH und von MOA-ID-PROXY, und die Einrichtung der Systemumgebungen. +

+
+
+ + + +
+ + + +
+

 

+
+

Übersicht

+
+Für den Betrieb von MOA-ID-AUTH sind unterschiedliche Szenarien möglich, die unterschiedliche Möglichkeiten bieten und die Installation unterschiedlicher Software- und Hardware-Komponenten erfordern. Dieser Abschnitt gibt einen kurzen Überblick über die notwendige Basis-Installation und optionale weitere Konfigurationsmöglichkeiten. +
+
+
+ +
+ + + +
+

 

+
+
Basis-Installation von MOA-ID-AUTH
+

+Die Basis-Installation stellt einerseits die minimalen Anforderungen für den Betrieb von MOA-ID-AUTH dar, andererseits dient sie als Ausgangspunkt für weitere (optionale) Konfigurations-Möglichkeiten. +

+Folgende Software ist Voraussetzung für die Basis-Installation: + +

    +
  • JDK 1.4.0, JDK 1.4.2 oder JDK 1.5.0
  • +
  • Tomcat 4.1.31 oder Tomcat 5.0.28
  • +
  • MOA-ID-AUTH 1.4
  • +
  • MOA SP/SS 1.4 oder neuer (entweder als WebService oder direkt als interne Bibliothek)
  • +
+
+Um möglichen Versionskonflikten aus dem Weg zu gehen sollten stets die neuesten Versionen von MOA-ID als auch von MOA-SP/SS verwendet werden.
+In diesem Betriebs-Szenario wird MOA-ID-AUTH in Tomcat deployt. Tomcat fungiert gleichzeitig als HTTP- und HTTPS-Endpunkt für MOA-ID-AUTH. Beide Protokolle werden direkt in Tomcat konfiguriert. +

+Die Webapplikation verwendet Log4j als Logging Toolkit. +
+
+
+ +
+ + + +
+

 

+
+

Basis-Installation von MOA-ID-PROXY (optional)

+
+Einer Online-Applikation, für die MOA-ID-AUTH die Authentisierung übernimmt, kann die Komponente MOA-ID-PROXY vorgeschaltet werden. Diese Komponente übernimmt die Anmeldedaten von MOA-ID-AUTH, fü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. +

+MOA-ID-AUTH und MOA-ID-PROXY können in verschiedenen Konstellationen zum Einsatz gebracht werden: +
    +
  • auf verschiedenen Rechnern
  • +
  • auf ein und demselben Rechner in verschiedenen Java Servlet Containern
  • +
  • auf ein und demselben Rechner in ein und demselben Java Servlet Container
  • +
+
+Ausgehend von der Basis-Installation können die optionalen Konfigurationen, die in den nachfolgenden Abschnitten beschrieben werden, unabhängig und in beliebiger Kombination aufgesetzt werden. +
+
+
+ +
+ + + +
+

 

+
+

Konfiguration mit vorgeschaltetem Webserver (optional)

+
+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 üblicherweise der Apache Webserver zum Einsatz. +

+ Folgende Software ist unter Windows Voraussetzung: +
+
    +
  • MS IIS 5.0
  • +
  • Jakarta mod_jk 1.2.2
  • +
+
Folgende Software ist unter Unix/Linux Voraussetzung:
+
    +
  • Apache Webserver 2.0.x mit mod_SSL
  • +
  • Jakarta mod_jk 1.2.2
  • +
+
In diesem Fall übernimmt der vorgeschaltete Webserver die Funktion des HTTP- und HTTPS-Endpunktes. Beide Protokolle werden im Webserver konfiguriert. +

+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ück übermittelt. +
+
+
+ +
+ + + +
+

 

+
+

Konfiguration mit PostgreSQL (optional)

+
+Das MOA ID Webservice kann eine PostgreSQL Datenbank nutzen, um: +
+
    +
  • Log-Meldungen zu speichern
  • +
+
Für den Zugriff auf PostgreSQL ist die Installation folgender Software Voraussetzung:
+
    +
  • PostgreSQL 7.3
  • +
+
+
+ +
+ + + +
+

 

+
+

Zusammenfassung

+
+Notwendig für den Betrieb von MOA ID ist eine Basis-Installation. Weitere optionale Konfigurationen können unabhängig und in beliebiger Kombination miteinander durchgeführt werden, um eine bessere Integration der MOA ID Webapplikationen in die vorhandene Betriebs-Infrastruktur zu erreichen. +
+
+

+ + + +
+ + + +
+

 

+
+

Referenzierte Software

+
+Die Versionsangaben beziehen sich auf die Versionen, mit denen die MOA ID Webapplikationen entwickelt und getestet wurde. Geringfügig andere Software-Versionen stellen üblicherweise kein Problem dar. +
+

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KomponenteGetestete Version
JDK (SDK) min. 1.4.0 bzw.
+ 1.4.2

+ 1.5.0 +
Tomcat +

4.1.31
+ 5.0.25

+
MOA-ID-AUTH 1.4 (neueste Version)
MOA-ID-PROXY 1.4 (neueste Version)
MOA-SPSS 1.4 (neueste Version) 
Apache Webserver 1.3.X + bzw.
+ 2.0.X
Microsoft Internet Information Server + 5.0 
+ 6.0 
mod_SSL (**)  +
Jakarta mod_jk 1.2.2  +
Jakarta Log4j 1.2.8  +
PostgreSQL 7.3  +
+
+
+
+ +
(**) passend zur Version des Apache Webservers
+
+

+ + + + + +

+
+
© 2004
+
+
+ + +
+
+ diff --git a/id/server/doc/moa_id/id-admin_1.htm b/id/server/doc/moa_id/id-admin_1.htm new file mode 100644 index 000000000..289c52d8a --- /dev/null +++ b/id/server/doc/moa_id/id-admin_1.htm @@ -0,0 +1,539 @@ + + + MOA ID-Administration + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
MOA-ID

+ +
+ Basis-Installation
+ + +
+ +
+ +
+

Basis-Installation v.1.4

+Bei der Basis-Installation von MOA-ID-AUTH und von MOA-ID-PROXY ist grundsätzlich gleichartig vorzugehen. +Unterschiede sind in der Installationsanweisung angeführt. +
+

Vorbereitung

+
+

Installation des JDK
+ Installieren Sie das JDK in ein + beliebiges Verzeichnis. Das Wurzelverzeichnis der JDK-Installation + wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
+
+ Installation von Tomcat
+ Installieren Sie Tomcat in ein Verzeichnis, das keine Leer- und + Sonderzeichen im Pfadnamen enthä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.
+
+ Entpacken der MOA ID Webapplikation
+ 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.
+
+ Installation der IAIK JCE und des IAIK LDAP Protocol Handlers
+ Die Dateien aus dem Verzeichnis $MOA_ID_INST_AUTH/ext (oder $MOA_ID_INST_PROXY/ext) + müssen in das Verzeichnis $JAVA_HOME/jre/lib/ext kopiert werden. + Anschließend steht eine Unterstützung für Kryptographie + und SSL jeder Java-Anwendung die dieses JDK verwendet zur Verfügung.
+
+ Zusätzlich müssen die so genannten Unlimited Strength + Jurisdiction Policy Files heruntergeladen, entpackt + und ins Verzeichnis $JAVA_HOME/jre/lib/security kopiert werden.

+

Der Download für diese Dateien findet sich am unteren Ende + der Download-Seite des jeweiligen JDK in der Sektion "Other + Downloads". D.h. JDK + hier für 1.4.0, das JDK hier + für 1.4.2 bzw. das JDK hier + für 1.5.0.

+
+ +
+ +
+ + +
+

 

+
+

+
+
+

Konfiguration von Tomcat

+
+Minimale Konfiguration
+Die zentrale Konfigurations-Datei von Tomcat ist $CATALINA_HOME/conf/server.xml. Tomcat wird grundsätzlich mit +einer funktionierenden Default-Konfiguration ausgeliefert, die jedoch einiges an Ballast enthält und viele Ports +offen lässt. Die Datei $MOA_ID_INST_AUTH/tomcat/server.xml (bzw. $MOA_ID_INST_PROXY/tomcat/server.xml) enthält eine minimale +Tomcat-Konfiguration, die je einen Connector für HTTP und für HTTPS freischaltet.

+SSL
+Fü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 übernimmt. +Ebenso kann SSL auch für MOA-ID-PROXY verwendet werden. +Das Dokument Tomcat SSL Configuration HOW-TO gibt einen guten Überblick über die Konfiguration von SSL in Tomcat. Da die für SSL notwendigen Bibliotheken bereits im Abschnitt "Vorbereitung" eingebunden wurden, sind nur noch folgende Schritte notwendig: +
+
    +
  • Erstellung eines Server-Keystores, welches den privaten Schlüssel des Servers sowie das Server-Zertifikat enthält, +z.B. mit dem Java Keytool.
    +Hinweis: Standardmäßig wird beim Erzeugen eines neuen Keystores im Home-Verzeichnis des Benutzers die Datei ".keystore" angelegt. Möchte man den Dateinamen und Pfad ändern, kann man das dem SSL-Connector in $CATALINA_HOME/conf/server.xml durch hinzufügen des Attributes keystoreFile="NAME DES KEYSTORES" im Element <Factory> bekannt machen. Das zum Keystore gehörende Passwort übergibt man Tomcat mittels des Attributes keystorePass= "PASSWORT DES KEYSTORES" im Element <Factory>.
  • +
  • Erstellung eines Keystores mit vertrauenswürdigen Client-Zertifikaten, z.B. mit dem Java Keytool (nur, wenn SSL Client-Authentisierung verwendet werden soll)
  • +
  • Falls eine Client-Authentisierung gewünscht ist, muss die Konfiguration des SSL-Connectors in $CATALINA_HOME/conf/server.xml angepasst werden.
  • +
+ +
+MOA Administrator
+Der Aufruf der URL für die dynamische Konfiguration von MOA-ID-AUTH ist durch eine Passwort-Abfrage geschützt, und kann nur von Benutzern aufgerufen werden, die der Benutzer-Rolle moa-admin zugeordnet werden können.
+Um diese Benutzer-Rolle und einen oder mehrere Benutzer einzurichten, müssen in der Datei $CATALINA_HOME/conf/tomcat-users.xml unter dem Element <tomcat-users> sinngemäß folgende Einträge hinzugefügt werden: +
+<role rolename="moa-admin"/>
+<user username="moa" password="moa" roles="moa-admin"/>
+
+
+
+ +
+ + +
+

 

+
+

+
+
+

Deployment von MOA-ID-AUTH in Tomcat

+
+Um MOA-ID-AUTH in Tomcat für den Ablauf vorzubereiten, sind folgende Schritte notwendig:
+
    +
  • 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.
  • +
  • Die MOA-ID Konfigurationsdatei und die zugehörigen Verzeichnisse + "certs" und "transforms" werden in ein beliebiges Verzeichnis + im Filesystem kopiert (z.B. $CATALINA_HOME/conf/moa-id).
    + Im Verzeichnis $MOA_ID_INST_AUTH/conf/moa-id befinden sich + acht verschiedene Beispielkonfigurationen, die als Ausgangspunkte + für die Konfiguration von MOA-ID-AUTH dienen können: +
      +
    • SampleMOAIDConfiguration.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID + für eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAWIDConfiguration.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAWIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAIDConfigurationProxy.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte +
      Konfiguration mit Proxykomponente.
    • +
    • SampleMOAIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID + für eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration mit Proxykomponente
    • +
    • SampleMOAWIDConfigurationProxy.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte +
      Konfiguration mit Proxykomponente
    • +
    • SampleMOAWIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration mit Proxykomponente
    • +
    +
  • +
  • Die endorsed Libraries für Tomcat müssen aus dem + Verzeichnis $MOA_ID_INST_AUTH/endorsed in das Tomcat-Verzeichnis + $CATALINA_HOME/common/endorsed kopieren werden. Folgende Libraries + sind für das Deployment im endorsed Verzeichnis vorgesehen: +
      +
    • Xerces-J-2.4.0 (bestehend aus xercesImpl.jar + und xmlParserAPIs.jar) - für alle JDKs.
    • +
    • Xalan-j-2.5.1 (bestehend aus xalan.jar).
    • +
    + Eventuell vorhandene Dateien mit dem gleichen Namen müssen + ersetzt werden. Die ggf. in diesem Verzeichnis vorhandene Datei + xml-apis.jar muss gelöscht werden.
  • +
  • Folgende Java System Properties sind zu setzen:
    +
      +
    • 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.
    • +
    • log4j.configuration=URL der Log4j Konfigurationsdatei. + Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties + enthalten.
    • +
    • javax.net.ssl.trustStore=Name des Truststores + für vertrauenswürdige SSL Client-Zertifikate (optional; + nur, wenn SSL Client-Authentisierung durchgeführt werden + soll).
      +
    • +
    + Diese Java System-Properties werden Tomcat über die Umgebungsvariable + CATALINA_OPTS mitgeteilt (Beispiel-Skripte zum Setzen dieser + Properties für Windows und für Unix bzw. + Linux finden sie unter $MOA_ID_INST_AUTH/tomcat/win32 bzw. + $MOA_ID_INST_AUTH/tomcat/unix). Diese Skripte können sie nach $CATALINA_HOME kompieren und in Folge von dort starten nachdem die Variablen CATALINA_HOME sowie JAVA_HOME in den Skripten entsprechend den Pfaden der Installation gesetzt wurden. +
+
+
+ + +
+ + +
+

 

+
+

+
+
+

Deployment von MOA-ID-PROXY in Tomcat

+
+Um MOA-ID-PROXY in Tomcat für den Ablauf vorzubereiten, sind folgende Schritte notwendig: +
+
    +
  • + Für Tomcat 4.1.31: +
      +
    • Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war wird in ein + beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) kopiert. HINWEIS: + Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!
      +
    • +
    • Anschließend muss in der Datei $CATALINA_HOME/conf/server.xml der + Tomcat-Root-Context auf diese Datei gesetzt werden: wenn + das war-file sich in $CATALINA_HOME/webappsProxy befindet, geschieht dies + mit dem Einfügen von folgendem Element innerhalb von + <Server>...<Service>...<Engine>...<Host>: +
      <Context path="" 
      +    docBase="../webappsProxy/moa-id-proxy.war"
      +    debug="0"/>
      + Anmerkung: Der Root-Context von Tomcat ist normalerweise auskommentiert. +
    • +
    +
  • +
  • + Für Tomcat 5.0.28: +
      +
    • Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war ist in ein + beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) zu entpacken + (diese Datei ist mittels ZIP Algorithmus komprimiert und kann mit jedem Tool, + das mit .ZIP-Dateien umgehen kann, geöffnet werden). HINWEIS: + Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!
      +
    • +
    • Anschließend muss in der Datei $CATALINA_HOME/conf/server.xml 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ügen + von folgendem Element innerhalb von + <Server>...<Service>...<Engine>...<Host>:
    • +
      <Context path="" docBase="../webappsProxy" 
      +    debug="0"/>
      + Alternativ kann statt die Datei server.xml zu ändern in $CATALINA_HOME\conf\Catalina\localhost eine Datei moa-id-proxy.xml mit vorhin angegebenen Inhalt erstellt werden. +
    +
  • +
+ +
+ Tomcat Konfiguration: +
    +
  • Die MOA-ID Konfigurationsdatei und die zugehörigen + Verzeichnisse "certs" und "oa" werden in ein beliebiges Verzeichnis + im Filesystem kopiert (z.B. $CATALINA_HOME/ conf/moa-id). +
    + Im Verzeichnis $MOA_ID_INST_PROXY/conf/moa-id befinden sich + vier verschiedene Beispielkonfigurationen, + die als Ausgangspunkte für die Konfiguration von MOA-ID-PROXY + dienen können. +
  • +
  • Die endorsed Libraries für Tomcat müssen aus dem + Verzeichnis $MOA_ID_INST_PROXY/endorsed in das Tomcat-Verzeichnis + $CATALINA_HOME/common/endorsed kopiert werden. Folgende Libraries + sind für das Deployment im endorsed Verzeichnis vorgesehen: +
      +
    • Xerces-J-2.4.0 (bestehend aus xercesImpl.jar + und xmlParserAPIs.jar)
    • +
    + Eventuell vorhandene Dateien mit dem gleichen Namen müssen + ersetzt werden. +
  • +
  • Folgende Java System Properties sind zu setzen:
    +
      +
    • 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.
    • +
    • log4j.configuration=URL der Log4j Konfigurationsdatei. + Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties + enthalten.
    • +
    • javax.net.ssl.trustStore=Name des Truststores + für vertrauenswürdige SSL Client-Zertifikate + (optional; nur, wenn SSL Client-Authentisierung durchgeführt + werden soll).
    • +
    +
  • + Diese Java System-Properties werden Tomcat über die Umgebungsvariable + CATALINA_OPTS mitgeteilt (siehe Deployment von MOA-ID-AUTH). +
    +
    + Beispiel-Skripts zum Setzen von CATALINA_OPTS und zum Starten + von Tomcat sind in $MOA_ID_INST_AUTH\tomcat\ zu finden - Sie + können diese für Ihre Zwecke adaptieren (JAVA_HOME + und $CATALINA_HOME setzen) und nach $CATALINA_HOME kopieren. +
+
+
+ +
+ + +
+

 

+
+

+
+
+

Starten und Stoppen von Tomcat

+
Nach dem Deployment und der Konfiguration kann + Tomcat aus seinem Wurzelverzeichnis ($CATALINA_HOME) mit
+
+    startTomcat (unter Windows) oder 
+    moa-id-env.sh
+    bin/catalina.sh start (unter Unix/Linux) 
+
+gestartet werden. Das Stoppen von Tomcat erfolgt analog mit
+
+    bin\catalina stop  (unter Windows) oder 
+    bin/catalina.sh stop (unter Unix/Linux) 
+
+Ein erfolgreicher Startvorgang von MOA-ID-AUTH ist an folgender Log-Meldung ersichtlich:
+
+    INFO | 08 13:33:38,497 | main | 
+    	MOA ID Authentisierung wurde 
+    	erfolgreich gestartet
+
+Analog bei MOA-ID-PROXY:
+
+    INFO | 08 13:35:49,876 | main | 
+    	MOA ID Proxy wurde erfolgreich gestartet
+
+ +Nach dem erfolgreichen Starten von Tomcat steht MOA-ID-AUTH unter der URL +
+http(s)://host:port/moa-id-auth/StartAuthentication    
+
+zur Verfügung. Der WebService ist unter +
+http(s)://host:port/moa-id-auth/services/GetAuthenticationData  
+
+erreichbar. Die Verfügbarkeit der Anwendung kann überprüft werden, indem die URLs mit einem Web-Browser aufgerufen werden.
+
+
+Dynamische Konfigurations-Updates
+Dynamische Konfigurations-Updates können für MOA-ID-AUTH durch den Aufruf der URL http://hostname:port/moa-id-auth/ConfigurationUpdate (z.B. durch Eingabe in einem Browser) durchgeführt werden. Analog wird die Konfiguration von MOA-ID-PROXY mittels http://hostname:port/ConfigurationUpdate aktualisiert.

+Hinweis: Konfigurationsänderungen für die Online-Applikationen betreffen grundsätzlich sowohl die Auth- als auch die Proxy-Komponente. +Wenn bspw. das publicURLPrefix der OA geändert wird, muss sowohl für die Auth- als auch für die Proxy-Komponente ein ConfigurationUpdate durchgeführt werden.

+Konnte MOA-ID-AUTH bzw. MOA-ID-PROXY nicht ordnungsgemäß konfiguriert und gestartet werden, geht das aus der Log-Meldung hervor:
+
+FATAL | 03 13:19:06,924 | main | Fehler 
+	beim Starten des Service MOA ID Authentisierung
+
+bzw. +
+FATAL | 03 13:19:06,924 | main | Fehler 
+	beim Starten des Service MOA ID Proxy
+
+In diesem Fall geben die WARN bzw. ERROR Log-Meldungen unmittelbar davor Aufschluss über den genaueren Grund.
+
+
+ + +
+ + +
+

 

+
+

+
+
+
+

Logging

+
+Die MOA ID Webapplikation verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Log4j bietet zahlreiche Konfigurationsmöglichkeiten, die ausführlich im Log4j Handbuch beschrieben sind. Unter anderem gibt es die Möglichkeit, folgende Einstellungen vorzunehmen:
+
    +
  • Das verwendete Log-Level (DEBUG, INFO, WARN, ERROR, FATAL).
  • +
  • Name und maximale Größe der Log-Datei(en).
  • +
  • Das Aussehen der Log-Einträge.
  • +
+Es werden folgende Log-Hierarchien verwendet: +
+
    +
  • moa.id.auth für alle Log-Meldungen aus dem MOA-ID-AUTH Modul
  • +
  • moa.id.proxy für alle Log-Meldungen aus dem MOA-ID-PROXY Modul
  • +
  • moa.spss.server für alle Log-Meldungen aus dem MOA-SPSS Modul
  • +
  • iaik.server für alle Log-Meldungen aus den IAIK Kryptographie-Modulen
  • +
+
+Als Ausgangspunkt fü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 $CATALINA_HOME/logs/moa-id.log geschrieben. +

+Format der Log-Meldungen
+Anhand einer konkreten Log-Meldung wird das Format der MOA ID Log-Meldungen erläutert: +
+    INFO | 09 08:23:59,385 | Thread-8 | 
+    	Anmeldedaten zu MOASession -5468974113772848113 
+    	angelegt, SAML Artifakt 
+    	AAF/BrdRfnMaQVGIbP/Gf9OwDUwwsXChb7nuT+VXQzOoHbV
+
+ +Der Wert INFO besagt, dass die Log-Meldung im Log-Level INFO entstanden ist. Folgende Log-Levels existieren:
+
    +
  • DEBUG: Log-Meldungen im Log-Level DEBUG geben Auskunft über die innere Arbeitsweise des Systems. Sie sind hauptsächlich für Entwickler interessant.
  • +
  • INFO: Diese Log-Meldungen geben informative Status-Informationen über den Ablauf der Webapplikation, wie z.B., dass eine neue Anfrage eingelangt ist.
  • +
  • WARN: Bei der Ausführung einer Operation sind leichte Fehler aufgetreten. Der Ablauf der Webapplikation ist nicht weiter beeinträchtigt.
  • +
  • ERROR: Die Ausführung einer Operation musste abgebrochen werden. Die Webapplikation ist davon nicht beeinträchtigt.
  • +
  • FATAL: Es ist ein Fehler aufgetreten, der den weiteren Betrieb der Webapplikation nicht mehr sinnvoll macht.
  • +
+Der nächste Wert 09 08:23:59,385, gibt den Zeitpunkt an, an dem die Log-Meldung generiert wurde (in diesem Fall den 9. Tag im aktuellen Monat, sowie die genaue Uhrzeit).
+Der Rest der Zeile einer Log-Meldung ist der eigentliche Text, mit dem das System bestimmte Informationen anzeigt. Im Fehlerfall ist häufig ein Java Stack-Trace angefügt, der eine genauere Ursachen-Forschung ermöglicht. +

+ + +Wichtige Log-Meldungen
+Neben den im Abschnitt "Starten und Stoppen von Tomcat" beschriebenen Log-Meldungen, die anzeigen, ob die Webapplikation +ordnungsgemäß gestartet wurde, geben nachfolgenden Log-Meldungen Aufschluss über die Abarbeitung von Anfragen. +Die Annahme einer Anfrage wird beispielsweise angezeigt durch: +
+
+    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
+    
+
+ +
+Die 1. Log-Meldung besagt, dass sich ein Benutzer an MOA-ID-AUTH angemeldet und eine eindeutige SessionID zugewiesen bekommen hat.
+Die 2. Log-Meldung informiert darüber, dass die Anmeldedaten des Benutzers unter dem angezeigten SAML Artifakt abgeholt werden können.
+
+Wenn nun versucht wird, eine Transaktion mit einer ungültigen SessionID fortzusetzen erhält man folgende Log-Meldung:
+
+    ERROR | 09 09:34:27,105 | Thread-8 | 
+	at.gv.egovernment.moa.id.AuthenticationException: 
+	MOASessionID ist unbekannt 
+	(MOASessionID=-8650403497547200032)
+
+

In diesem Fall gibt der mitgeloggte Stacktrace Auskunft + über die Art des Fehlers. Der Aufrufer der MOA ID + Webapplikation bekommt einen Fehlercode sowie eine kurze + Beschreibung des Fehlers als Antwort zurück.
+
+ Die Tatsächlich übertragenen Anfragen bzw. Antworten + werden aus Effizienzgründen nur im Log-Level DEBUG + angezeigt.

+
+

+

+

+
+
+

+ + + + + + +

+
+
© 2004
+
+
+ + +
+
+ diff --git a/id/server/doc/moa_id/id-admin_2.htm b/id/server/doc/moa_id/id-admin_2.htm new file mode 100644 index 000000000..aa7809425 --- /dev/null +++ b/id/server/doc/moa_id/id-admin_2.htm @@ -0,0 +1,1417 @@ + + + MOA ID-Administration + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + + +
+
MOA-ID

+ + +
+ Konfiguration
+ +
+ +

+ + +
+
Konfiguration von MOA ID v.1.4
+
+

Konfiguration von MOA ID v.1.4

+

Die Konfiguration von MOA ID wird mittels einer XML-basierten + Konfigurationsdatei, die dem Schema + MOA-ID-Configuration-1.4.xsd + entspricht, durchgeführt. +

Der Ort der Konfigurationsdatei wird im Abschnitt Deployment + der Web-Applikation in Tomcat beschrieben. +

Die folgenden Abschnitte erläutern das Format der Konfigurationsdatei. + MOA-ID-Configuration.xml + zeigt ein Beispiel für eine umfassende Konfigurationsdatei.

+

Enthält die Konfigurationsdatei relative Pfadangaben, werden + diese relativ zum Verzeichnis, in dem sich die MOA-ID Konfigurationsdatei + befindet, interpretiert.
+

+
+

ConnectionParameter
+ Das Element ConnectionParameter enthält Parameter, + die MOA-ID für den Aufbau von Verbindungen zu anderen Komponenten + benötigt. Dieses Element tritt mehrfach in der Konfigurationsdatei + auf und wird daher vorab detailliert beschrieben.
+
+ Das Attribut URL enthält die URL der Komponente zu + der die Verbindung aufgebaut werden soll. Wird das Schema https + verwendet, können die Kind-Elemente AcceptedServerCertificates + und ClientKeyStore angegeben werden. Wird das Schema http + verwendet müssen keine Kind-Elemente angegeben werden bzw. + werden diese nicht ausgewertet. Andere Schemas werden nicht unterstützt. +
+
+ Wird die Verbindung über TLS aufgebaut und erfordert der TLS-Server + eine Client-Authentisierung mittels Zertifikate, dann muss das Kind-Element + ClientKeyStore spezifiziert werden. Im Element ClientKeyStore + wird der Filename des PKCS#12-Keys (relativ zur MOA-ID Konfigurationsdatei) + angegeben. Diesem Keystore wird der private Schlüssel für + die TLS-Client-Authentisierung entnommen. Das Passwort zum Lesen + des privaten Schlüssels wird im Attribut ClientKeyStore/@password + konfiguriert.
+ Aufgrund der Tatsache, dass starke Verschlüsselung eine Voraussetzung + für MOA-ID darstellt, werden clientseitig nur die folgenden + Cipher Suites unterstützt:
+

    +
  • SSL_RSA_WITH_RC4_128_SHA
  • +
  • SSL_RSA_WITH_RC4_128_MD5
  • +
  • SSL_RSA_WITH_3DES_EDE_CBC_SHA
  • +
+ Im Kind-Element AcceptedServerCertificates 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 überprüft ob ein Zertifikatspfad + zu den im Element <TrustedCACertificates> angegebenen + Zertifikaten erstellt werden kann. Falls dies nicht möglich ist, + kommt es zu einem Fehlerfall. +

+
+

AuthComponent
+ AuthComponent enthä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 AuthComponent hat fünf Kind-Elemente: +

    +
  • BKUSelection (optional)
  • +
  • SecurityLayer
  • +
  • MOA-SP
  • +
  • IdentityLinkSigners
  • +
  • VerifyInfoboxes (optional ab Version 1.4)
  • +
+

+
+

AuthComponent/BKUSelection
+ Das optionale Element BKUSelection enthält Parameter + zur Nutzung eines Auswahldienstes für eine Bürgerkartenumgebung + (BKU). Wird das Element nicht angegeben, dann wird die lokale + Bürgerkartenumgebung auf http://localhost:3495/http-security-layer-request + verwendet.
+
+ Das Attribut BKUSelectionAlternative gibt an welche + Alternative zur BKU-Auswahl verwendet werden soll. MOA-ID unterstützt + die Werte HTMLComplete (vollständige HTML-Auswahl) + und HTMLSelect (HTML-Code für Auswahl) ["Auswahl + von Bürgerkartenumge-bungen", Arno Hollosi].
+
+ Das Kind-Element ConnectionParameter spezifiziert die + Verbindung zum Auswahldienst (siehe ConnectionParameter), + jedoch kann das Kind-Element ClientKeyStore nicht angegeben + werden.

+
+

AuthComponent/Templates
+ Das optionale Element Templates kann genau einmal vorkommen, um + das Aussehen der Seiten "Auswahl der Bürgerkartenumgebung" sowie + "Anmeldung mit Bürgerkarte" anzupassen. Die hier + spezifizierten (globalen) Templates haben Priorität gegenüber Templates, + die in der aufrufenden URL (vgl. Aufruf von MOA-ID-AUTH) + übergeben werden, haben jedoch Nachrang gegenüber in + der Konfigurationsdatei für eine Online-Applikation individuell definierte (lokale) + Templates (siehe + OnlineApplication/AuthComponent/Templates). + Das heißt, sind in der Konfigurationsddatei für eine Online-Applikation lokale + Templates definiert (Element OnlineApplication/AuthComponent/Templates), so werden + die als global spezifizierten Templates (AuthComponent/Templates) für diese + OnlineApplikation ignoriert, jedoch für alle anderen Online-Applikationen + verwendet. Templates in der aufrufenden URL werden demnach nur mehr dann + herangezogen, wenn in der Konfigurationsdatei weder globale (für alle + Online-Applikationen gültig) noch lokale (Templates je Online-Applikation) + spezifiziert sind.
+ Das Templates-Element hat die zwei Kindelemente + BKUSelectionTemplate und Template. Jedes dieser + beiden Elemente kann genau einmal vorkommen oder fehlen. + Das Kindelement BKUSelectionTemplate spezifiziert ein Template + zur Gestaltung der Seite "Auswahl der Bürgerkartenumgebung", + während das Kindelement Template die Seite + "Anmeldung mit Bürgerkarte" referenziert. + Beide Elemente haben genau ein Attribut namens URL, + 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.
+ Im folgenden Beispiel werden zwei Templates im Verzeichnis + CATALINA_HOME/conf/moa-id/templates referenziert: +
+

+<Templates>
+  <BKUSelectionTemplate URL="templates/SampleBKUSelectionTemplate.html"/>
+  <Template URL="templates/SampleTemplate.html"/>
+</Templates>
+ +
+ Richtlinien zur Struktur der beiden Templates können der + MOA-ID-Spezifikation bzw. dem Abschnitt + Aufruf von MOA-ID-AUTH + dieses Handbuches entnommen werden. + +

+
+
+

AuthComponent/SecurityLayer
+ Das Element SecurityLayer enthält Parameter + zur Nutzung des Security-Layers.
+
+ Das Kind-Element TransformsInfo spezifiziert eine + Transformation, die für die Erstellung der Signatur des + AUTH-Blocks als Parameter in den CreateXMLSignatureRequest + des Security-Layers integriert werden muss. Mehrere unterschiedliche + Implementierungen des Security-Layer können durch die + Angabe mehrerer TransformsInfo-Elemente unterstützt + werden.
+
+ Das Attribut TransformsInfo/@filename verweist auf + eine Datei, die das globale Element TransformsInfo + vom Typ TransformsInfo enthält. Die Angabe erfolgt + relativ zur MOA-ID Konfigurationsdatei. Das Encoding dieser + Datei muss UTF-8 sein.
+
+ Beispiel für + eine TransformsInfo-Datei

+
+

AuthComponent/MOA-SP
+ Das Element MOA-SP enthält Parameter zur Nutzung + von MOA-SP. MOA-SP wird für die überprüfung + der Signatur der Personenbindung und des AUTH-Blocks verwendet. +
+
+ Wird das Kind-Element ConnectionParameter angegeben, + dann wird MOA-SP über das Webservice angesprochen.

+

Wird das Kind-Element ConnectionParameter + nicht angegeben so wird eine MOA-ID beiligende Version von + MOA-SP direkt ü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 $MOA_ID_INST_AUTH/conf/moa-spss/SampleMOASPSSConfiguration.xml + enthalten.

+
+
+
+
+
+
+
+
+
+
+
+
+
+

Hinweis: MOA-SP muss entsprechend konfiguriert + werden - siehe hierzu Abschnitt Konfiguration + von MOA-SP. Alle Details zur Konfiguration von MOA-SP + finden sie in der Distribution von MOA-SP/SS beiligenden + Dokumentation im Abschnitt 'Konfiguration'.
+

+ Das Kind-Element VerifyIdentityLink/TrustProfileID + spezifiziert eine TrustProfileID, die für den VerifyXMLSignatureRequest + zur Überprüfung der Signatur der Personenbindung + verwendet werden muss. Diese TrustProfileID muss beim + verwendeten MOA-SP Modul konfiguriert sein.
+
+ Die Kind-Elemente VerifyAuthBlock/TrustProfileID + und VerifyAuthBlock/VerifyTransformsInfoProfileID + spezifizieren eine TrustProfileID und eine ID für + ein Transformationsprofil, die für den VerifyXMLSignatureRequest + zur überprüfung der Signatur des Auth-Blocks + verwendet werden müssen. Diese TrustProfileID muss + beim verwendeten MOA-SP Modul konfiguriert sein.

+
+
+
+
+
+
+
+
+
+
+

AuthComponent/IdentityLinkSigners +
+ Dieses Element gibt an von welchen Signatoren die Signatur + des IdentityLink erstellt werden musste damit der IdentityLink + akzeptiert wird. Für jeden Signator muss der X509SubjectName + nach RFC 2253 spezifiziert werden.
+
+ Beispiel +

+ Anmerkung: Ab Version 1.4 ist dieses Element nicht mehr verpflichtend notwendig, da die + Berechtigung von Zertifikaten zum Signieren von Personenbindungen ab Februar + 2007 über die Zertifikatseigenschaft "Eigenschaft zur Ausstellung von Personenbindungen" + (OID: 1.2.40.0.10.1.7.1) geprüft wird. + Der Namens-Check des alten Zertifikats wird fix in MOA-ID integriert, sodass das + IdentityLinkSigners-Element in der Konfiguration überflüssig wird. + +
+

+
+

AuthComponent/VerifyInfoboxes +
+ Ab Version 1.4 bietet MOA-ID die Möglichkeit einer erweiterten Infobox-Validierung, + das heißt, es können neben der Personenbindung auch weitere ausgelesene Infoboxen + validiert werden. Die für die Validierung der Infoboxen notwendigen Parameter + können über die Konfigurationsdatei durch das VerifyInfoboxes + Element sowohl global als auch + lokal + je Online-Applikation gesetzt werden. MOA-ID übergibt diese Parameter der + Applikation, die für die Verifikation des Inhaltes der jeweilgen von der BKU + übermittelten Infobox verantwortlich ist. Im Folgenden wird eine derartige + Applikation als Prüfapplikation bezeichnet. +
+ Das Verifyinfoboxes Element ist optional und kann fehlen, + wenn keine Infoboxen außer der der Personenbindung validiert werden müssen. +
+ Das VerifyInfoboxes-Element hat folgende Kind-Elemente: +

    +
  • DefaultTrustProfile: Dieses optionale + Element kann nur einmal vorkommen und spezifiziert ein Trust-Profil, das + von einer Prüfapplikation zur Validierung einer Infobox + herangezogen werden kann, wenn für diese Infobox kein eigenes + Trust-Profil gesetzt wurde. Es hat genau ein + Kindelement namens TrustProfileID, das die ID eines in MOA-SP + konfigurierten Trust-Profiles enthält. +
    + Anmerkung: Das Trust-Profil für die + Personenbindung darf nicht + zur Validierung anderer Infoboxen verwendet werden. Das Trust-Profil für + die Bürgerkarte soll nur dann zur Validierung + anderer Infoboxen verwendet werden, wenn die zur Verifikation der Zertifikate benötigten + Wurzelzertifikate bereits im entsprechenden Trust-Store enthalten sind. (vgl. + MOA-ID Spezifikation, Abschnitt 4.6). +
  • +
  • Infobox: Dieses Element kann beliebig oft vorkommen + und kapselt die Parameter, die für die Validierung einer Infobox an die + jeweilige Prüfapplikation übergeben werden. +
    + Das Infobox-Element hat folgende Attribute: +
      +
    • Identifier: Dieses Attribut muss vorhanden sein und gibt + den Namen der Infobox an. Er muss dabei exakt dem Bezeichner + der jeweiligen zu validierenden Infobox aus der BKU entsprechen, also + zum Beispiel Mandates für die Vollmachten-Infobox oder + EHSPToken für die GDAToken-Infobox. +
      +
    • +
    • required: Dieses Attribut vom Typ + boolean bestimmt, ob MOA-ID den Inhalt der entsprechenden Infobox + für die Anmeldung zwingend benötigt. Ist es auf true + gesetzt, und wird der entsprechende Infobox-Inhalt nicht von der BKU + übermittelt, so bricht MOA-ID den Anmeldevorgang mit einer Fehlermeldung + ab. +
      + Fehlt dieses Attribut, so wird als Defaultwert false gesetzt. +
      +
    • +
    • provideStammzahl: Dieses Attribut vom Typ + boolean bestimmt, ob die Prüfapplikation die Stammzahl aus der + Personenbindung erhalten darf. Fehlt dieses Attribut, so wird als Defaultwert + false gesetzt. +
      + Anmerkung: Das Attribut steht in keinem Zusammenhang zum gleichnamigen + Attribut OnlineApplication/AuthComponent/@provideStammzahl, + das angibt ob die Stammzahl an die Online-Applikation weitergegeben werden darf. +
    • +
    • provideIdentityLink: Dieses Attribut vom Typ + boolean bestimmt, ob die Prüfapplikation die Personenbindung erhalten + soll. Hat es den Wert true, so wird ein Klone des Wurzel-Elements der Personenbindung + an die Prüfapplikation übergeben, wobei zu beachten ist, dass die + darin enthaltene Stammzahl auf einen leeren String gesetzt wird, falls das + Attribut provideStammzahl auf false + gesetzt ist. + Fehlt das provideIdentityLink-Attribut, so wird als Defaultwert false gesetzt. +
      + Anmerkung 1: Das Attribut steht in keinem Zusammenhang zum gleichnamigen + Attribut OnlineApplication/AuthComponent/@provideIdentityLink, + das angibt ob die Online-Applikation die Personenbindung erhalten + soll. +
      + Anmerkung 2: Der Prüfapplikation werden defaultmäßig der Vorname, + der Familienname, das Geburtsdatum, der Typ der Stammzahl, die Stammzahl + (konfigurierbar) und die öffentlichen Schlüssel aus der Personenbindung + übergeben. Das Attribut provideIdentityLink sollte deshalb + wirklich nur dann auf true gesetzt werden, wenn von der + Prüfapplikation noch andere Daten aus der Personenbindung benötigt + werden. +
    • +
    + Das Infobox-Element hat folgende Kind-Elemente: +
      +
    • FriendlyName: Das Element ist optional und + enthä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. Vollmachten + oder Stellvertretungen für die Mandates-Infobox oder + GDAToken für die EHSPToken-Infobox. +
      + Fehlt dieses Element, so wird für Fehlermeldungen der Wert des + Identifier-Attributes verwendet. +
    • +
    • TrustProfileID: Das Element ist optional und + bezeichnet ein in MOA-SP konfiguriertes Trust-Profil, das von MOA-ID + für die Validierung der Infobox verwendet wird. + Dabei ist wieder zu beachten, dass das Trust-Profil für die + Personenbindung nicht + zur Validierung anderer Infoboxen verwendet werden darf, und das Trust-Profil für + die Bürgerkarte nur dann zur Validierung + anderer Infoboxen verwendet werden soll, wenn die zur Verifikation der + Zertifikate benötigten Wurzelzertifikate bereits im entsprechenden + Trust-Store enthalten sind. (vgl. MOA-ID Spezifikation, Abschnitt 4.6). +
      Fehlt dieses Element, so wird das + Default-Trust-Profil + verwendet. Ist dieses auch nicht konfiguriert, so wird für die + Validierung der entsprechenden Infobox keine Zertifikatsprüfung + notwendig sein. +
    • +
    • ValidatorClass: 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 Identifier-Attribut der Infobox abgeleitet + wird (vgl. MOA-ID-Spezifikation, Abschnitt 4.7.2.3, + Zuordnung eines InfoboxReadResponse zu einer implementierenden Klasse). +
      + Anmerkung: Im Regelfall wird dieses Element fehlen, da bei der + Entwicklung einer Infobox-Prüfapplikation der Default-Klassennamen + verwendet werden sollte. Nur wenn es verschiedene Prüfapplikationen + für eine Infobox gibt, wird man das ValidatorClass + verwenden, um eine andere als die Default-Applikation zu laden. +
    • +
    • SchemaLocations: Das Element ist optional + und referenziert XML-Schemas, die von der Prüfapplikation zum + validierenden Parsen von Infoboxen verwendet werden können. Das + Element hat beliebig viele Schema-Kindelemente, dessen Attribute + namespace und schemaLocation jeweils die Namespace-URI + und den Ort (URI) des entsprechenden Schemas bezeichnen. Relative URIs im + schemaLocation-Attribut sind dabei relativ zum Verzeichnis der + MOA-ID-Konfigurationsdatei zu interpretieren. +
      + Beispiel: +
      +
      +    <SchemaLocations>
      +      <Schema namespace="http://ns1.ns1" schemaLocation="schemas/ns1.xsd"/>
      +      <Schema namespace="http://ns2.ns2" schemaLocation="schemas/ns2.xsd"/>
      +    </SchemaLocations>
      +                              
      + Weitere Möglichkeiten zur Übergabe von XML-Schemas an die + Prüfapplikation können in der MOA-ID-Spezifikation im + Abschnitt 4.7.2, Erweiterte Infoboxüberprüfung, nachgelesen werden. +
    • +
    • ApplicationSpecificParameters: + Das Element ist optional und nimmt Infobox-kontext-spezifische Parameter + auf. +
      + Da MOA-ID die zusätzlichen zur Personenbindung abgefragten Infoboxen + (bzw. deren Inhalte) nicht a priori kennt, ist es unmöglich vorherzusehen, + welche Parameter eine Prüfapplikation zum Validieren einer Infobox + benötigt. Die Konfiguration sieht daher das Element + ApplicationSpecificParameters vor, um einer bestimmten + Prüfapplikation kontext spezifische Parameter zu übermitteln. + Dieses Element wird vollständig an die Prüfapplikation + weitergegeben, und es obliegt der Prüfapplikation die Kindelemente + des ApplicationSpecificParameters-Element zu extrahieren und zu + interpretieren. +
      + Beispiel: +
      +
      +    <ApplicationSpecificParameters>
      +      <Parameter1>content1</Parameter1>
      +      <Parameter2>content2</Parameter2>
      +      <Parameter3>
      +        <Parameter3a>content3a</Parameter3a>
      +        <Parameter3b>content3b</Parameter3b>
      +      </Parameter3>
      +    </ApplicationSpecificParameters>
      +                              
      +
    • +
    +
  • +
+
+ Eine Beispielkonfiguration finden sie am Ende das Abschnitts + OnlineApplication/AuthComponent/VerifyInfoboxes. +
+
+

+
+ +
+

ProxyComponent
+ ProxyComponent enthä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.
+
+ Das Element ProxyComponent hat nur das Kind-Element + AuthComponent, das die Verbindung zur Authentisierungs-komponente + beschreibt.
+
+ Baut die Proxykomponente die Verbindung zur Authentisierungs-komponente + über ein Webservice auf, dann muss das Element + ConnectionParameter spezifiziert werden.
+
+ Baut die Proxykomponente die Verbindung zur Authentisierungs-komponente + über das API auf, dann wird das Element ConnectionParameter + nicht spezifiziert.

+
+

OnlineApplication
+ Für jede Online-Applikation, die über MOA-ID + authentisiert wird, gibt es ein Element OnlineApplication. + Die Parameter betreffen teils die MOA-ID Authentisierungskomponente, + teils die MOA-ID Proxykomponente, teils beide.
+
+ Das ab Version 1.3 optionale Attribut OnlineApplication/@type + spezifiziert den Typ der OnlineApplikation und kann + die Werte publicService für eine Applikation + aus dem öffentlichen Bereich und businessService + für eine Anwendung aus dem privatwirtschaftlichen Bereich annehmen. + Ab Version 1.4 kann im Modus businessService ein zusätzliches + logisches Attribut OnlineApplication/@calculateHPI angegeben werden. + Dadurch wird im Falle von calculateHPI="true" im privatwirtschaftlichen + Bereich zur Identifikation der Health Professional Identifier HPI anstatt des wbPKs (siehe + + OnlineApplication/AuthComponent/IdentificationNumber) berechnet + und zur Anmeldung weiterverwendet. + Ist dieses Attribut nicht gesetzt, so wird der Typ publicService + vorausgesetzt.
+
+ Das Attribut OnlineApplication/@publicURLPrefix + entspricht dem URL-Präfix der nach außen + sichtbaren Domäne der Online-Applikation, welcher + von der MOA-ID Proxykomponente durch den URL-Präfix + der wirklichen Domäne (Attribut OnlineApplication/ProxyComponent/ConnectionParameter/@URL) + ersetzt wird. Es dient als Schlüssel zum Auffinden + der Konfigurationsparameter zur Online-Applikation. +

+

Das Attribut OnlineApplication/@keyBoxIdentifier + gibt das Schlüsselpaar an, welches von der Bürgerkartenumgebung + zum Signieren des Auth Blocks verwendet wird. Mögliche + Werte: CertifiedKeypair sowie SecureSignatureKeypair.
+

+ Das Element OnlineApplication hat optional + zwei Kind-Elemente: AuthComponent und ProxyComponent. +

+
+

OnlineApplication/AuthComponent +
+ Das Element OnlineApplication/AuthComponent + muss verwendet werden wenn auf dem Server die Authentisierungskomponente + installiert wird. Es enthält Parameter, die + das Verhalten der Authentisierungskomponente bezüglich + der Online-Applikation konfiguriert.
+
+ Das optionale Attribut slVersion definiert die Version des + verwendeten SecurityLayer und damit den Namespace aller + Requests, die von MOA-ID an die Bürgerkartenumgebung + geschickt werden. Dieses Attribut kann entweder den Wert 1.1 + oder 1.2 annehmen. Fehlt das Attribut, so wird als + Defaultwert 1.1 gesetzt. +
Wurde als Typ der Online-Applikation + der Wert businessService (vgl. Attribut OnlineApplication/@type) + spezifiziert, so wird das Attribut slVersion ignoriert + und immer der Wert 1.2 verwendet, da die für + Applikationen aus dem privatwirtschaftlichen Bereich notwendige + Berechnung des wirtschaftsbereichsspezifischen Personenkennzeichens + (wbPK) erst ab SecurityLayer Version 1.2 möglich ist. +

+ Das Attribut provideStammzahl bestimmt, + ob die Stammzahl in den Anmeldedaten aufscheint + oder ob der Wert ausgeblendet (d.h. auf den Leerstring gesetzt) + wird. Die Attribute provideAUTHBlock und + provideIdentityLink steuern, ob die + Anmeldedaten den Auth-Block bzw. die Personenbindung enthalten. + Ab Version 1.3 kann das Attribut provideCertificate + verwendet werden, um das Signatorzertifikat in die + Anmeldedaten aufzunehmen. + Alle Attribute sind optional und haben den Default-Wert + false. +
+ Anmerkung: Das Attribut provideStammzahl steht in keinem + Zusammenhang zum gleichnamigen Attribut + VerifyInfoboxes/@provideStammzahl, + das angibt ob die Stammzahl an eine Prüfapplikation weitergegeben + werden darf. + Anmerkung: Das Attribut provideIdentityLink steht in keinem + Zusammenhang zum gleichnamigen Attribut + VerifyInfoboxes/@provideIdentityLink, + das angibt ob die Personenbindung an eine Prüfapplikation + weitergegeben werden soll. +
+
+

+
+

OnlineApplication/AuthComponent/IdentificationNumber +
+ Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) + wird aus der auf der Bürgerkarte gespeicherten Stammzahl des Bürgers + und der Stammzahl des Wirtschaftsunternehmens berechnet. + Laut E-Governmentgesetz + darf die Errechnung eines wbPK aus der Stammzahl nicht beim Auftraggeber eines + privaten Bereichs durchgeführt werden (vgl. E-GovGesetz §12(1).4), und muss deshalb + an die Bürgerkartenumgebung ausgelagert werden. + Das OnlineApplication/AuthComponent/IdentificationNumber Element + wird nun verwendet, um die Stammzahl des Wirtschaftsunternehmens zu spezifizieren, + welche in weiterer Folge von MOA-ID an die Bürgerkartenumgebung übergeben + wird.
Dieses Element muss bei privatwirtschaftlichen Applikationen + vorhanden sein und wird ignoriert, falls es im Kontext von Anwendungen aus + dem öffentlichen Bereich verwendet wird.
+ Das Element hat genau eines der folgenden möglichen Kindelemente + aus dem PersonData + Namespace, die als einzigen Inhalt die jeweilige Stammzahl des Unternehmens enthalten: +

    +
  • + Das Element pr:Firmenbuchnummer enthält als einzigen Inhalt + die Firmenbuchnummer des Unternehmens. +
  • +
  • + Das Element pr:Vereinsnummer enthält als einzigen Inhalt + die Vereinsregisternummer des Unternehmens. +
  • +
  • + Das Element pr:ERJPZahl enthält als einzigen Inhalt eine + Zahl aus dem Ergänzungsregister für nicht-natürliche Personen (CorporateBody). +
  • +
  • + Das Element pr:ZMRzahl enthält als einzigen Inhalt eine + Stammzahl einer natürlichen in Österreich meldepflichtigen Person. +
  • +
+ + Die Stammzahl ist jeweils ohne Präfix anzugeben, also wird zum Beispiel + die Firmenbuchnummer FN468924i folgendermaßen definiert: +

+ <pr:Firmenbuchnummer>468924i</pr:Firmenbuchnummer> +

+ Leerzeichen werden ignoriert und im Falle einer Firmenbuchnummer werden + führende Nullen gelöscht und Bindestriche aus der Nummer entfernt. +

+ Beispiele:
+
+ 468924 i wird zu 468924i
+ 00468924 wird zu 468924i
+ 468924-i wird zu 468924i
+
+ Alternativ zu den oben angeführten Elementen aus dem + PersonData + Namespace kann auch das Element AnyNumber verwendet werden, um + Stammzahlen zu spezifizieren, die nicht einer der vier oben aufgelisteten + Kategorien zugeordnet werden können. +

+ Das Element AnyNumber hat genau ein Attribut namens Identifier, + das das Präfix der jeweiligen Stammzahl entält. Der Inhalt des + Elements AnyNumber ist die Stammzahl selbst, wobei die selben Regeln + wie oben gelten. +

+ Die Firmenbuchnummer aus obigem Beispiel könnte man nun beispielsweise mit Hilfe das Elements + AnyNumber auch folgendermaßen definieren: +

+ <AnyNumber Identifier="FN">468924i</AnyNumber> +

+ Es sei aber nochmals daraufhingewiesen, dass für Stammzahlen der + Kategorien Firmenbuchnummer, Vereinsnummer, + ERJPZahl und ZMRzahl die vordefinierten Elemente aus + dem PersonData + Namespace verwendet werden sollen. Das Element AnyNumber wurde hauptsächlich in + das Schema aufgenommen, um offen für mögliche Erweiterungen zu sein. +

+
+

OnlineApplication/AuthComponent/Templates +
+ Dieses Kindelement kann genau einmal vorkommen und entspricht in seiner Struktur dem + Element AuthComponent/Templates. + Es kann verwendet werden, um Templates zur Gestaltung der Seiten + "Auswahl der Bürgerkartenumgebung" sowie + "Anmeldung mit Bürgerkarte" individuell für + eine Online-Applikation zu definieren. Die hier definierten Templates haben + Priorität gegenüber globalen Templates und Templates, die + in der aufrufenden URL übergeben werden. +

+
+ +
+

OnlineApplication/AuthComponent/TransformsInfo +
+ Dieses Kindelement kann mehrfach vorkommen und entspricht in seiner Struktur + dem Element AuthComponent/SecurityLayer/TransformsInfo. + Das Element kann verwendet werden, um für unterschiedliche + Online-Applikationen unterschiedliche Transformationen zu spezifizieren. + Alle über dieses Element definierten Transformationen haben + Vorrang gegenüber die durch AuthComponent/SecurityLayer/TransformsInfo + angegebenen Transformationen. Das heißt, ist für eine + Online-Applikation das Kindelement AuthComponent/TransformsInfo + vorhanden, so wird für diese Applikation die durch dieses Element + spezifizierte Transformation verwendet (das Element kann natürlich + mehrfach vorkommen, wodurch mehrere Transformationen bezeichnet werden). + Für alle Applkikationen, die kein Kindelement vom Typ + AuthComponent/TransformsInfo enthalten, werden die unter + AuthComponent/SecurityLayer/TransformsInfo spezifizierten + "Default-Transformationen" verwendet.
+ Dabei ist zu beachten, dass für jede definierte Transformation + ein entsprechendes MOA-SP/VerifyAuthBlock/VerifyTransformsInfoProfileID + Element vorhanden sein muss.

+

+
+
+

OnlineApplication/AuthComponent/VerifyInfoboxes +
+ Dieses optionale Element entspricht dem VerifyInfoboxes-Element + aus der globalen AUTH-Komponente und überschreibt teilweise die + dort gesetzten Werte für die jeweilige Infobox pro Online-Applikation. + Dabei gelten die folgenden Regeln: +
+ Ist nur das globale VerifyInfoboxes-Element + vorhanden, so gelten die dort definierten Parameter für alle + Online-Applikationen. Ist kein globales Element vorhanden, so kann + MOA-ID für alle Online-Applikation, in deren AUTH-Komponente + ein VerifyInfoboxes-Element enthalten ist, die darin + definierten Infoboxen überprüfen. Für + Online-Applikationen, in deren AUTH-Komponente kein + VerifyInfoboxes-Element gesetzt ist, kann demnach keine + andere Infobox als die der Personenbindung validiert werden. +
+ Sind sowohl global (MOA-IDConfiguration/AuthComponent/VerifyInfoboxes) + als auch lokal (OnlineApplication/AuthComponent/VerifyInfoboxes) + in den Online-Applikationen Infobox-Validatoren konfiguriert, so verarbeitet + MOA-ID die darin enthaltenen Parameter wie folgt: +

    +
  • DefaultTrustProfile: Ein lokal + definiertes Default-Trust-Profil hat sowohl Vorrang gegenüber einem + global gesetzten Default-Trust-Profil + als auch gegenüber einem global gesetzen + infobox-spezifischen Trustprofil. Ist + beispielsweise im globalen VerifyInfoboxes-Element zwar kein + Default-Trust-Profil, aber für die Infobox A ein eigenes Trust-Profil + definiert, so wird ein lokal definiertes Default-Trust-Profil dem global + für die Infobox A gesetzten Trust-Profil vorgezogen. +
  • +
  • Infobox: MOA-ID kann die Vereinigung aus den + global und lokal konfigurierten Infoboxen für eine Online-Applikation + validieren. Sind beispielsweise global Prüfapplikationen + für die Infoboxen mit den Bezeichnern + (Infobox/@Identifier-Attribut) A + und B konfiguriert, und lokal für die Online-Applikation + OA1 die Infoboxen B, C und D, so + kann MOA-ID für die Online-Applikation OA1 die + Infoboxen A, B, C und D validieren. + Für die Infobox A werden dabei die Parameter aus der + globalen Konfiguration verwendet und für die Infoboxen + C und D die lokalen Parameter. Für die Infobox + B sind sowohl globale als auch lokale Parameter vorhanden, + die von MOA-ID wie folgt interpretiert werden: +
      +
    • Attribute: + Die Attribute required, + provideStammzahl und + provideIdentityLink überschreiben + die global gesetzten Werte. Dabei ist zu beachten, das ein Fehlen dieser + Attribute bedeutet, dass ihnen über das Schema der Defaultwert + false zugewiesen wird. Ist also beispielsweise für die + Infobox mit dem Bezeichner B das required-Attribut + global auf true gesetzt (<Infobox Identifier="B" required="true">) + und fehlt dieses Attribut lokal in der Online-Applikation OA1 + (<Infobox Identifier="B">), so hat das required-Attribut + für die Infobox B den Wert false. +
      + Die Attribute required, + provideStammzahl und + provideIdentityLink müssen also + für Infoboxen, die sowohl global als auch lokal konfiguriert sind, + in jeder lokalen Konfiguration neu gesetzt werden, wenn ihnen der Wert + true zugwiesen werden sollen. +
    • +
    • Kind-Elemente: +
        +
      • FriendlyName: + Ein lokal gesetzter FriendlyName wird einem global + gesetzten vorgezogen. Ist sowohl lokal als auch global kein + FriendlyName definiert, so wird das + Identifier-Attribut als FriendlyName + verwendet. +
        +
      • +
      • TrustProfileID: + 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ür für die Validierung dieser + Infobox kein Trust-Profil benötigt. +
      • +
      • ValidatorClass: + Eine lokal gesetzte Validator-Klasse wird einer global gesetzten + vorgezogen. Ist sowohl lokal als auch global für eine Infobox + keine Validator-Klasse konfiguriert, so wird die Default-Klasse + geladen (siehe ValidatorClass). +
      • +
      • SchemaLocations: + Lokal definierte Schemas werden global definierten vorgezogen. + Sind lokal keine Schemas konfiguriert, so werden die globalen verwendet, + so sie vorhanden sind. +
      • +
      • + ApplicationSpecificParameters: + Lokal definierte applikationsspezifische Paramter werden global + definierten vorgezogen. Sind lokal keine derartigen Paramter + konfiguriert, so werden die globalen verwendet, so sie vorhanden + sind. +
      • +
      +
    • +
    +
  • +
+
+ Beispiel: In der Konfigurationsdatei + + SampleMOAIDVerifyInfoboxesConfiguration.xml sind global + (MOA-IDConfiguration/AuthComponent/VerifyInfoboxes) + Prüfapplikationen für die beiden Infoboxen mit den Bezeichnern + InfoboxA und InfoboxB konfiguriert. + InfoboxA demonstriert in diesem Beispiel die minimale Konfiguration + einer Prüfapplikation - es ist nur der Identifier angegeben. MOA-ID + wird in diesem Fall versuchen, die Default-Validatorklasse + at.gv.egovernment.moa.id.auth.validator.infoboxa.InfoboxAValidator + zu laden (siehe dazu auch MOA-ID-Spezifikation, Abschnitt 4.7.2.3, + Zuordnung eines InfoboxReadResponse zu einer implementierenden Klasse). + Da ein Default-Trust-Profil (GlobalVIDefaultTrust) konfiguriert ist, + wird MOA-ID dieses Profil zur Verifikation von Zertifikaten heranziehen. + Da kein FriendlyName gesetzt ist, wird das Identifier Attibut + (InfoboxA) als FriendlyName verwendet. Weitere Parameter + sind für die Verifikation dieser Infobox nicht erforderlich. +
+ Die Prüfapplikation für die InfoboxB setzt nahezu alle + möglichen Paramter mit Ausnahme der Validator-Klasse. MOA-ID wird + zur Verifikation dieser Infobox also auch die dafür zustädige Default-Klasse + (at.gv.egovernment.moa.id.auth.validator.infoboxb.InfoboxBValidator) + laden, und alle konfigurierten Parameter an diese Klasse übergeben. +
+ In die Konfigurationsdatei sind drei Online-Applikationen mit den + public URL-Prefixen https://OA1/, https://OA2/ und + https://OA3/ eingetragen. + Online-Applikation OA1 konfiguriert Prüfapplikationen für + die drei Infoboxen InfoboxB, InfoboxC und + InfoboxD. Das heißt, MOA-ID kann für die Online-Applikation + OA1 insgesamt vier Infoboxen überprüfen: die + Paramter für die Infobox InfoboxA werden + von der entsprechenden global konfigurierten Prüapplikation + übernommen. Die Infoboxen InfoboxC und + InfoboxD sind nur lokal gesetzt. Für InfoboxB + übernimmt MOA-ID die applikationsspezifischen Parameter aus der + entsprechenden global konfigurierten Infobox und überschreibt + alle weiteren Parameter mit den lokalen Werten. Als Trust-Profil wird + das lokale Deafult-Trust-Profil (LocalOA1DefaultTrust) genommen - + dieses hat Vorrang gegenüber den global gesetzten Profilen. Weiters + ist zu beachten, dass die Attribute provideStammzahl und + provideIdentityLink lokal nicht gesetzt sind, und daher den + Deafult-Wert false einnehmen. +
+ Das VerifyInfoboxes-Element in der AUTH-Komponente der zweiten + Online-Applikation (OA2) spezifiziert keine anderen Prüfapplikationen + als die global definierten, überschreibt aber für beide Infoboxen + teilweise die global gesetzten Parameter. InfoboxA verwendet + ein lokal definiertes Trust-Profil (LocalInfoboxOA2ATrust), + InfoboxB übernimmt + alle globalen Parameter, setzt aber für die Attribute required, + provideStammzahl und provideIdentityLink jeweils den + Defaultwert false. +
+ Die dritte Online-Applikation OA3 enthält in Ihrer AUTH-Komponente + kein VerifyInfoboxes-Element. MOA-ID übernimmt daher für + diese Online-Applikation die global konfigurierten Infobox-Prüapplikationen + (InfoboxA und InfoboxB) mit allen Paramertern genauso wie + sie dort gesetzt sind. Zu beachten ist hier, dass das in der AUTH-Komponente + auf true gesetzte Attribut proviedStammzahl die + Online-Applikation und nicht die Prüapplikation + betrifft. +
+

+
+

+
+
+

OnlineApplication/ProxyComponent +
+ Das Element OnlineApplication/ProxyComponent + muss verwendet werden wenn auf dem Server die + Proxykomponente installiert wird.
+
+ Das optionale Attribut configFileURL + verweist auf eine Konfigurationsdatei die dem Schema + MOA-ID-Configuration-1.4.xsd + entspricht mit Dokument-Element Configuration. + Die Angabe erfolgt relativ zur verwendeten MOA-ID + Konfigurationsdatei. Beispiel für das Element + configFileURL: "oa/SampleOAConfiguration.xml".
+ Defaultmäßig wird versucht die Datei + von der betreffenden OnlineApplikation unter dem + Wert: http://<realURLPrefix>/MOAConfig.xml + zu laden.
+ (<realURLPrefix> entspricht dem + Wert von OnlineApplication/ProxyComponent/ConnectionParameter/@URL) +
+
+ Das optionale Attribut sessionTimeOut + legt das Timeout einer Benutzersession in der + Proxykomponente in Sekunden fest.
+ Default-Wert: 3600
+
+ Im optionalen Attribut loginParameterResolverImpl + kann der Klassenname eines zu verwendenden LoginParameterResolver + angegeben werden, welcher die Defaultimplementierung + ersetzt.
+

+

Im optionalen Attribut loginParameterResolverConfiguration + kann ein Configurationsstring für die + Initialisierung der betreffenden loginParameterResolverImpl + angegeben werden.
+
+ Im optionalen Attribut connectionBuilderImpl + kann der Klassenname eines zu verwendenden ConnectionBuilder + angegeben werden, welcher die Defaultimplementierung + ersetzt.
+
+ Im Kind-Element ConnectionParameter ist + konfiguriert, wie MOA-ID-PROXY zur Online-Applikation + verbindet.

+
+

ChainingModes
+ Das Element ChainingModes definiert, + ob bei der Zertifikatspfad-überprüfung + das Kettenmodell ("chaining") oder + das Modell nach PKIX RFC 3280 ("pkix") + verwendet werden soll.
+
+ Das Attribut systemDefaultMode spezifiziert + das Modell, das im Standardfall verwendet werden + soll.
+
+ Mit dem Kind-Element TrustAnchor kann + für jeden Trust Anchor ein abweichendes + Modell spezifiziert werden. Ein Trust Anchor + ist ein Zertifikat, das in TrustedCACertificates + spezifiziert ist. Ein Trust Anchor wird durch + den Typ <dsig:X509IssuerSerialType> + spezifiziert. Das für diesen Trust Anchor + gültige Modell wird durch das Attribut + mode spezifiziert.
+
+ Gültige Werte für die Attribute systemDefaultMode + und mode sind "chaining" und + "pkix".
+
+ Beispiel +

+
+

TrustedCACertificates
+ Das Element TrustedCACertificates + enthält das Verzeichnis (relativ zur + MOA-ID Konfigurationsdatei), das jene Zertifikate + enthält, die als vertrauenswürdig + betrachtet werden. Im Zuge der Überprüfung + der TLS-Serverzertifikate wird die Zertifikatspfaderstellung + an einem dieser Zertifikate beendet.

+
+

GenericConfiguration
+ Das Element GenericConfiguration + ermöglicht das Setzen von Namen-Werte + Paaren mittels der Attribute name + und value. Die folgende Liste spezifiziert +

    +
  • gültige Werte für das name-Attribut, +
  • +
  • eine Beschreibung
  • +
  • gültige Werte für das value-Attribut + und (falls vorhanden)
  • +
  • den Default-Wert für das value-Attribut. +
  • +
+ + + + + + + +
name: DirectoryCertStoreParameters.RootDir
Gibt den Pfadnamen zu einem + Verzeichnis an, das als Zertifikatsspeicher + im Zuge der TLS-Server-Zertifikatsüberprüfung + verwendet wird.
+
+ value:
+ Gültige Werte: Name eines gültigen + Verzeichnisses (relativ zur MOA-ID Konfigurationsdatei)
+ Dieser Parameter muss angegeben werden. +
+ + + + + + + +
name: AuthenticationSession.TimeOut
Gibt die Zeitspanne in + Sekunden vom Beginn der Authentisierung + bis zum Anlegen der Anmeldedaten an. + Wird die Angegebene Zeitspanne überschritten + wird der Anmeldevorgang abgebrochen. +
+
+ value:
+ Gültige Werte: positive Ganzzahlen +
+ Default-Wert: 120
+ + + + + + + +
name: AuthenticationData.TimeOut
Gibt die Zeitspanne in + Sekunden an, fü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öscht.
+
+ value:
+ Gültige Werte: positive Ganzzahlen
+ Default-Wert: 600
+ + + + + + + +
name: TrustManager.RevocationChecking
Für die TLS-Server-Authentisierung + dürfen nur Server-Zertifikate verwendet + werden, die eine CRLDP-Extension enthalten + (andernfalls kann von MOA-ID keine CRL-überprüfung + durchgeführt werden).
+ Soll das RevocationChecking generell + ausgeschaltet werden, ist dieses Attribut + anzugeben und auf "false" zu setzen. +
+
+ value:
+ Gültige Werte: true, false
+ Default-Wert: true
+ + + + + + + +
name: FrontendServlets.EnableHTTPConnection
+

Standardmäßig können + die beiden Servlets "StartAuthentication" + und "SelectBKU" welche das + User-Frontend darstellen, aus Sicherheitsgründen, + nur über das Schema HTTPS aufgerufen + werden.

+

Wenn die beiden Servlets jedoch auch + Verbindungen nach dem Schema HTTP + entgegennehmen sollen, so kann mittels + dem Attribut "EnableHTTPServletConnection" + erlaubt werden.

+

Hinweis: Sicher und sinnvoll ist + das Erlauben der HTTP Verbindung nur + dann, wenn ein Vorgeschalteter Webserver + das HTTPS handling übernimmt, + und eine Verbindung zu den Servlets + nur über diesen Webserver möglich + ist.

+
+ value:
+ Gültige Werte: true, false
+ Default-Wert: false
+ + + + + + + +
name: + FrontendServlets.DataURLPrefix
+

Standardmäßig wird als + DataURL Prefix das URL Prä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äfix angegeben + werden. In diesem Fall muss der Webserver + so konfiguriert sein, dass er Request + auf diese URLs an den MOA-ID Server + weiterleitet.

+
+ value:
+ Gültige Werte: URLs nach dem Schema + 'http://' und 'https://'
+ Default-Wert: kein Default-Wert
+ Beispiel: <GenericConfiguration name="FrontendServlets.DataURLPrefix" + value="https://<your_webserver>/moa-id-auth/"/>
+
+
+
+
+
+
+
+
+
+
+ + + + +
+ + +

+
+ + + +
+

 

+
+

+
+
+

Konfiguration der Online-Applikation

+
+Die Konfiguration der OA beschreibt die Art und Weise, wie die Proxykomponente die Anmeldung an der Online-Applikation +durchführt. +

+Der Name der Konfigurationsdatei wird in der Konfiguration von MOA-ID als Wert des Attributs +configFileURL des Elements MOA-IDConfiguration/OnlineApplication/ProxyComponent hinterlegt. +
Ist dieses Attribut nicht gesetzt, dann wird die Datei von http://<realURLPrefix>/MOAConfig.xml geladen, +wobei <realURLPrefix> dem Konfigurationswert OnlineApplication/ProxyComponent/ConnectionParameter/@URL entspricht. +

+Die Konfigurationsdatei ist eine XML-Datei, die dem Schema +MOA-ID-Configuration-1.4.xsd mit dem Wurzelelement +Configuration entspricht. +
+ +
+

+LoginType
+Das Element LoginType gibt an, ob die Online-Applikation ein einmaliges Login erwartet (stateful), +oder ob die Login-Parameter bei jedem Request mitgegeben werden müssen (stateless). Im Fall einer stateful +Online-Applikation werden die in der HTTP-Session der Proxykomponente gespeicherten Anmeldedaten nur für den Aufruf +des Login-Scripts verwendet. Unmittelbar nach dem Aufruf werden sie gelöscht. +
+Default-Wert: stateful +

+
+ +
+

+ParamAuth
+Konfiguriert die übergabe der Authentisierungs-Parameter an die Online-Applikation mittels URL-Parametern. Das Element +kann ein oder mehrere Kind-Elemente <Parameter> beinhalten. +

+
+ +
+

+ParamAuth/Parameter
+Das Element <Paramter> enthält die Attribute Name und Value. +

+Das Attribut Name beschreibt den Namen des Parameters und ist ein frei zu wählender String. +

+Das Attribut Value beschreibt den Inhalt des Parameters und kann einen der durch MOAAuthDataType beschriebenen +Werte annehmen. Gültige Werte von MOAAuthDataType sind: +

    +
  • MOAGivenName - der Vorname des Benutzers, wie in der Personenbindung enthalten +
  • MOAFamilyName - der Nachname des Benutzers, wie in der Personenbindung enthalten +
  • MOADateOfBirth - das Geburtsdatum des Benutzers, wie in der Personenbindung enthalten +
  • MOABPK - die bereichsspezifische Personenkennzeichnung des Benutzers, wie von der +Authentisierungskomponente berechnet +
  • MOAWBPK - das wirtschaftsbereichsspezifische Personenkennzeichen des Benutzers, wie von der +Bügerkartenumgebung berechnet +
  • MOAPublicAuthority - wird durch true ersetzt, falls der Benutzer mit einem Zertifikat signierte, +welches eine Behördenerweiterung beinhaltet. Andernfalls wird false gesetzt +
  • MOABKZ - das Behördenkennzeichen (nur sinnvoll, wenn MOAPublicAuthority den Wert true +ergibt) +
  • MOAQualifiedCertificate - wird durch true ersetzt, falls das Zertifikat des Benutzers +qualifiziert ist, andernfalls wird false gesetzt +
  • MOAStammzahl - die Stammzahl des Benutzers; diese ist nur dann verfügbar, wenn die Online-Applikation +die Stammzahl bekommen darf (und daher in der Personenbindung enthalten ist) +
  • MOAIPAddress - IP-Adresse des Client des Benutzers. +
+ +Anhand der <Parameter>-Elemente wird der Request für den Login-Vorgang (für stateful Online-Applikationen) +folgendermaßen zusammenge-stellt:
+
+GET https://<login-url>?
+  <p1.name=p1.resolvedValue>&
+  <p2.name=p2.resolvedValue>...
+
+

+Die <login-url> ergibt sich aus dem Parameter OA des Aufrufs von MOA-ID-AUTH, +zusammen mit der Konfiguration von OnlineApplication/@publicURLPrefix und von OnlineApplication/ProxyComponent/ConnectionParameter/@URL. +
Der Wert resolvedValue wird in MOA-ID-PROXY je nach Wert des Platzhalters eingesetzt. +

+
+
+

+BasicAuth
+Das Element BasicAuth konfiguriert die übergabe der Authentisierungs-Parameter an die Online-Appliktion +mittels HTTP Basic Authentication. Es enthält zwei Kind-Elemente. +

+Das Element UserID gibt die UserId des zu authentisierenden Benutzers an und kann einen der durch +MOAAuthDataType beschriebenen Werte annehmen. +

+Das Element Password gibt das Passwort des zu authentisierenden Benutzers an und kann einen der durch +MOAAuthDataType beschriebenen Werte annehmen. +

+
+ +
+

+HeaderAuth
+Das Element HeaderAuth konfiguriert die übergabe der Authentisierungs-Parameter an die Online-Applikation +in HTTP Request Headern. Das Element kann ein oder mehrere Kind-Elemente <Header> beinhalten. +

+
+ + +
+ + +
+ + + +
+

 

+
+

+
+
+

Konfiguration von MOA-SP

+
+ +

MOA-ID überprüft die Signaturen der Personenbindung und + des AUTH-Blocks mit dem VerifyXMLSignatureRequest von + MOA-SP. Dazu muss MOA-SP wie unten beschreiben konfiguriert werden. +
+
+ VerifyTransformsInfoProfile
+ Der Request zum überprüfen der Signatur des AUTH-Blocks + verwendet ein vordefiniertes VerifyTransformsInfoProfile. Die + im Request verwendete Profil-ID wird in der MOA-ID Konfigurationsdatei + im Element /MOA-IDConfiguration/ AuthComponent/MOA-SP/VerifyAuthBlock/ + VerifyTransformsInfoProfileID 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/MOAIDTransformAuthBlock.xml + enthalten. Diese Profildefinition muss unverändert übernommen + werden.

+
+ +
+

+TrustProfile
+Die Requests zur überprüfung der Signatur verwenden vordefinierte TrustProfile. +Die im Request verwendete Profil-IDs werden in der MOA-ID Konfigurationsdatei +in den Elementen /MOA-IDConfiguration/AuthComponent/MOA-SP/VerifyIdentityLink/ TrustProfileID und +/MOA-IDConfiguration/AuthComponent/MOA-SP/VerifyAuthBlock/TrustProfileID definiert. Diese beiden Elemente +können unterschiedliche oder identische TrustProfileIDs enthalten. +Am MOA-SP Server müssen TrustProfile mit gleichlautender ID definiert werden. +Die Auslieferung von MOA-ID enthält das Verzeichnis $MOA_ID_INST_AUTH/conf/moa-spss/trustprofiles/MOAIDBuergerkarteRoot, +das als TrustProfile verwendet werden kann. Weitere Zertifikate können als vertrauenswürdig hinzugefügt werden. +

+
+ +
+

+Certstore
+Zum Aufbau eines Zertifikatspfades können benötigte Zertifikate aus einem Zertifikatsspeicher verwendet werden. +Die Auslieferung von MOA-ID enthält das Verzeichnis $MOA_ID_INST_AUTH/conf/moa-spss/certstore, das als initialer +Zertifikatsspeicher verwendet werden kann. +

+
+ +
+Hinweis: Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues Format für die XML-Konfigurationsdatei. +Für die Konvertierung einer älteren Konfigurationsdatei auf das neue Format steht Ihnen ein Tool +zur Verfügung. Details dazu finden sie in der der Distribution von MOA-SP/SS beiligenden +Dokumentation im Kapitel 'Konfiguration', Abschnitt 1.2.1.
+ +
+
+ + +
+ + + +
+

 

+
+

+
+
+

Änderung der Konfiguration während des Betriebs

+
+Der Inhalt dieser Konfiguration, bzw. jene Teile, auf die indirekt verwiesen wird, können während des laufenden +Betriebes des MOA-Servers geändert werden. Der Server selbst wird durch den Aufruf einer URL +(im Applikationskontext von MOA ID) dazu veranlasst, die geänderte Konfiguration neu einzulesen. +Im Falle einer fehlerhaften neuen Konfiguration wird die ursprüngliche Konfiguration beibehalten. +
+ + +
+

+ + + + + + +

+
+
© 2004
+
+
+ + +
+
+ diff --git a/id/server/doc/moa_id/id-admin_3.htm b/id/server/doc/moa_id/id-admin_3.htm new file mode 100644 index 000000000..14c8aecce --- /dev/null +++ b/id/server/doc/moa_id/id-admin_3.htm @@ -0,0 +1,204 @@ + + + MOA ID-Administration + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
+
MOA-ID

+ + + +
+ Optionale
    Komponenten
+
+ +
+
+Optionale
Komponenten

+IIS
+Apache
+PostgreSQL
+
+
+

Konfiguration der optionalen Komponenten

+

Konfiguration des Microsoft Internet Information Server (optional)

+
+Vor MOA-ID-AUTH oder MOA-ID-PROXY kann optional ein MS IIS vorgeschaltet sein. In diesem Fall ü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ührt.

+Konfiguration von Jakarta mod_jk im MS IIS
+Fü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 mod_jk IIS HowTo. Beispiele für workers.properties und uriworkermap.properties Dateien liegen im ausgelieferten moa-id-auth-x.y.zip bzw. moa-id-proxy-x.y.zip, Verzeichnis tomcat bei. +

+Konfiguration von Tomcat
+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önnen die Connectoren für HTTP und HTTPS deaktiviert werden. Das geschieht am einfachsten durch ein- bzw. auskommentieren der entsprechenden Connector Konfigurations-Elemente in dieser Datei. +

+
+
+

Konfiguration von SSL
+ Die Dokumentation zum Einrichten von SSL auf dem MS IIS steht nach + Installation des IIS unter http://localhost/iisHelp/ bzw. online + zur Verfügung.

+

Konfiguration des zu verwendenden DATA-URL + Präfix
+ Befindet sich der Rechner auf dem MOA-ID installiert wird hinter + einer Firewall welche zwar Zugriffe vom vorgelagerten Webserver + zulä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äfix vergeben werden. An dieses + URL-Präfix werden Daten von der verwendeten Bürgerkartenumgebung + gesendet. Details finden sie im Abschnitt Konfiguration. + Requests an das DataURL-Präfix> müssen durch den Webserver + an https://<moa-id-rechnername>/moa-id-auth/ bzw. an http://<moa-id-rechnername>/moa-id-auth/ + weitergeleitet werden.

+
+
+

+ + +
+ + + +
+

 

+
+

+
+
+

Konfiguration des Apache Webservers (optional)

+
+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ür die Kommunikation zwischen Webserver und Tomcat eingesetzt. +

+Konfiguration von Jakarta mod_jk im Apache Webserver
+ 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 mod_jk Apache HowTo. Ein Beispiel für eine workers.properties Datei liegt im Verzeichnis $MOA_SPSS_INST/conf/moa bei.
+Um MOA-ID-AUTH oder MOA-ID-PROXY dem Apache Webserver bekannt zu machen, muss folgender Eintrag in die Apache Konfigurationsdatei gemacht werden: +
+    JkMount /moa-id-auth/* moaworker
+
+oder für die Proxy-Komponente +
+    JkMount /* moaworker
+
+
+Konfiguration von Tomcat
+Die Konfiguration von Tomcat ist analog wie im Abschnitt über den MS IIS durchzuführen. +

+ +Konfiguration von SSL mit mod_SSL
+Apache kann in Verbindung mit mod_SSL als SSL-Endpunkt für das MOA-ID-AUTH Webservice fungieren. In diesem Fall entfä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 Online-Dokumentation. +

+Bei der Verwendung von Client-Authentisierung muss darauf geachtet werden, dass mod_ssl die HTTP-Header mit den Informationen über das Client-Zertifikat exportiert. Dies wird durch Angabe der Option
+
+    SSLOptions +ExportCertData +StdEnvVars
+
+in der Apache-Konfiguration erreicht.
+Weiters muss Jakarta mod_jk angewiesen werden, die SSL Schlüssellänge zu exportieren. Dies geschieht mit der Direktive: +
+    JkOptions +ForwardKeySize 
+              +ForwardURICompat 
+              -ForwardDirectories
+
+

Konfiguration des zu verwendenden DATA-URL Präfix

+

siehe gleichnamige Überschrift + in Abschnitt "Konfiguration des Microsoft Internet Information + Server (optional)"

+
+
+

+ + +
+ + + +
+

 

+
+

Konfiguration von PostgreSQL

+
+MOA-ID-AUTH bzw. MOA-ID-PROXY kann PostgreSQL zum Abspeichern von Log-Meldungen verwenden. Hierfür wird eine installierte und konfigurierte Datenbank vorausgesetzt. Eine detaillierte Übersicht über die Installation und Konfiguration von PostgreSQL gibt die Online-Dokumentation.

+Logging
+Für das Logging in eine PostgreSQL Datenbank mittels Jakarta Log4j muss zunächst eine Tabelle für die Log-Meldungen angelegt werden. Dies kann mit folgendem SQL-Statement erreicht werden: +
+    create table spss_log 
+      (log_time timestamp, 
+       log_level varchar(5), 
+       log_msg varchar(256));
+
+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ält bereits eine beispielhafte Jakarta Log4j-Konfiguration für das Logging in eine PostgreSQL Datenbank, die standardmäßig ausgeschaltet ist. Hinweis: Bei Tests hat sich das Logging in eine Datenbank mit Jakarta Log4j als Performance-Engpaß herausgestellt. Es wird deshalb empfohlen, auf dieses Feature zu verzichten. +

+
+ +
+

+ + + + + + +

+
+
© 2004
+
+
+ + +
+
+ \ No newline at end of file diff --git a/id/server/doc/moa_id/id-anwendung.htm b/id/server/doc/moa_id/id-anwendung.htm new file mode 100644 index 000000000..6e33f40e8 --- /dev/null +++ b/id/server/doc/moa_id/id-anwendung.htm @@ -0,0 +1,104 @@ + + + MOA ID-Anwendung + + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
MOA-ID

+
+ Übersicht
+ + +
+ +
+
+
MOA ID-Anwendung
+

+MOA-ID führt für eine Online-Applikation (OA) die Benutzeridentifizierung und -authentisierung mit Hilfe der Bürgerkarte durch. +

+

Übersicht

+Um diese Funktionalität verfügbar zu machen, ist folgendermaßen vorzugehen:
+

+
    +
  • Die OA muss als Webapplikation installiert werden.
  • +
  • MOA-ID-AUTH muss als Webapplikation installiert und für die OA konfiguriert werden.
  • +
  • MOA-ID-AUTH wird durch einen Verweis von einer Webseite aufgerufen. +Diese Webseite kann z.B. Teil eines Portals sein.
  • +
  • Nach erfolgter Authentisierung holt die OA die bereitgestellten Anmeldedaten zum Bürger von MOA-ID-AUTH ab. +Dies kann unter Mithilfe der Webapplikation MOA-ID-PROXY geschehen, die für diesen Zweck installiert und für die OA konfiguriert werden muss.
  • +
+
+
+ + + + + + +

+
+
© 2003
+
+
+ + +
+ + diff --git a/id/server/doc/moa_id/id-anwendung_1.htm b/id/server/doc/moa_id/id-anwendung_1.htm new file mode 100644 index 000000000..27da073a5 --- /dev/null +++ b/id/server/doc/moa_id/id-anwendung_1.htm @@ -0,0 +1,205 @@ + + + MOA ID-Anwendung + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
MOA-ID

+ + + +
+ +

+
+

Aufruf von MOA-ID-AUTH

+
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:
+
<a href="https://<moa-id-server-und-pfad>/
+StartAuthentication?Target=<geschäftsbereich>
+&OA=<oa-url>&Template=<template-url>">
+ + + + + + + + + + + + + +
<moa-id-server-und-pfad>Server und Pfad, wo MOA-ID-AUTH installiert ist
Target=<geschäftsbereich>Angabe, für welches Verfahren der Benutzer authentisiert werden soll (siehe TODO: Link auf Verzeichnis der Geschäftsbereich)
OA=<oa-url>Webseite, auf die der Browser nach erfolgter Authentisierung weitergeleitet werden soll
Template=<template-url>optional; HTML-Vorlage für der Anmeldeseite von MOA-ID-AUTH, über die der Bürger den Authentisierungsvorgang startet. Über diesen Parameter kann das Aussehen der Anmeldeseite an das Aussehen der Online-Applikation angepasst werden.
+

+ +
+Template

+Ein Template für die Anmeldeseite von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:
+
<!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">
</head>
+

<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>
+

+Innerhalb dieser <form>-Elemente können Texte, Beschriftungen und Styles modifiziert werden, +und es können zusätzliche Elemente darin aufgenommen werden. +

+Die vorgegebene Grundstruktur ist aber in jedem Fall einzuhalten, und es müssen die speziellen +Tags <BKU> (kommt 2x vor), <XMLRequest>, <DataURL>, <CertInfoXMLRequest> und <CertInfoDataURL> +darin enthalten sein. Das Tag <PushInfobox> muss ab Version 1.4 vorhanden sein, wenn MOA-ID auch andere Infoboxen als die Personenbindung bearbeiten kann. +

+ +
+BKU-Auswahl

+MOA-ID-AUTH bietet die Möglichkeit, die Bürgerkartenumgebung (BKU) auszuwählen, über die in weiterer Folge die Bürgerkarte ausgelesen wird. Der Aufruf erfolgt dann durch einen Verweis der Form:
+
<a href="https://<moa-id-server-und-pfad>/
+SelectBKU?Target=<geschäftsbereich>
+&OA=<oa-url>&Template=<template-url>
+&BKUSelectionTemplate=<bku-template-url>">
+ + + + +
BKUSelectionTemplate= <bku-template-url>optional; HTML-Vorlage für der BKU-Auswahlseite von MOA-ID-AUTH. +Über diesen Parameter kann das Aussehen der BKU-Auswahlseite an das Aussehen der Online-Applikation angepasst werden.
+

+ +
+BKUSelectionTemplate

+Ein Template für die BKU-Auswahl von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:
+
+<!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">
</head>

<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>

+

</body>
+</html>
+

+

+ + +Innerhalb dieser <form>-Elemente können Texte, Beschriftungen und Styles modifiziert werden, +und es können zusätzliche Elemente darin aufgenommen werden.
+
+Auch dabei ist die vorgegebene Grundstruktur einzuhalten, die speziellen Tags <StartAuth> und <BKUSelect> sind verpflichtend.

+

Wichtiger Hinweis: wenn die Templates ü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.

+Vorgeschlagene Vorgehensweise:
+
+
+
+1. Webserver SSL/TLS Zertifikat speichern im .cer Format speichern (z.B. mittels Internet Explorer).
+2. Mittels Java Keytool das Zertifikat in einen Java Truststore importieren.
+ +Im folgenden Beispiel wird in den Java Truststore "truststore.jks" mit dem Passwort "changeit" importiert.
+
keytool -import -trustcacerts -alias mytomcat -file tomcat_localhost.cer -keystore truststore.jks
+

3. Truststore beim Starten von Tomcat angeben (über das Hinzufügen folgender Parameter in + die Variable CATALINA_OPTS im Tomcat Startskript).

+


+    -Djavax.net.ssl.trustStore=<PFAD>\truststore.jks
+ -Djavax.net.ssl.trustStorePassword=changeit
+ -Djavax.net.ssl.trustStoreType=jks
+

+ + + + + + +

+
+
© 2004
+
+
+ + +
+ + diff --git a/id/server/doc/moa_id/id-anwendung_2.htm b/id/server/doc/moa_id/id-anwendung_2.htm new file mode 100644 index 000000000..45a815379 --- /dev/null +++ b/id/server/doc/moa_id/id-anwendung_2.htm @@ -0,0 +1,247 @@ + + + MOA ID-Anwendung + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + + +
+
MOA-ID

+ + + +
+ +

+
+Abfragearten: +
+Web Service
+MOA-ID-PROXY
+
+
+

Abfrage der Anmeldedaten von MOA-ID-AUTH

+
Nach erfolgter Authentisierung stehen in MOA-ID-AUTH Anmeldedaten zum Abholen bereit, +und MOA-ID-AUTH veranlasst einen Redirect zur Online-Applikation (OA). +

+In diesem Redirect werden der Geschäftsbereich und ein SAML-Artifact als Parameter übergeben. +
+
<a href="https://<oa-url>
+?Target=<geschäftsbereich>
+&SAMLArtifact=<saml-artifact>">
+ + + + + +
<oa-url>URL, der beim Aufruf von MOA-ID-AUTH als Parameter "OA" übergeben wurde
Target=<geschäftsbereich>Parameter, der beim Aufruf von MOA-ID-AUTH übergeben wurde
SAMLArtifact=<saml-artifact>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.
+

+
Grundsätzlich stehen einer OA mehrere Arten zum Abholen der Anmeldedaten von MOA-ID-AUTH zur Verfügung:
+
    +
  1. Die Applikation ruft selbst das MOA-ID-AUTH Web Service auf. +
    Die Implementierung dieser Variante wird empfohlen, insbesondere für Online-Applikationen, die neu erstellt werden. +
  2. +
  3. Es wird die MOA-ID-PROXY Webapplikation eingesetzt, um die Anmeldedaten abzuholen und an die OA zu übergeben. +
    Aus Sicht von MOA-ID-PROXY ist bedeutsam, ob die OA die Anmeldedaten nach Abarbeitung des HTTP-Requests behält. +
      +
    • Stateful OA: MOA-ID-PROXY übergibt einmalig die Anmeldedaten an die OA, und die OA speichert die Anmeldedaten, typischerweise unter Einsatz von Cookies.
    • +
    • Stateless OA: MOA-ID-PROXY übergibt die Anmeldedaten bei jedem HTTP-Request vom Browser des Bürgers an die OA.
    • +
    +Diese Variante ist vorzuziehen, wenn +
      +
    • für die Plattform, auf der die OA aufbaut, Web Service-Schnittstellen nicht verfügbar sind
    • +
    • das nötige Web Service-Know How nicht zur Verfügung steht
    • +
    • die Implementierung von Variante 1 zu aufwändig wäre
    • +
    • eine Anpassung der OA aus bestimmten Gründen nicht möglich ist
    • +
    +
  4. +
+
+ + + +
+ + + +
+

 

+
+

+
+
+

Aufruf des MOA-ID-AUTH Web Service

+
Das MOA-ID-AUTH Web Service wird über einen <samlp:Request> aufgerufen. +Der <samlp:Request> enthält in einem <samlp:AssertionArtifact> das von MOA-ID-AUTH übergebene SAML-Artifact. +

+MOA-ID-AUTH liefert als Antwort einen <samlp:Response>. Die Anmeldedaten sind im <samlp:Response> in Form einer <saml:Assertion> enthalten. +

+SAML 1.0 Protocol Schema +
+SAML 1.0 Assertion Schema +
+Der detaillierte Aufbau der <saml:Assertion> zu den Anmeldedaten ist in der Spezifikation MOA-ID 1.4 beschrieben. +

+

Beispiel LoginServletExample

+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 über Redirect aufgerufen. +

+Das Beispiel demonstriert insgesamt die Integration von MOA-ID-AUTH in die OA: +
+
    +
  • Parameterübergabe von MOA-ID-AUTH an die OA
  • +
  • Aufruf des MOA-ID-AUTH Web Service mittels des SOAP Frameworks "Apache AXIS"
  • +
  • Parsen der Anmeldedaten mittels der XPath Engine "Jaxen"
  • +
  • Speichern der Anmeldedaten in der HTTPSession
  • +
  • Redirect auf die eigentliche Startseite der OA
  • +
+ + +Voraussetzungen
+
Die folgende Liste enthält die für das Beispiel erforderlichen Java-Bibliotheken. Die angeführten Versionsnummern bezeichnen jene Versionen dieser Java-Bibliotheken, mit denen das Beispiel getestet wurde.
+
+ + + + + + + + + + + + + + + + + + + + + +
Java-BibliothekVersionBemerkung
JDK1.4.0+, 1.5.0Java Development Kit
Xerces
XML Parser
2.0.2+Download: xml.apache.org/xerces2-j
AXIS
SOAP Framework
1.0+Download: xml.apache.org/axis
Jaxen XPath Engine1.0+Download: http://jaxen.sourceforge.net
Servlet API2.3+Download: java.sun.com/products/servlet
+
+Code
+LoginServletExample + +
+ +
+ + + +
+ + +
+

 

+
+

+
+
+

Einsatz von MOA-ID-PROXY zum Abfragen der Anmeldedaten von MOA-ID-AUTH

+
+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ür die OA zu erledigen. MOA-ID-PROXY muss für die OA konfiguriert werden, so wie in MOA-ID-Administration beschrieben. +

+Bei der Konfiguration ist speziell zu beachten: +

+Konfigurationsdatei zur OA
+Der LoginType (stateful oder stateless) ist gemäß dem Applikationstyp zu setzen. +

+Die Übergabe der Anmeldedaten ist in Form und Inhalt zu konfigurieren. +
+
    +
  • BasicAuth: HTTP Basic Authentication (Beispiel)
  • +
  • ParamAuth: Übergabe über Requestparameter (Beispiel)
  • +
  • HeaderAuth: Übergabe über Requestheader (Beispiel)
  • +
+ +
+LoginParameterResolver
+Das Übergabe der Anmeldedaten an die OA über Request Parameter oder Header geschieht in einer Standardimplementierung des Interface +
at.gv.egovernment.moa.proxy.LoginParameterResolver
+Falls die Erfordernisse der OA mittels Konfiguration nicht abgedeckt werden können, +so kann eine maßgeschneiderte Implementierung von LoginParameterResolver erstellt und zusammen mit MOA-ID-PROXY zum Einsatz gebracht werden +(siehe API). +

+ConnectionBuilder +Das Herstellen einer URL-Verbindung von MOA-ID-PROXY zur OA geschieht einer Standardimplementierung des Interface +
at.gv.egovernment.moa.proxy.ConnectionBuilder 
+Falls nötig, kann eine maßgeschneiderte Implementierung von ConnectionBuilder erstellt und zusammen mit MOA-ID-PROXY zum Einsatz gebracht werden +(siehe API). +
+
+ + + + + +

+
+
© 2003
+
+
+ + +
+ + diff --git a/id/server/doc/moa_id/links.htm b/id/server/doc/moa_id/links.htm new file mode 100644 index 000000000..c5a9b7113 --- /dev/null +++ b/id/server/doc/moa_id/links.htm @@ -0,0 +1,141 @@ + + + MOA Grundlagen + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
MOA Links

+ + + + +
+ +
+ +
+
MOA Links
+ +
+ + + + + + + +

+
+
© 2003
+
+
+ + +
+ + \ No newline at end of file diff --git a/id/server/doc/moa_id/moa-id-ablauf.jpg b/id/server/doc/moa_id/moa-id-ablauf.jpg new file mode 100644 index 000000000..0585664f4 Binary files /dev/null and b/id/server/doc/moa_id/moa-id-ablauf.jpg differ diff --git a/id/server/doc/moa_id/moa.htm b/id/server/doc/moa_id/moa.htm new file mode 100644 index 000000000..05a2d3007 --- /dev/null +++ b/id/server/doc/moa_id/moa.htm @@ -0,0 +1,248 @@ + + + MOA Module fuer Online Applikationen + + + + + + + + + +
+ + + + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + + + +
+
MOA-ID

+
+ Allgemein
+ + + + + +
+ +
+
+
+
+ +
Allgemein v.1.4
+

+Dieses Dokument enthält die Dokumentation für das Modul
+

    +
  • MOA-ID (Identifikation)
  • +

+
+ +
+ + + +
+

 

+
+
+
+
+Das Modul Identifikation stellt Online-Applikationen Funktionalität zur Verfügung zu stellen, damit diese +eine Benutzer-Identifikation und -Authentisierung mit Hilfe der Bürgerkarte und deren Signaturfunktion +realisieren können. +

+Das Modul besteht aus zwei Komponenten: +
    +
  • Die Authentisierungskomponente (MOA-ID-AUTH) führt die eigentliche Authentisierung des Benutzers durch und übergibt der +Proxykomponente die Anmeldedaten.
  • +
  • Die Proxykomponente (MOA-ID-PROXY) übernimmt die Anmeldedaten von der Authentisierungskomponente, +führt die Anmeldung an der Online Applikation durch und schleust in der Folge Daten an die Online-Applikation +und Daten an den Benutzer durch.
  • +
+Diese beiden Komponenten können auf unterschiedlichen Rechnern +oder auf dem gleichen Rechner eingesetzt werden. +

+Die Funktionalität und der Aufbau der Schnittstelle zu MOA-ID ist in der +Spezifikation detailliert beschrieben. +
+
+Für den Betrieb von MOA-ID ist der Einsatz von MOA-Signaturprüfung (MOA-SP) erforderlich. +
+ +

+
Ablauf einer Anmeldung
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1Der Benutzer verbindet sich zu einem Web-Portal, über das die verfügbaren Online-Applikationen (OA) erreichbar +sind. Jeder Link zu einer OA verweist auf die Authentisierungs-komponente. +
2Der Benutzer verbindet sich mit MOA-ID-AUTH, die die Authentisierung des +Benutzers durchführt:
2.1MOA-ID-AUTH bietet dem Benutzer optional eine Auswahl von verfügbaren Bürgerkartenumgebungen (engl. Bezeichnung: Security-Layer) an.
2.2MOA-ID-AUTH erzeugt eine HTML-Seite mit einem <InfoboxReadRequest> + zum Auslesen der Personenbindung. Diese HTML-Seite wird an den Browser geschickt.
2.3Der Browser schickt den <InfoboxReadRequest> an den ausgewählten Security-Layer. Der Security-Layer liest die +Personenbindung von der Bürgerkarte und sendet diese an MOA-ID-AUTH, die die Signatur der Personenbindung durch +einen Aufruf von MOA-SP überprüft. +
2.4MOA-ID-AUTH erstellt den AUTH-Block. Der AUTH-Block enthält +
    +
  • Vor- und Nachname aus der Personenbindung,
  • +
  • URL von MOA-ID-AUTH,
  • +
  • URL und Geschäftsbereich der Online-Applikation,
  • +
  • die aktuelle Zeit.
  • +
+Anschließend wird +eine XML Antwortseite, die das Kommando zum Signieren (<CreateXMLSignatureRequest>) des generierten +AUTH-Blocks enthält, an den ausgewählten Security-Layer gesendet.
2.5Der Request wird vom Security-Layer verarbeitet. Die signierten Daten werden an +MOA-ID-AUTH zurückgesendet.
2.6MOA-ID-AUTH überprüft den signierten AUTH-Block und legt für den Benutzer die Anmeldedaten +an. Die Anmeldedaten enthalten +
    +
  • die bereichsspezifische Personenkennzeichen (bPK),
  • +
  • den signierten AUTH-Block (optional),
  • +
  • die Personenbindung (optional),
  • +
  • die PersonData-Struktur aus der Personenbindung (optional),
  • +
  • die Information, ob die Signatur des AUTH-Blocks mit einem qualifiziertem Zertifikat erfolgte,
  • +
  • Informationen zur Behörde, falls die Signatur mit einem Behördenzertifikat erzeugt wurde.
  • +
+
2.7Ist der obige Authentisierungsvorgang erfolgreich, dann wird eine Redirect-Seite +zum Browser gesendet.
3Der Browser führt das Redirect zur Proxykomponente durch. Als Parameter wird das von MOA-ID-AUTH +erzeugte SAML-Artifact übergeben.
4Die 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öscht.
5MOA-ID-PROXY liest die Konfigurationsdatei der zugehörigen Online-Applikation, die beschreibt, wie die Anmeldedaten +an die nachfolgende Applikation übergeben werden müssen, und meldet den Benutzer bei der Applikation an.
6Ist 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.
+ + +
+

+ + + + + +

+
+
© 2004
+
+
+ + +
+ + diff --git a/id/server/doc/moa_images/east.gif b/id/server/doc/moa_images/east.gif new file mode 100644 index 000000000..e76117cb0 Binary files /dev/null and b/id/server/doc/moa_images/east.gif differ diff --git a/id/server/doc/moa_images/idle.gif b/id/server/doc/moa_images/idle.gif new file mode 100644 index 000000000..28b8148e5 Binary files /dev/null and b/id/server/doc/moa_images/idle.gif differ diff --git a/id/server/doc/moa_images/moa_diagramm1.jpg b/id/server/doc/moa_images/moa_diagramm1.jpg new file mode 100644 index 000000000..776331fb8 Binary files /dev/null and b/id/server/doc/moa_images/moa_diagramm1.jpg differ diff --git a/id/server/doc/moa_images/moa_thema.gif b/id/server/doc/moa_images/moa_thema.gif new file mode 100644 index 000000000..f59075528 Binary files /dev/null and b/id/server/doc/moa_images/moa_thema.gif differ diff --git a/id/server/doc/moa_images/north.gif b/id/server/doc/moa_images/north.gif new file mode 100644 index 000000000..b4316b5d7 Binary files /dev/null and b/id/server/doc/moa_images/north.gif differ diff --git a/id/server/doc/moa_images/pfeil.gif b/id/server/doc/moa_images/pfeil.gif new file mode 100644 index 000000000..e4eeb1740 Binary files /dev/null and b/id/server/doc/moa_images/pfeil.gif differ diff --git a/id/server/doc/moa_images/print.gif b/id/server/doc/moa_images/print.gif new file mode 100644 index 000000000..b8e59144e Binary files /dev/null and b/id/server/doc/moa_images/print.gif differ diff --git a/id/server/doc/moa_images/select.gif b/id/server/doc/moa_images/select.gif new file mode 100644 index 000000000..59a1694c5 Binary files /dev/null and b/id/server/doc/moa_images/select.gif differ diff --git a/id/server/doc/moa_images/south.gif b/id/server/doc/moa_images/south.gif new file mode 100644 index 000000000..c70ab3e97 Binary files /dev/null and b/id/server/doc/moa_images/south.gif differ diff --git a/id/server/doc/moa_images/transdot.gif b/id/server/doc/moa_images/transdot.gif new file mode 100644 index 000000000..e31aba280 Binary files /dev/null and b/id/server/doc/moa_images/transdot.gif differ diff --git a/id/server/doc/moa_images/west.gif b/id/server/doc/moa_images/west.gif new file mode 100644 index 000000000..135698ee7 Binary files /dev/null and b/id/server/doc/moa_images/west.gif differ diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/AuthenticationException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/AuthenticationException.java new file mode 100644 index 000000000..96a5e0673 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/AuthenticationException.java @@ -0,0 +1,31 @@ +package at.gv.egovernment.moa.id; + + +/** + * Exception thrown during handling of AuthenticationSession + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationException extends MOAIDException { + + /** + * Constructor for AuthenticationException. + * @param messageId + */ + public AuthenticationException(String messageId, Object[] parameters) { + super(messageId, parameters, null); + } + /** + * Constructor for AuthenticationException. + * @param messageId + * @param parameters + * @param wrapped + */ + public AuthenticationException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/BuildException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/BuildException.java new file mode 100644 index 000000000..785dce7a3 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/BuildException.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.id; + + +/** + * Exception thrown while building an XML or HTML structure. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class BuildException extends MOAIDException { + + /** + * Constructor for BuildException. + * @param messageId + * @param parameters + */ + public BuildException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for BuildException. + * @param messageId + * @param parameters + * @param wrapped + */ + public BuildException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ECDSAConverterException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ECDSAConverterException.java new file mode 100644 index 000000000..682395a83 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ECDSAConverterException.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.id; + + +/** + * Exception thrown while converting ECDSAKeys from/to an XML structure. + * + * @author Rudolf Schamberger + * @version $Id$ + */ +public class ECDSAConverterException extends MOAIDException { + + /** + * Constructor for ECDSAConverterException. + * @param messageId + * @param parameters + */ + public ECDSAConverterException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for ECDSAConverterException. + * @param messageId + * @param parameters + * @param wrapped + */ + public ECDSAConverterException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/MOAIDException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/MOAIDException.java new file mode 100644 index 000000000..bce2c4778 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/MOAIDException.java @@ -0,0 +1,159 @@ +package at.gv.egovernment.moa.id; + +import java.io.PrintStream; +import java.io.PrintWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.util.Constants; + +/** + * Base class of technical MOA exceptions. + * + * Technical exceptions are exceptions that originate from system failure (e.g., + * a database connection fails, a component is not available, etc.) + * + * @author Patrick Peck, Ivancsics Paul + * @version $Id$ + */ +public class MOAIDException extends Exception { + /** message ID */ + private String messageId; + /** wrapped exception */ + private Throwable wrapped; + + /** + * Create a new MOAIDException. + * + * @param messageId The identifier of the message associated with this + * exception. + * @param parameters Additional message parameters. + */ + public MOAIDException(String messageId, Object[] parameters) { + super(MOAIDMessageProvider.getInstance().getMessage(messageId, parameters)); + this.messageId = messageId; + } + + /** + * Create a new MOAIDException. + * + * @param messageId The identifier of the message associated with this + * MOAIDException. + * @param parameters Additional message parameters. + * @param wrapped The exception wrapped by this + * MOAIDException. + */ + public MOAIDException( + String messageId, + Object[] parameters, + Throwable wrapped) { + + super(MOAIDMessageProvider.getInstance().getMessage(messageId, parameters)); + this.messageId = messageId; + this.wrapped = wrapped; + } + + /** + * Print a stack trace of this exception to System.err. + * + * @see java.lang.Throwable#printStackTrace() + */ + public void printStackTrace() { + printStackTrace(System.err); + } + + /** + * Print a stack trace of this exception, including the wrapped exception. + * + * @param s The stream to write the stack trace to. + * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) + */ + public void printStackTrace(PrintStream s) { + if (getWrapped() == null) + super.printStackTrace(s); + else { + s.print("Root exception: "); + getWrapped().printStackTrace(s); + } + } + + /** + * Print a stack trace of this exception, including the wrapped exception. + * + * @param s The stream to write the stacktrace to. + * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) + */ + public void printStackTrace(PrintWriter s) { + if (getWrapped() == null) + super.printStackTrace(s); + else { + s.print("Root exception: "); + getWrapped().printStackTrace(s); + } + } + + /** + * @return message ID + */ + public String getMessageId() { + return messageId; + } + + /** + * @return wrapped exception + */ + public Throwable getWrapped() { + return wrapped; + } + + /** + * Convert this MOAIDException to an ErrorResponse + * element from the MOA namespace. + * + * @return An ErrorResponse element, containing the subelements + * ErrorCode and Info required by the MOA schema. + */ + public Element toErrorResponse() { + DocumentBuilder builder; + DOMImplementation impl; + Document doc; + Element errorResponse; + Element errorCode; + Element info; + + // create a new document + try { + builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + impl = builder.getDOMImplementation(); + } catch (ParserConfigurationException e) { + return null; + } + + // build the ErrorResponse element + doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null); + errorResponse = doc.getDocumentElement(); + + // add MOA namespace declaration + errorResponse.setAttributeNS( + Constants.XMLNS_NS_URI, + "xmlns", + Constants.MOA_NS_URI); + + // build the child elements + errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode"); + errorCode.appendChild(doc.createTextNode(messageId)); + info = doc.createElementNS(Constants.MOA_NS_URI, "Info"); + info.appendChild(doc.createTextNode(toString())); + errorResponse.appendChild(errorCode); + errorResponse.appendChild(info); + return errorResponse; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ParseException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ParseException.java new file mode 100644 index 000000000..a5e0088d9 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ParseException.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.id; + + +/** + * Exception thrown while parsing an XML structure. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ParseException extends MOAIDException { + + /** + * Constructor for ParseException. + * @param messageId + * @param parameters + */ + public ParseException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for ParseException. + * @param messageId + * @param parameters + * @param wrapped + */ + public ParseException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ServiceException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ServiceException.java new file mode 100644 index 000000000..9e6ab2361 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/ServiceException.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.id; + + +/** + * Exception thrown while calling the MOA-SPSS web service. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ServiceException extends MOAIDException { + + /** + * Constructor for ServiceException. + * @param messageId + * @param parameters + */ + public ServiceException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for ServiceException. + * @param messageId + * @param parameters + * @param wrapped + */ + public ServiceException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} 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 new file mode 100644 index 000000000..5f4ec2d29 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -0,0 +1,1019 @@ +package at.gv.egovernment.moa.id.auth; + +import iaik.pki.PKIException; +import iaik.x509.X509Certificate; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; + +import javax.xml.transform.TransformerException; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.ServiceException; +import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; +import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder; +import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; +import at.gv.egovernment.moa.id.auth.builder.CertInfoVerifyXMLSignatureRequestBuilder; +import at.gv.egovernment.moa.id.auth.builder.CreateXMLSignatureRequestBuilder; +import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; +import at.gv.egovernment.moa.id.auth.builder.GetIdentityLinkFormBuilder; +import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilder; +import at.gv.egovernment.moa.id.auth.builder.InfoboxValidatorParamsBuilder; +import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder; +import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder; +import at.gv.egovernment.moa.id.auth.builder.SelectBKUFormBuilder; +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +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.ExtendedSAMLAttribute; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult; +import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams; +import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; +import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; +import at.gv.egovernment.moa.id.auth.parser.ExtendedInfoboxReadResponseParser; +import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; +import at.gv.egovernment.moa.id.auth.parser.SAMLArtifactParser; +import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; +import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; +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; +import at.gv.egovernment.moa.id.auth.validator.ValidateException; +import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; +import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameter; +import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.util.HTTPUtils; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.id.util.Random; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.BoolUtils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.DateTimeUtils; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * API for MOA ID Authentication Service.
+ * {@link AuthenticationSession} is stored in a session store and retrieved + * by giving the session ID. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationServer implements MOAIDAuthConstants { + + /** single instance */ + private static AuthenticationServer instance; + /** session data store (session ID -> AuthenticationSession) */ + private static Map sessionStore = new HashMap(); + /** authentication data store (assertion handle -> AuthenticationData) */ + private static Map authenticationDataStore = new HashMap(); + /** + * time out in milliseconds used by {@link cleanup} for session store + */ + private long sessionTimeOut = 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 AuthenticationServer. + * + * @return the single instance of AuthenticationServer + */ + public static AuthenticationServer getInstance() { + if (instance == null) + instance = new AuthenticationServer(); + return instance; + } + /** + * Constructor for AuthenticationServer. + */ + public AuthenticationServer() { + super(); + } + /** + * Processes request to select a BKU. + *
Processing depends on value of {@link AuthConfigurationProvider#getBKUSelectionType}. + *
For bkuSelectionType==HTMLComplete, a returnURI for the + * "BKU Auswahl" service is returned. + *
For bkuSelectionType==HTMLSelect, an HTML form for BKU selection is returned. + * @param authURL base URL of MOA-ID Auth component + * @param target "Geschäftsbereich" + * @param oaURL online application URL requested + * @param bkuSelectionTemplateURL template for BKU selection form to be used + * in case of HTMLSelect; may be null + * @param templateURL URL providing an HTML template for the HTML form to be used + * for call startAuthentication + * @return for bkuSelectionType==HTMLComplete, the returnURI for the + * "BKU Auswahl" service; + * for bkuSelectionType==HTMLSelect, an HTML form for BKU selection + * @throws WrongParametersException upon missing parameters + * @throws AuthenticationException when the configured BKU selection service cannot be reached, + * and when the given bkuSelectionTemplateURL cannot be reached + * @throws ConfigurationException on missing configuration data + * @throws BuildException while building the HTML form + */ + public String selectBKU( + String authURL, + String target, + String oaURL, + String bkuSelectionTemplateURL, + String templateURL) + throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException { + + //check if HTTP Connection may be allowed (through FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY) + String boolStr = AuthConfigurationProvider.getInstance().getGenericConfigurationParameter( + AuthConfigurationProvider.FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY); + if ((!authURL.startsWith("https:")) && (false == BoolUtils.valueOf(boolStr))) + throw new AuthenticationException("auth.07", new Object[] { authURL + "*" }); + if (isEmpty(authURL)) + throw new WrongParametersException("StartAuthentication", "AuthURL"); + if (isEmpty(oaURL)) + throw new WrongParametersException("StartAuthentication", PARAM_OA); + + ConnectionParameter bkuConnParam = + AuthConfigurationProvider.getInstance().getBKUConnectionParameter(); + if (bkuConnParam == null) + throw new ConfigurationException( + "config.08", + new Object[] { "BKUSelection/ConnectionParameter" }); + OAAuthParameter oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); + if (oaParam == null) + throw new AuthenticationException("auth.00", new Object[] { oaURL }); + + if (!oaParam.getBusinessService()) { + if (isEmpty(target)) + throw new WrongParametersException("StartAuthentication", PARAM_TARGET); + } else { + if (!isEmpty(target)) { + Logger.info("Ignoring target parameter thus application type is \"businessService\""); + } + target = null; + } + + AuthenticationSession session = newSession(); + Logger.info("MOASession " + session.getSessionID() + " angelegt"); + session.setTarget(target); + session.setOAURLRequested(oaURL); + session.setPublicOAURLPrefix(oaParam.getPublicURLPrefix()); + session.setAuthURL(authURL); + session.setTemplateURL(templateURL); + session.setBusinessService(oaParam.getBusinessService()); + String returnURL = + new DataURLBuilder().buildDataURL(authURL, REQ_START_AUTHENTICATION, session.getSessionID()); + String bkuSelectionType = AuthConfigurationProvider.getInstance().getBKUSelectionType(); + if (bkuSelectionType.equals(AuthConfigurationProvider.BKU_SELECTION_TYPE_HTMLCOMPLETE)) { + // bkuSelectionType==HTMLComplete + String redirectURL = bkuConnParam.getUrl() + "?" + AuthServlet.PARAM_RETURN + "=" + returnURL; + return redirectURL; + } else { + // bkuSelectionType==HTMLSelect + String bkuSelectTag; + try { + bkuSelectTag = readBKUSelectTag(AuthConfigurationProvider.getInstance(), bkuConnParam); + } catch (Throwable ex) { + throw new AuthenticationException( + "auth.11", + new Object[] { bkuConnParam.getUrl(), ex.toString()}, + ex); + } + String bkuSelectionTemplate = null; + // override template url by url from configuration file + if (oaParam.getBkuSelectionTemplateURL() != null) { + bkuSelectionTemplateURL = oaParam.getBkuSelectionTemplateURL(); + } + if (bkuSelectionTemplateURL != null) { + try { + bkuSelectionTemplate = new String(FileUtils.readURL(bkuSelectionTemplateURL)); + } catch (IOException ex) { + throw new AuthenticationException( + "auth.03", + new Object[] { bkuSelectionTemplateURL, ex.toString()}, + ex); + } + } + String htmlForm = + new SelectBKUFormBuilder().build(bkuSelectionTemplate, returnURL, bkuSelectTag); + return htmlForm; + } + } + /** + * Method readBKUSelectTag. + * @param conf the ConfigurationProvider + * @param connParam the ConnectionParameter for that connection + * @return String + * @throws ConfigurationException on config-errors + * @throws PKIException on PKI errors + * @throws IOException on any data error + * @throws GeneralSecurityException on security errors + */ + private String readBKUSelectTag(ConfigurationProvider conf, ConnectionParameter connParam) + throws ConfigurationException, PKIException, IOException, GeneralSecurityException { + + if (connParam.isHTTPSURL()) + return SSLUtils.readHttpsURL(conf, connParam); + else + return HTTPUtils.readHttpURL(connParam.getUrl()); + } + /** + * Processes the beginning of an authentication session. + *
    + *
  • Starts an authentication session
  • + *
  • Creates an <InfoboxReadRequest>
  • + *
  • Creates an HTML form for querying the identity link from the + * security layer implementation. + *
    Form parameters include + *
      + *
    • the <InfoboxReadRequest>
    • + *
    • the data URL where the security layer implementation sends it response to
    • + *
    + *
+ * @param authURL URL of the servlet to be used as data URL + * @param target "Geschäftsbereich" of the online application requested + * @param oaURL online application URL requested + * @param bkuURL URL of the "Bürgerkartenumgebung" to be used; + * may be null; in this case, the default location will be used + * @param templateURL URL providing an HTML template for the HTML form generated + * @return HTML form + * @throws AuthenticationException + * @see GetIdentityLinkFormBuilder + * @see InfoboxReadRequestBuilder + */ + public String startAuthentication( + String authURL, + String target, + String oaURL, + String templateURL, + String bkuURL, + String sessionID) + throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException { + + if (isEmpty(sessionID)) { + if (isEmpty(authURL)) + throw new WrongParametersException("StartAuthentication", "AuthURL"); + + //check if HTTP Connection may be allowed (through FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY) + String boolStr = + AuthConfigurationProvider.getInstance().getGenericConfigurationParameter( + AuthConfigurationProvider.FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY); + if ((!authURL.startsWith("https:")) && (false == BoolUtils.valueOf(boolStr))) + throw new AuthenticationException("auth.07", new Object[] { authURL + "*" }); + if (isEmpty(oaURL)) + throw new WrongParametersException("StartAuthentication", PARAM_OA); + } + AuthenticationSession session; + OAAuthParameter oaParam; + if (sessionID != null) { + session = getSession(sessionID); + oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + session.getPublicOAURLPrefix()); + } else { + oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); + if (oaParam == null) + throw new AuthenticationException("auth.00", new Object[] { oaURL }); + if (!oaParam.getBusinessService()) { + if (isEmpty(target)) + throw new WrongParametersException("StartAuthentication", PARAM_TARGET); + } else { + target = null; + } + session = newSession(); + Logger.info("MOASession " + session.getSessionID() + " angelegt"); + session.setTarget(target); + session.setOAURLRequested(oaURL); + session.setPublicOAURLPrefix(oaParam.getPublicURLPrefix()); + session.setAuthURL(authURL); + session.setTemplateURL(templateURL); + session.setBusinessService(oaParam.getBusinessService()); + } + // BKU URL has not been set yet, even if session already exists + if (bkuURL == null) { + bkuURL = DEFAULT_BKU; + } + session.setBkuURL(bkuURL); + String infoboxReadRequest = + new InfoboxReadRequestBuilder().build(oaParam.getSlVersion12(), + oaParam.getBusinessService(), + oaParam.getIdentityLinkDomainIdentifier()); + String dataURL = + new DataURLBuilder().buildDataURL( + session.getAuthURL(), + REQ_VERIFY_IDENTITY_LINK, + session.getSessionID()); + String template = null; + // override template url by url from configuration file + if (oaParam.getTemplateURL() != null) { + templateURL = oaParam.getTemplateURL(); + } else { + templateURL = session.getTemplateURL(); + } + if (templateURL != null) { + try { + template = new String(FileUtils.readURL(templateURL)); + } catch (IOException ex) { + throw new AuthenticationException( + "auth.03", + new Object[] { templateURL, ex.toString()}, + ex); + } + } + String pushInfobox = ""; + VerifyInfoboxParameters verifyInfoboxParameters = oaParam.getVerifyInfoboxParameters(); + if (verifyInfoboxParameters != null) { + pushInfobox = verifyInfoboxParameters.getPushInfobox(); + } + String certInfoRequest = new CertInfoVerifyXMLSignatureRequestBuilder().build(oaParam.getSlVersion12()); + String certInfoDataURL = + new DataURLBuilder().buildDataURL( + session.getAuthURL(), + REQ_START_AUTHENTICATION, + session.getSessionID()); + String htmlForm = + new GetIdentityLinkFormBuilder().build( + template, + bkuURL, + infoboxReadRequest, + dataURL, + certInfoRequest, + certInfoDataURL, + pushInfobox); + return htmlForm; + } + /** + * Processes an <InfoboxReadResponse> sent by the + * security layer implementation.
+ *
    + *
  • Validates given <InfoboxReadResponse>
  • + *
  • Parses identity link enclosed in <InfoboxReadResponse>
  • + *
  • Verifies identity link by calling the MOA SP component
  • + *
  • Checks certificate authority of identity link
  • + *
  • Stores identity link in the session
  • + *
  • Verifies all additional infoboxes returned from the BKU
  • + *
  • Creates an authentication block to be signed by the user
  • + *
  • Creates and returns a <CreateXMLSignatureRequest> + * containg the authentication block, meant to be returned to the + * security layer implementation
  • + *
+ * + * @param sessionID ID of associated authentication session data + * @param infoboxReadResponseParameters The parameters from the response returned from + * the BKU including the <InfoboxReadResponse> + * @return String representation of the <CreateXMLSignatureRequest> + */ + public String verifyIdentityLink(String sessionID, Map infoboxReadResponseParameters) + throws + AuthenticationException, + BuildException, + ParseException, + ConfigurationException, + ValidateException, + ServiceException { + + if (isEmpty(sessionID)) + 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}); + + AuthenticationSession session = getSession(sessionID); + if (session.getTimestampIdentityLink() != null) + throw new AuthenticationException("auth.01", new Object[] { sessionID }); + session.setTimestampIdentityLink(); + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + // parses the + IdentityLink identityLink = + new InfoboxReadResponseParser(xmlInfoboxReadResponse).parseIdentityLink(); + // validates the identity link + IdentityLinkValidator.getInstance().validate(identityLink); + // builds a 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 = + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse).parseData(); + + if (identityLink.getIdentificationType().equalsIgnoreCase(Constants.URN_PREFIX_BASEID)) { + } + + 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 + VerifyXMLSignatureResponseValidator.getInstance().validate( + verifyXMLSignatureResponse, + authConf.getIdentityLinkX509SubjectNames(), + VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, + ignoreManifestValidationResult); + + session.setIdentityLink(identityLink); + // now validate the extended infoboxes + verifyInfoboxes(session, infoboxReadResponseParameters, !oaParam.getProvideStammzahl()); + // builds the AUTH-block + String authBlock = buildAuthenticationBlock(session); +// session.setAuthBlock(authBlock); + // builds the + String[] transformsInfos = oaParam.getTransformsInfos(); + if ((transformsInfos == null) || (transformsInfos.length == 0)) { + // no OA specific transforms specified, use default ones + transformsInfos = authConf.getTransformsInfos(); + } + String createXMLSignatureRequest = + new CreateXMLSignatureRequestBuilder().build(authBlock, + oaParam.getKeyBoxIdentifier(), + transformsInfos, + oaParam.getSlVersion12()); + return createXMLSignatureRequest; + } + /** + * Builds an authentication block <saml:Assertion> from given session data. + * @param session authentication session + * + * @return <saml:Assertion> 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) throws BuildException { + IdentityLink identityLink = session.getIdentityLink(); + String issuer = identityLink.getName(); + String gebDat = identityLink.getDateOfBirth(); + String identificationValue = identityLink.getIdentificationValue(); + String identificationType = identityLink.getIdentificationType(); + String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); + session.setIssueInstant(issueInstant); + String authURL = session.getAuthURL(); + String target = session.getTarget(); + String oaURL = session.getPublicOAURLPrefix(); + List extendedSAMLAttributes = session.getExtendedSAMLAttributesAUTH(); + String authBlock = new AuthenticationBlockAssertionBuilder().buildAuthBlock( + issuer, + issueInstant, + authURL, + target, + identificationValue, + identificationType, + oaURL, + gebDat, + extendedSAMLAttributes, + session); + + 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 infoboxReadResponseParams The parameters returned from the BKU as response + * to an infobox read request (including the infobox + * tokens to be verified). + * @param hideStammzahl Indicates whether source pins (Stammzahlen) + * should be hidden in any SAML attribute that may be + * returned by a validator. + * + * @throws AuthenticationException If the verification of at least one infobox fails. + * @throws ConfigurationException If the OAuthParameter cannot be extracted. + */ + private void verifyInfoboxes( + AuthenticationSession session, Map infoboxReadResponseParams, boolean hideStammzahl) + throws ValidateException, ConfigurationException + { + + AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance(); + // get the default VerifyInfobox parameters + Map defaultInfoboxParameters = null; + VerifyInfoboxParameters defaultVerifyInfoboxParameters = + authConfigurationProvider.getDefaultVerifyInfoboxParameters(); + if (defaultVerifyInfoboxParameters != null) { + defaultInfoboxParameters = defaultVerifyInfoboxParameters.getInfoboxParameters(); + } + // get the OA specific VerifyInfobox parameters + Map infoboxParameters = null; + OAAuthParameter oaParam = + authConfigurationProvider.getOnlineApplicationParameter(session.getPublicOAURLPrefix()); + VerifyInfoboxParameters verifyInfoboxParameters = oaParam.getVerifyInfoboxParameters(); + if (verifyInfoboxParameters != null) { + Vector authAttributes = new Vector(); + Vector oaAttributes = new Vector(); + infoboxParameters = verifyInfoboxParameters.getInfoboxParameters(); + // get the list of infobox identifiers + List identifiers = verifyInfoboxParameters.getIdentifiers(); + if (identifiers != null) { + // step through the identifiers and verify the infoboxes + Iterator it = identifiers.iterator(); + while (it.hasNext()) { + String identifier = (String)it.next(); + // get the infobox read response from the map of parameters + String infoboxReadResponse = (String)infoboxReadResponseParams.get(identifier); + // get the configuration parameters + VerifyInfoboxParameter verifyInfoboxParameter = null; + Object object = infoboxParameters.get(identifier); + // if not present, use default + if ((object == null) && (defaultInfoboxParameters != null)) { + object = defaultInfoboxParameters.get(identifier); + } + if (object != null) { + verifyInfoboxParameter = (VerifyInfoboxParameter)object; + } + if (infoboxReadResponse != null) { + if (verifyInfoboxParameter == null) { + // should not happen because of the pushinfobox mechanism; check it anyway + Logger.error("No validator for verifying \"" + identifier + "\"-infobox configured."); + throw new ValidateException("validator.41", new Object[] {identifier}); + } else { + String friendlyName = verifyInfoboxParameter.getFriendlyName(); + // get the class for validating the infobox + InfoboxValidator infoboxValidator = null; + try { + Class validatorClass = Class.forName(verifyInfoboxParameter.getValidatorClassName()); + infoboxValidator = (InfoboxValidator) validatorClass.newInstance(); + } catch (Exception e) { + Logger.error("Could not load validator class \"" + verifyInfoboxParameter.getValidatorClassName() + + "\" for \"" + identifier + "\"-infobox: " + e.getMessage()); + throw new ValidateException("validator.42", new Object[] {friendlyName}); + } + Logger.debug("Successfully loaded validator class \"" + verifyInfoboxParameter.getValidatorClassName() + + "\" for \"" + identifier + "\"-infobox."); + // parse the infobox read reponse + List infoboxTokenList = null; + try { + infoboxTokenList = + ExtendedInfoboxReadResponseParser.parseInfoboxReadResponse(infoboxReadResponse, friendlyName); + } catch (ParseException e) { + Logger.error("InfoboxReadResponse for \"" + identifier + + "\"-infobox could not be parsed successfully: " + e.getMessage()); + throw new ValidateException("validator.43", new Object[] {friendlyName}); + } + // build the parameters for validating the infobox + InfoboxValidatorParams infoboxValidatorParams = + InfoboxValidatorParamsBuilder.buildInfoboxValidatorParams( + session, verifyInfoboxParameter, infoboxTokenList, hideStammzahl); + // now validate the infobox + InfoboxValidationResult infoboxValidationResult = null; + try { + infoboxValidationResult = infoboxValidator.validate(infoboxValidatorParams); + } 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()}); + } + + Logger.info(identifier + " infobox successfully validated."); + + // get the SAML attributes to be appended to the AUTHBlock or to the final + // SAML Assertion + ExtendedSAMLAttribute[] extendedSAMLAttributes = infoboxValidationResult.getExtendedSamlAttributes(); + if (extendedSAMLAttributes != null) { + int length = extendedSAMLAttributes.length; + for (int i=0; i<CreateXMLSignatureResponse> sent by the + * security layer implementation.
+ *
    + *
  • Validates given <CreateXMLSignatureResponse>
  • + *
  • Parses <CreateXMLSignatureResponse> for error codes
  • + *
  • Parses authentication block enclosed in + * <CreateXMLSignatureResponse>
  • + *
  • Verifies authentication block by calling the MOA SP component
  • + *
  • Creates authentication data
  • + *
  • Creates a corresponding SAML artifact
  • + *
  • Stores authentication data in the authentication data store + * indexed by the SAML artifact
  • + *
  • Deletes authentication session
  • + *
  • Returns the SAML artifact, encoded BASE64
  • + *
+ * + * @param sessionID session ID of the running authentication session + * @param xmlCreateXMLSignatureReadResponse String representation of the + * <CreateXMLSignatureResponse> + * @return SAML artifact needed for retrieving authentication data, encoded BASE64 + */ + public String verifyAuthenticationBlock( + String sessionID, + String xmlCreateXMLSignatureReadResponse) + throws + AuthenticationException, + BuildException, + ParseException, + ConfigurationException, + ServiceException, + ValidateException { + + if (isEmpty(sessionID)) + 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}); + AuthenticationSession session = getSession(sessionID); + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + // parses + 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 + new CreateXMLSignatureResponseValidator().validate(csresp, session); + // builds a for a MOA-SPSS call + 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 vsresp = new VerifyXMLSignatureResponseParser(domVsresp).parseData(); + // validates the + VerifyXMLSignatureResponseValidator.getInstance().validate( + vsresp, + null, + VerifyXMLSignatureResponseValidator.CHECK_AUTH_BLOCK, + false); + + + // TODO See Bug #144 + // Compare AuthBlock Data with information stored in session, especially date and time + + + // compares the public keys from the identityLink with the AuthBlock + VerifyXMLSignatureResponseValidator.getInstance().validateCertificate( + vsresp, + session.getIdentityLink()); + + // builds authentication data and stores it together with a SAML artifact + AuthenticationData authData = buildAuthenticationData(session, vsresp); + String samlArtifact = + new SAMLArtifactBuilder().build(session.getAuthURL(), session.getSessionID()); + storeAuthenticationData(samlArtifact, authData); + // invalidates the authentication session + sessionStore.remove(sessionID); + Logger.info( + "Anmeldedaten zu MOASession " + sessionID + " angelegt, SAML Artifakt " + samlArtifact); + return samlArtifact; + } + /** + * Builds the AuthenticationData object together with the + * corresponding <saml:Assertion> + * @param session authentication session + * @param verifyXMLSigResp VerifyXMLSignatureResponse from MOA-SP + * @return AuthenticationData object + * @throws ConfigurationException while accessing configuration data + * @throws BuildException while building the <saml:Assertion> + */ + private AuthenticationData buildAuthenticationData( + AuthenticationSession session, + VerifyXMLSignatureResponse verifyXMLSigResp) + throws ConfigurationException, BuildException { + + IdentityLink identityLink = session.getIdentityLink(); + AuthenticationData authData = new AuthenticationData(); + OAAuthParameter oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + session.getPublicOAURLPrefix()); + boolean businessService = oaParam.getBusinessService(); + authData.setMajorVersion(1); + authData.setMinorVersion(0); + authData.setAssertionID(Random.nextRandom()); + authData.setIssuer(session.getAuthURL()); + authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance())); + + authData.setIdentificationType(identityLink.getIdentificationType()); + authData.setGivenName(identityLink.getGivenName()); + authData.setFamilyName(identityLink.getFamilyName()); + authData.setDateOfBirth(identityLink.getDateOfBirth()); + authData.setQualifiedCertificate(verifyXMLSigResp.isQualifiedCertificate()); + authData.setPublicAuthority(verifyXMLSigResp.isPublicAuthority()); + authData.setPublicAuthorityCode(verifyXMLSigResp.getPublicAuthorityCode()); + authData.setBkuURL(session.getBkuURL()); + boolean provideStammzahl = oaParam.getProvideStammzahl(); + if (provideStammzahl) { + authData.setIdentificationValue(identityLink.getIdentificationValue()); + } + String prPerson = new PersonDataBuilder().build(identityLink, provideStammzahl); + try { + String signerCertificateBase64 = ""; + if (oaParam.getProvideCertifcate()) { + X509Certificate signerCertificate = verifyXMLSigResp.getX509certificate(); + if (signerCertificate != null) { + signerCertificateBase64 = Base64Utils.encode(signerCertificate.getEncoded()); + } else { + Logger.info("\"provideCertificate\" is \"true\", but no signer certificate available"); + } + } + authData.setSignerCertificate(signerCertificateBase64); + if (businessService) { + authData.setWBPK(identityLink.getIdentificationValue()); + } else { + // only compute bPK if online applcation is a public service + String bpkBase64 = + new BPKBuilder().buildBPK( + identityLink.getIdentificationValue(), + session.getTarget()); + authData.setBPK(bpkBase64); + } + String ilAssertion = + oaParam.getProvideIdentityLink() + ? identityLink.getSerializedSamlAssertion() + : ""; + if (!oaParam.getProvideStammzahl()) { + ilAssertion = StringUtils.replaceAll(ilAssertion, identityLink.getIdentificationValue(), ""); + } + String authBlock = oaParam.getProvideAuthBlock() ? session.getAuthBlock() : ""; + String samlAssertion = + new AuthenticationDataAssertionBuilder().build( + authData, + prPerson, + authBlock, + ilAssertion, + session.getBkuURL(), + signerCertificateBase64, + businessService, + session.getExtendedSAMLAttributesOA()); + authData.setSamlAssertion(samlAssertion); + return authData; + } catch (Throwable ex) { + throw new BuildException( + "builder.00", + new Object[] { "AuthenticationData", ex.toString()}, + ex); + } + } + /** + * Retrieves AuthenticationData indexed by the SAML artifact. + * The AuthenticationData is deleted from the store upon end of this call. + * + * @return AuthenticationData + */ + public AuthenticationData getAuthenticationData(String samlArtifact) + throws AuthenticationException { + String assertionHandle; + try { + assertionHandle = new SAMLArtifactParser(samlArtifact).parseAssertionHandle(); + } catch (ParseException ex) { + throw new AuthenticationException("1205", new Object[] { samlArtifact, ex.toString()}); + } + AuthenticationData authData = null; + synchronized (authenticationDataStore) { + authData = (AuthenticationData) authenticationDataStore.get(assertionHandle); + if (authData == null) { + Logger.error("Assertion not found for SAML Artifact: " + samlArtifact); + throw new AuthenticationException("1206", new Object[] { samlArtifact }); + } + authenticationDataStore.remove(assertionHandle); + } + long now = new Date().getTime(); + if (now - authData.getTimestamp().getTime() > authDataTimeOut) + throw new AuthenticationException("1207", new Object[] { samlArtifact }); + Logger.debug("Assertion delivered for SAML Artifact: " + samlArtifact); + return authData; + } + /** + * Stores authentication data indexed by the assertion handle contained in the + * given saml artifact. + * @param samlArtifact SAML artifact + * @param authData authentication data + * @throws AuthenticationException when SAML artifact is invalid + */ + private void storeAuthenticationData(String samlArtifact, AuthenticationData authData) + throws AuthenticationException { + + try { + SAMLArtifactParser parser = new SAMLArtifactParser(samlArtifact); + // check type code 0x0001 + byte[] typeCode = parser.parseTypeCode(); + if (typeCode[0] != 0 || typeCode[1] != 1) + throw new AuthenticationException("auth.06", new Object[] { samlArtifact }); + String assertionHandle = parser.parseAssertionHandle(); + synchronized (authenticationDataStore) { + Logger.debug("Assertion stored for SAML Artifact: " + samlArtifact); + authenticationDataStore.put(assertionHandle, authData); + } + } catch (AuthenticationException ex) { + throw ex; + } catch (Throwable ex) { + throw new AuthenticationException("auth.06", new Object[] { samlArtifact }); + } + } + /** + * Creates a new session and puts it into the session store. + * + * @param id Session ID + * @return AuthenticationSession created + * @exception AuthenticationException + * thrown when an AuthenticationSession is running + * already for the given session ID + */ + private static AuthenticationSession newSession() throws AuthenticationException { + String sessionID = Random.nextRandom(); + AuthenticationSession newSession = new AuthenticationSession(sessionID); + synchronized (sessionStore) { + AuthenticationSession session = (AuthenticationSession) sessionStore.get(sessionID); + if (session != null) + throw new AuthenticationException("auth.01", new Object[] { sessionID }); + sessionStore.put(sessionID, newSession); + } + return newSession; + } + /** + * Retrieves a session from the session store. + * + * @param id session ID + * @return AuthenticationSession stored with given session ID, + * null if session ID unknown + */ + public static AuthenticationSession getSession(String id) throws AuthenticationException { + AuthenticationSession session = (AuthenticationSession) sessionStore.get(id); + if (session == null) + throw new AuthenticationException("auth.02", new Object[] { id }); + return session; + } + /** + * Cleans up expired session and authentication data stores. + */ + public void cleanup() { + long now = new Date().getTime(); + synchronized (sessionStore) { + Set keys = new HashSet(sessionStore.keySet()); + for (Iterator iter = keys.iterator(); iter.hasNext();) { + String sessionID = (String) iter.next(); + AuthenticationSession session = (AuthenticationSession) sessionStore.get(sessionID); + if (now - session.getTimestampStart().getTime() > sessionTimeOut) { + Logger.info( + MOAIDMessageProvider.getInstance().getMessage( + "cleaner.02", + new Object[] { sessionID })); + sessionStore.remove(sessionID); + } + } + } + synchronized (authenticationDataStore) { + Set keys = new HashSet(authenticationDataStore.keySet()); + for (Iterator iter = keys.iterator(); iter.hasNext();) { + String samlArtifact = (String) iter.next(); + AuthenticationData authData = + (AuthenticationData) authenticationDataStore.get(samlArtifact); + if (now - authData.getTimestamp().getTime() > authDataTimeOut) { + Logger.info( + MOAIDMessageProvider.getInstance().getMessage( + "cleaner.03", + new Object[] { samlArtifact })); + authenticationDataStore.remove(samlArtifact); + } + } + } + } + + /** + * Sets the sessionTimeOut. + * @param seconds Time out of the session in seconds + */ + public void setSecondsSessionTimeOut(long seconds) { + sessionTimeOut = 1000 * seconds; + } + /** + * Sets the authDataTimeOut. + * @param seconds Time out for signing AuthData in seconds + */ + public void setSecondsAuthDataTimeOut(long seconds) { + authDataTimeOut = 1000 * seconds; + } + + /** + * 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; + } + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java new file mode 100644 index 000000000..7e5ed6ec7 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationSessionCleaner.java @@ -0,0 +1,52 @@ +package at.gv.egovernment.moa.id.auth; + +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Thread cleaning the AuthenticationServer session store + * and authentication data store from garbage. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationSessionCleaner implements Runnable { + + /** interval the AuthenticationSessionCleaner is run in */ + private static final long SESSION_CLEANUP_INTERVAL = 30 * 60; // 30 min + + /** + * Runs the thread. Cleans the AuthenticationServer session store + * and authentication data store from garbage, then sleeps for given interval, and restarts. + */ + public void run() { + while (true) { + try { + Logger.debug("AuthenticationSessionCleaner run"); + AuthenticationServer.getInstance().cleanup(); + } + catch (Exception e) { + Logger.error(MOAIDMessageProvider.getInstance().getMessage("cleaner.01", null), e); + } + try { + Thread.sleep(SESSION_CLEANUP_INTERVAL * 1000); + } + catch (InterruptedException e) { + } + } + } + + /** + * start the sessionCleaner + */ + public static void start() { + // start the session cleanup thread + Thread sessionCleaner = + new Thread(new AuthenticationSessionCleaner()); + sessionCleaner.setName("SessionCleaner"); + sessionCleaner.setDaemon(true); + sessionCleaner.setPriority(Thread.MIN_PRIORITY); + sessionCleaner.start(); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java new file mode 100644 index 000000000..43e88e7b5 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java @@ -0,0 +1,75 @@ +package at.gv.egovernment.moa.id.auth; + +import iaik.asn1.ObjectID; + + +/** + * Constants used throughout moa-id-auth component. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public interface MOAIDAuthConstants { + + /** servlet parameter "Target" */ + public static final String PARAM_TARGET = "Target"; + /** servlet parameter "OA" */ + public static final String PARAM_OA = "OA"; + /** servlet parameter "bkuURI" */ + public static final String PARAM_BKU = "bkuURI"; + /** servlet parameter "BKUSelectionTemplate" */ + public static final String PARAM_BKUTEMPLATE = "BKUSelectionTemplate"; + /** default BKU URL */ + public static final String DEFAULT_BKU = "http://localhost:3495/http-security-layer-request"; + /** servlet parameter "returnURI" */ + public static final String PARAM_RETURN = "returnURI"; + /** servlet parameter "Template" */ + public static final String PARAM_TEMPLATE = "Template"; + /** servlet parameter "MOASessionID" */ + public static final String PARAM_SESSIONID = "MOASessionID"; + /** servlet parameter "XMLResponse" */ + public static final String PARAM_XMLRESPONSE = "XMLResponse"; + /** servlet parameter "SAMLArtifact" */ + public static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; + /** Request name {@link at.gv.egovernment.moa.id.auth.servlet.StartAuthenticationServlet} is mapped to */ + public static final String REQ_START_AUTHENTICATION = "StartAuthentication"; + /** Request name {@link at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet} is mapped to */ + public static final String REQ_VERIFY_IDENTITY_LINK = "VerifyIdentityLink"; + /** Request name {@link at.gv.egovernment.moa.id.auth.servlet.VerifyAuthenticationBlockServlet} is mapped to */ + public static final String REQ_VERIFY_AUTH_BLOCK = "VerifyAuthBlock"; + /** Logging hierarchy used for controlling debug output of XML structures to files */ + public static final String DEBUG_OUTPUT_HIERARCHY = "moa.id.auth"; + /** Header Name for controlling the caching mechanism of the browser */ + public static final String HEADER_EXPIRES = "Expires"; + /** Header Value for controlling the caching mechanism of the browser */ + public static final String HEADER_VALUE_EXPIRES = "Sat, 6 May 1995 12:00:00 GMT"; + /** Header Name for controlling the caching mechanism of the browser */ + public static final String HEADER_PRAGMA = "Pragma"; + /** Header Value for controlling the caching mechanism of the browser */ + public static final String HEADER_VALUE_PRAGMA = "no-cache"; + /** Header Name for controlling the caching mechanism of the browser */ + public static final String HEADER_CACHE_CONTROL = "Cache-control"; + /** Header Value for controlling the caching mechanism of the browser */ + public static final String HEADER_VALUE_CACHE_CONTROL = "no-store, no-cache, must-revalidate"; + /** Header Value for controlling the caching mechanism of the browser */ + public static final String HEADER_VALUE_CACHE_CONTROL_IE = "post-check=0, pre-check=0"; + /** + * the identity link signer X509Subject names of those identity link signer certificates + * not including the identity link signer OID. The authorisation for signing the identity + * link must be checked by using their issuer names. After february 19th 2007 the OID of + * the certificate will be used fo checking the authorisation for signing identity links. + */ + public static final String[] IDENTITY_LINK_SIGNERS_WITHOUT_OID = + new String[] {"T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitgieds der Datenschutzkommission", + "T=Dr.,CN=Nikolaus Schwab,O=BM f. Inneres i.A. des gf. Mitglieds der Datenschutzkommission"}; + /** + * the number of the certifcate extension "Eigenschaft zur Ausstellung von Personenbindungen" + */ + public static final String IDENTITY_LINK_SIGNER_OID_NUMBER = "1.2.40.0.10.1.7.1"; + /** + * the OID of the identity link signer certificate (Eigenschaft zur Ausstellung von Personenbindungen); + * used for checking the authorisation for signing the identity link for identity links signed after february 19th 2007 + */ + public static final ObjectID IDENTITY_LINK_SIGNER_OID = new ObjectID(IDENTITY_LINK_SIGNER_OID_NUMBER); + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java new file mode 100644 index 000000000..7964e2fb6 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java @@ -0,0 +1,163 @@ +package at.gv.egovernment.moa.id.auth; + +import iaik.pki.PKIException; +import iaik.pki.jsse.IAIKX509TrustManager; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.Properties; + +import javax.activation.CommandMap; +import javax.activation.MailcapCommandMap; +import javax.mail.Session; +import javax.net.ssl.SSLSocketFactory; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; +import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; +import at.gv.egovernment.moa.util.Constants; + +/** + * Web application initializer + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class MOAIDAuthInitializer { + + /** a boolean identifying if the MOAIDAuthInitializer has been startet */ + public static boolean initialized = false; + + /** + * Initializes the web application components which need initialization: + * logging, JSSE, MOA-ID Auth configuration, Axis, session cleaner. + */ + public static void initialize() throws ConfigurationException, + PKIException, IOException, GeneralSecurityException { + if (initialized) return; + initialized = true; + Logger.setHierarchy("moa.id.auth"); + Logger.info("Default java file.encoding: " + + System.getProperty("file.encoding")); + + //JDK bug workaround according to: + // http://jce.iaik.tugraz.at/products/03_cms/faq/index.php#JarVerifier + // register content data handlers for S/MIME types + MailcapCommandMap mc = new MailcapCommandMap(); + CommandMap.setDefaultCommandMap(mc); + + // create some properties and get the default Session + Properties props = new Properties(); + props.put("mail.smtp.host", "localhost"); + Session session = Session.getDefaultInstance(props, null); + + // Restricts TLS cipher suites + System.setProperty( + "https.cipherSuites", + "SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_3DES_EDE_CBC_SHA"); + // load some jsse classes so that the integrity of the jars can be + // verified + // before the iaik jce is installed as the security provider + // this workaround is only needed when sun jsse is used in conjunction + // with + // iaik-jce (on jdk1.3) + ClassLoader cl = MOAIDAuthInitializer.class.getClassLoader(); + try { + cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar + } catch (ClassNotFoundException e) { + Logger.warn(MOAIDMessageProvider.getInstance().getMessage( + "init.01", null), e); + } + + // Initializes SSLSocketFactory store + SSLUtils.initialize(); + + // Initializes Namespace Map + Constants.nSMap.put(Constants.SAML_PREFIX, Constants.SAML_NS_URI); + Constants.nSMap.put(Constants.ECDSA_PREFIX, + "http://www.w3.org/2001/04/xmldsig-more#"); + Constants.nSMap.put(Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); + + // Loads the configuration + AuthConfigurationProvider authConf = AuthConfigurationProvider.reload(); + ConnectionParameter moaSPConnParam = authConf + .getMoaSpConnectionParameter(); + + // If MOA-SP API calls: loads MOA-SP configuration and configures IAIK + if (moaSPConnParam == null) { + try { + LoggingContextManager.getInstance().setLoggingContext( + new LoggingContext("startup")); + ConfigurationProvider config = ConfigurationProvider + .getInstance(); + new IaikConfigurator().configure(config); + } catch (at.gv.egovernment.moa.spss.server.config.ConfigurationException ex) { + throw new ConfigurationException("config.10", new Object[] { ex + .toString() }, ex); + } + } + + // Initializes IAIKX509TrustManager logging + String log4jConfigURL = System.getProperty("log4j.configuration"); + if (log4jConfigURL != null) { + IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); + } + + // Initializes the Axis secure socket factory for use in calling the + // MOA-SP web service + if (moaSPConnParam != null && moaSPConnParam.isHTTPSURL()) { + SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(authConf, + moaSPConnParam); + AxisSecureSocketFactory.initialize(ssf); + } + + // sets the authentication session and authentication data time outs + String param = authConf + .getGenericConfigurationParameter(AuthConfigurationProvider.AUTH_SESSION_TIMEOUT_PROPERTY); + if (param != null) { + long sessionTimeOut = 0; + try { + sessionTimeOut = new Long(param).longValue(); + } catch (NumberFormatException ex) { + Logger + .error(MOAIDMessageProvider + .getInstance() + .getMessage( + "config.05", + new Object[] { AuthConfigurationProvider.AUTH_SESSION_TIMEOUT_PROPERTY })); + } + if (sessionTimeOut > 0) + AuthenticationServer.getInstance() + .setSecondsSessionTimeOut(sessionTimeOut); + } + param = authConf + .getGenericConfigurationParameter(AuthConfigurationProvider.AUTH_DATA_TIMEOUT_PROPERTY); + if (param != null) { + long authDataTimeOut = 0; + try { + authDataTimeOut = new Long(param).longValue(); + } catch (NumberFormatException ex) { + Logger + .error(MOAIDMessageProvider + .getInstance() + .getMessage( + "config.05", + new Object[] { AuthConfigurationProvider.AUTH_DATA_TIMEOUT_PROPERTY })); + } + if (authDataTimeOut > 0) + AuthenticationServer.getInstance() + .setSecondsAuthDataTimeOut(authDataTimeOut); + } + + } + +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/WrongParametersException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/WrongParametersException.java new file mode 100644 index 000000000..3ce2798ea --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/WrongParametersException.java @@ -0,0 +1,21 @@ +package at.gv.egovernment.moa.id.auth; + +import at.gv.egovernment.moa.id.MOAIDException; + +/** + * Exception thrown when the AuthenticationServer API is + * called with wrong parameters provided. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class WrongParametersException extends MOAIDException { + + /** + * Constructor + */ + public WrongParametersException(String call, String parameter) { + super("auth.05", new Object[] {call, parameter}); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java new file mode 100644 index 000000000..241cf0afc --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java @@ -0,0 +1,88 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.io.IOException; +import java.text.MessageFormat; +import java.util.Iterator; +import java.util.List; + +import javax.xml.transform.TransformerException; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * Base class for building authentication the AUTHBlock and final OA data SAML assertions. + * Encapsulates methods used by the two specific builders + * {@link at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder AuthenticationBlockAssertionBuilder} + * and + * {@link at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder AuthenticationDataAssertionBuilder} + * + * @author Harald Bratko + */ +public class AuthenticationAssertionBuilder { + + /** the NewLine representation in Java*/ + protected static String NL = "\n"; + + protected static String SAML_ATTRIBUTE = + " " + NL + + " {2}" + NL + + " "+ NL; + + /** + * Empty constructor + */ + public AuthenticationAssertionBuilder() { + } + + /** + * Builds the SAML attributes to be appended to the AUTHBlock or to the SAML assertion + * delivered to the online application. + * The method traverses through the list of given SAML attribute objects and builds an + * XML structure (String representation) for each of the attributes. + * + * @param extendedSAMLAttributes The SAML attributes to be appended to the AUTHBlock or + * to the SAML assertion delivered to the online application. + * @return A string representation including the XML structures of + * the SAML attributes. + * + * @throws ParseException If an error occurs on serializing an SAML attribute. + */ + protected String buildExtendedSAMLAttributes(List extendedSAMLAttributes) throws ParseException + { + StringBuffer sb = new StringBuffer(); + if (extendedSAMLAttributes!=null) { + Iterator it = extendedSAMLAttributes.iterator(); + while (it.hasNext()) { + ExtendedSAMLAttribute extendedSAMLAttribute = (ExtendedSAMLAttribute)it.next(); + Object value = extendedSAMLAttribute.getValue(); + String name = extendedSAMLAttribute.getName(); + String namespace = extendedSAMLAttribute.getNameSpace(); + if (value instanceof String) { + sb.append(MessageFormat.format( SAML_ATTRIBUTE, new Object[] {name, namespace, value})); + } else if (value instanceof Element) { + try { + String serializedValue = DOMUtils.serializeNode((Element)(value)); + serializedValue = StringUtils.removeXMLDeclaration(serializedValue); + sb.append(MessageFormat.format( SAML_ATTRIBUTE, new Object[] {name, namespace, serializedValue})); + } catch (TransformerException e) { + Logger.error("Error on serializing SAML attribute \"" + name + + " (namespace: \"" + namespace + "\"."); + throw new ParseException("parser.05", new Object[] { name, namespace}); + } catch (IOException e) { + Logger.error("Error on serializing SAML attribute \"" + name + + " (namespace: \"" + namespace + "\"."); + throw new ParseException("parser.05", new Object[] { name, namespace}); + } + } + } + } + return sb.toString(); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java new file mode 100644 index 000000000..60cd11ed6 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java @@ -0,0 +1,146 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.text.MessageFormat; +import java.util.List; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; + +/** + * Builder for the authentication block <saml:Assertion> + * to be included in a <CreateXMLSignatureResponse>. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertionBuilder implements Constants { + + /** template for the Auth-Block */ + private static String AUTH_BLOCK = + "" + NL + + " " + NL + + " " + NL + + " {3}" + NL + + " " + NL + + "{4}" + + " " + NL + + " {5}" + NL + + " " + NL + + " " + NL + + " {6}" + NL + + " " + NL + + "{7}" + + " " + NL + + ""; + + private static String GESCHAEFTS_BEREICH_ATTRIBUTE = + " " + NL + + " {0}" + NL + + " " + NL; + + private static String WBPK_ATTRIBUTE = + " " + NL + + " " + NL + + " " + NL + + " {0}" + NL + + " {1}" + NL + + " " + NL + + " " + NL + + " " + NL; + + /** + * The number of SAML attributes included in this AUTH-Block (without the extended SAML attributes). + */ + public static final int NUM_OF_SAML_ATTRIBUTES = 3; + + /** + * Constructor for AuthenticationBlockAssertionBuilder. + */ + public AuthenticationBlockAssertionBuilder() { + super(); + } + + /** + * Builds the authentication block <saml:Assertion> + * + * @param issuer authentication block issuer; "GivenName FamilyName" + * @param issueInstant current timestamp + * @param authURL URL of MOA-ID authentication component + * @param target "Geschäftsbereich"; maybe null if the application + * is a business application + * @param identityLinkValue the content of the <pr:Value> + * child element of the <pr:Identification> + * element derived from the Identitylink; this is the + * value of the wbPK; + * maybe null if the application is a public service + * @param identityLinkType the content of the <pr:Type> + * child element of the <pr:Identification> + * element derived from the Identitylink; this includes the + * URN prefix and the identification number of the business + * application used as input for wbPK computation; + * maybe null if the application is a public service + * @param oaURL public URL of online application requested + * @param gebDat The date of birth from the identity link. + * @param extendedSAMLAttributes The SAML attributes to be appended to the AUTHBlock. + * + * @return String representation of authentication block + * <saml:Assertion> built + * + * @throws BuildException If an error occurs on serializing an extended SAML attribute + * to be appended to the AUTH-Block. + */ + public String buildAuthBlock( + String issuer, + String issueInstant, + String authURL, + String target, + String identityLinkValue, + String identityLinkType, + String oaURL, + String gebDat, + List extendedSAMLAttributes, + AuthenticationSession session) + throws BuildException + { + session.setSAMLAttributeGebeORwbpk(true); + String gebeORwbpk = ""; + String wbpkNSDeclaration = ""; + if (target == null) { + // OA is a business application + if (!Constants.URN_PREFIX_HPI.equals(identityLinkType)) { + // Only add wbPKs to AUTH-Block. HPIs can be added to the AUTH-Block by the corresponding Validator + gebeORwbpk = MessageFormat.format(WBPK_ATTRIBUTE, new Object[] { identityLinkValue, identityLinkType }); + wbpkNSDeclaration = " xmlns:pr=\"" + PD_NS_URI + "\""; + } else { + // We do not have a wbPK, therefore no SAML-Attribute is provided + session.setSAMLAttributeGebeORwbpk(false); + } + } else { + gebeORwbpk = MessageFormat.format(GESCHAEFTS_BEREICH_ATTRIBUTE, new Object[] { target }); + } + + String assertion; + try { + assertion = MessageFormat.format( + AUTH_BLOCK, new Object[] { + wbpkNSDeclaration, + issuer, + issueInstant, + authURL, + gebeORwbpk, + oaURL, + gebDat, + buildExtendedSAMLAttributes(extendedSAMLAttributes)}); + } catch (ParseException e) { + Logger.error("Error on building AUTH-Block: " + e.getMessage()); + throw new BuildException("builder.00", new Object[] { "AUTH-Block", e.toString()}); + } + + return assertion; + + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java new file mode 100644 index 000000000..53520c846 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java @@ -0,0 +1,156 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.text.MessageFormat; +import java.util.List; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * Builder for the authentication data <saml:Assertion> + * to be provided by the MOA ID Auth component. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionBuilder implements Constants { + /** private static String NL contains the NewLine representation in Java*/ + private static final String NL = "\n"; + /** + * XML template for the <saml:Assertion> to be built + */ + private static final String AUTH_DATA = + "" + NL + + "" + NL + + " " + NL + + " " + NL + + " {4}" + NL + + " " + NL + + " " + MOA_NS_URI + "cm" + NL + + " {5}{6}" + NL + + " " + NL + + " " + NL + + " " + NL + + " {7}" + NL + + " " + NL + + " " + NL + + " {8}" + NL + + " " + NL + + " " + NL + + " {9}" + NL + + " " + NL + + "{10}" + + "{11}" + + "{12}" + + " " + NL + + ""; + /** + * XML template for the <saml:Attribute> named "isPublicAuthority", + * to be inserted into the <saml:Assertion> + */ + private static final String PUBLIC_AUTHORITY_ATT = + " " + NL + + " {0}" + NL + + " " + NL; + + private static final String SIGNER_CERTIFICATE_ATT = + " " + NL + + " {0}" + NL + + " " + NL; + + /** + * Constructor for AuthenticationDataAssertionBuilder. + */ + public AuthenticationDataAssertionBuilder() { + super(); + } + + /** + * Builds the authentication data <saml:Assertion>. + * + * @param authData the AuthenticationData to build the + * <saml:Assertion> from + * @param xmlPersonData lt;pr:Person> element as a String + * @param xmlAuthBlock authentication block to be included in a + * lt;saml:SubjectConfirmationData> element; may include + * the "Stammzahl" or not; may be empty + * @param xmlIdentityLink the IdentityLink + * @param signerCertificateBase64 Base64 encoded certificate of the signer. Maybe + * an empty string if the signer certificate should not be provided. + * Will be ignored if the businessService parameter is + * set to false. + * @param businessService true if the online application is a + * business service, otherwise false + * @return the <saml:Assertion> + * @throws BuildException if an error occurs during the build process + */ + public String build( + AuthenticationData authData, + String xmlPersonData, + String xmlAuthBlock, + String xmlIdentityLink, + String bkuURL, + String signerCertificateBase64, + boolean businessService, + List extendedSAMLAttributes) + throws BuildException + { + + String isQualifiedCertificate = authData.isQualifiedCertificate() ? "true" : "false"; + String publicAuthorityAttribute = ""; + if (authData.isPublicAuthority()) { + String publicAuthorityIdentification = authData.getPublicAuthorityCode(); + if (publicAuthorityIdentification == null) + publicAuthorityIdentification = "True"; + publicAuthorityAttribute = MessageFormat.format( + PUBLIC_AUTHORITY_ATT, new Object[] { publicAuthorityIdentification }); + } + + + String signerCertificateAttribute = ""; + if (signerCertificateBase64 != "") { + signerCertificateAttribute = MessageFormat.format( + SIGNER_CERTIFICATE_ATT, new Object[] { signerCertificateBase64 }); + } + + String pkType; + String pkValue; + if (businessService) { + pkType = authData.getIdentificationType(); + pkValue = authData.getWBPK(); + + } else { + pkType = URN_PREFIX_BPK; + pkValue = authData.getBPK(); + } + + String assertion; + try { + assertion = MessageFormat.format(AUTH_DATA, new Object[] { + authData.getAssertionID(), + authData.getIssuer(), + authData.getIssueInstant(), + pkType, + pkValue, + StringUtils.removeXMLDeclaration(xmlAuthBlock), + StringUtils.removeXMLDeclaration(xmlIdentityLink), + StringUtils.removeXMLDeclaration(xmlPersonData), + isQualifiedCertificate, + bkuURL, + publicAuthorityAttribute, + signerCertificateAttribute, + buildExtendedSAMLAttributes(extendedSAMLAttributes)}); + } catch (ParseException e) { + Logger.error("Error on building Authentication Data Assertion: " + e.getMessage()); + throw new BuildException("builder.00", new Object[] { "Authentication Data Assertion", e.toString()}); + } + return assertion; + } + +} 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 new file mode 100644 index 000000000..6cc8c1be8 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java @@ -0,0 +1,49 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.security.MessageDigest; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; + +/** + * Builder for the bPK, as defined in + * "Ableitung f¨r die bereichsspezifische Personenkennzeichnung" + * version 1.0.1 from "reference.e-government.gv.at". + * + * @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}); + } + String 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); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/Builder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/Builder.java new file mode 100644 index 000000000..3a2ee07de --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/Builder.java @@ -0,0 +1,59 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * Base class for HTML/XML builders providing commonly useful functions. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class Builder { + + /** + * Replaces a given number of occurences of a special tag in an XML or HTML template by a value. + * @param template html template + * @param tag special tag + * @param value value replacing the tag + * @param expected specifies if the tag is expected to present; if true and the tag + * is not present, an exception is thrown; if false and the tag is + * not present, the original string is returned + * @param maxreplacements Set -1 to replace each occurence of tag, or limit replacements by a given positive number + * @return XML or HTML code, the tag replaced + * @throws BuildException when template does not contain the tag + */ + protected String replaceTag( + String template, + String tag, + String value, + boolean expected, + int maxreplacements) + throws BuildException + { + String result = template; + int index = result.indexOf(tag); + if (index < 0) { + if (expected) { + // Substring not found but should + throw new BuildException( + "builder.01", + new Object[] {"<" + tag.substring(1, tag.length() - 1) + ">"}); + } + } else { + // replace each occurence + if (maxreplacements == -1) { + return StringUtils.replaceAll(template, tag, value); + } else { + int found = 1; + while (index > -1 && (found <= maxreplacements)) { + result = result.substring(0, index) + value + result.substring(index + tag.length()); + index = result.indexOf(tag); + if (index > -1) found += 1; + } + } + } + return result; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java new file mode 100644 index 000000000..06c81f49e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CertInfoVerifyXMLSignatureRequestBuilder.java @@ -0,0 +1,84 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.io.IOException; +import java.text.MessageFormat; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.FileUtils; + +/** + * Builder for the <VerifyXMLSignatureRequest> structure + * used for presenting certificate information in the secure viewer of the security layer implementation. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class CertInfoVerifyXMLSignatureRequestBuilder extends Builder implements Constants { + + /** special tag in the VerifyXMLRequest template to be substituted for a <dsig:Signature> */ + private static final String SIGNATURE_TAG = ""; + + /** private static String nl contains the NewLine representation in Java*/ + private static final String nl = "\n"; + + /** + * XML template for the CertInfoVerifyXMLSignatureRequest to be built + */ + static final String CERTINFO_REQUEST = + "" + nl + + "<{0}:VerifyXMLSignatureRequest {2} xmlns:dsig=\"" + DSIG_NS_URI + "\">" + nl + + " <{0}:SignatureInfo>" + nl + + " <{0}:SignatureEnvironment>" + nl + + " <{1}:XMLContent xml:space=\"preserve\">" + nl + + " " + nl + + " <{0}:SignatureLocation>//dsig:Signature" + nl + + " " + nl + + ""; + + /** + * Constructor + */ + public CertInfoVerifyXMLSignatureRequestBuilder() { + super(); + } + /** + * Builds the <VerifyXMLSignatureRequest> structure. + * @return the XML structure + * @throws BuildException + */ + public String build(boolean slVersion12) throws BuildException { + + String sl10Prefix; + String sl11Prefix; + String slNsDeclaration; + + if (slVersion12) { + + sl10Prefix = SL12_PREFIX; + sl11Prefix = SL12_PREFIX; + slNsDeclaration = "xmlns:" + SL12_PREFIX + "=\"" + SL12_NS_URI + "\""; + + } else { + + sl10Prefix = SL10_PREFIX; + sl11Prefix = SL11_PREFIX; + slNsDeclaration = "xmlns:" + sl11Prefix + "=\"" + SL11_NS_URI + "\" xmlns:" + sl10Prefix + "=\"" + SL10_NS_URI + "\""; + + } + + String certInfoRequest = MessageFormat.format(CERTINFO_REQUEST, new Object[] {sl11Prefix, sl10Prefix, slNsDeclaration}); + String resDsigSignature = "resources/xmldata/CertInfoDsigSignature.xml"; + + + try { + String dsigSignature = FileUtils.readResource(resDsigSignature, "UTF-8"); + certInfoRequest = replaceTag(certInfoRequest, SIGNATURE_TAG, dsigSignature, true, 1); + return certInfoRequest; + } + catch (IOException ex) { + throw new BuildException("auth.04", new Object[] {resDsigSignature, ex.toString()}); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java new file mode 100644 index 000000000..e9a9f308d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureRequestBuilder.java @@ -0,0 +1,93 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.text.MessageFormat; + +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * Builder for the <CreateXMLSignatureRequest> structure + * used for requesting a signature under the authentication block from the + * security layer implementation. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class CreateXMLSignatureRequestBuilder implements Constants { + /** private static String nl contains the NewLine representation in Java*/ + private static final String nl = "\n"; + /** + * XML template for the <moa:CreateXMLSignatureRequest> to be built + */ + private static final String CREATE_XML_SIGNATURE_REQUEST = + "" + nl + + "<{3}:CreateXMLSignatureRequest xmlns:dsig=''" + DSIG_NS_URI + "'' {5}>" + nl + + " <{3}:KeyboxIdentifier>{1}" + nl + + " <{3}:DataObjectInfo Structure=''detached''>" + nl + + " <{4}:DataObject Reference=''''/>" + nl + + "{2}" + + " " + nl + + " <{3}:SignatureInfo>" + nl + + " <{3}:SignatureEnvironment>" + nl + + " <{4}:XMLContent>{0}" + nl + + " " + nl + + " <{3}:SignatureLocation Index=''2''>/saml:Assertion" + nl + + " " + nl + + ""; + + + /** + * Constructor for CreateXMLSignatureRequestBuilder. + */ + public CreateXMLSignatureRequestBuilder() { + super(); + } + + /** + * Builds the <CreateXMLSignatureRequest>. + * + * @param authBlock String representation of XML authentication block + * @param keyBoxIdentifier the key box identifier which will be used (e.g. CertifiedKeypair) + * @param slVersion12 specifies whether the Security Layer version number is 1.2 or not + * @return String representation of <CreateXMLSignatureRequest> + */ + public String build(String authBlock, String keyBoxIdentifier, String[] dsigTransformInfos, boolean slVersion12) { + + String sl10Prefix; + String sl11Prefix; + String slNsDeclaration; + + String dsigTransformInfosString = ""; + for (int i = 0; i < dsigTransformInfos.length; i++) { + dsigTransformInfosString += dsigTransformInfos[i]; + } + + if (slVersion12) { + + // replace the SecurityLayer namespace prefixes and URIs within the transforms + dsigTransformInfosString = StringUtils.changeSLVersion(dsigTransformInfosString, + SL10_PREFIX, SL12_PREFIX, + SL10_NS_URI, SL12_NS_URI); + sl10Prefix = SL12_PREFIX; + sl11Prefix = SL12_PREFIX; + slNsDeclaration = "xmlns:" + SL12_PREFIX + "='" + SL12_NS_URI + "'"; + + } else { + + sl10Prefix = SL10_PREFIX; + sl11Prefix = SL11_PREFIX; + slNsDeclaration = "xmlns:" + sl10Prefix + "='" + SL10_NS_URI + "' xmlns:" + sl11Prefix + "='" + SL11_NS_URI + "'"; + + } + + String request = MessageFormat.format( + CREATE_XML_SIGNATURE_REQUEST, new Object[] { authBlock, + keyBoxIdentifier, + dsigTransformInfosString, + sl11Prefix, + sl10Prefix, + slNsDeclaration }); + + return request; + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java new file mode 100644 index 000000000..30cc1df5a --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java @@ -0,0 +1,83 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; +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; + +/** + * Builds a DataURL parameter meant for the security layer implementation + * to respond to. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class DataURLBuilder { + + /** + * Constructor for DataURLBuilder. + */ + public DataURLBuilder() { + super(); + } + + /** + * Constructs a data URL for VerifyIdentityLink or VerifyAuthenticationBlock, + * including the MOASessionID as a parameter. + * + * @param authBaseURL base URL (context path) of the MOA ID Authentication component, + * including a trailing '/' + * @param authServletName request part of the data URL + * @param sessionID sessionID to be included in the dataURL + * @return String + */ + public String buildDataURL(String authBaseURL, String authServletName, String sessionID) { + + String individualDataURLPrefix = null; + String dataURL; + try { + //check if an individual prefix is configured + individualDataURLPrefix = AuthConfigurationProvider.getInstance(). + getGenericConfigurationParameter(AuthConfigurationProvider.INDIVIDUAL_DATA_URL_PREFIX); + + if (null != individualDataURLPrefix) { + + //check individualDataURLPrefix + if(!individualDataURLPrefix.startsWith("http")) + throw(new ConfigurationException("config.13", new Object[] { individualDataURLPrefix})); + + //when ok then use it + dataURL = individualDataURLPrefix + authServletName; + } else + dataURL = authBaseURL + authServletName; + + } catch (ConfigurationException e) { + Logger.warn(e); + Logger.warn(MOAIDMessageProvider.getInstance().getMessage("config.12", new Object[] { authBaseURL } )); + dataURL = authBaseURL + authServletName; + } + + dataURL = addParameter(dataURL, AuthServlet.PARAM_SESSIONID, sessionID); + return dataURL; + } + + /** + * Method addParameter. + * @param urlString represents the url + * @param paramname is the parameter to be added + * @param value is the value of that parameter + * @return String + */ + private String addParameter(String urlString, String paramname, String value) { + String url = urlString; + if (paramname != null) { + if (url.indexOf("?") < 0) + url += "?"; + else + url += "&"; + url += paramname + "=" + value; + } + return url; + } +} 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 new file mode 100644 index 000000000..0d0595b69 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java @@ -0,0 +1,150 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; + +import at.gv.egovernment.moa.id.BuildException; + +/** + * Builder for HTML form requesting the security layer implementation + * to get the identity link from smartcard by a <InfoboxReadRequest>. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class GetIdentityLinkFormBuilder extends Builder { + /** private static String NL contains the NewLine representation in Java*/ + private static final String nl = "\n"; + /** special tag in the HTML template to be substituted for the BKU URL */ + private static final String BKU_TAG = ""; + /** special tag in the HTML template to be substituted for the XML request */ + private static final String XMLREQUEST_TAG = ""; + /** special tag in the HTML template to be substituted for the data URL */ + private static final String DATAURL_TAG = ""; + /** special tag in the HTML template to be substituted for certificate info XML request */ + private static final String CERTINFO_XMLREQUEST_TAG = ""; + /** special tag in the HTML template to be substituted for the certificate info data URL */ + private static final String CERTINFO_DATAURL_TAG = ""; + /** special tag in the HTML template to be substituted for the infoboxes to be pushed from the BKU */ + private static final String PUSHINFOBOX_TAG = ""; + /** private static int all contains the representation to replace all tags*/ + private static final int ALL = -1; + + /** default HTML template */ + private static final String DEFAULT_HTML_TEMPLATE = + "" + nl + + "" + nl + + "" + nl + + "Anmeldung mit Bürgerkarte" + nl + + "" + nl + + "" + nl + + "
" + nl + + " " + nl + + " " + nl + + " " + nl + + " " + nl + + "
" + nl + + "
" + nl + + " " + nl + + " " + nl + +// " " + nl + + " " + nl + + "
" + nl + + "" + nl + + ""; + + /** + * Constructor for GetIdentityLinkFormBuilder. + */ + public GetIdentityLinkFormBuilder() { + super(); + } + /** + * Builds the HTML form, including XML Request and data URL as parameters. + * + * @param htmlTemplate template to be used for the HTML form; + * may be null, in this case a default layout will be produced + * @param xmlRequest XML Request to be sent as a parameter in the form + * @param bkuURL URL of the "Bürgerkartenumgebung" the form will be submitted to; + * may be null, in this case the default URL will be used + * @param dataURL DataURL to be sent as a parameter in the form + */ + public String build( + String htmlTemplate, + String bkuURL, + String xmlRequest, + String dataURL, + String certInfoXMLRequest, + String certInfoDataURL, + String pushInfobox) + throws BuildException + { + String htmlForm = htmlTemplate == null ? DEFAULT_HTML_TEMPLATE : htmlTemplate; +// String bku = bkuURL == null ? DEFAULT_BKU : bkuURL; + htmlForm = replaceTag(htmlForm, BKU_TAG, bkuURL, true, ALL); + htmlForm = replaceTag(htmlForm, XMLREQUEST_TAG, encodeParameter(xmlRequest), true, ALL); + htmlForm = replaceTag(htmlForm, DATAURL_TAG, dataURL, true, ALL); + htmlForm = replaceTag(htmlForm, PUSHINFOBOX_TAG, pushInfobox, false, ALL); +//new:wird oben mitreplaced htmlForm = replaceTag(htmlForm, BKU_TAG, bkuURL); + htmlForm = replaceTag(htmlForm, CERTINFO_XMLREQUEST_TAG, encodeParameter(certInfoXMLRequest), true, ALL); + htmlForm = replaceTag(htmlForm, CERTINFO_DATAURL_TAG, certInfoDataURL, true, ALL); + return htmlForm; + } + /** + * Encodes a string for inclusion as a parameter in the form. + * Double quotes are substituted by "&quot;". + * @param s the string to be encoded + * @return the string encoded + * @throws BuildException on any exception encountered + */ + public static String encodeParameter(String s) throws BuildException { + StringReader in = new StringReader(s); + StringWriter out = new StringWriter(); + try { + for (int ch = in.read(); ch >= 0; ch = in.read()) { + if (ch == '"') + out.write("""); + else if (ch == '<') + out.write("<"); + else if (ch == '>') + out.write(">"); + else if (ch == 'ä') + out.write("ä"); + else if (ch == 'ö') + out.write("ö"); + else if (ch == 'ü') + out.write("ü"); + else if (ch == 'Ä') + out.write("Ä"); + else if (ch == 'Ö') + out.write("Ö"); + else if (ch == 'Ü') + out.write("Ü"); + else if (ch == 'ß') + out.write("ß"); + else + out.write(ch); + } + } + catch (IOException ex) { + throw new BuildException("builder.00", new Object[] {"GetIdentityLinkForm", ex.toString()}); + } + return out.toString(); + } + +} 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 new file mode 100644 index 000000000..c2bafe43b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilder.java @@ -0,0 +1,86 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.util.Constants; + +/** + * Builder for the <InfoboxReadRequest> 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 <InfoboxReadRequest>. + * + * @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 null if the OA + * is a public service; must not be null + * if the OA is a business service + * + * @return <InfoboxReadRequest> as String + */ + public String build(boolean slVersion12, boolean businessService, String identityLinkDomainIdentifier) { + + String slPrefix; + String slNsDeclaration; + + if (slVersion12) { + slPrefix = SL12_PREFIX; + slNsDeclaration = SL12_NS_URI; + } else { + slPrefix = SL10_PREFIX; + slNsDeclaration = SL10_NS_URI; + } + + StringBuffer sb = new StringBuffer(""); + 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("<"); + 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(""); + sb.append(""); + } + sb.append(""); + + return sb.toString(); + + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java new file mode 100644 index 000000000..038e549be --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/InfoboxValidatorParamsBuilder.java @@ -0,0 +1,82 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.util.List; + +import org.w3c.dom.Element; + +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.data.InfoboxValidatorParams; +import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParamsImpl; +import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; +import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameter; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * This class provides one method for building parameters needed for + * validating an infobox token. + * + * @author Harald Bratko + */ +public class InfoboxValidatorParamsBuilder { + + // hide the default constructor + private InfoboxValidatorParamsBuilder() { + } + + /** + * Builds the parameters passed to the validator class for validating an infobox token. + * + * @param session The actual Authentication session. + * @param verifyInfoboxParameter The configuration parameters for the infobox. + * @param infoboxTokenList Contains the infobox token to be validated. + * @param hideStammzahl Indicates whether source pins (Stammzahlen) + * should be hidden in any SAML attributes returned by + * an infobox validator. + * + * @return Parameters for validating an infobox token. + */ + public static InfoboxValidatorParams buildInfoboxValidatorParams( + AuthenticationSession session, + VerifyInfoboxParameter verifyInfoboxParameter, + List infoboxTokenList, + boolean hideStammzahl) + { + InfoboxValidatorParamsImpl infoboxValidatorParams = new InfoboxValidatorParamsImpl(); + IdentityLink identityLink = session.getIdentityLink(); + + // the infobox token to validate + infoboxValidatorParams.setInfoboxTokenList(infoboxTokenList); + // configuration parameters + infoboxValidatorParams.setTrustProfileID(verifyInfoboxParameter.getTrustProfileID()); + infoboxValidatorParams.setSchemaLocations(verifyInfoboxParameter.getSchemaLocations()); + infoboxValidatorParams.setApplicationSpecificParams(verifyInfoboxParameter.getApplicationSpecificParams()); + // authentication session parameters + infoboxValidatorParams.setBkuURL(session.getBkuURL()); + infoboxValidatorParams.setTarget(session.getTarget()); + infoboxValidatorParams.setBusinessApplication(session.getBusinessService()); + // parameters from the identity link + infoboxValidatorParams.setFamilyName(identityLink.getFamilyName()); + infoboxValidatorParams.setGivenName(identityLink.getGivenName()); + infoboxValidatorParams.setDateOfBirth(identityLink.getDateOfBirth()); + if (verifyInfoboxParameter.getProvideStammzahl()) { + infoboxValidatorParams.setIdentificationValue(identityLink.getIdentificationValue()); + } + infoboxValidatorParams.setIdentificationType(identityLink.getIdentificationType()); + infoboxValidatorParams.setPublicKeys(identityLink.getPublicKey()); + if (verifyInfoboxParameter.getProvideIdentityLink()) { + Element identityLinkElem = (Element)identityLink.getSamlAssertion().cloneNode(true); + if (!verifyInfoboxParameter.getProvideStammzahl()) { + Element identificationValueElem = + (Element)XPathUtils.selectSingleNode(identityLinkElem, IdentityLinkAssertionParser.PERSON_IDENT_VALUE_XPATH); + if (identificationValueElem != null) { + identificationValueElem.getFirstChild().setNodeValue(""); + } + } + infoboxValidatorParams.setIdentityLink(identityLinkElem); + } + infoboxValidatorParams.setHideStammzahl(hideStammzahl); + return infoboxValidatorParams; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java new file mode 100644 index 000000000..819ed79bb --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilder.java @@ -0,0 +1,59 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Builder for the lt;pr:Person> element to be inserted + * in the authentication data lt;saml:Assertion>. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class PersonDataBuilder { + + /** + * Constructor for PersonDataBuilder. + */ + public PersonDataBuilder() { + super(); + } + /** + * Builds the <pr:Person> element.
+ * Utilizes the parsed <prPerson> from the identity link + * and the information regarding inclusion of "Stammzahl" in the + * <pr:Person> data. + * + * @param identityLink IdentityLink containing the + * attribute prPerson + * @param provideStammzahl true if "Stammzahl" is to be included; + * false otherwise + * @return the <pr:Person> element as a String + * @throws BuildException on any error + */ + public String build(IdentityLink identityLink, boolean provideStammzahl) + throws BuildException { + + try { + Element prPerson = (Element)identityLink.getPrPerson().cloneNode(true); + if (! provideStammzahl) { + Node prIdentification = XPathUtils.selectSingleNode(prPerson, "pr:Identification/pr:Value"); + //remove IdentificationValue + prIdentification.getFirstChild().setNodeValue(""); + } + String xmlString = DOMUtils.serializeNode(prPerson); + return xmlString; + } + catch (Exception ex) { + throw new BuildException( + "builder.00", + new Object[] {"PersonData", ex.toString()}, + ex); + } + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java new file mode 100644 index 000000000..27e19e830 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java @@ -0,0 +1,60 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.io.ByteArrayOutputStream; +import java.security.MessageDigest; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.util.Base64Utils; + +/** + * Builder for the SAML artifact, as defined in the + * Browser/Artifact profile of SAML. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLArtifactBuilder { + + /** + * Constructor for SAMLArtifactBuilder. + */ + public SAMLArtifactBuilder() { + super(); + } + + /** + * Builds the SAML artifact, encoded BASE64. + *
    + *
  • TypeCode: 0x0001.
  • + *
  • SourceID: SHA-1 hash of the authURL
  • + *
  • AssertionHandle: SHA-1 hash of the MOASessionID
  • + *
+ * @param authURL URL auf the MOA-ID Auth component to be used for construction + * of SourceID + * @param sessionID MOASessionID to be used for construction + * of AssertionHandle + * @return the 42-byte SAML artifact, encoded BASE64 + */ + public String build(String authURL, String sessionID) throws BuildException { + try { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] sourceID = md.digest(authURL.getBytes()); + byte[] assertionHandle = md.digest(sessionID.getBytes()); + ByteArrayOutputStream out = new ByteArrayOutputStream(42); + out.write(0); + out.write(1); + out.write(sourceID, 0, 20); + out.write(assertionHandle, 0, 20); + byte[] samlArtifact = out.toByteArray(); + String samlArtifactBase64 = Base64Utils.encode(samlArtifact); + return samlArtifactBase64; + } + catch (Throwable ex) { + throw new BuildException( + "builder.00", + new Object[] {"SAML Artifact, MOASessionID=" + sessionID, ex.toString()}, + ex); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java new file mode 100644 index 000000000..64cb16181 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java @@ -0,0 +1,91 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import java.text.MessageFormat; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * Builder for the lt;samlp:Response> used for passing + * result and status information from the GetAuthenticationData + * web service. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLResponseBuilder implements Constants { + /** XML - Template for samlp:Response */ + private static final String RESPONSE = + "" + + "" + + " " + + " " + + " {4}" + + " " + + " {5}" + + " " + + " {6}" + + ""; + /** XML - Template for samlp:StatusCode */ + private static final String SUB_STATUS_CODE = + ""; + + /** + * Constructor for SAMLResponseBuilder. + */ + public SAMLResponseBuilder() { + super(); + } + /** + * Builds the SAML response. + * @param responseID response ID + * @param inResponseTo request ID of lt;samlp:Request> responded to + * @param issueInstant current timestamp + * @param statusCode status code + * @param subStatusCode sub-status code refining the status code; may be null + * @param statusMessage status message + * @param samlAssertion SAML assertion representing authentication data + * @return SAML response as a DOM element + */ + public Element build( + String responseID, + String inResponseTo, + String issueInstant, + String statusCode, + String subStatusCode, + String statusMessage, + String samlAssertion) + throws BuildException { + + try { + String xmlSubStatusCode = + subStatusCode == null ? + "" : + MessageFormat.format(SUB_STATUS_CODE, new Object[] {subStatusCode}); + + String xmlResponse = MessageFormat.format(RESPONSE, new Object[] { + responseID, + inResponseTo, + issueInstant, + statusCode, + xmlSubStatusCode, + statusMessage, + StringUtils.removeXMLDeclaration(samlAssertion) }); + Element domResponse = DOMUtils.parseDocument(xmlResponse, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + return domResponse; + } + catch (Throwable ex) { + throw new BuildException( + "builder.00", + new Object[] { "samlp:Response", ex.toString() }, + ex); + } + } + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java new file mode 100644 index 000000000..312179e73 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SelectBKUFormBuilder.java @@ -0,0 +1,63 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.id.BuildException; + +/** + * Builder for the BKU selection form requesting the user to choose + * a BKU from a list. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SelectBKUFormBuilder extends Builder { + /** private static String NL contains the NewLine representation in Java*/ + private static final String nl = "\n"; + /** special tag in the HTML template to be substituted for the form action which is + * a URL of MOA-ID Auth */ + private static final String ACTION_TAG = ""; + /** special tag in the HTML template to be substituted for the <select;gt; tag + * containing the BKU selection options */ + private static final String SELECT_TAG = ""; + /** + * Template for the default html-code to be returned as security-layer-selection to be built + */ + private static final String DEFAULT_HTML_TEMPLATE = + "" + nl + + "" + nl + + "" + nl + + "Auswahl der Bürgerkartenumgebung" + nl + + "" + nl + + "" + nl + + "
" + nl + + SELECT_TAG + nl + + " " + nl + + "
" + nl + + "" + nl + + ""; + + /** + * Constructor + */ + public SelectBKUFormBuilder() { + super(); + } + /** + * Method build. Builds the form + * @param htmlTemplate to be used + * @param startAuthenticationURL the url where the startAuthenticationServlet can be found + * @param bkuSelectTag if a special bku should be used + * @return String + * @throws BuildException on any error + */ + public String build(String htmlTemplate, String startAuthenticationURL, String bkuSelectTag) + throws BuildException { + + String htmlForm = htmlTemplate == null ? DEFAULT_HTML_TEMPLATE : htmlTemplate; + htmlForm = replaceTag(htmlForm, ACTION_TAG, startAuthenticationURL, true, 1); + htmlForm = replaceTag(htmlForm, SELECT_TAG, bkuSelectTag, true, 1); + return htmlForm; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java new file mode 100644 index 000000000..758f28150 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilder.java @@ -0,0 +1,206 @@ +package at.gv.egovernment.moa.id.auth.builder; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; + +/** + * Builder for the <VerifyXMLSignatureRequestBuilder> structure + * used for sending the DSIG-Signature of the Security Layer card for validating to MOA-SP. + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class VerifyXMLSignatureRequestBuilder { + + /** shortcut for XMLNS namespace URI */ + private static final String XMLNS_NS_URI = Constants.XMLNS_NS_URI; + /** shortcut for MOA namespace URI */ + private static final String MOA_NS_URI = Constants.MOA_NS_URI; + /** The DSIG-Prefix */ + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + + /** The document containing the VerifyXMLsignatureRequest */ + private Document requestDoc_; + /** the VerifyXMLsignatureRequest root element */ + private Element requestElem_; + + + /** + * Builds the body for a VerifyXMLsignatureRequest including the root + * element and namespace declarations. + * + * @throws BuildException If an error occurs on building the document. + */ + public VerifyXMLSignatureRequestBuilder() throws BuildException { + try { + DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + requestDoc_ = docBuilder.newDocument(); + requestElem_ = requestDoc_.createElementNS(MOA_NS_URI, "VerifyXMLSignatureRequest"); + requestElem_.setAttributeNS(XMLNS_NS_URI, "xmlns", MOA_NS_URI); + requestElem_.setAttributeNS(XMLNS_NS_URI, "xmlns:" + Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); + requestDoc_.appendChild(requestElem_); + } catch (Throwable t) { + throw new BuildException( + "builder.00", + new Object[] {"VerifyXMLSignatureRequest", t.toString()}, + t); + } + } + + + /** + * Builds a <VerifyXMLSignatureRequest> + * from an IdentityLink with a known trustProfileID which + * has to exist in MOA-SP + * @param identityLink - The IdentityLink + * @param trustProfileID - a preconfigured TrustProfile at MOA-SP + * + * @return Element - The complete request as Dom-Element + * + * @throws ParseException + */ + public Element build(IdentityLink identityLink, String trustProfileID) + throws ParseException + { + try { + // build the request + Element dateTimeElem = requestDoc_.createElementNS(MOA_NS_URI, "DateTime"); + requestElem_.appendChild(dateTimeElem); + Node dateTime = requestDoc_.createTextNode(identityLink.getIssueInstant()); + dateTimeElem.appendChild(dateTime); + Element verifiySignatureInfoElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureInfo"); + requestElem_.appendChild(verifiySignatureInfoElem); + Element verifySignatureEnvironmentElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureEnvironment"); + verifiySignatureInfoElem.appendChild(verifySignatureEnvironmentElem); + Element base64ContentElem = requestDoc_.createElementNS(MOA_NS_URI, "Base64Content"); + verifySignatureEnvironmentElem.appendChild(base64ContentElem); + // insert the base64 encoded identity link SAML assertion + String serializedAssertion = identityLink.getSerializedSamlAssertion(); + String base64EncodedAssertion = Base64Utils.encode(serializedAssertion.getBytes("UTF-8")); + //replace all '\r' characters by no char. + StringBuffer replaced = new StringBuffer(); + for (int i = 0; i < base64EncodedAssertion.length(); i ++) { + char c = base64EncodedAssertion.charAt(i); + if (c != '\r') { + replaced.append(c); + } + } + base64EncodedAssertion = replaced.toString(); + Node base64Content = requestDoc_.createTextNode(base64EncodedAssertion); + base64ContentElem.appendChild(base64Content); + // specify the signature location + Element verifySignatureLocationElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureLocation"); + verifiySignatureInfoElem.appendChild(verifySignatureLocationElem); + Node signatureLocation = requestDoc_.createTextNode(DSIG + "Signature"); + verifySignatureLocationElem.appendChild(signatureLocation); + // signature manifest params + Element signatureManifestCheckParamsElem = + requestDoc_.createElementNS(MOA_NS_URI, "SignatureManifestCheckParams"); + requestElem_.appendChild(signatureManifestCheckParamsElem); + signatureManifestCheckParamsElem.setAttribute("ReturnReferenceInputData", "false"); + // add the transforms + Element referenceInfoElem = requestDoc_.createElementNS(MOA_NS_URI, "ReferenceInfo"); + signatureManifestCheckParamsElem.appendChild(referenceInfoElem); + Element[] dsigTransforms = identityLink.getDsigReferenceTransforms(); + for (int i = 0; i < dsigTransforms.length; i++) { + Element verifyTransformsInfoProfileElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifyTransformsInfoProfile"); + referenceInfoElem.appendChild(verifyTransformsInfoProfileElem); + verifyTransformsInfoProfileElem.appendChild(requestDoc_.importNode(dsigTransforms[i], true)); + } + Element returnHashInputDataElem = + requestDoc_.createElementNS(MOA_NS_URI, "ReturnHashInputData"); + requestElem_.appendChild(returnHashInputDataElem); + Element trustProfileIDElem = requestDoc_.createElementNS(MOA_NS_URI, "TrustProfileID"); + trustProfileIDElem.appendChild(requestDoc_.createTextNode(trustProfileID)); + requestElem_.appendChild(trustProfileIDElem); + } catch (Throwable t) { + throw new ParseException("builder.00", + new Object[] { "VerifyXMLSignatureRequest (IdentityLink)" }, t); + } + + return requestElem_; + } + + + /** + * Builds a <VerifyXMLSignatureRequest> + * from the signed AUTH-Block with a known trustProfileID which + * has to exist in MOA-SP + * @param csr - signed AUTH-Block + * @param verifyTransformsInfoProfileID - allowed verifyTransformsInfoProfileID + * @param trustProfileID - a preconfigured TrustProfile at MOA-SP + * @return Element - The complete request as Dom-Element + * @throws ParseException + */ + public Element build( + CreateXMLSignatureResponse csr, + String[] verifyTransformsInfoProfileID, + String trustProfileID) + throws BuildException { //samlAssertionObject + + try { + // build the request +// requestElem_.setAttributeNS(Constants.XMLNS_NS_URI, "xmlns:" +// + Constants.XML_PREFIX, Constants.XMLNS_NS_URI); + Element verifiySignatureInfoElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureInfo"); + requestElem_.appendChild(verifiySignatureInfoElem); + Element verifySignatureEnvironmentElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureEnvironment"); + verifiySignatureInfoElem.appendChild(verifySignatureEnvironmentElem); + Element xmlContentElem = requestDoc_.createElementNS(MOA_NS_URI, "XMLContent"); + verifySignatureEnvironmentElem.appendChild(xmlContentElem); + xmlContentElem.setAttribute(Constants.XML_PREFIX + ":space", "preserve"); + // insert the SAML assertion + xmlContentElem.appendChild(requestDoc_.importNode(csr.getSamlAssertion(), true)); + // specify the signature location + Element verifySignatureLocationElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifySignatureLocation"); + verifiySignatureInfoElem.appendChild(verifySignatureLocationElem); + Node signatureLocation = requestDoc_.createTextNode(DSIG + "Signature"); + verifySignatureLocationElem.appendChild(signatureLocation); + // signature manifest params + Element signatureManifestCheckParamsElem = + requestDoc_.createElementNS(MOA_NS_URI, "SignatureManifestCheckParams"); + requestElem_.appendChild(signatureManifestCheckParamsElem); + signatureManifestCheckParamsElem.setAttribute("ReturnReferenceInputData", "true"); + // add the transform profile IDs + Element referenceInfoElem = requestDoc_.createElementNS(MOA_NS_URI, "ReferenceInfo"); + signatureManifestCheckParamsElem.appendChild(referenceInfoElem); + for (int i = 0; i < verifyTransformsInfoProfileID.length; i++) { + Element verifyTransformsInfoProfileIDElem = + requestDoc_.createElementNS(MOA_NS_URI, "VerifyTransformsInfoProfileID"); + referenceInfoElem.appendChild(verifyTransformsInfoProfileIDElem); + verifyTransformsInfoProfileIDElem.appendChild( + requestDoc_.createTextNode(verifyTransformsInfoProfileID[i])); + } + Element returnHashInputDataElem = + requestDoc_.createElementNS(MOA_NS_URI, "ReturnHashInputData"); + requestElem_.appendChild(returnHashInputDataElem); + Element trustProfileIDElem = requestDoc_.createElementNS(MOA_NS_URI, "TrustProfileID"); + trustProfileIDElem.appendChild(requestDoc_.createTextNode(trustProfileID)); + requestElem_.appendChild(trustProfileIDElem); + + } catch (Throwable t) { + throw new BuildException("builder.00", new Object[] { "VerifyXMLSignatureRequest" }, t); + } + + return requestElem_; + } + +} 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 new file mode 100644 index 000000000..90d79a46d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java @@ -0,0 +1,383 @@ +package at.gv.egovernment.moa.id.auth.data; + +import java.util.Date; +import java.util.List; + +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; + +/** + * Session data to be stored between AuthenticationServer API calls. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationSession { + + private static String TARGET_PREFIX_ = Constants.URN_PREFIX_CDID + "+"; + + /** + * session ID + */ + private String sessionID; + /** + * "Geschäftsbereich" the online application belongs to; maybe null + * if the online application is a business application + */ + private String target; + /** + * public online application URL requested + */ + private String oaURLRequested; + /** + * public online application URL prefix + */ + private String oaPublicURLPrefix; + /** + * URL of MOA ID authentication component + */ + private String authURL; + /** + * HTML template URL + */ + private String templateURL; + /** + * URL of the BKU + */ + private String bkuURL; + /** + * identity link read from smartcard + */ + private IdentityLink identityLink; + /** + * authentication block to be signed by the user + */ + private String authBlock; + /** + * timestamp logging when authentication session has been created + */ + private Date timestampStart; + /** + * timestamp logging when identity link has been received + */ + private Date timestampIdentityLink; + /** + * Indicates whether the corresponding online application is a business + * service or not + */ + private boolean businessService; + + /** + * SAML attributes from an extended infobox validation to be appended + * to the SAML assertion delivered to the final online application. + */ + private List extendedSAMLAttributesOA; + + /** + * The boolean value for either a target or a wbPK is provided as + * SAML Attribute in the SAML Assertion or not. + */ + private boolean samlAttributeGebeORwbpk; + + /** + * SAML attributes from an extended infobox validation to be appended + * to the SAML assertion of the AUTHBlock. + */ + private List extendedSAMLAttributesAUTH; + + /** + * The issuing time of the AUTH-Block SAML assertion. + */ + private String issueInstant; + + /** + * Constructor for AuthenticationSession. + * + * @param id Session ID + */ + public AuthenticationSession(String id) { + sessionID = id; + setTimestampStart(); + } + + /** + * Returns the identityLink. + * @return IdentityLink + */ + public IdentityLink getIdentityLink() { + return identityLink; + } + + /** + * Returns the sessionID. + * @return String + */ + public String getSessionID() { + return sessionID; + } + + /** + * Sets the identityLink. + * @param identityLink The identityLink to set + */ + public void setIdentityLink(IdentityLink identityLink) { + this.identityLink = identityLink; + } + + /** + * Sets the sessionID. + * @param sessionId The sessionID to set + */ + public void setSessionID(String sessionId) { + this.sessionID = sessionId; + } + + /** + * Returns the oaURLRequested. + * @return String + */ + public String getOAURLRequested() { + return oaURLRequested; + } + + /** + * Returns the oaURLRequested. + * @return String + */ + public String getPublicOAURLPrefix() { + return oaPublicURLPrefix; + } + + /** + * Returns the BKU URL. + * @return String + */ + public String getBkuURL() { + return bkuURL; + } + + /** + * Returns the target. + * @return String + */ + public String getTarget() { + return target; + } + + /** + * Sets the oaURLRequested. + * @param oaURLRequested The oaURLRequested to set + */ + public void setOAURLRequested(String oaURLRequested) { + this.oaURLRequested = oaURLRequested; + } + + /** + * Sets the oaPublicURLPrefix + * @param oaPublicURLPrefix The oaPublicURLPrefix to set + */ + public void setPublicOAURLPrefix(String oaPublicURLPrefix) { + this.oaPublicURLPrefix = oaPublicURLPrefix; + } + + /** + * Sets the bkuURL + * @param bkuURL The BKU URL to set + */ + public void setBkuURL(String bkuURL) { + this.bkuURL = bkuURL; + } + + /** + * Sets the target. If the target includes the target prefix, the prefix will be stripped off. + * @param target The target to set + */ + public void setTarget(String target) { + if (target != null && target.startsWith(TARGET_PREFIX_)) + { + // If target starts with prefix "urn:publicid:gv.at:cdid+"; remove prefix + this.target = target.substring(TARGET_PREFIX_.length()); + Logger.debug("Target prefix stripped off; resulting target: " + this.target); + } + else + { + this.target = target; + } + } + + /** + * Returns the authURL. + * @return String + */ + public String getAuthURL() { + return authURL; + } + + /** + * Sets the authURL. + * @param authURL The authURL to set + */ + public void setAuthURL(String authURL) { + this.authURL = authURL; + } + + /** + * Returns the authBlock. + * @return String + */ + public String getAuthBlock() { + return authBlock; + } + + /** + * Sets the authBlock. + * @param authBlock The authBlock to set + */ + public void setAuthBlock(String authBlock) { + this.authBlock = authBlock; + } + + /** + * Returns the timestampIdentityLink. + * @return Date + */ + public Date getTimestampIdentityLink() { + return timestampIdentityLink; + } + + /** + * Returns the businessService. + * @return true if the corresponding online application is + * a business application, otherwise false + */ + public boolean getBusinessService() { + return businessService; + } + + /** + * Sets the businessService variable. + * @param businessService the value for setting the businessService variable. + */ + public void setBusinessService(boolean businessService) { + this.businessService = businessService; + } + + /** + * Returns the timestampStart. + * @return Date + */ + public Date getTimestampStart() { + return timestampStart; + } + + /** + * Sets the current date as timestampIdentityLink. + */ + public void setTimestampIdentityLink() { + timestampIdentityLink = new Date(); + } + + /** + * Sets the current date as timestampStart. + */ + public void setTimestampStart() { + timestampStart = new Date(); + } + + /** + * @return template URL + */ + public String getTemplateURL() { + return templateURL; + } + + /** + * @param string the template URL + */ + public void setTemplateURL(String string) { + templateURL = string; + } + + /** + * Returns the SAML Attributes to be appended to the AUTHBlock. Maybe null. + * + * @return The SAML Attributes to be appended to the AUTHBlock. Maybe null. + */ + public List getExtendedSAMLAttributesAUTH() { + return extendedSAMLAttributesAUTH; + } + + /** + * Sets the SAML Attributes to be appended to the AUTHBlock. + * + * @param extendedSAMLAttributesAUTH The SAML Attributes to be appended to the AUTHBlock. + */ + public void setExtendedSAMLAttributesAUTH( + List extendedSAMLAttributesAUTH) { + this.extendedSAMLAttributesAUTH = extendedSAMLAttributesAUTH; + } + + /** + * Returns the SAML Attributes to be appended to the SAML assertion + * delivered to the online application. Maybe null. + * + * @return The SAML Attributes to be appended to the SAML assertion + * delivered to the online application + */ + public List getExtendedSAMLAttributesOA() { + return extendedSAMLAttributesOA; + } + + /** + * Sets the SAML Attributes to be appended to the SAML assertion + * delivered to the online application. + * + * @param extendedSAMLAttributesOA The SAML Attributes to be appended to the SAML + * assertion delivered to the online application. + */ + public void setExtendedSAMLAttributesOA( + List extendedSAMLAttributesOA) { + this.extendedSAMLAttributesOA = extendedSAMLAttributesOA; + } + + /** + * Returns the boolean value for either a target or a wbPK is + * provided as SAML Attribute in the SAML Assertion or not. + * + * @return true either a target or a wbPK is provided as SAML Attribute + * in the SAML Assertion or false if not. + */ + public boolean getSAMLAttributeGebeORwbpk() { + return this.samlAttributeGebeORwbpk; + } + + /** + * Sets the boolean value for either a target or a wbPK is + * provided as SAML Attribute in the SAML Assertion or not. + * + * @param samlAttributeGebeORwbpk The boolean for value either a target or + * wbPK is provided as SAML Attribute in the SAML Assertion or not. + */ + public void setSAMLAttributeGebeORwbpk(boolean samlAttributeGebeORwbpk) { + this.samlAttributeGebeORwbpk = samlAttributeGebeORwbpk; + } + + /** + * Returns the issuing time of the AUTH-Block SAML assertion. + * + * @return The issuing time of the AUTH-Block SAML assertion. + */ + public String getIssueInstant() { + return issueInstant; + } + + /** + * Sets the issuing time of the AUTH-Block SAML assertion. + * + * @param issueInstant The issueInstant to set. + */ + public void setIssueInstant(String issueInstant) { + this.issueInstant = issueInstant; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java new file mode 100644 index 000000000..d121f2c55 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/CreateXMLSignatureResponse.java @@ -0,0 +1,71 @@ +package at.gv.egovernment.moa.id.auth.data; + +import org.w3c.dom.Element; + +/** + * This bean saves all information of the CreateXMLSignature-Response: + * a {@link SAMLAttribute} array, the SamlAssertion-Element and the + * saml NameIdentifier + * + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class CreateXMLSignatureResponse { + /** the samlNameIdentifier */ +private String samlNameIdentifier; + /** an array of saml-attributes */ +private SAMLAttribute[] samlAttributes; + /** + * the original saml:Assertion-Element + */ + private Element samlAssertion; +/** + * Returns the samlAssertion. + * @return Element + */ +public Element getSamlAssertion() { + return samlAssertion; +} + +/** + * Returns the samlAttribute. + * @return SAMLAttribute[] + */ +public SAMLAttribute[] getSamlAttributes() { + return samlAttributes; +} + +/** + * Returns the samlNameIdentifier. + * @return String + */ +public String getSamlNameIdentifier() { + return samlNameIdentifier; +} + +/** + * Sets the samlAssertion. + * @param samlAssertion The samlAssertion to set + */ +public void setSamlAssertion(Element samlAssertion) { + this.samlAssertion = samlAssertion; +} + +/** + * Sets the samlAttribute. + * @param samlAttributes The samlAttributes to set + */ +public void setSamlAttributes(SAMLAttribute[] samlAttributes) { + this.samlAttributes = samlAttributes; +} + +/** + * Sets the samlNameIdentifier. + * @param samlNameIdentifier The samlNameIdentifier to set + */ +public void setSamlNameIdentifier(String samlNameIdentifier) { + this.samlNameIdentifier = samlNameIdentifier; +} + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java new file mode 100644 index 000000000..795079227 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttribute.java @@ -0,0 +1,73 @@ +package at.gv.egovernment.moa.id.auth.data; + +/** + * A SAML-Attribute to be appended to the final SAML-Assertion + * that will be passed to the online application. + */ +public interface ExtendedSAMLAttribute { + /** + * Add this attribute only to the SAML-Assertion + * passed to the online application, but not to + * the AUTH-Block. + */ + public final static int NOT_ADD_TO_AUTHBLOCK = 0; + /** + * Add this attribute to both, the AUTH-Block and the + * final SAML-Assertion passed to the online application. + */ + public final static int ADD_TO_AUTHBLOCK = 1; + /** + * Add this attribute to only the AUTH-Block, but not + * to the final SAML-Assertion passed to the online application. + */ + public final static int ADD_TO_AUTHBLOCK_ONLY = 2; + + /** + * The value of the SAML-Attribute. This must be either a + * org.w3c.Element or a java.lang.String + * object. Each other type will be ignored.
+ * If, for example, the type of the actual SAML-Attribute is a + * <xsd:boolean> the value must be either the String + * "true" or "false". + * Or the <xsd:integer> number 273 + * has to be the String "273". + * + * @return The value of the SAML-Attribute. Must not be null. + */ + public Object getValue(); + + /** + * The name of the SAML-Attribute. + * + * @return The name of the SAML-Attribute. Must not be null. + */ + public String getName(); + + /** + * The namespace of the SAML-Attribute. + * An application will use the context specific namespace URI for the attribute it returns. + * However, if the application cannot explicitely assign a namespace URI, the + * {@link at.gv.egovernment.moa.util.Constants#MOA_NS_URI default} MOA namespace URI + * should be used. + * + * @return The namespace of the SAML-Attribute. Must not be null. + */ + public String getNameSpace(); + + /** + * Specifies if this SAML-Attribute should be added to the AUTH-Block. + *
+ * Depending on the returned value, this SAML-Attribute should be only added to the + * final SAML-Assertion passed to the online application (0), to both, the final + * assertion and the AUTH-Block (1) or to the AUTH-Block only (2). + * + * @return
    + *
  • 0 - add this SAML-Attribute to the final SAML-Assertion only
  • + *
  • 1 - add this SAML-Attribute to both, the final SAML-Assertion and the + * AUTH-Block
  • + *
  • 2 - add this SAML-Attribute to the AUTH-Block only + *
+ */ + public int getAddToAUTHBlock(); + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java new file mode 100644 index 000000000..e7e490924 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/ExtendedSAMLAttributeImpl.java @@ -0,0 +1,137 @@ +package at.gv.egovernment.moa.id.auth.data; + +/** + * This class contains SAML attributes to be appended to the SAML assertion delivered to + * the Online application. + * + * @author Harald Bratko + */ +public class ExtendedSAMLAttributeImpl implements ExtendedSAMLAttribute { + + /** + * The value of this SAML attribute. Must be either of type java.lang.String + * or org.w3c.Element. + */ + protected Object value_; + + /** + * The name of this SAML attribute. + */ + protected String name_; + + /** + * The namespace URI of this SAML attribute. + */ + protected String namespace_; + + /** + * Specifies whether this SAML attribute should be appended to AUTH Block. + */ + protected int addToAUTHBlock_; + + /** + * Sets this ExtendedSAMLAttribute. + * @param name The name of this SAML Attribute. + * @param value The value of this SAML Attribute. Must be either of type + * java.lang.String or org.w3c.dom.Element. + * @param namespace The namespace of this SAML Attribute. + * @param addToAUTHBlock Specifies if this SAML Attribute should be added to the AUTHBlock. + * The following values are allowed: + *
    + *
  • + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK} + *
  • + *
  • + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#NOT_ADD_TO_AUTHBLOCK} + *
  • + *
  • + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK_ONLY} + *
  • + *
+ * + */ + public ExtendedSAMLAttributeImpl(String name, Object value, String namespace, int addToAUTHBlock) { + name_ = name; + value_ = value; + namespace_ = namespace; + addToAUTHBlock_ = addToAUTHBlock; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getValue() + */ + public Object getValue() { + return value_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getName() + */ + public String getName() { + return name_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getNameSpace() + */ + public String getNameSpace() { + return namespace_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#getAddToAUTHBlock() + */ + public int getAddToAUTHBlock() { + return addToAUTHBlock_; + } + + /** + * Specifies if this SAML Attribute should be added to the AUTHBlock. + * + * @param addToAUTHBlock One of the following values: + *
    + *
  • + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK} + *
  • + *
  • + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#NOT_ADD_TO_AUTHBLOCK} + *
  • + *
  • + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK_ONLY} + *
  • + *
+ * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute#ADD_TO_AUTHBLOCK} + */ + public void setAddToAUTHBlock(int addToAUTHBlock) { + addToAUTHBlock_ = addToAUTHBlock; + } + + /** + * Sets the name of this SAML attribute. + * + * @param name The name of this SAML attribute. + */ + public void setName(String name) { + name_ = name; + } + + /** + * Sets the namespace of this SAML attribute. + * + * @param namespace The namespace to set. + */ + public void setNamespace(String namespace) { + namespace_ = namespace; + } + + /** + * Sets the value of this SAML attribute. + * + * @param value The value of this SAML Attribute. Must be either of type + * java.lang.String or org.w3c.dom.Element. + */ + public void setValue(Object value) { + value_ = value; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/IdentityLink.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/IdentityLink.java new file mode 100644 index 000000000..844451035 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/IdentityLink.java @@ -0,0 +1,266 @@ +package at.gv.egovernment.moa.id.auth.data; + +import java.io.IOException; +import java.security.PublicKey; + +import javax.xml.transform.TransformerException; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.util.DOMUtils; + + +/** + * Data contained in an identity link issued by BMI, relevant to the MOA ID component. + *
"IdentityLink" is the translation of "Personenbindung". + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class IdentityLink { + /** + * "identificationValue" is the translation of "Stammzahl". + */ + private String identificationValue; + /** + * "identificationType" type of the identificationValue in the IdentityLink. + */ + private String identificationType; + /** + * first name + */ + private String givenName; + /** + * family name + */ + private String familyName; + + /** + * The name as (givenName + familyName) + */ + private String name; + /** + * date of birth + */ + private String dateOfBirth; + /** + * the original saml:Assertion-Element + */ + private Element samlAssertion; + /** + * the serializes saml:Assertion + */ + private String serializedSamlAssertion; + /** + * Element /saml:Assertion/saml:AttributeStatement/saml:Subject/saml:SubjectConfirmation/saml:SubjectConfirmationData/pr:Person + */ + private Element prPerson; + /** + * we need for each dsig:Reference Element all + * transformation elements + */ + private Element[] dsigReferenceTransforms; + + /** + * The issuing time of the identity link SAML assertion. + */ + private String issueInstant; + + /** + * we need all public keys stored in + * the identity link + */ + private PublicKey[] publicKey; + + /** + * Constructor for IdentityLink + */ + public IdentityLink() { + } + + /** + * Returns the dateOfBirth. + * @return Calendar + */ + public String getDateOfBirth() { + return dateOfBirth; + } + + /** + * Returns the familyName. + * @return String + */ + public String getFamilyName() { + return familyName; + } + + /** + * Returns the givenName. + * @return String + */ + public String getGivenName() { + return givenName; + } + + /** + * Returns the name. + * @return The name. + */ + public String getName() { + if (name == null) { + name = givenName + " " + familyName; + } + return name; + } + + /** + * Returns the identificationValue. + * "identificationValue" is the translation of "Stammzahl". + * @return String + */ + public String getIdentificationValue() { + return identificationValue; + } + + /** + * Returns the identificationType. + * "identificationType" type of the identificationValue in the IdentityLink. + * @return String + */ + public String getIdentificationType() { + return identificationType; + } + + /** + * Sets the dateOfBirth. + * @param dateOfBirth The dateOfBirth to set + */ + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + /** + * Sets the familyName. + * @param familyName The familyName to set + */ + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + /** + * Sets the givenName. + * @param givenName The givenName to set + */ + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + /** + * Sets the identificationValue. + * "identificationValue" is the translation of "Stammzahl". + * @param identificationValue The identificationValue to set + */ + public void setIdentificationValue(String identificationValue) { + this.identificationValue = identificationValue; + } + + /** + * Sets the Type of the identificationValue. + * @param identificationType The type of identificationValue to set + */ + public void setIdentificationType(String identificationType) { + this.identificationType = identificationType; + } + + /** + * Returns the samlAssertion. + * @return Element + */ + public Element getSamlAssertion() { + return samlAssertion; + } + + /** + * Returns the samlAssertion. + * @return Element + */ + public String getSerializedSamlAssertion() { + return serializedSamlAssertion; + } + + /** + * Sets the samlAssertion and the serializedSamlAssertion. + * @param samlAssertion The samlAssertion to set + */ + public void setSamlAssertion(Element samlAssertion) throws TransformerException, IOException { + this.samlAssertion = samlAssertion; + this.serializedSamlAssertion = DOMUtils.serializeNode(samlAssertion); + } + + /** + * Returns the dsigReferenceTransforms. + * @return Element[] + */ + public Element[] getDsigReferenceTransforms() { + return dsigReferenceTransforms; + } + + /** + * Sets the dsigReferenceTransforms. + * @param dsigReferenceTransforms The dsigReferenceTransforms to set + */ + public void setDsigReferenceTransforms(Element[] dsigReferenceTransforms) { + this.dsigReferenceTransforms = dsigReferenceTransforms; + } + + /** + * Returns the publicKey. + * @return PublicKey[] + */ + public PublicKey[] getPublicKey() { + return publicKey; + } + + /** + * Sets the publicKey. + * @param publicKey The publicKey to set + */ + public void setPublicKey(PublicKey[] publicKey) { + this.publicKey = publicKey; + } + + /** + * Returns the prPerson. + * @return Element + */ + public Element getPrPerson() { + return prPerson; + } + + /** + * Sets the prPerson. + * @param prPerson The prPerson to set + */ + public void setPrPerson(Element prPerson) { + this.prPerson = prPerson; + } + + /** + * Returns the issuing time of the identity link SAML assertion. + * + * @return The issuing time of the identity link SAML assertion. + */ + public String getIssueInstant() { + return issueInstant; + } + + /** + * Sets the issuing time of the identity link SAML assertion. + * + * @param issueInstant The issueInstant to set. + */ + public void setIssueInstant(String issueInstant) { + this.issueInstant = issueInstant; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java new file mode 100644 index 000000000..6b1f24aba --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxToken.java @@ -0,0 +1,65 @@ +package at.gv.egovernment.moa.id.auth.data; + +import org.w3c.dom.Element; + +/** + * Contains an infobox token included in an InfoboxReadResponse. + * Depending on whether the token is extracted from an XMLContent or a + * Base64Content it is either returned as DOM element + * ({@link #getXMLToken()}) or base64 encoded string ({@link #getBase64Token()}). + * + * @author Harald Bratko + */ +public interface InfoboxToken { + + /** + * The key of the corresponding infobox. + * This is the value of Key attribute of the <Pair> child + * element in an <AssocArrayData> content of an InfoboxReadResponse. + * Maybe null if the InfoboxReadResponse conatains BinaryFileData. + * + * + * @return The key identifier of the corresponding infobox. + */ + public String getKey(); + + /** + * Specifies if this token is the first token (e.g in an array of tokens) included in an + * InfoboxReadResponse. If true this token is the token to be + * validated by a corresponding + * {@link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator InfoboxValidator}. + * If false this token maybe needed to validate the primary token. + * + * @return True if this token is the first token. + */ + public boolean isPrimary(); + + /** + * Returns the infobox token. + * Maybe null if the token is returned by method {@link #getBase64Token()} + * as base64 encoded string. + *
+ * Note that this token is not validated against the + * application specific schema (e.g. Mandates schema in the mandates context). + * Thus the validating application has to validate the token + * against the appropriate schema. + * + * @return The infobox token. If null the token is returned by method + * {@link #getBase64Token()} as base64 encoded string. + */ + public Element getXMLToken(); + + /** + * Returns the infobox token. + * Maybe null if the token is returned by method {@link #getXMLToken()} + * as a DOM element. + *
+ * Note, that the base64 encoded string actually may include more than one infobox + * elements. + * + * @return The infobox token. If null the token is returned by method + * {@link #getBase64Token()} as base64 encoded string. + */ + public String getBase64Token(); + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java new file mode 100644 index 000000000..f1ff30a8a --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxTokenImpl.java @@ -0,0 +1,129 @@ +package at.gv.egovernment.moa.id.auth.data; + +import org.w3c.dom.Element; + +/** + * This class contains an infobox token. + * + * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken + * + * @author Harald Bratko + */ +public class InfoboxTokenImpl implements InfoboxToken { + + /** + * The key of the infobox token. + */ + private String key_; + + /** + * Specifies whether this token is the primary (first in an array) token. + */ + private boolean primary_; + + /** + * The infobox token. + */ + private Element xmlToken_; + + /** + * The base64 encoded infobox token. + */ + private String base64Token_; + + /** + * Sets an XML infobox token. + * + * @param key The key of the infobox token. + * @param primary True this token is the primary (e.g .first in an array) + * token, otherwise false + * @param xmlToken The infobox token. + */ + public InfoboxTokenImpl(String key, boolean primary, Element xmlToken) { + key_ = key; + primary_ = primary; + xmlToken_ = xmlToken; + base64Token_ = null; + } + + /** + * Sets a base64 encoded infobox token. + * + * @param key The key of the infobox token. + * @param primary True this token is the primary (e.g .first in an array) + * token, otherwise false + * @param base64Token The base64 encoded infobox token. + */ + public InfoboxTokenImpl(String key, boolean primary, String base64Token) { + key_ = key; + primary_ = primary; + base64Token_ = base64Token; + xmlToken_ = null; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#getKey() + */ + public String getKey() { + return key_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#isPrimary() + */ + public boolean isPrimary() { + return primary_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#getXMLToken() + */ + public Element getXMLToken() { + return xmlToken_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxToken#getBase64Token() + */ + public String getBase64Token() { + return base64Token_; + } + + /** + * Sets the key of the infobox token. + * + * @param key The key of the infobox token. + */ + public void setKey(String key) { + key_ = key; + } + + /** + * Specifies whether this token is the primary (e.g. first in an array) token. + * + * @param primary True this token is the primary (e.g .first in an array) + * token, otherwise false. + */ + public void setPrimary(boolean primary) { + primary_ = primary; + } + + /** + * Sets the base64 encoded token. + * + * @param base64Token The base64 encoded token. + */ + public void setBase64Token(String base64Token) { + base64Token_ = base64Token; + } + + /** + * Sets the infobox token. + * + * @param xmlToken The infobox token. + */ + public void setXmlToken(Element xmlToken) { + xmlToken_ = xmlToken; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java new file mode 100644 index 000000000..b8dd7f18e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java @@ -0,0 +1,57 @@ +package at.gv.egovernment.moa.id.auth.data; + + +/** + * Includes the result of an extended infobox validation. + * + * If validation succeeds, an array of + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute ExtendedSAMLAttributes} + * maybe provided. Each of these SAML-Attributes will be either appended to the + * final SAML-Assertion passed to the online application or to the AUTH-Block, + * or to both. + *
+ * If validation fails the implementing class has to provide a short error message. + * + * @author Harald Bratko + */ +public interface InfoboxValidationResult { + + /** + * The method returns true if validation succeeds. In that case + * method {@link #getExtendedSamlAttributes()} may provide an array of + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute + * ExtendedSAMLAttributes} that should be appended to the final SAML-Assertion or the + * AUTH-Block or to both. + *
+ * The method returns false if validation fails. In that case + * method {@link #getErrorMessage()} has to provide a short error description. + * + * @return True if validation succeeds, + * otherwise false. + */ + public boolean isValid(); + + /** + * Returns an array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute + * ExtendedSAMLAttributes} that should be added to the SAML-Assertion + * provided to the online application. + * The SAML-Attributes in that array will be added to the final + * SAML-Assertion, the AUTH-Block, or both, exactly in the order as they are arranged + * in the array this method returns. + * + * @return An array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute + * ExtendedSAMLAttributes} that should be added to the SAML-Assertion + * provided to the online application, the AUTH-Block, or both. If no attributes should + * be added this array maybe null or empty. + */ + public ExtendedSAMLAttribute[] getExtendedSamlAttributes(); + + /** + * A short error description that should be displayed by MOA-ID if + * validation of the InfoBoxReadResponse fails. + * + * @return An short error message if validation fails. + */ + public String getErrorMessage(); + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java new file mode 100644 index 000000000..97f52fb55 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResultImpl.java @@ -0,0 +1,101 @@ +package at.gv.egovernment.moa.id.auth.data; + + +/** + * Default implementation of the {@link InfoboxValidationResult} interface. + * + * @author Harald Bratko + */ +public class InfoboxValidationResultImpl implements InfoboxValidationResult { + + /** + * Indicates whether the validation was successful or not. + */ + protected boolean valid_; + + /** + * The error message. + */ + protected String errorMessage_; + + /** + * The SAML attributes returned by the infobox validator. + */ + protected ExtendedSAMLAttribute[] extendedSamlAttributes_; + + /** + * Empty constructor. + */ + public InfoboxValidationResultImpl() { + } + + /** + * Constructor to set all values. + * + * @param valid Global validation result. + * @param extendedSamlAttributes SAML attributes that should be appended to the final + * SAML Assertion or to the AUTH Block + * or to both. + * @param errorMessage An error message if infobox validation fails. + */ + public InfoboxValidationResultImpl( + boolean valid, + ExtendedSAMLAttribute[] extendedSamlAttributes, + String errorMessage) + { + valid_ = valid; + extendedSamlAttributes_ = extendedSamlAttributes; + errorMessage_ = errorMessage; + } + + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#getErrorMessage() + */ + public String getErrorMessage() { + return errorMessage_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#getExtendedSamlAttributes() + */ + public ExtendedSAMLAttribute[] getExtendedSamlAttributes() { + return extendedSamlAttributes_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#isValid() + */ + public boolean isValid() { + return valid_; + } + + /** + * Sets the error message if validation fails.. + * + * @param errorMessage The error message to set. + */ + public void setErrorMessage(String errorMessage) { + errorMessage_ = errorMessage; + } + + /** + * Sets the SAML attributes returned by the infobox validatior.. + * + * @param extendedSamlAttributes The SAML attributes returned by the infobox validator. + */ + public void setExtendedSamlAttributes(ExtendedSAMLAttribute[] extendedSamlAttributes) { + extendedSamlAttributes_ = extendedSamlAttributes; + } + + /** + * Sets validation result.. + * + * @param valid True if the infobox could be validated successfully, + * otherwise false. + */ + public void setValid(boolean valid) { + valid_ = valid; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java new file mode 100644 index 000000000..c7a557290 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParams.java @@ -0,0 +1,172 @@ +package at.gv.egovernment.moa.id.auth.data; + +import java.security.PublicKey; +import java.util.List; + +import org.w3c.dom.Element; + +/** + * Parameters for validating an infobox. + * + * This interface is used by MOA-ID to provide parameters to an + * {link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator + * InfoboxValidator}. + * + * @author Harald Bratko + */ +public interface InfoboxValidatorParams { + + /** + * Returns a list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} + * objects. The first token in this list is the one to be validated. Each further token + * maybe needed to validate this first token. + * + * @return A list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} + * objects. + */ + public List getInfoboxTokenList(); + + /** + * Returns the ID of the trust profile to be used for validating + * certificates. Maybe ignored by a validator, if no certificates + * has to be validated. + * + * @return The ID of a trust profile. + */ + public String getTrustProfileID(); + + /** + * Returns schema location URIs that may be needed by the + * validator to parse infobox tokens. + * Each entry in the list is a {@link Schema} specifying the location + * of an XML schema. + * + * @return A list of {@link Schema} objects each of them specifying the + * location of an XML schema. + */ + public List getSchemaLocations(); + + /** + * Returns the URL of the BKU. + * Maybe needed by a validator. + * + * @return The url of the BKU. + */ + public String getBkuURL(); + + /** + * Returns the target parameter. + * null in the case of a business service. + * + * @return The target parameter. + */ + public String getTarget(); + + /** + * Returns true if the application is a business + * service, otherwise false. This may be useful + * for the validating application. + * + * @return True if the application is a business + * service, otherwise false + */ + public boolean getBusinessApplication(); + + /** + * Returns the family name from the identity link. + * Maybe needed by a validator. + * + * @return The family name from the identity link. + */ + public String getFamilyName(); + + /** + * Returns the given name from the identity link. + * Maybe needed by a validator. + * + * @return The given name from the identity link. + */ + public String getGivenName(); + + /** + * The date of birth from the identity link. + * The method returns the value of the + * element from the identity link. + * Maybe needed by a validator. + * + * @return The date of birth from the identity link. + */ + public String getDateOfBirth(); + + /** + * Returns he identification value from the identity + * link. This may be the Stammzahl + * in the case of a public application or the + * wbPK in the case of a business + * application. This parameter is only returned + * if specified within the config file. + * + * @return The identification value from the identity link. + */ + public String getIdentificationValue(); + + /** + * Returns the type of the identification value + * from the identity link. This may be + * especially of interest for business + * applications. + * + * @return The type of the identification value + * from the identity link. + */ + public String getIdentificationType(); + + /** + * Returns the public keys from the identity link. + * Maybe needed by the application. + * + * @return PublicKey[] The public keys from the + * identity link. + */ + public PublicKey[] getPublicKeys(); + + /** + * Returns the identity link. + * A validator may need other data from the identity link, than + * family name, given name, date of birth and identification value. + * The identity link element is only returned if specified within the + * config file. + * + * @return The identity link. + */ + public Element getIdentityLink(); + + /** + * Indicates whether source pins (Stammzahlen) should be hidden or not. + * If an online application lying behind MOA-ID is not allowed to get source pins + * (Stammzahlen), any source pins within SAML attributes + * returned by the validator must suppressed:
+ * If the parameter getHideStammzahl is true, then the validator + * MUST hide (replace by an empty string) any source pin (Stammzahl) + * that may be included in a SAML attribute returned by the validator. + * + * @return true if source pins (Stammzahlen) must be hidden, + * otherwise false. + */ + public boolean getHideStammzahl(); + + /** + * Returns application specific parameters. + * Each child element of this element contains + * a validating application specific parameter. The + * element is passed as specified within the config + * file and its up to the implementing class to + * parse and interprete its children. + * + * @return Application specific parameters. + */ + public Element getApplicationSpecificParams(); + +} + + diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java new file mode 100644 index 000000000..80ba5995f --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/InfoboxValidatorParamsImpl.java @@ -0,0 +1,348 @@ +package at.gv.egovernment.moa.id.auth.data; + +import java.security.PublicKey; +import java.util.List; + +import org.w3c.dom.Element; + +/** + * Parameters for validating an infobox. + * + * This interface is used by MOA-ID to provide parameters to an + * {link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator + * InfoboxValidator}. + * + * @author Harald Bratko + */ +public class InfoboxValidatorParamsImpl implements InfoboxValidatorParams { + + /** + * A list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} objects. + * The first token in this list is the one to be validated. Each further token + * maybe needed to validate this first token. + */ + protected List infoboxTokenList_; + + /** + * The ID of the trust profile used for validating certificates. + */ + protected String trustProfileID_; + + /** + * The locations of schemas that maybe needed for validating infobox tokens. + */ + protected List schemaLocations_; + + /** + * The URL of the BKU. + */ + protected String bkuURL_; + + /** + * Specifies whether the current online application is a business or a public application. + */ + protected boolean businessApplication_; + + /** + * The target parameter. + */ + protected String target_; + + /** + * The family name from the identity link. + */ + protected String familyName_; + + /** + * The given name from the identity link. + */ + protected String givenName_; + + /** + * The date of birth from the identity link. + */ + protected String dateOfBirth_; + + /** + * The date of identification value. + */ + protected String identificationValue_; + + /** + * The identification type. + */ + protected String identificationType_; + + /** + * The public keys from the identity link. + */ + protected PublicKey[] publicKeys_; + + /** + * The identity link. + */ + protected Element identityLink_; + + /** + * Indicates whether source pins (Stammzahlen) must be hidden or not. + */ + protected boolean hideStammzahl_; + + /** + * Application specific parameters. + */ + protected Element applicationSpecificParams_; + + /** + * Empty constructor. + */ + public InfoboxValidatorParamsImpl() { + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getInfoboxTokenList() + */ + public List getInfoboxTokenList() { + return infoboxTokenList_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getTrustProfileID() + */ + public String getTrustProfileID() { + return trustProfileID_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getSchemaLocations() + */ + public List getSchemaLocations() { + return schemaLocations_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getBkuURL() + */ + public String getBkuURL() { + return bkuURL_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getTarget() + */ + public String getTarget() { + return target_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getBusinessApplication() + */ + public boolean getBusinessApplication() { + return businessApplication_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getFamilyName() + */ + public String getFamilyName() { + return familyName_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getGivenName() + */ + public String getGivenName() { + return givenName_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getDateOfBirth() + */ + public String getDateOfBirth() { + return dateOfBirth_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getIdentificationValue() + */ + public String getIdentificationValue() { + return identificationValue_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getIdentificationType() + */ + public String getIdentificationType() { + return identificationType_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getPublicKeys() + */ + public PublicKey[] getPublicKeys() { + return publicKeys_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getIdentityLink() + */ + public Element getIdentityLink() { + return identityLink_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getHideStammzahl() + */ + public boolean getHideStammzahl() { + return hideStammzahl_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams#getApplicationSpecificParams() + */ + public Element getApplicationSpecificParams() { + return applicationSpecificParams_; + } + + /** + * Sets the application specific parameters. + * + * @param applicationSpecificParams The application specific parameters to set. + */ + public void setApplicationSpecificParams(Element applicationSpecificParams) { + applicationSpecificParams_ = applicationSpecificParams; + } + + /** + * Sets the bku URL. + * + * @param bkuURL The bku URL to set. + */ + public void setBkuURL(String bkuURL) { + bkuURL_ = bkuURL; + } + + /** + * Sets the business application parameter. + * + * @param businessApplication The business application parameter to set. + * (True if the application is a business + * application, otherwies false). + */ + public void setBusinessApplication(boolean businessApplication) { + businessApplication_ = businessApplication; + } + + /** + * Sets the date of birth. + * + * @param dateOfBirth The date of birth. + */ + public void setDateOfBirth(String dateOfBirth) { + dateOfBirth_ = dateOfBirth; + } + + /** + * Sets the family name. + * + * @param familyName The family name. + */ + public void setFamilyName(String familyName) { + familyName_ = familyName; + } + + /** + * Sets the given name. + * + * @param givenName The given name. + */ + public void setGivenName(String givenName) { + givenName_ = givenName; + } + + /** + * Sets the identification type. + * + * @param identificationType The identification type. + */ + public void setIdentificationType(String identificationType) { + identificationType_ = identificationType; + } + + /** + * Sets the identification value. + * + * @param identificationValue The identification value. + */ + public void setIdentificationValue(String identificationValue) { + identificationValue_ = identificationValue; + } + + /** + * Sets the identity link. + * + * @param identityLink The identity link. + */ + public void setIdentityLink(Element identityLink) { + identityLink_ = identityLink; + } + + /** + * Sets the infobox token to be validated. + * + * @param infoboxTokenList A list {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} + * objects. + */ + public void setInfoboxTokenList(List infoboxTokenList) { + infoboxTokenList_ = infoboxTokenList; + } + + /** + * Sets the public Keys. + * + * @param publicKeys The public keys. + */ + public void setPublicKeys(PublicKey[] publicKeys) { + publicKeys_ = publicKeys; + } + + /** + * Sets the schema locations. + * + * @param schemaLocations The schema locations. A list of + * {@link Schema} objects. + */ + public void setSchemaLocations(List schemaLocations) { + schemaLocations_ = schemaLocations; + } + + /** + * Sets the target. + * + * @param target The target. + */ + public void setTarget(String target) { + target_ = target; + } + + /** + * Sets the ID of the trust profile used for validating certificates. + * + * @param trustProfileID the ID of the trust profile used for validating certificates. + */ + public void setTrustProfileID(String trustProfileID) { + trustProfileID_ = trustProfileID; + } + + /** + * Sets the {@link #hideStammzahl_} parameter. This indicates whether source pins + * (Stammzahlen) must be hidden or not. + * + * @param hideStammzahl True if source pins (Stammzahlen) should + * be hidden, otherwise false. + */ + public void setHideStammzahl(boolean hideStammzahl) { + hideStammzahl_ = hideStammzahl; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java new file mode 100644 index 000000000..76ba6366d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SAMLAttribute.java @@ -0,0 +1,79 @@ +package at.gv.egovernment.moa.id.auth.data; + +/** + * This bean saves all data of a single SAMLAttribute: + * the name, value and namespace + * + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class SAMLAttribute { + + /** the name to be stored */ + private String name; + /** the namespace to be stored */ + private String namespace; + /** the value to be stored */ + private Object value; + + /** + * Constructor for SAMLAttribute. + */ + public SAMLAttribute(String name, String namespace, Object value) { + + this.name = name; + this.namespace = namespace; + this.value = value; + + } + + /** + * Returns the name. + * @return String + */ + public String getName() { + return name; + } + + /** + * Returns the namespace. + * @return String + */ + public String getNamespace() { + return namespace; + } + + /** + * Returns the value. + * @return String + */ + public Object getValue() { + return value; + } + + /** + * Sets the name. + * @param name The name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Sets the namespace. + * @param namespace The namespace to set + */ + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + /** + * Sets the value. + * @param value The value to set + */ + public void setValue(Object value) { + this.value = value; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/Schema.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/Schema.java new file mode 100644 index 000000000..c113f16b8 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/Schema.java @@ -0,0 +1,26 @@ +package at.gv.egovernment.moa.id.auth.data; + +/** + * Specifies the location of a schema. + * + * @author Harald Bratko + */ +public interface Schema { + + /** + * The namespace URI of this schema. + * + * @return The namespace of this schema. + */ + public String getNamespace(); + + /** + * The location URI of this schema. + * Relative paths have to be interpreted relative to the + * location of the MOA-ID config file. + * + * @return The location URI of this schema. + */ + public String getSchemaLocation(); + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java new file mode 100644 index 000000000..964725416 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/SchemaImpl.java @@ -0,0 +1,63 @@ +package at.gv.egovernment.moa.id.auth.data; + +/** + * This class specifies the location of a schema. + * + * @author Harald Bratko + */ +public class SchemaImpl implements Schema { + + /** + * The namespace of this schema. + */ + protected String namespace_; + + /** + * The location (URI) of this schema; + */ + protected String schemaLocation_; + + /** + * Sets the namespace and schema location URIS of this schema. + * + * @param namespace The namespace URI of this schema. + * @param schemaLocation The location URI of this schema. + */ + public SchemaImpl(String namespace, String schemaLocation) { + namespace_ = namespace; + schemaLocation_ = schemaLocation; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.Schema#getNamespace() + */ + public String getNamespace() { + return namespace_; + } + + /** + * @see at.gv.egovernment.moa.id.auth.data.Schema#getSchemaLocation() + */ + public String getSchemaLocation() { + return schemaLocation_; + } + + /** + * Sets the namespace. + * + * @param namespace The namespace to set. + */ + public void setNamespace(String namespace) { + namespace_ = namespace; + } + + /** + * Sets the location URI of this schema. + * + * @param schemaLocation The schemaLocation to set. + */ + public void setSchemaLocation(String schemaLocation) { + schemaLocation_ = schemaLocation; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java new file mode 100644 index 000000000..8233d1478 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/VerifyXMLSignatureResponse.java @@ -0,0 +1,177 @@ +package at.gv.egovernment.moa.id.auth.data; + +import iaik.x509.X509Certificate; + +/** + * This bean saves all information of the MOA-SP-Answer + * after the verification of any signature + * + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class VerifyXMLSignatureResponse { + /** The xmlDsigSubjectName to be stored */ + private String xmlDsigSubjectName; + /** The signatureCheckCode to be stored */ + private int signatureCheckCode; + /** The xmlDSIGManifestCheckCode to be stored */ + private int xmlDSIGManifestCheckCode; + /** The xmlDSIGManigest to be stored */ + private boolean xmlDSIGManigest; + /** The certificateCheckCode to be stored */ + private int certificateCheckCode; + /** The publicAuthority to be stored */ + private boolean publicAuthority; + /** The publicAuthorityCode to be stored */ + private String publicAuthorityCode; + /** The qualifiedCertificate to be stored */ + private boolean qualifiedCertificate; + /** The x509certificate to be stored */ + private X509Certificate x509certificate; + + /** + * Returns the certificateCheckCode. + * @return int + */ + public int getCertificateCheckCode() { + return certificateCheckCode; + } + + /** + * Returns the signatureCheckCode. + * @return int + */ + public int getSignatureCheckCode() { + return signatureCheckCode; + } + + /** + * Returns the xmlDSIGManifestCheckCode. + * @return int + */ + public int getXmlDSIGManifestCheckCode() { + return xmlDSIGManifestCheckCode; + } + + /** + * Returns the xmlDsigSubjectName. + * @return String + */ + public String getXmlDsigSubjectName() { + return xmlDsigSubjectName; + } + + /** + * Sets the certificateCheckCode. + * @param certificateCheckCode The certificateCheckCode to set + */ + public void setCertificateCheckCode(int certificateCheckCode) { + this.certificateCheckCode = certificateCheckCode; + } + + /** + * Sets the signatureCheckCode. + * @param signatureCheckCode The signatureCheckCode to set + */ + public void setSignatureCheckCode(int signatureCheckCode) { + this.signatureCheckCode = signatureCheckCode; + } + + /** + * Sets the xmlDSIGManifestCheckCode. + * @param xmlDSIGManifestCheckCode The xmlDSIGManifestCheckCode to set + */ + public void setXmlDSIGManifestCheckCode(int xmlDSIGManifestCheckCode) { + this.xmlDSIGManifestCheckCode = xmlDSIGManifestCheckCode; + } + + /** + * Sets the xmlDsigSubjectName. + * @param xmlDsigSubjectName The xmlDsigSubjectName to set + */ + public void setXmlDsigSubjectName(String xmlDsigSubjectName) { + this.xmlDsigSubjectName = xmlDsigSubjectName; + } + + /** + * Returns the publicAuthorityCode. + * @return int + */ + public String getPublicAuthorityCode() { + return publicAuthorityCode; + } + + /** + * Sets the publicAuthorityCode. + * @param publicAuthorityCode The publicAuthorityCode to set + */ + public void setPublicAuthorityCode(String publicAuthorityCode) { + this.publicAuthorityCode = publicAuthorityCode; + } + + /** + * Returns the qualifiedCertificate. + * @return boolean + */ + public boolean isQualifiedCertificate() { + return qualifiedCertificate; + } + + /** + * Returns the x509certificate. + * @return X509Certificate + */ + public X509Certificate getX509certificate() { + return x509certificate; + } + + /** + * Sets the qualifiedCertificate. + * @param qualifiedCertificate The qualifiedCertificate to set + */ + public void setQualifiedCertificate(boolean qualifiedCertificate) { + this.qualifiedCertificate = qualifiedCertificate; + } + + /** + * Sets the x509certificate. + * @param x509certificate The x509certificate to set + */ + public void setX509certificate(X509Certificate x509certificate) { + this.x509certificate = x509certificate; + } + + /** + * Returns the xmlDSIGManigest. + * @return boolean + */ + public boolean isXmlDSIGManigest() { + return xmlDSIGManigest; + } + + /** + * Sets the xmlDSIGManigest. + * @param xmlDSIGManigest The xmlDSIGManigest to set + */ + public void setXmlDSIGManigest(boolean xmlDSIGManigest) { + this.xmlDSIGManigest = xmlDSIGManigest; + } + + /** + * Returns the publicAuthority. + * @return boolean + */ + public boolean isPublicAuthority() { + return publicAuthority; + } + + /** + * Sets the publicAuthority. + * @param publicAuthority The publicAuthority to set + */ + public void setPublicAuthority(boolean publicAuthority) { + this.publicAuthority = publicAuthority; + } + +} 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 new file mode 100644 index 000000000..a18cf7322 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java @@ -0,0 +1,92 @@ +package at.gv.egovernment.moa.id.auth.invoke; + +import java.util.Vector; + +import javax.xml.namespace.QName; +import javax.xml.rpc.Call; +import javax.xml.rpc.Service; +import javax.xml.rpc.ServiceFactory; + +import org.apache.axis.message.SOAPBodyElement; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.ServiceException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.spss.api.SignatureVerificationService; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * Invoker of the SignatureVerification web service of MOA-SPSS.
+ * Either invokes the web service, or calls the corresponding API, depending on configuration data. + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class SignatureVerificationInvoker { + /** This QName Object identifies the SignatureVerification endpoint of the web service */ + private static final QName SERVICE_QNAME = new QName("SignatureVerification"); + + /** + * Method verifyXMLSignature. + * @param request to be sent + * @return Element with the answer + * @throws ServiceException if an error occurs + */ + public Element verifyXMLSignature(Element request) throws ServiceException { + return doCall(SERVICE_QNAME, request); + } + + /** + * Method doCall. + * @param serviceName the name of the service + * @param request the request to be sent + * @return Element the answer + * @throws ServiceException if an error occurs + */ + protected Element doCall(QName serviceName, Element request) throws ServiceException { + ConnectionParameter authConnParam = null; + try { + Service service = ServiceFactory.newInstance().createService(serviceName); + Call call = service.createCall(); + SOAPBodyElement body = new SOAPBodyElement(request); + SOAPBodyElement[] params = new SOAPBodyElement[] { body }; + Vector responses; + SOAPBodyElement response; + + String endPoint; + AuthConfigurationProvider authConfigProvider = AuthConfigurationProvider.getInstance(); + authConnParam = authConfigProvider.getMoaSpConnectionParameter(); + //If the ConnectionParameter do NOT exist, we try to get the api to work.... + if (authConnParam != null) { + endPoint = authConnParam.getUrl(); + call.setTargetEndpointAddress(endPoint); + responses = (Vector) call.invoke(serviceName, params); + response = (SOAPBodyElement) responses.get(0); + return response.getAsDOM(); + } + else { + SignatureVerificationService svs = SignatureVerificationService.getInstance(); + VerifyXMLSignatureRequest vsrequest = new VerifyXMLSignatureRequestParser().parse(request); + + VerifyXMLSignatureResponse vsresponse = svs.verifyXMLSignature(vsrequest); + Document result = new VerifyXMLSignatureResponseBuilder().build(vsresponse); + + Logger.setHierarchy("moa.id.auth"); + return result.getDocumentElement(); + } + } + catch (Exception ex) { + if (authConnParam != null) { + throw new ServiceException("service.00", new Object[] { ex.toString()}, ex); + } else { + throw new ServiceException("service.03", new Object[] { ex.toString()}, ex); + } + } + } +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java new file mode 100644 index 000000000..a8b870f04 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/CreateXMLSignatureResponseParser.java @@ -0,0 +1,193 @@ +package at.gv.egovernment.moa.id.auth.parser; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.id.auth.data.SAMLAttribute; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Parses an <InfoboxReadResponse> returned from + * the security layer + * + * @author Stefan Knirsch + * @version $Id$ + */ + +public class CreateXMLSignatureResponseParser { + // + // XPath namespace prefix shortcuts + // + + /** Xpath prefix for reaching SAML Namespaces */ + private static final String SAML = Constants.SAML_PREFIX + ":"; + /** Xpath prefix for reaching XML-DSIG Namespaces */ + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + /** Xpath expression to the root element */ + private static final String ROOT = ":CreateXMLSignatureResponse/"; + /** Xpath expression to the SAML:Assertion element */ + private static final String SAML_ASSERTION_XPATH = ROOT + SAML + "Assertion"; + /** Xpath expression to the SAML:NameIdentifier element */ + private static final String SAML_SUBJECT_NAME_IDENTIFIER_XPATH = SAML_ASSERTION_XPATH + "/" + SAML + "AttributeStatement/" + SAML + "Subject/" + SAML + "NameIdentifier"; + /** Xpath expression to the AttributeStatement element */ + private static final String SAML_ATTRIBUTE_XPATH = SAML_ASSERTION_XPATH + "/" + SAML + "AttributeStatement/" + SAML + "Attribute"; + /** Xpath expression to the AttributeValue element */ + private static final String SAML_ATTRIBUTE_VALUE_XPATH = SAML + "AttributeValue"; + + + /** This is the root element of the CreateXMLsignatureResponse */ + private Element sigResponse_; + + /** + * Parses and validates the document given as string and extracts the + * root element. + * + * @param xmlResponse <CreateXMLSignatureResponse> as String + * + * @throws AuthenticationException if any authentication error occurs + * @throws ParseException if an element cannot be parsed + */ + public CreateXMLSignatureResponseParser(String xmlResponse) throws AuthenticationException, ParseException { + try { + InputStream s = new ByteArrayInputStream(xmlResponse.getBytes("UTF-8")); + init(s); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + } + + /** + * Parses and validates the document given as stream and extracts the + * root element. + * + * @param is <InfoboxReadResponse> as InputStream + * + * @throws AuthenticationException If any authentication error occurs + * @throws ParseException If an element cannot be parsed + */ + public CreateXMLSignatureResponseParser(InputStream is) throws AuthenticationException, ParseException { + init(is); + } + + /** + * Constructor for CreateXMLSignatureResponseParser. + * The incoming Element will be used for further operations + * @param xmlResponse <InfoboxReadResponse> as InputStream + */ + public CreateXMLSignatureResponseParser(Element xmlResponse) { + sigResponse_ = xmlResponse; + } + + /** + * Initializes the parser. + * Parses and validates the document given as stream and extracts the + * root element. + * + * @param is The CreateXMLSignatureResponse as stream. + * @throws AuthenticationException if an authentication error occurs. + * @throws ParseException If an error occurs on parsing the the document. + */ + private void init(InputStream is) throws AuthenticationException, ParseException { + try { + + Element responseElem = DOMUtils.parseXmlValidating(is); + + if ("CreateXMLSignatureResponse".equals(responseElem.getLocalName())) { + sigResponse_ = responseElem; + } else { + ErrorResponseParser erp = new ErrorResponseParser(responseElem); + throw new AuthenticationException("auth.08", new Object[] { erp.getErrorCode(), erp.getErrorInfo()}); + } + + } catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + } + + /** + * Unmarshalls the <@link sigResponse> to an + * <CreateXMLSignatureResponse> object. + * + * @return a <CreateXMLSignatureResponse> object + * @throws ParseException + */ + + public CreateXMLSignatureResponse parseResponse() throws ParseException { + CreateXMLSignatureResponse cResp; + try { + cResp = new CreateXMLSignatureResponse(); + String slPrefix = XPathUtils.getSlPrefix(sigResponse_); + cResp.setSamlNameIdentifier(XPathUtils.getElementValue(sigResponse_, "/" + slPrefix + SAML_SUBJECT_NAME_IDENTIFIER_XPATH, null)); + cResp.setSamlAssertion((Element) XPathUtils.selectSingleNode(sigResponse_, "/" + slPrefix + SAML_ASSERTION_XPATH)); + NodeIterator attrIter = XPathUtils.selectNodeIterator(sigResponse_, "/" + slPrefix + SAML_ATTRIBUTE_XPATH); + Element samlAttr; + List samlAttributes = new ArrayList(); + while ((samlAttr = (Element) attrIter.nextNode()) != null) { + String attrName = XPathUtils.getAttributeValue(samlAttr, "@AttributeName", ""); + String attrNamespace = XPathUtils.getAttributeValue(samlAttr, "@AttributeNamespace", ""); + Object attrValue; + Element attrValueElem = (Element)XPathUtils.selectSingleNode(samlAttr, SAML_ATTRIBUTE_VALUE_XPATH); + attrValue = DOMUtils.getElementFromNodeList(attrValueElem.getChildNodes()); + if (attrValue == null) { + if (null!=attrValueElem.getFirstChild()) { + attrValue = attrValueElem.getFirstChild().getNodeValue(); + } else { + attrValue = ""; + } + } + samlAttributes.add(new SAMLAttribute(attrName, attrNamespace, attrValue)); + } + SAMLAttribute[] result = new SAMLAttribute[samlAttributes.size()]; + samlAttributes.toArray(result); + cResp.setSamlAttributes(result); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + return cResp; + } + +// public CreateXMLSignatureResponse parseResponse() throws ParseException { +// CreateXMLSignatureResponse cResp; +// try { +// cResp = new CreateXMLSignatureResponse(); +// Element samlAssertion = (Element)sigResponse.getElementsByTagNameNS(Constants.SAML_NS_URI, "Assertion").item(0); +// cResp.setSamlAssertion(samlAssertion); +// Element samlAttributeStatement = (Element)samlAssertion.getElementsByTagNameNS(Constants.SAML_NS_URI, "AttributeStatement").item(0); +// Element samlSubject = (Element)samlAttributeStatement.getElementsByTagNameNS(Constants.SAML_NS_URI, "Subject").item(0); +// Element samlNameIdentifier = (Element)samlSubject.getElementsByTagNameNS(Constants.SAML_NS_URI, "NameIdentifier").item(0); +// cResp.setSamlNameIdentifier(samlNameIdentifier.getFirstChild().getNodeValue()); +// NodeList nl = samlAttributeStatement.getElementsByTagNameNS(Constants.SAML_NS_URI, "Attribute"); +// List samlAttributes = new ArrayList(); +// for (int i=0; i<ErrorResponse>. + * + * @author Stefan Knirsch + * @version $Id$ + */ + +public class ErrorResponseParser { + + /** + * The error code included in this error response. + * 1000 is used as default value, if some problems occur on + * evaluating the error response. + */ + private String errorCode_ = "1000"; + + /** + * The error info included in this error response. + * <Unklassifizierter Fehler.> is used as default value, + * if some problems occur on evaluating the error response. + */ + private String errorInfo_ = "Unklassifizierter Fehler."; + + + /** + * This Constructor extracts the error code and error info included in this + * error response. + * + * @param errorElement The error element. This is the root element of + * the error response. + */ + public ErrorResponseParser(Element errorElement) throws ParseException { + if (errorElement != null) { + String namespace = errorElement.getNamespaceURI(); + NodeList nl = errorElement.getElementsByTagNameNS(namespace, "ErrorCode"); + if (nl.getLength() == 1) { + errorCode_ = ((Element)nl.item(0)).getFirstChild().getNodeValue(); + } + nl = errorElement.getElementsByTagNameNS(namespace, "Info"); + if (nl.getLength() == 1) { + errorInfo_ = ((Element)nl.item(0)).getFirstChild().getNodeValue(); + } + } + } + + /** + * Returns the error code included in this error response. + */ + public String getErrorCode() { + return errorCode_ ; + } + + /** + * Returns the information included in this error response. + * @return The error infomation String + */ + public String getErrorInfo() { + return errorInfo_ ; + } + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java new file mode 100644 index 000000000..e493f07fb --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/ExtendedInfoboxReadResponseParser.java @@ -0,0 +1,157 @@ +package at.gv.egovernment.moa.id.auth.parser; + +import java.util.Iterator; +import java.util.List; +import java.util.Vector; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.InfoboxToken; +import at.gv.egovernment.moa.id.auth.data.InfoboxTokenImpl; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +/** + * Parses and unmarshales InfoboxReadResponse. + * This parser is especially used for parsing additional responses (additional to that + * one containing the IdentityLink retuned from the BKU as an answer of + * a <PushInfobox> request. + */ +public class ExtendedInfoboxReadResponseParser { + + /** + * Hide default constructor. + */ + private ExtendedInfoboxReadResponseParser() { + } + + /** + * Parses and unmarshales the given infoboxReadResponse to a list of + * {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} objects. + * The method parses the given infoboxReadResponse + * + * @param infoboxReadResponse The infobox read response to be unmarshaled. + * @param infoboxName The name of the infobox the reponse corresponds to. + * + * @return A list of {@link at.gv.egovernment.moa.id.auth.data.InfoboxToken InfoboxToken} + * objects. Maybe empty. + * + * @throws ParseException If an error occurs on parsing and unmarshaling the response. + */ + public static List parseInfoboxReadResponse(String infoboxReadResponse, String infoboxName) + throws ParseException + { + Element infoboxReadResponseElem = null; + try { + Document doc = + DOMUtils.parseDocument(infoboxReadResponse, true, Constants.ALL_SCHEMA_LOCATIONS, null); + infoboxReadResponseElem = doc.getDocumentElement(); + } catch (Exception e) { + Logger.error("InfoboxReadResponse for \"" + infoboxName + + "\"-infobox could not be parsed successfully: " + e.getMessage()); + throw new ParseException("parser.01", new Object[] {infoboxName + "-InfoboxReadResponse"}); + } + + Vector infoboxTokenList = new Vector(); + + if (infoboxReadResponseElem != null) { + // avoid using namespace URI or prefix, because it might change within the response + // (e.g.: sl11-namespace, some child sl10-namespace + List infoboxReadResponseChildren = DOMUtils.getChildElements(infoboxReadResponseElem); + String key = null; + boolean primary = true; + Element infoboxReadResponseChild = (Element)infoboxReadResponseChildren.get(0); + String infoboxReadResponseChildName = infoboxReadResponseChild.getLocalName(); + if (infoboxReadResponseChildName.equals("AssocArrayData")) { + // get the child elements from the element + List assocArrayPairs = DOMUtils.getChildElements(infoboxReadResponseChild); + Iterator assocArrayPairIt = assocArrayPairs.iterator(); + int pairCount = 0; + // step through the elemnts + while (assocArrayPairIt.hasNext()) { + Element assocArrayPair = (Element)assocArrayPairIt.next(); + // check if the element actually a "Pair" element and not only a "key" + if (assocArrayPair.getLocalName().equals("Key")) { + // do not accept only a Key + throw new ParseException("parser.07", new Object[] {infoboxName}); + } + key = assocArrayPair.getAttribute("Key"); + if (pairCount > 0) { + primary = false; + } + pairCount++; + infoboxTokenList.addAll(getTokenFromXMLOrBase64Content(assocArrayPair, infoboxName, key, primary)); + } + + } else if (infoboxReadResponseChildName.equals("BinaryFileData")) { + infoboxTokenList.addAll(getTokenFromXMLOrBase64Content(infoboxReadResponseChild, infoboxName, null, true)); + } + } + return infoboxTokenList; + } + + /** + * Unmarshales the <XMLContent> or + * <Base64Content> child of the given element to a list of + * infobox token. + * + * @param contentParent The elment including the <XMLContent> or + * <Base64Content> child to unmarshal the + * infobox token from. + * @param infoboxName The name of the infobox. + * @param key The key of an AssocArrayData-Pair. + * Maybe null. + * @param primary Specifies whether this token is the first (e.g. in an + * AssocArrayData) token. + * + * @return A infobox token list. + * + * @throws ParseException If the contentParent has no <XMLContent> + * or <Base64Content> child or the + * <XMLContent> is empty. + */ + public static List getTokenFromXMLOrBase64Content( + Element contentParent, + String infoboxName, + String key, + boolean primary) + throws ParseException + { + Vector tokenList = new Vector(); + // get the or + List content = DOMUtils.getChildElements(contentParent); + if (content.size() == 1) { + Element contentElem = (Element)content.get(0); + if (contentElem.getLocalName().equals("XMLContent")) { + List xmlContentChildren = DOMUtils.getChildElements(contentElem); + if (xmlContentChildren.size() == 0) { + throw new ParseException("parser.06", new Object[] {infoboxName, "Inhalt", "XMLContent"}); + } + int xmlCount = 0; + Iterator contentIt = xmlContentChildren.iterator(); + while (contentIt.hasNext()) { + Element xmlToken = (Element)contentIt.next(); + if (xmlCount > 0) { + primary = false; + } + InfoboxToken infoboxToken = new InfoboxTokenImpl(key, primary, xmlToken); + tokenList.add(infoboxToken); + xmlCount++; + } + } else { + String base64Token = contentElem.getFirstChild().getNodeValue(); + InfoboxToken infoboxToken = new InfoboxTokenImpl(key, primary, base64Token); + tokenList.add(infoboxToken); + } + } else { + throw new ParseException("parser.06", + new Object[] {infoboxName, "XMLContent oder Base64Content", contentParent.getLocalName()}); + } + return tokenList; + } + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java new file mode 100644 index 000000000..d8a57fd2f --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParser.java @@ -0,0 +1,319 @@ +package at.gv.egovernment.moa.id.auth.parser; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.security.PublicKey; +import java.security.interfaces.RSAPublicKey; +import java.util.ArrayList; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.id.ECDSAConverterException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.util.ECDSAKeyValueConverter; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Parses an identity link <saml:Assertion> + * @author Paul Ivancsics + * @version $Id$ + */ +public class IdentityLinkAssertionParser { + + // + // XPath namespace prefix shortcuts + // + + /** Xpath prefix for reaching PersonData Namespaces */ + private static final String PDATA = Constants.PD_PREFIX + ":"; + /** Xpath prefix for reaching SAML Namespaces */ + private static final String SAML = Constants.SAML_PREFIX + ":"; + /** Xpath prefix for reaching XML-DSIG Namespaces */ + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + /** Xpath prefix for reaching ECDS Namespaces */ + private static final String ECDSA = Constants.ECDSA_PREFIX + ":"; + /** Xpath expression to the root element */ + private static final String ROOT = ""; + /** Xpath expression to the SAMLSubjectConfirmationData element */ + private static final String SAML_SUBJECT_CONFIRMATION_DATA_XPATH = + ROOT + + SAML + + "AttributeStatement/" + + SAML + + "Subject/" + + SAML + + "SubjectConfirmation/" + + SAML + + "SubjectConfirmationData"; + /** Xpath expression to the PersonData element */ + private static final String PERSON_XPATH = + SAML_SUBJECT_CONFIRMATION_DATA_XPATH + + "/" + + PDATA + + "Person"; + /** Xpath expression to the PersonData GivenName element */ + private static final String PERSON_GIVEN_NAME_XPATH = + PERSON_XPATH + + "/" + + PDATA + + "Name/" + + PDATA + + "GivenName"; + /** Xpath expression to the PersonData FamilyName element */ + private static final String PERSON_FAMILY_NAME_XPATH = + PERSON_XPATH + + "/" + + PDATA + + "Name/" + + PDATA + + "FamilyName"; + /** Xpath expression to the PersonData DateOfBirth element */ + private static final String PERSON_DATE_OF_BIRTH_XPATH = + PERSON_XPATH + + "/" + + PDATA + + "DateOfBirth"; + /** Xpath expression to the Identification element */ + private static final String PERSON_IDENT_XPATH = + PERSON_XPATH + + "/" + + PDATA + + "Identification"; + + /** Xpath expression to the Identification Value element */ + public static final String PERSON_IDENT_VALUE_XPATH = + PERSON_XPATH + + "/" + + PDATA + + "Identification/" + + PDATA + + "Value"; + + /** Xpath expression to the Identification Value element */ + private static final String PERSON_IDENT_TYPE_XPATH = + PERSON_XPATH + + "/" + + PDATA + + "Identification/" + + PDATA + + "Type"; + + /** Xpath expression to the RSAKeyValue element */ + private static final String RSA_KEY_VALUE_XPATH = + ROOT + + SAML + + "AttributeStatement/" + + SAML + + "Attribute/" + + SAML + + "AttributeValue/" + + DSIG + + "RSAKeyValue"; + + /** Xpath expression to the ECKeyValue element */ + private static final String ECDSA_KEY_VALUE_XPATH = + ROOT + + SAML + + "AttributeStatement/" + + SAML + + "Attribute/" + + SAML + + "AttributeValue/" + + ECDSA + + "ECDSAKeyValue"; + + + /** Xpath expression to the RSA Modulus element */ + private static final String RSA_KEY_MODULUS_XPATH = DSIG + "Modulus"; + /** Xpath expression to the RSA Exponent element */ + private static final String RSA_KEY_EXPONENT_XPATH = DSIG + "Exponent"; + /** Xpath expression to the DSIG X509Certificate element */ + private static final String DSIG_CERTIFICATES_XPATH = + ROOT + + DSIG + + "Signature/" + + DSIG + + "KeyInfo/" + + DSIG + + "X509Data/" + + DSIG + + "X509Certificate"; + /** Xpath expression to the DSIG Transforms element */ + private static final String DSIG_REFERENCE_TRANSFORMATION_XPATH = + ROOT + + DSIG + + "Signature/" + + DSIG + + "SignedInfo/" + + DSIG + + "Reference/" + + DSIG + + "Transforms"; + + /** The IssueInstant attribute of the SAML assertion */ + private static final String ISSUE_INSTANT_ATTR = "IssueInstant"; + + /**This is the root element of the XML-Document provided by the Security Layer Card*/ + private Element assertionElem; + + /** + * Constructor for IdentityLinkAssertionParser. + * A DOM-representation of the incoming String will be created + * @param xmlAssertion <saml:Assertion> as String + * @throws ParseException on any parsing error + */ + public IdentityLinkAssertionParser(String xmlAssertion) throws ParseException { + try { + InputStream s = new ByteArrayInputStream(xmlAssertion.getBytes("UTF-8")); + assertionElem = DOMUtils.parseXmlValidating(s); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + } + + /** + * Sets the <@link assertionElem>. + * @param xmlAssertion the assertion element + * @throws ParseException on any parsing error + */ + public IdentityLinkAssertionParser(Element xmlAssertion) throws ParseException { + assertionElem = xmlAssertion; + } + + /** + * Constructor for IdentityLinkAssertionParser. + * A DOM-representation of the incoming Inputstream will be created + * @param xmlAssertion <saml:Assertion> as InputStream + * @throws ParseException on any parsing error + */ + public IdentityLinkAssertionParser(InputStream xmlAssertion) throws Exception { + try { + assertionElem = DOMUtils.parseXmlValidating(xmlAssertion); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString() }, t); + } + } + + /** + * Parses the identity link from the <saml:Assertion> + * @return Identity link + * @throws ParseException on any parsing error + */ + + public IdentityLink parseIdentityLink() throws ParseException { + IdentityLink identityLink; + try { + identityLink = new IdentityLink(); + identityLink.setSamlAssertion(assertionElem); + identityLink.setIssueInstant(assertionElem.getAttribute(ISSUE_INSTANT_ATTR)); + identityLink.setPrPerson((Element) + XPathUtils.selectSingleNode(assertionElem, PERSON_XPATH)); + identityLink.setIdentificationValue( + XPathUtils.getElementValue(assertionElem, PERSON_IDENT_VALUE_XPATH, "")); + identityLink.setIdentificationType( + XPathUtils.getElementValue(assertionElem, PERSON_IDENT_TYPE_XPATH, "")); + identityLink.setGivenName( + XPathUtils.getElementValue(assertionElem, PERSON_GIVEN_NAME_XPATH, "")); + identityLink.setFamilyName( + XPathUtils.getElementValue(assertionElem, PERSON_FAMILY_NAME_XPATH, "")); + identityLink.setDateOfBirth( + XPathUtils.getElementValue(assertionElem, PERSON_DATE_OF_BIRTH_XPATH, "")); + NodeIterator dsigRefTransforms = + XPathUtils.selectNodeIterator(assertionElem, DSIG_REFERENCE_TRANSFORMATION_XPATH); + List transElems = new ArrayList(); + Element transformsElem; + while ((transformsElem = (Element) dsigRefTransforms.nextNode()) != null) { + transElems.add(transformsElem); + } + Element[] result = new Element[transElems.size()]; + transElems.toArray(result); + identityLink.setDsigReferenceTransforms(result); + + identityLink.setPublicKey(getPublicKeys()); + + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString() }, t); + } + + return identityLink; + } + + /** + * Parses an array of Public Keys from the <InfoboxReadResponse> + * @return RSAPublicKey[] + * @throws IOException can occur when decoding the base64 values of the modulus and exponent + */ + public PublicKey[] getPublicKeys() throws IOException, ECDSAConverterException{ + + + List pubKeys = new ArrayList(); + //Try to get RSA-Keys + NodeIterator rsaIter = + XPathUtils.selectNodeIterator(assertionElem, Constants.nSMap, RSA_KEY_VALUE_XPATH); + Element rsaElem; + + while ((rsaElem = (Element) rsaIter.nextNode()) != null) { + String modulus = + XPathUtils.getElementValue(rsaElem, RSA_KEY_MODULUS_XPATH, ""); + String exponent = + XPathUtils.getElementValue(rsaElem, RSA_KEY_EXPONENT_XPATH, ""); + + RSAPublicKey resPub = + new iaik.security.rsa.RSAPublicKey( + new BigInteger(1, Base64Utils.decode(modulus, true)), + new BigInteger(1, Base64Utils.decode(exponent, true))); + pubKeys.add(resPub); + } + + //Try to get ECDSA-Keys + NodeIterator ecdsaIter = + XPathUtils.selectNodeIterator(assertionElem, Constants.nSMap, ECDSA_KEY_VALUE_XPATH); + Element ecdsaElem; + PublicKey ecPubKey = null; + while ((ecdsaElem = (Element) ecdsaIter.nextNode()) != null) { + try { + ecPubKey = ECDSAKeyValueConverter.element2ECDSAPublicKey(ecdsaElem); + pubKeys.add(ecPubKey); + } + catch(Exception e) { + throw new ECDSAConverterException("parser.03", new Object[] { e.toString() }, e); + } + } + + PublicKey[] result = new PublicKey[pubKeys.size()]; + pubKeys.toArray(result); + return result; + + } + /** + * Parses a string array of decoded base64 certificates from + * the <InfoboxReadResponse> found in the dsig-signature + * @return String[] with raw-certificates from the dsig-signature keyinfo + * @throws Exception + */ + public String[] getCertificates() throws Exception { + List certs = new ArrayList(); + NodeIterator rsaIter = + XPathUtils.selectNodeIterator(assertionElem, DSIG_CERTIFICATES_XPATH); + Element certElem; + while ((certElem = (Element) rsaIter.nextNode()) != null) { + String content = DOMUtils.getText(certElem); + certs.add(new String(Base64Utils.decode(content, true))); + } + String[] result = new String[certs.size()]; + certs.toArray(result); + return result; + + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java new file mode 100644 index 000000000..e59c88ddc --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParser.java @@ -0,0 +1,165 @@ +package at.gv.egovernment.moa.id.auth.parser; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Parses an <InfoboxReadResponse>. + * + * @author Stefan Knirsch + * @version $Id$ + */ + +public class InfoboxReadResponseParser { + + /** This is the root element of the XML-Document provided by the Security Layer Card*/ + private Element infoBoxElem_; + + /** + * Parses and validates the document given as string and extracts the + * root element. + * + * @param xmlResponse <InfoboxReadResponse> as String + * @throws ParseException If an element cannot be parsed + * @throws AuthenticationException If any authentication error occurs + */ + public InfoboxReadResponseParser(String xmlResponse) throws ParseException, AuthenticationException { + + try { + InputStream s = new ByteArrayInputStream(xmlResponse.getBytes("UTF-8")); + init(s); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + } + + /** + * Parses and validates the document given as stream and extracts the + * root element. + * + * @param is <InfoboxReadResponse> as InputStream + * @throws ParseException If an element cannot be parsed + * @throws AuthenticationException If any authentication error occurs + */ + public InfoboxReadResponseParser(InputStream is) throws ParseException, AuthenticationException { + init(is); + } + + /** + * Initializes the parser. + * Parses and validates the document given as stream and extracts the + * root element. + * + * @param is The InfoBoxReadResponse as stream. + * @throws AuthenticationException If an authentication error occurs. + * @throws ParseException If an error occurs on parsing the the document. + */ + private void init(InputStream is) throws AuthenticationException, ParseException { + try { + + Element responseElem = DOMUtils.parseXmlValidating(is); + + if ("InfoboxReadResponse".equals(responseElem.getLocalName())) { + infoBoxElem_ = responseElem; + } else { + ErrorResponseParser erp = new ErrorResponseParser(responseElem); + throw new AuthenticationException("auth.08", new Object[] { erp.getErrorCode(), erp.getErrorInfo()}); + } + + } catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + } + + + + /** + * Parses the embedded <saml:Assertion> element from <InfoboxReadResponse> + * @return <saml:Assertion> as String + * @throws ParseException on any parsing error + */ +// public String parseSAMLAssertion() throws ParseException { +// try { +// +// String slPrefix = XPathUtils.getSlPrefix(infoBoxElem_); +// StringBuffer sb = new StringBuffer("/"); +// sb.append(slPrefix); +// sb.append(":InfoboxReadResponse/"); +// sb.append(slPrefix); +// sb.append(":BinaryFileData/"); +// sb.append(slPrefix); +// sb.append(":XMLContent/"); +// sb.append(Constants.SAML_PREFIX); +// sb.append(":Assertion"); +// String samlAssertionXPath = sb.toString(); +// Element samlAssertion = (Element) XPathUtils.selectSingleNode(infoBoxElem_, samlAssertionXPath); +// return DOMUtils.serializeNode(samlAssertion); +// +// } +// catch (Throwable t) { +// throw new ParseException("parser.01", new Object[] { t.toString()}, t); +// } +// } + + /** + * Parses the embedded <saml:Assertion> element from <InfoboxReadResponse> + * @return <saml:Assertion> as String + * @throws ParseException on any parsing error + */ + public Element parseSAMLAssertion() throws ParseException { + try { + + String slPrefix = XPathUtils.getSlPrefix(infoBoxElem_); + StringBuffer sb = new StringBuffer("/"); + sb.append(slPrefix); + sb.append(":InfoboxReadResponse/"); + sb.append(slPrefix); + sb.append(":BinaryFileData/"); + sb.append(slPrefix); + sb.append(":XMLContent/"); + sb.append(Constants.SAML_PREFIX); + sb.append(":Assertion"); + String samlAssertionXPath = sb.toString(); + Element samlAssertion = (Element) XPathUtils.selectSingleNode(infoBoxElem_, samlAssertionXPath); + return samlAssertion; + + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString()}, t); + } + } + + /** + * Parses the identity link from the <saml:Assertion> + * @return Identity link + * @throws ParseException on any parsing error + */ + +// public IdentityLink parseIdentityLink() throws ParseException { +// String samlAssertionString = parseSAMLAssertion(); +// IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(samlAssertionString); +// return ilParser.parseIdentityLink(); +// } + + /** + * Parses the identity link from the <saml:Assertion> + * @return Identity link + * @throws ParseException on any parsing error + */ + public IdentityLink parseIdentityLink() throws ParseException { + Element samlAssertion = parseSAMLAssertion(); + IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(samlAssertion); + return ilParser.parseIdentityLink(); + } + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java new file mode 100644 index 000000000..7c4c01abe --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParser.java @@ -0,0 +1,58 @@ +package at.gv.egovernment.moa.id.auth.parser; + +import java.io.IOException; + +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.util.Base64Utils; + +/** + * Parser for a SAML artifact. + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLArtifactParser { + /** byte array containing the SamlArtifact bytes */ + private byte[] samlArtifactBytes; + + /** + * Constructor + * @param samlArtifact as String + * @throws ParseException on any parsing error + */ + public SAMLArtifactParser(String samlArtifact) throws ParseException { + try { + samlArtifactBytes = Base64Utils.decode(samlArtifact, false); + } + catch (IOException ex) { + throw new ParseException("parser.02", new Object[] {ex.toString()}, ex); + } + } + /** + * Parses the type code. + * @return type code + * @throws ParseException when SAML artifact is invalid + */ + public byte[] parseTypeCode() throws ParseException { + try { + byte[] typeCode = new byte[] {samlArtifactBytes[0], samlArtifactBytes[1]}; + return typeCode; + } + catch (Throwable ex) { + throw new ParseException("parser.02", new Object[] {ex.toString()}, ex); + } + } + /** + * Parses the assertion handle. + * @return assertion handle + * @throws ParseException when SAML artifact is invalid + */ + public String parseAssertionHandle() throws ParseException { + try { + return new String(samlArtifactBytes, 22, 20); + } + catch (Throwable ex) { + throw new ParseException("parser.02", new Object[] {ex.toString()}, ex); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java new file mode 100644 index 000000000..4c49afb76 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/VerifyXMLSignatureResponseParser.java @@ -0,0 +1,156 @@ +package at.gv.egovernment.moa.id.auth.parser; + +import iaik.utils.Base64InputStream; +import iaik.x509.X509Certificate; +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.*; +import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Parses a <VerifyXMLSignatureResponse> returned by + * MOA-SPSS. + * This class implements the Singleton pattern + * + * @author Stefan Knirsch + * @version $Id$ + */ + + +public class VerifyXMLSignatureResponseParser { + // + // XPath namespace prefix shortcuts + // + /** Xpath prefix for reaching MOA Namespaces */ + private static final String MOA = Constants.MOA_PREFIX + ":"; + /** Xpath prefix for reaching DSIG Namespaces */ + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + /** Xpath expression to the root element */ + private static final String ROOT = "/" + MOA + "VerifyXMLSignatureResponse/"; + + /** Xpath expression to the X509SubjectName element */ + private static final String DSIG_SUBJECT_NAME_XPATH = + ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + + DSIG + "X509SubjectName"; + /** Xpath expression to the X509Certificate element */ + private static final String DSIG_X509_CERTIFICATE_XPATH = + ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + + DSIG + "X509Certificate"; + /** Xpath expression to the PublicAuthority element */ + private static final String PUBLIC_AUTHORITY_XPATH = + ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + + MOA + "PublicAuthority"; + /** Xpath expression to the PublicAuthorityCode element */ + private static final String PUBLIC_AUTHORITY_CODE_XPATH = + PUBLIC_AUTHORITY_XPATH + "/" + MOA + "Code"; + /** Xpath expression to the QualifiedCertificate element */ + private static final String QUALIFIED_CERTIFICATE_XPATH = + ROOT + MOA + "SignerInfo/" + DSIG + "X509Data/" + + MOA + "QualifiedCertificate"; + + /** Xpath expression to the SignatureCheckCode element */ + private static final String SIGNATURE_CHECK_CODE_XPATH = + ROOT + MOA + "SignatureCheck/" + MOA + "Code"; + /** Xpath expression to the XMLDSIGManifestCheckCode element */ + private static final String XMLDSIG_MANIFEST_CHECK_CODE_XPATH = + ROOT + MOA + "XMLDSIGManifestCheck/" + MOA + "Code"; + /** Xpath expression to the CertificateCheckCode element */ + private static final String CERTIFICATE_CHECK_CODE_XPATH = + ROOT + MOA + "CertificateCheck/" + MOA + "Code"; + + + /** This is the root element of the XML-Document provided by the Security Layer Card*/ + private Element verifyXMLSignatureResponse; + + /** + * Constructor for VerifyXMLSignatureResponseParser. + * A DOM-representation of the incoming String will be created + * @param xmlResponse <InfoboxReadResponse> as String + * @throws ParseException on any parsing error + */ + public VerifyXMLSignatureResponseParser(String xmlResponse) throws ParseException{ + try { + InputStream s = new ByteArrayInputStream(xmlResponse.getBytes("UTF-8")); + + verifyXMLSignatureResponse = DOMUtils.parseXmlValidating(s); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString() }, t); + } + } + + /** + * Constructor for VerifyXMLSignatureResponseParser. + * A DOM-representation of the incoming Inputstream will be created + * @param xmlResponse <InfoboxReadResponse> as InputStream + * @throws Exception on any parsing error + */ + public VerifyXMLSignatureResponseParser(InputStream xmlResponse) throws Exception + { + try { + verifyXMLSignatureResponse = DOMUtils.parseXmlValidating(xmlResponse); + } + catch (Throwable t) { + throw new ParseException("parser.01", null, t); + } + } + + /** + * Constructor for VerifyXMLSignatureResponseParser. + * The incoming Element will be used for further operations + * @param xmlResponse <InfoboxReadResponse> as Element + */ + public VerifyXMLSignatureResponseParser(Element xmlResponse) + { + verifyXMLSignatureResponse =xmlResponse; + + } + + /** + * Parse identity link from <InfoboxReadResponse> + * @return Identity link + * @throws ParseException on any parsing error + */ + + public VerifyXMLSignatureResponse parseData() throws ParseException { + + VerifyXMLSignatureResponse respData=new VerifyXMLSignatureResponse(); + + try { + respData.setXmlDsigSubjectName(XPathUtils.getElementValue(verifyXMLSignatureResponse,DSIG_SUBJECT_NAME_XPATH,"")); + Element e = (Element)XPathUtils.selectSingleNode(verifyXMLSignatureResponse,QUALIFIED_CERTIFICATE_XPATH); + respData.setQualifiedCertificate(e!=null); + + Base64InputStream in = new Base64InputStream(new ByteArrayInputStream(XPathUtils.getElementValue( + verifyXMLSignatureResponse,DSIG_X509_CERTIFICATE_XPATH,"").getBytes("UTF-8")),true); + + respData.setX509certificate(new X509Certificate(in)); + Element publicAuthority = (Element)XPathUtils.selectSingleNode(verifyXMLSignatureResponse,PUBLIC_AUTHORITY_XPATH); + respData.setPublicAuthority(publicAuthority != null); + respData.setPublicAuthorityCode(XPathUtils.getElementValue(verifyXMLSignatureResponse,PUBLIC_AUTHORITY_CODE_XPATH,"")); + respData.setSignatureCheckCode(new Integer(XPathUtils.getElementValue(verifyXMLSignatureResponse,SIGNATURE_CHECK_CODE_XPATH,"")).intValue()); + + String xmlDsigCheckCode = XPathUtils.getElementValue(verifyXMLSignatureResponse,XMLDSIG_MANIFEST_CHECK_CODE_XPATH,null); + if (xmlDsigCheckCode!=null) + { + respData.setXmlDSIGManigest(true); + respData.setXmlDSIGManifestCheckCode(new Integer(xmlDsigCheckCode).intValue()); + } + else + respData.setXmlDSIGManigest(false); + respData.setCertificateCheckCode(new Integer(XPathUtils.getElementValue(verifyXMLSignatureResponse,CERTIFICATE_CHECK_CODE_XPATH,"")).intValue()); + } + catch (Throwable t) { + throw new ParseException("parser.01", null, t); + } + return respData; + } + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java new file mode 100644 index 000000000..96e8e6dd6 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java @@ -0,0 +1,202 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileItemFactory; +import org.apache.commons.fileupload.FileUploadException; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.fileupload.servlet.ServletFileUpload; + +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.auth.WrongParametersException; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.URLDecoder; + +/** + * Base class for MOA-ID Auth Servlets, providing standard error handling + * and constant names. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthServlet extends HttpServlet implements MOAIDAuthConstants { + + + /** + * Handles an error.
+ *
    + *
  • Logs the error
  • + *
  • Places error message and exception thrown into the request + * as request attributes (to be used by "/errorpage-auth.jsp")
  • + *
  • Sets HTTP status 500 (internal server error)
  • + *
+ * + * @param errorMessage error message + * @param exceptionThrown exception thrown + * @param req servlet request + * @param resp servlet response + */ + protected void handleError( + String errorMessage, Throwable exceptionThrown, HttpServletRequest req, HttpServletResponse resp) { + + + if(null != errorMessage) { + Logger.error(errorMessage); + req.setAttribute("ErrorMessage", errorMessage ); + } + + if (null != exceptionThrown) { + if(null == errorMessage) errorMessage = exceptionThrown.getMessage(); + Logger.error(errorMessage, exceptionThrown); + req.setAttribute("ExceptionThrown", exceptionThrown); + } + + //forward this to errorpage-auth.jsp where the HTML error page is generated + ServletContext context = getServletContext(); + RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-auth.jsp"); + try { + dispatcher.forward(req, resp); + } catch (ServletException e) { + Logger.error(e); + } catch (IOException e) { + Logger.error(e); + } + + } + /** + * Handles a WrongParametersException. + * @param req servlet request + * @param resp servlet response + */ + protected void handleWrongParameters(WrongParametersException ex, HttpServletRequest req, HttpServletResponse resp) { + Logger.error(ex.toString()); + req.setAttribute("WrongParameters", ex.getMessage()); + + // forward this to errorpage-auth.jsp where the HTML error page is generated + ServletContext context = getServletContext(); + RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-auth.jsp"); + try { + dispatcher.forward(req, resp); + } catch (ServletException e) { + Logger.error(e); + } catch (IOException e) { + Logger.error(e); + } + } + + /** + * Logs all servlet parameters for debugging purposes. + */ + protected void logParameters(HttpServletRequest req) { + for (Enumeration params = req.getParameterNames(); params.hasMoreElements(); ) { + String parname = (String)params.nextElement(); + Logger.debug("Parameter " + parname + req.getParameter(parname)); + } + } + + /** + * Parses the request input stream for parameters, assuming parameters are encoded UTF-8 + * (no standard exists how browsers should encode them). + * + * @param req servlet request + * + * @return mapping parameter name -> value + * + * @throws IOException if parsing request parameters fails. + * + * @throws FileUploadException if parsing request parameters fails. + */ + protected Map getParameters(HttpServletRequest req) + throws IOException, FileUploadException { + + Map parameters = new HashMap(); + + + if (ServletFileUpload.isMultipartContent(req)) + { + // request is encoded as mulitpart/form-data + FileItemFactory factory = new DiskFileItemFactory(); + ServletFileUpload upload = null; + upload = new ServletFileUpload(factory); + List items = null; + items = upload.parseRequest(req); + for (int i = 0; i < items.size(); i++) + { + FileItem item = (FileItem) items.get(i); + if (item.isFormField()) + { + // Process only form fields - no file upload items + parameters.put(item.getFieldName(), item.getString("UTF-8")); + Logger.debug("Processed multipart/form-data request parameter: \nName: " + + item.getFieldName() + "\nValue: " + + item.getString("UTF-8")); + } + } + } + + else + { + // request is encoded as application/x-www-urlencoded + InputStream in = req.getInputStream(); + + String paramName; + String paramValueURLEncoded; + do { + paramName = new String(readBytesUpTo(in, '=')); + if (paramName.length() > 0) { + paramValueURLEncoded = readBytesUpTo(in, '&'); + String paramValue = URLDecoder.decode(paramValueURLEncoded, "UTF-8"); + parameters.put(paramName, paramValue); + } + } + while (paramName.length() > 0); + in.close(); + } + + return parameters; + } + + /** + * Reads bytes up to a delimiter, consuming the delimiter. + * @param in input stream + * @param delimiter delimiter character + * @return String constructed from the read bytes + * @throws IOException + */ + protected String readBytesUpTo(InputStream in, char delimiter) throws IOException { + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + boolean done = false; + int b; + while (! done && (b = in.read()) >= 0) { + if (b == delimiter) + done = true; + else + bout.write(b); + } + return bout.toString(); + } + + /** + * Calls the web application initializer. + * + * @see javax.servlet.Servlet#init(ServletConfig) + */ + public void init(ServletConfig servletConfig) throws ServletException { + super.init(servletConfig); + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java new file mode 100644 index 000000000..f33377547 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ConfigurationServlet.java @@ -0,0 +1,75 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.io.IOException; +import java.text.DateFormat; +import java.util.Date; +import java.util.Locale; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; +import at.gv.egovernment.moa.id.util.HTTPRequestJSPForwarder; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Servlet requested for updating the MOA-ID Auth configuration from configuration file + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ConfigurationServlet extends HttpServlet { + + /** + * Handle a HTTP GET request, used to indicated that the MOA + * configuration needs to be updated (reloaded). + * + * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) + */ + public void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance(); + + try { + MOAIDAuthInitializer.initialized=false; + MOAIDAuthInitializer.initialize(); + String message = msg.getMessage("config.00", new Object[] + { DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.GERMAN).format(new Date())} ); + + Logger.info(message); + HTTPRequestJSPForwarder.forwardNamed(message, "/message-auth.jsp", getServletContext(), request, response); + + } catch (Throwable t) { + String errorMessage = msg.getMessage("config.04", null); + Logger.error(errorMessage, t); + HTTPRequestJSPForwarder.forwardNamed(errorMessage, "/message-auth.jsp", getServletContext(), request, response); + } + } + + /** + * Do the same as doGet. + * + * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) + */ + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + doGet(request, response); + } + + /** + * Calls the web application initializer. + * + * @see javax.servlet.Servlet#init(ServletConfig) + */ + public void init(ServletConfig servletConfig) throws ServletException { + super.init(servletConfig); + } + +} + + diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java new file mode 100644 index 000000000..c41b514c8 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java @@ -0,0 +1,135 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.util.Calendar; + +import org.apache.axis.AxisFault; +import org.w3c.dom.Element; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.MOAIDException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.builder.SAMLResponseBuilder; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.id.util.Random; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.DateTimeUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Web service for picking up authentication data created in the MOA-ID Auth component. + * + * @author Paul Ivancsics + * @version $Id$ + * @see at.gv.egovernment.moa.id.auth.AuthenticationServer#getAuthenticationData + */ +public class GetAuthenticationDataService implements Constants { + + /** + * Constructor for GetAuthenticationDataService. + */ + public GetAuthenticationDataService() { + super(); + } + + /** + * Takes a lt;samlp:Request> containing a + * SAML artifact and returns the corresponding + * authentication data lt;saml:Assertion> + * (obtained from the AuthenticationServer), + * enclosed in a lt;samlp:Response>. + *
Bad requests are mapped into various lt;samlp:StatusCode>s, + * possibly containing enclosed sub-lt;samlp:StatusCode>s. + * The status codes are defined in the SAML specification. + * + * @param requests request elements of type lt;samlp:Request>; + * only 1 request element is allowed + * @return response element of type lt;samlp:Response>, + * packed into an Element[] + * @throws AxisFault thrown when an error occurs in assembling the + * lt;samlp:Response> + */ + public Element[] Request(Element[] requests) + throws AxisFault { + + Element request = requests[0]; + Element[] responses = new Element[1]; + String requestID = ""; + String statusCode = ""; + String subStatusCode = null; + String statusMessageCode = null; + String statusMessage = null; + String samlAssertion = ""; + if (requests.length > 1) { + // more than 1 request given as parameter + statusCode = "samlp:Requester"; + subStatusCode = "samlp:TooManyResponses"; + statusMessageCode = "1201"; + } + else { + try { + DOMUtils.validateElement(request, ALL_SCHEMA_LOCATIONS, null); + NodeList samlArtifactList = XPathUtils.selectNodeList(request, "samlp:AssertionArtifact"); + if (samlArtifactList.getLength() == 0) { + // no SAML artifact given in request + statusCode = "samlp:Requester"; + statusMessageCode = "1202"; + } + else if (samlArtifactList.getLength() > 1) { + // too many SAML artifacts given in request + statusCode = "samlp:Requester"; + subStatusCode = "samlp:TooManyResponses"; + statusMessageCode = "1203"; + } + else { + Element samlArtifactElem = (Element)samlArtifactList.item(0); + requestID = samlArtifactElem.getAttribute("RequestID"); + String samlArtifact = DOMUtils.getText(samlArtifactElem); + try { + AuthenticationData authData = AuthenticationServer.getInstance(). + getAuthenticationData(samlArtifact); + // success + samlAssertion = authData.getSamlAssertion(); + statusCode = "samlp:Success"; + statusMessageCode = "1200"; + } + catch (AuthenticationException ex) { + // no authentication data for given SAML artifact + statusCode = "samlp:Requester"; + subStatusCode = "samlp:ResourceNotRecognized"; + statusMessage = ex.toString(); + } + } + } + catch (Throwable t) { + // invalid request format + statusCode = "samlp:Requester"; + statusMessageCode = "1204"; + } + } + try { + String responseID = Random.nextRandom(); + String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); + if (statusMessage == null) + statusMessage = MOAIDMessageProvider.getInstance().getMessage(statusMessageCode, null); + responses[0] = new SAMLResponseBuilder().build( + responseID, requestID, issueInstant, statusCode, subStatusCode, statusMessage, samlAssertion); + } + catch (MOAIDException e) { + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + throw fault; + } + catch (Throwable t) { + MOAIDException e = new MOAIDException("1299", null, t); + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + throw fault; + } + return responses; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java new file mode 100644 index 000000000..4dc69c70b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/SelectBKUServlet.java @@ -0,0 +1,99 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; +import at.gv.egovernment.moa.id.auth.WrongParametersException; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Servlet requested for selecting a BKU. + *
In case of {@link AuthConfigurationProvider#getBKUSelectionType}==HTMLComplete, + * the browser is redirected to the configured "BKU-Auswahl-URL". + *
In case of {@link AuthConfigurationProvider#getBKUSelectionType}==HTMLSelect, + * the list of available BKU's is fetched from a BKU-Auswahl server, and presented + * to the user in an HTML form. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SelectBKUServlet extends AuthServlet { + + /** + * Calls the web application initializer. + * + * @see javax.servlet.Servlet#init(ServletConfig) + */ + public void init(ServletConfig servletConfig) throws ServletException { + try { + super.init(servletConfig); + MOAIDAuthInitializer.initialize(); + Logger.debug("default platform file.encoding: " + System.getProperty("file.encoding")); + Logger.info(MOAIDMessageProvider.getInstance().getMessage("init.00", null)); + } + catch (Exception ex) { + Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("init.02", null), ex); + throw new ServletException(ex); + } + } + + /** + * Responds with an HTML form which requests the user to choose a BKU. + */ + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + Logger.debug("GET SelectBKU"); + String authURL = + req.getScheme() + "://" + + req.getServerName() + ":" + + req.getServerPort() + + req.getContextPath() + "/"; + String target = req.getParameter(PARAM_TARGET); + String oaURL = req.getParameter(PARAM_OA); + String bkuSelectionTemplateURL = req.getParameter(PARAM_BKUTEMPLATE); + String templateURL = req.getParameter(PARAM_TEMPLATE); + resp.setHeader(HEADER_EXPIRES,HEADER_VALUE_EXPIRES); + resp.setHeader(HEADER_PRAGMA,HEADER_VALUE_PRAGMA); + resp.setHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL); + resp.addHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL_IE); + + try { + String returnValue = AuthenticationServer.getInstance().selectBKU( + authURL, target, oaURL, bkuSelectionTemplateURL, templateURL); + String bkuSelectionType = AuthConfigurationProvider.getInstance().getBKUSelectionType(); + if (bkuSelectionType.equals(AuthConfigurationProvider.BKU_SELECTION_TYPE_HTMLCOMPLETE)) { + // bkuSelectionType==HTMLComplete + String redirectURL = returnValue; + resp.setContentType("text/html"); + resp.sendRedirect(redirectURL); + Logger.info("REDIRECT TO: " + redirectURL); + } else { + // bkuSelectionType==HTMLSelect + String htmlForm = returnValue; + resp.setContentType("text/html;charset=UTF-8"); + Logger.debug("HTML-Form: " + htmlForm); + Writer out = new OutputStreamWriter(resp.getOutputStream(), "UTF8"); + out.write(htmlForm); + out.flush(); + Logger.debug("Finished GET SelectBKU"); + } + } + catch (WrongParametersException ex) { + handleWrongParameters(ex, req, resp); + } + catch (Throwable ex) { + handleError(null, ex, req, resp); + } + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java new file mode 100644 index 000000000..6098f5138 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java @@ -0,0 +1,103 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import at.gv.egovernment.moa.id.MOAIDException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; +import at.gv.egovernment.moa.id.auth.WrongParametersException; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Servlet requested for starting a MOA ID authentication session. + * Utilizes the {@link AuthenticationServer}. + * + * @author Paul Ivancsics + * @version $Id$ + * @see AuthenticationServer#startAuthentication + */ +public class StartAuthenticationServlet extends AuthServlet { + + /** + * Responds with an HTML form which upon submit requests the identity link + * from the security layer implementation. + *
+ * Response: + *
    + *
  • Content type: "text/html"
  • + *
  • Content: see return value of {@link AuthenticationServer#startAuthentication}
  • + *
  • Error status: 500 + *
+ * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) + */ + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + Logger.debug("GET StartAuthentication"); + String authURL = + req.getScheme() + "://" + + req.getServerName() + ":" + + req.getServerPort() + + req.getContextPath() + "/"; + String target = req.getParameter(PARAM_TARGET); + String oaURL = req.getParameter(PARAM_OA); + String bkuURL = req.getParameter(PARAM_BKU); + String templateURL = req.getParameter(PARAM_TEMPLATE); + String sessionID = req.getParameter(PARAM_SESSIONID); + resp.setHeader(HEADER_EXPIRES,HEADER_VALUE_EXPIRES); + resp.setHeader(HEADER_PRAGMA,HEADER_VALUE_PRAGMA); + resp.setHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL); + resp.addHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL_IE); + try { + String getIdentityLinkForm = + AuthenticationServer.getInstance().startAuthentication(authURL, target, oaURL, templateURL, bkuURL, sessionID); + resp.setContentType("text/html;charset=UTF-8"); + PrintWriter out = new PrintWriter(resp.getOutputStream()); + out.print(getIdentityLinkForm); + out.flush(); + Logger.debug("Finished GET StartAuthentication"); + } + catch (WrongParametersException ex) { + handleWrongParameters(ex, req, resp); + } + catch (MOAIDException ex) { + handleError(null, ex, req, resp); + } + } + + + /** + * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + */ + protected void doPost(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + doGet(req, resp); + } + + + /** + * Calls the web application initializer. + * + * @see javax.servlet.Servlet#init(ServletConfig) + */ + public void init(ServletConfig servletConfig) throws ServletException { + try { + super.init(servletConfig); + MOAIDAuthInitializer.initialize(); + Logger.info(MOAIDMessageProvider.getInstance().getMessage("init.00", null)); + } + catch (Exception ex) { + Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("init.02", null), ex); + throw new ServletException(ex); + } + } + +} 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 new file mode 100644 index 000000000..6ec4a247d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java @@ -0,0 +1,120 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.io.IOException; +import at.gv.egovernment.moa.util.URLEncoder; //java.net.URLEncoder; +import java.util.Map; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.fileupload.FileUploadException; + +import at.gv.egovernment.moa.id.MOAIDException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Servlet requested for verifying the signed authentication block + * provided by the security layer implementation. + * Utilizes the {@link AuthenticationServer}. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class VerifyAuthenticationBlockServlet extends AuthServlet { + + + /** + * Constructor for VerifyAuthenticationBlockServlet. + */ + public VerifyAuthenticationBlockServlet() { + super(); + } + + /** + * GET requested by security layer implementation to verify + * that data URL resource is available. + * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) + */ + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + Logger.debug("GET VerifyAuthenticationBlock"); + } + + /** + * Verifies the signed authentication block and redirects the browser + * to the online application requested, adding a parameter needed for + * retrieving the authentication data. + *
+ * Request parameters: + *
    + *
  • MOASessionID: ID of associated authentication session
  • + *
  • XMLResponse: <CreateXMLSignatureResponse>
  • + *
+ * Response: + *
    + *
  • Status: 302
  • + *
  • Header "Location": URL of the online application requested, with + * parameters "Target"(only if the online application is + * a public service) and "SAMLArtifact" added
  • + *
  • Error status: 500 + *
+ * @see AuthenticationServer#verifyAuthenticationBlock + * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) + */ + protected void doPost(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + Logger.debug("POST VerifyAuthenticationBlock"); + Map parameters; + try + { + parameters = getParameters(req); + } catch (FileUploadException e) + { + Logger.error("Parsing mulitpart/form-data request parameters failed: " + e.getMessage()); + throw new IOException(e.getMessage()); + } + String sessionID = req.getParameter(PARAM_SESSIONID); + String createXMLSignatureResponse = (String)parameters.get(PARAM_XMLRESPONSE); + + try { + AuthenticationSession session = AuthenticationServer.getSession(sessionID); + String samlArtifactBase64 = + AuthenticationServer.getInstance().verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + String redirectURL = session.getOAURLRequested(); + if (!session.getBusinessService()) { + redirectURL = addURLParameter(redirectURL, PARAM_TARGET, URLEncoder.encode(session.getTarget(), "UTF-8")); + } + redirectURL = addURLParameter(redirectURL, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); + redirectURL = resp.encodeRedirectURL(redirectURL); + resp.setContentType("text/html"); + resp.setStatus(302); + resp.addHeader("Location", redirectURL); + Logger.debug("REDIRECT TO: " + redirectURL); + } + + catch (MOAIDException ex) { + handleError(null, ex, req, resp); + } + + } + /** + * Adds a parameter to a URL. + * @param url the URL + * @param paramname parameter name + * @param paramvalue parameter value + * @return the URL with parameter added + */ + private static String addURLParameter(String url, String paramname, String paramvalue) { + String param = paramname + "=" + paramvalue; + if (url.indexOf("?") < 0) + return url + "?" + param; + else + return url + "&" + param; + } + +} 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 new file mode 100644 index 000000000..2134c1444 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java @@ -0,0 +1,107 @@ +package at.gv.egovernment.moa.id.auth.servlet; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.Map; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.commons.fileupload.FileUploadException; + +import at.gv.egovernment.moa.id.MOAIDException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; +import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Servlet requested for verifying the identity link + * provided by the security layer implementation. + * Utilizes the {@link AuthenticationServer}. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class VerifyIdentityLinkServlet extends AuthServlet { + + /** + * Constructor for VerifyIdentityLinkServlet. + */ + public VerifyIdentityLinkServlet() { + super(); + } + + /** + * GET requested by security layer implementation to verify + * that data URL resource is available. + * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) + */ + protected void doGet(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + Logger.debug("GET VerifyIdentityLink"); + } + + /** + * Verifies the identity link and responds with a new + * CreateXMLSignatureRequest. + *
+ * Request parameters: + *
    + *
  • MOASessionID: ID of associated authentication session
  • + *
  • XMLResponse: <InfoboxReadResponse>
  • + *
+ * Response: + *
    + *
  • Content type: "text/xml"
  • + *
  • Content: see return value of {@link AuthenticationServer#verifyIdentityLink}
  • + *
  • Error status: 500 + *
+ * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) + */ + protected void doPost(HttpServletRequest req, HttpServletResponse resp) + throws ServletException, IOException { + + Logger.debug("POST VerifyIdentityLink"); + Map parameters; + try + { + parameters = getParameters(req); + } catch (FileUploadException e) + { + Logger.error("Parsing mulitpart/form-data request parameters failed: " + e.getMessage()); + throw new IOException(e.getMessage()); + } + String sessionID = req.getParameter(PARAM_SESSIONID); + + + try { + AuthenticationSession session = AuthenticationServer.getSession(sessionID); + + String createXMLSignatureRequest = + AuthenticationServer.getInstance().verifyIdentityLink(sessionID, parameters); + resp.setStatus(307); + String dataURL = new DataURLBuilder().buildDataURL( + session.getAuthURL(), AuthenticationServer.REQ_VERIFY_AUTH_BLOCK, sessionID); + resp.addHeader("Location", dataURL); + + //TODO test impact of explicit setting charset with older versions of BKUs (HotSign) + resp.setContentType("text/xml;charset=UTF-8"); + + OutputStream out = resp.getOutputStream(); + out.write(createXMLSignatureRequest.getBytes("UTF-8")); + out.flush(); + out.close(); + Logger.debug("Finished POST VerifyIdentityLink"); + } + catch (MOAIDException ex) { + handleError(null, ex, req, resp); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java new file mode 100644 index 000000000..e6c9f4bee --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java @@ -0,0 +1,274 @@ +package at.gv.egovernment.moa.id.auth.validator; + +import java.util.Iterator; +import java.util.List; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; +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.ExtendedSAMLAttribute; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.auth.data.SAMLAttribute; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.StringUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * + * This class is used to validate an {@link CreateXMLSignatureResponse} + * returned by the security layer. + * This class implements the Singleton pattern. + * @author Stefan Knirsch + * @version $Id$ + */ +public class CreateXMLSignatureResponseValidator { + + + /** Xpath expression to the dsig:Signature element */ + private static final String SIGNATURE_XPATH = Constants.DSIG_PREFIX + ":Signature"; + + + /** Singleton instance. null, if none has been created. */ + private static CreateXMLSignatureResponseValidator instance; + + /** + * Constructor for a singleton CreateXMLSignatureResponseValidator. + * @return an instance of CreateXMLSignatureResponseValidator + * @throws ValidateException if no instance can be created + */ + public static synchronized CreateXMLSignatureResponseValidator getInstance() + throws ValidateException { + if (instance == null) { + instance = new CreateXMLSignatureResponseValidator(); + } + return instance; + } + + + /** + * The Method validate is used for validating an explicit {@link CreateXMLSignatureResponse} + * @param createXMLSignatureResponse + * @param session + * @throws ValidateException + */ + public void validate(CreateXMLSignatureResponse createXMLSignatureResponse, AuthenticationSession session) + throws ValidateException { + + // A3.056: more then one /saml:Assertion/saml:AttributeStatement/saml:Subject/saml:NameIdentifier + + String gbTarget = session.getTarget(); + String oaURL = session.getPublicOAURLPrefix(); + boolean businessService = session.getBusinessService(); + + IdentityLink identityLink = session.getIdentityLink(); + + Element samlAssertion = createXMLSignatureResponse.getSamlAssertion(); + String issuer = samlAssertion.getAttribute("Issuer"); + if (issuer == null) { + // should not happen, because parser would dedect this + throw new ValidateException("validator.32", null); + } + String issueInstant = samlAssertion.getAttribute("IssueInstant"); + if (!issueInstant.equals(session.getIssueInstant())) { + throw new ValidateException("validator.39", new Object[] {issueInstant, session.getIssueInstant()}); + } + + String name = identityLink.getName(); + if (!issuer.equals(name)) { + throw new ValidateException("validator.33", new Object[] {issuer, name}); + } + + SAMLAttribute[] samlAttributes = createXMLSignatureResponse.getSamlAttributes(); + + boolean foundOA = false; + boolean foundGB = false; + boolean foundWBPK = false; + int offset = 0; + + // check number of SAML aatributes + List extendedSAMLAttributes = session.getExtendedSAMLAttributesAUTH(); + int extendedSAMLAttributesNum = 0; + if (extendedSAMLAttributes != null) { + extendedSAMLAttributesNum = extendedSAMLAttributes.size(); + } + int expectedSAMLAttributeNumber = + AuthenticationBlockAssertionBuilder.NUM_OF_SAML_ATTRIBUTES + extendedSAMLAttributesNum; + if (!session.getSAMLAttributeGebeORwbpk()) expectedSAMLAttributeNumber--; + int actualSAMLAttributeNumber = samlAttributes.length; + if (actualSAMLAttributeNumber != expectedSAMLAttributeNumber) { + Logger.error("Wrong number of SAML attributes in CreateXMLSignatureResponse: expected " + + expectedSAMLAttributeNumber + ", but was " + actualSAMLAttributeNumber); + throw new ValidateException( + "validator.36", + new Object[] {String.valueOf(actualSAMLAttributeNumber), String.valueOf(expectedSAMLAttributeNumber)}); + } + + SAMLAttribute samlAttribute; + if (session.getSAMLAttributeGebeORwbpk()) { + // check the first attribute ("Geschaeftsbereich" or "wbPK") + samlAttribute = samlAttributes[0]; + if (businessService) { + if (!samlAttribute.getName().equals("wbPK")) { + if (samlAttribute.getName().equals("Geschaeftsbereich")) { + throw new ValidateException("validator.26", null); + } else { + throw new ValidateException( + "validator.37", + new Object[] {samlAttribute.getName(), "wbPK", String.valueOf(1)}); + } + } + if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { + foundWBPK = true; + try { + Element attrValue = (Element)samlAttribute.getValue(); + String value = ((Element)attrValue.getElementsByTagNameNS(Constants.PD_NS_URI, "Value").item(0)).getFirstChild().getNodeValue(); + String type = ((Element)attrValue.getElementsByTagNameNS(Constants.PD_NS_URI, "Type").item(0)).getFirstChild().getNodeValue(); + if (!value.equals(identityLink.getIdentificationValue())) { + throw new ValidateException("validator.28", null); + } + if (!type.equals(identityLink.getIdentificationType())) { + throw new ValidateException("validator.28", null); + } + } catch (Exception ex) { + throw new ValidateException("validator.29", null); + } + } else { + throw new ValidateException("validator.30", null); + } + } else { + if (!samlAttribute.getName().equals("Geschaeftsbereich")) { + if (samlAttribute.getName().equals("wbPK")) { + throw new ValidateException("validator.26", null); + } else { + throw new ValidateException( + "validator.37", + new Object[] {samlAttribute.getName(), "Geschaeftsbereich", String.valueOf(1)}); + } + } + if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { + foundGB = true; + if (!gbTarget.equals((String)samlAttribute.getValue())) { + throw new ValidateException("validator.13", null); + } + } else { + throw new ValidateException("validator.12", null); + } + } + } else { + offset--; + } + + // check the second attribute (must be "OA") + samlAttribute = samlAttributes[1 + offset]; + if (!samlAttribute.getName().equals("OA")) { + throw new ValidateException( + "validator.37", + new Object[] {samlAttribute.getName(), "OA", String.valueOf(2)}); + } + if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { + foundOA = true; + if (!oaURL.equals((String)samlAttribute.getValue())) { // CHECKS für die AttributeVALUES fehlen noch + throw new ValidateException("validator.16", new Object[] {":gefunden wurde '" + oaURL + "', erwartet wurde '" + samlAttribute.getValue()}); + } + } else { + throw new ValidateException("validator.15", null); + } + + // check the third attribute (must be "Geburtsdatum") + samlAttribute = samlAttributes[2 + offset]; + if (!samlAttribute.getName().equals("Geburtsdatum")) { + throw new ValidateException( + "validator.37", + new Object[] {samlAttribute.getName(), "Geburtsdatum", String.valueOf(3)}); + } + if (samlAttribute.getNamespace().equals("http://reference.e-government.gv.at/namespace/moa/20020822#")) { + String samlDateOfBirth = (String)samlAttribute.getValue(); + String dateOfBirth = identityLink.getDateOfBirth(); + if (!samlDateOfBirth.equals(dateOfBirth)) { + throw new ValidateException("validator.34", new Object[] {samlDateOfBirth, dateOfBirth}); + } + } else { + throw new ValidateException("validator.35", null); + } + + // now check the extended SAML attributes + int i = AuthenticationBlockAssertionBuilder.NUM_OF_SAML_ATTRIBUTES + offset; + if (extendedSAMLAttributes != null) { + Iterator it = extendedSAMLAttributes.iterator(); + while (it.hasNext()) { + ExtendedSAMLAttribute extendedSAMLAttribute = (ExtendedSAMLAttribute)it.next(); + samlAttribute = samlAttributes[i]; + String actualName = samlAttribute.getName(); + String expectedName = extendedSAMLAttribute.getName(); + if (!actualName.equals(expectedName)) { + throw new ValidateException( + "validator.38", + new Object[] {"Name", String.valueOf((i+1)), actualName, actualName, expectedName }); + } + String actualNamespace = samlAttribute.getNamespace(); + String expectedNamespace = extendedSAMLAttribute.getNameSpace(); + if (!actualNamespace.equals(expectedNamespace)) { + throw new ValidateException( + "validator.38", + new Object[] {"Namespace", String.valueOf((i+1)), actualName, actualNamespace, expectedNamespace, }); + } + Object expectedValue = extendedSAMLAttribute.getValue(); + Object actualValue = samlAttribute.getValue(); + try { + if (expectedValue instanceof String) { + // replace \r\n because text might be base64-encoded + String expValue = StringUtils.replaceAll((String)expectedValue,"\r",""); + expValue = StringUtils.replaceAll(expValue,"\n",""); + String actValue = StringUtils.replaceAll((String)actualValue,"\r",""); + actValue = StringUtils.replaceAll(actValue,"\n",""); + if (!expValue.equals(actValue)) { + throw new ValidateException( + "validator.38", + new Object[] {"Wert", String.valueOf((i+1)), actualName, actualValue, expectedValue }); + } + } else if (expectedValue instanceof Element) { + // only check the name of the element + String actualElementName = ((Element)actualValue).getNodeName(); + String expectedElementName = ((Element)expectedValue).getNodeName(); + if (!(expectedElementName.equals(actualElementName))){ + throw new ValidateException( + "validator.38", + new Object[] {"Wert", String.valueOf((i+1)), actualName, actualElementName, expectedElementName}); + } + } else { + // should not happen + throw new ValidateException( + "validator.38", + new Object[] {"Typ", String.valueOf((i+1)), expectedName, "java.lang.String oder org.wrc.dom.Element", expectedValue.getClass().getName()}); + } + } catch (ClassCastException e) { + throw new ValidateException( + "validator.38", + new Object[] {"Typ", String.valueOf((i+1)), expectedName, expectedValue.getClass().getName(), actualValue.getClass().getName()}); + } + i++; + } + } + + + if (!foundOA) throw new ValidateException("validator.14", null); + if (businessService) { + if (session.getSAMLAttributeGebeORwbpk() && !foundWBPK) throw new ValidateException("validator.31", null); + } else { + if (!foundGB) throw new ValidateException("validator.11", null); + } + + //Check if dsig:Signature exists +// NodeList nl = createXMLSignatureResponse.getSamlAssertion().getElementsByTagNameNS(Constants.DSIG_NS_URI, "Signature"); +// if (nl.getLength() != 1) { +// throw new ValidateException("validator.05", null); +// } + Element dsigSignature = (Element) XPathUtils.selectSingleNode(samlAssertion, SIGNATURE_XPATH); + if (dsigSignature == null) { + throw new ValidateException("validator.05", new Object[] {"im AUTHBlock"}) ; + } + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java new file mode 100644 index 000000000..444f706e4 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java @@ -0,0 +1,159 @@ +package at.gv.egovernment.moa.id.auth.validator; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * This class is used to validate an {@link IdentityLink} + * returned by the security layer + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class IdentityLinkValidator implements Constants { + + // + // XPath namespace prefix shortcuts + // + /** Xpath prefix for reaching PersonData Namespaces */ + private static final String PDATA = PD_PREFIX + ":"; + /** Xpath prefix for reaching SAML Namespaces */ + private static final String SAML = SAML_PREFIX + ":"; + /** Xpath prefix for reaching XML-DSIG Namespaces */ + private static final String DSIG = DSIG_PREFIX + ":"; + /** Xpath prefix for reaching ECDSA Namespaces */ + private static final String ECDSA = ECDSA_PREFIX + ":"; + /** Xpath expression to the root element */ + private static final String ROOT = ""; + /** Xpath expression to the SAML:SubjectConfirmationData element */ + private static final String SAML_SUBJECT_CONFIRMATION_DATA_XPATH = + ROOT + + SAML + + "AttributeStatement/" + + SAML + + "Subject/" + + SAML + + "SubjectConfirmation/" + + SAML + + "SubjectConfirmationData"; +/** Xpath expression to the PersonData:Person element */ + private static final String PERSON_XPATH = + SAML_SUBJECT_CONFIRMATION_DATA_XPATH + "/" + PDATA + "Person"; + /** Xpath expression to the SAML:Attribute element */ + private static final String ATTRIBUTE_XPATH = + ROOT + SAML + "AttributeStatement/" + SAML + "Attribute"; + /** Xpath expression to the SAML:AttributeName attribute */ + private static final String ATTRIBUTE_NAME_XPATH = + ROOT + SAML + "AttributeStatement/" + SAML + "Attribute/@AttributeName"; + /** Xpath expression to the SAML:AttributeNamespace attribute */ + private static final String ATTRIBUTE_NAMESPACE_XPATH = + ROOT + + SAML + + "AttributeStatement/" + + SAML + + "Attribute/@AttributeNamespace"; + /** Xpath expression to the SAML:AttributeValue element */ + private static final String ATTRIBUTE_VALUE_XPATH = + ROOT + + SAML + + "AttributeStatement/" + + SAML + + "Attribute/" + + SAML + + "AttributeValue"; + + /** Singleton instance. null, if none has been created. */ + private static IdentityLinkValidator instance; + + /** + * Constructor for a singleton IdentityLinkValidator. + * @return a new IdentityLinkValidator instance + * @throws ValidateException if no instance can be created + */ + public static synchronized IdentityLinkValidator getInstance() + throws ValidateException { + if (instance == null) { + instance = new IdentityLinkValidator(); + } + return instance; + } + + /** + * Method validate. Validates the {@link IdentityLink} + * @param identityLink The identityLink to validate + * @throws ValidateException on any validation error + */ + public void validate(IdentityLink identityLink) throws ValidateException { + + Element samlAssertion = identityLink.getSamlAssertion(); + //Search the SAML:ASSERTION Object (A2.054) + if (samlAssertion == null) { + throw new ValidateException("validator.00", null); + } + + // Check how many saml:Assertion/saml:AttributeStatement/ + // saml:Subject/ saml:SubjectConfirmation/ + // saml:SubjectConfirmationData/pr:Person of type + // PhysicalPersonType exist (A2.056) + NodeList nl = XPathUtils.selectNodeList(samlAssertion, PERSON_XPATH); + // If we have just one Person-Element we don't need to check the attributes + int counterPhysicalPersonType = 0; + if (nl.getLength() > 1) + for (int i = 0; i < nl.getLength(); i++) { + String xsiType = + ((Element) nl.item(i)) + .getAttributeNodeNS( + "http://www.w3.org/2001/XMLSchema-instance", + "type") + .getNodeValue(); + // We have to check if xsiType contains "PhysicalPersonType" + // An equal-check will fail because of the Namespace-prefix of the attribute value + if (xsiType.indexOf("PhysicalPersonType") > -1) + counterPhysicalPersonType++; + } + if (counterPhysicalPersonType > 1) + throw new ValidateException("validator.01", null); + + //Check the SAML:ATTRIBUTES + nl = XPathUtils.selectNodeList(samlAssertion, ATTRIBUTE_XPATH); + for (int i = 0; i < nl.getLength(); i++) { + String attributeName = + XPathUtils.getAttributeValue( + (Element) nl.item(i), + "@AttributeName", + null); + String attributeNS = + XPathUtils.getAttributeValue( + (Element) nl.item(i), + "@AttributeNamespace", + null); + if (attributeName.equals("CitizenPublicKey")) { + + if (attributeNS.equals("http://www.buergerkarte.at/namespaces/personenbindung/20020506#") || + attributeNS.equals("urn:publicid:gv.at:namespaces:identitylink:1.2")) { + Element attributeValue = + (Element) XPathUtils.selectSingleNode((Element) nl.item(i),nSMap, SAML + "AttributeValue/" + DSIG + "RSAKeyValue"); + if (attributeValue==null) + attributeValue = + (Element) XPathUtils.selectSingleNode((Element)nl.item(i), nSMap, SAML + "AttributeValue/" + ECDSA + "ECDSAKeyValue"); + if (attributeValue == null) + throw new ValidateException("validator.02", null); + + } + else + throw new ValidateException("validator.03", new Object [] {attributeNS} ); + } + else + throw new ValidateException("validator.04", new Object [] {attributeName} ); + } + + //Check if dsig:Signature exists + Element dsigSignature = (Element) XPathUtils.selectSingleNode(samlAssertion,ROOT + DSIG + "Signature"); + if (dsigSignature==null) throw new ValidateException("validator.05", new Object[] {"in der Personenbindung"}); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java new file mode 100644 index 000000000..c776418ab --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/InfoboxValidator.java @@ -0,0 +1,32 @@ +package at.gv.egovernment.moa.id.auth.validator; + +import at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult; +import at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams; + +/** + * Validates an InfoboxReadResponse. + * An implementing class has to validate the content of the InfoboxReadResponse + * according to the type specific rules and guidelines of the underlying + * application. + */ +public interface InfoboxValidator { + + /** + * This method validates an InfoboxReadResponse. + * The method validates the content of the passed infoboxReadResponse + * according to the type specific rules and guidelines of the underlying + * application. + * + * @param params {@link at.gv.egovernment.moa.id.auth.data.InfoboxValidatorParams + * Parameters} needed by the validator. + * + * @return True if validation succeeds, + * otherwise false. + * + * @throws ValidateException If an error occurs on validating the + * InfoboxReadResponse. + */ + public InfoboxValidationResult validate (InfoboxValidatorParams params) + throws ValidateException; + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/ValidateException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/ValidateException.java new file mode 100644 index 000000000..a6685fca8 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/ValidateException.java @@ -0,0 +1,35 @@ +package at.gv.egovernment.moa.id.auth.validator; + +import at.gv.egovernment.moa.id.MOAIDException; + +/** + * Exception thrown while validating an incoming XML structure + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ValidateException extends MOAIDException { + + /** + * Constructor for ValidateException. + * @param messageId + * @param parameters + */ + public ValidateException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for ValidateException. + * @param messageId + * @param parameters + * @param wrapped + */ + public ValidateException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} 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 new file mode 100644 index 000000000..1f2ebc37c --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java @@ -0,0 +1,177 @@ +package at.gv.egovernment.moa.id.auth.validator; + +import iaik.asn1.structures.Name; +import iaik.security.ecc.ecdsa.ECPublicKey; +import iaik.utils.RFC2253NameParserException; +import iaik.x509.X509Certificate; +import iaik.x509.X509ExtensionInitException; + +import java.security.PublicKey; +import java.security.interfaces.RSAPublicKey; +import java.util.List; + +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.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * This class is used to validate an {@link VerifyXMLSignatureResponse} + * returned by MOA-SPSS + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class VerifyXMLSignatureResponseValidator { + + /** Identification string for checking identity link */ + public static final String CHECK_IDENTITY_LINK = "IdentityLink"; + /** Identification string for checking authentication block */ + public static final String CHECK_AUTH_BLOCK = "AuthBlock"; + + /** Singleton instance. null, if none has been created. */ + private static VerifyXMLSignatureResponseValidator instance; + + /** + * Constructor for a singleton VerifyXMLSignatureResponseValidator. + */ + public static synchronized VerifyXMLSignatureResponseValidator getInstance() + throws ValidateException { + if (instance == null) { + instance = new VerifyXMLSignatureResponseValidator(); + } + return instance; + } + + /** + * Validates a {@link VerifyXMLSignatureResponse} returned by MOA-SPSS. + * + * @param verifyXMLSignatureResponse the <VerifyXMLSignatureResponse> + * @param identityLinkSignersSubjectDNNames subject names configured + * @param whatToCheck is used to identify whether the identityLink or the Auth-Block is validated + * @param ignoreManifestValidationResult specifies whether the validation result of the + * manifest has to be ignored (identityLink validation if + * the OA is a business service) or not + * @throws ValidateException on any validation error + */ + public void validate(VerifyXMLSignatureResponse verifyXMLSignatureResponse, + List identityLinkSignersSubjectDNNames, + String whatToCheck, + boolean ignoreManifestValidationResult) + throws ValidateException { + + if (verifyXMLSignatureResponse.getSignatureCheckCode() != 0) + throw new ValidateException("validator.06", null); + + if (verifyXMLSignatureResponse.getCertificateCheckCode() != 0) { + String checkFailedReason =""; + if (verifyXMLSignatureResponse.getCertificateCheckCode() == 1) + checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.21", null); + if (verifyXMLSignatureResponse.getCertificateCheckCode() == 2) + checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.22", null); + if (verifyXMLSignatureResponse.getCertificateCheckCode() == 3) + checkFailedReason = MOAIDMessageProvider.getInstance().getMessage("validator.23", null); + if (verifyXMLSignatureResponse.getCertificateCheckCode() == 4) + 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 } ); + } + + if (ignoreManifestValidationResult) { + Logger.debug("OA type is business service, thus ignoring DSIG manifest validation result"); + } else { + if (verifyXMLSignatureResponse.isXmlDSIGManigest()) + if (verifyXMLSignatureResponse.getXmlDSIGManifestCheckCode() != 0) + throw new ValidateException("validator.08", null); + } + + + // TODO See Bug #322 + // Check result of SignatureManifestCheck + + + //Check whether the returned X509 SubjectName is in the MOA-ID configuration or not + if (identityLinkSignersSubjectDNNames != null) { + String subjectDN = ""; + X509Certificate x509Cert = verifyXMLSignatureResponse.getX509certificate(); + try { + subjectDN = ((Name) x509Cert.getSubjectDN()).getRFC2253String(); + } + catch (RFC2253NameParserException e) { + throw new ValidateException("validator.17", null); + } + // check the authorisation to sign the identity link + if (!identityLinkSignersSubjectDNNames.contains(subjectDN)) { + // subject DN check failed, try OID check: + try { + if (x509Cert.getExtension(MOAIDAuthConstants.IDENTITY_LINK_SIGNER_OID) == null) { + throw new ValidateException("validator.18", new Object[] { subjectDN }); + } else { + Logger.debug("Identity link signer cert accepted for signing identity link: " + + "subjectDN check failed, but OID check successfully passed."); + } + } catch (X509ExtensionInitException e) { + throw new ValidateException("validator.49", null); + } + } else { + Logger.debug("Identity link signer cert accepted for signing identity link: " + + "subjectDN check successfully passed."); + } + + } + } + + /** + * Method validateCertificate. + * @param verifyXMLSignatureResponse The VerifyXMLSignatureResponse + * @param idl The Identitylink + * @throws ValidateException + */ + public void validateCertificate( + VerifyXMLSignatureResponse verifyXMLSignatureResponse, + IdentityLink idl) + throws ValidateException { + + X509Certificate x509Response = verifyXMLSignatureResponse.getX509certificate(); + PublicKey[] pubKeysIdentityLink = (PublicKey[]) idl.getPublicKey(); + + PublicKey pubKeySignature = x509Response.getPublicKey(); + + boolean found = false; + for (int i = 0; i < pubKeysIdentityLink.length; i++) { + + //compare RSAPublicKeys + if ((idl.getPublicKey()[i] instanceof java.security.interfaces.RSAPublicKey) && + (pubKeySignature instanceof java.security.interfaces.RSAPublicKey)) { + + RSAPublicKey rsaPubKeySignature = (RSAPublicKey) pubKeySignature; + RSAPublicKey rsakey = (RSAPublicKey) pubKeysIdentityLink[i]; + + if (rsakey.getModulus().equals(rsaPubKeySignature.getModulus()) + && rsakey.getPublicExponent().equals(rsaPubKeySignature.getPublicExponent())) + found = true; + } + + //compare ECDSAPublicKeys + if((idl.getPublicKey()[i] instanceof iaik.security.ecc.ecdsa.ECPublicKey) && + (pubKeySignature instanceof iaik.security.ecc.ecdsa.ECPublicKey)) { + + ECPublicKey ecdsaPubKeySignature = (ECPublicKey) pubKeySignature; + ECPublicKey ecdsakey = (ECPublicKey) pubKeysIdentityLink[i]; + + if(ecdsakey.equals(ecdsaPubKeySignature)) + found = true; + } + } + + if (!found) + throw new ValidateException("validator.09", null); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java new file mode 100644 index 000000000..90b780526 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java @@ -0,0 +1,894 @@ +package at.gv.egovernment.moa.id.config; + +import iaik.pki.pathvalidation.ChainingModes; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; + +import java.math.BigInteger; +import java.security.Principal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Vector; + +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.auth.data.Schema; +import at.gv.egovernment.moa.id.auth.data.SchemaImpl; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; +import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameter; +import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters; +import at.gv.egovernment.moa.id.data.IssuerAndSerial; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.BoolUtils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.StringUtils; +import at.gv.egovernment.moa.util.XPathException; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * A class that builds configuration data from a DOM based representation. + * + * @author Patrick Peck + * @author Stefan Knirsch + * @version $Id$ + */ +public class ConfigurationBuilder { + + // + // XPath namespace prefix shortcuts + // + /** an XPATH-Expression */ + protected static final String CONF = Constants.MOA_ID_CONFIG_PREFIX + ":"; + /** an XPATH-Expression */ + protected static final String DSIG = Constants.DSIG_PREFIX + ":"; + + // + // chaining mode constants appearing in the configuration file + // + /** an XPATH-Expression */ + protected static final String CM_CHAINING = "chaining"; + /** an XPATH-Expression */ + protected static final String CM_PKIX = "pkix"; + /** an XPATH-Expression */ + protected static final String DEFAULT_ENCODING = "UTF-8"; + + // + // XPath expressions to select certain parts of the configuration + // + /** an XPATH-Expression */ + protected static final String ROOT = "/" + CONF + "MOA-IDConfiguration/"; + + /** an XPATH-Expression */ + protected static final String AUTH_BKU_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "BKUSelection"; + /** an XPATH-Expression */ + protected static final String AUTH_BKUSELECT_TEMPLATE_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "Templates/" + CONF + "BKUSelectionTemplate/@URL"; + /** an XPATH-Expression */ + protected static final String AUTH_TEMPLATE_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "Templates/" + CONF + "Template/@URL"; + /** an XPATH-Expression */ + public static final String AUTH_SECLAYER_TRANSFORMS_INFO_FILENAME_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "SecurityLayer/" + CONF + "TransformsInfo/@filename"; + /** an XPATH-Expression */ + protected static final String AUTH_MOA_SP_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP"; + /** an XPATH-Expression */ + protected static final String AUTH_MOA_SP_VERIFY_IDENTITY_TRUST_ID_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP/" + CONF + "VerifyIdentityLink/" + CONF + "TrustProfileID"; + /** an XPATH-Expression */ + protected static final String AUTH_MOA_SP_VERIFY_AUTH_TRUST_ID_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP/" + CONF + "VerifyAuthBlock/" + CONF + "TrustProfileID"; + /** an XPATH-Expression */ + protected static final String AUTH_MOA_SP_VERIFY_AUTH_VERIFY_ID_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "MOA-SP/" + CONF + "VerifyAuthBlock/" + CONF + "VerifyTransformsInfoProfileID"; + + /** an XPATH-Expression */ + protected static final String AUTH_IDENTITY_LINK_X509SUBJECTNAME_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "IdentityLinkSigners/" + CONF + "X509SubjectName"; + + /** an XPATH-Expression */ + public static final String AUTH_VERIFY_INFOBOXES_XPATH = + ROOT + CONF + "AuthComponent/" + CONF + "VerifyInfoboxes"; + + /** an XPATH-Expression */ + protected static final String OA_XPATH = ROOT + CONF + "OnlineApplication"; + /** an XPATH-Expression */ + protected static final String OA_LOGIN_XPATH = ROOT + CONF + "OnlineApplication/@loginURL"; + /** an XPATH-Expression */ + protected static final String OA_AUTH_COMPONENT_XPATH = CONF + "AuthComponent"; + /** an XPATH-Expression */ + protected static final String OA_AUTH_COMPONENT_IDENT_NUMBER_XPATH = CONF + "IdentificationNumber"; + /** an XPATH-Expression */ + protected static final String OA_AUTH_COMPONENT_BKUSELECT_TEMPLATE_XPATH = + CONF + "Templates/" + CONF + "BKUSelectionTemplate/@URL"; + /** an XPATH-Expression */ + protected static final String OA_AUTH_COMPONENT_TEMPLATE_XPATH = + CONF + "Templates/" + CONF + "Template/@URL"; + /** an XPATH-Expression */ + protected static final String OA_AUTH_COMPONENT_TRANSFORMS_INFO_FILENAME_XPATH = CONF + "TransformsInfo/@filename"; + /** an XPATH-Expression */ + protected static final String OA_AUTH_COMPONENT_VERIFY_INFOBOXES_XPATH = CONF + "VerifyInfoboxes"; + /** an XPATH-Expression */ + protected static final String CONNECTION_PARAMETER_URL_XPATH = + CONF + "ConnectionParameter/@URL"; + /** an XPATH-Expression */ + protected static final String CONNECTION_PARAMETER_ACCEPTED_CERTS_XPATH = + CONF + "ConnectionParameter/" + CONF + "AcceptedServerCertificates"; + /** an XPATH-Expression */ + protected static final String CONNECTION_PARAMETERN_KEYSTORE_XPATH = + CONF + "ConnectionParameter/" + CONF + "ClientKeyStore"; + /** an XPATH-Expression */ + protected static final String CONNECTION_PARAMETER_KEYSTORE_PASS_XPATH = + CONNECTION_PARAMETERN_KEYSTORE_XPATH + "/@password"; + /** an XPATH-Expression */ + protected static final String GENERIC_CONFIGURATION_XPATH = + ROOT + CONF + "GenericConfiguration"; + + /** an XPATH-Expression */ + protected static final String CHAINING_MODES_XPATH = + ROOT + CONF + "ChainingModes"; + /** an XPATH-Expression */ + protected static final String CHAINING_MODES_DEFAULT_XPATH = + CHAINING_MODES_XPATH + "/@systemDefaultMode"; + /** an XPATH-Expression */ + protected static final String TRUST_ANCHOR_XPATH = + ROOT + CONF + "ChainingModes/" + CONF + "TrustAnchor"; + /** an XPATH-Expression */ + protected static final String ISSUER_XPATH = DSIG + "X509IssuerName"; + /** an XPATH-Expression */ + protected static final String SERIAL_XPATH = DSIG + "X509SerialNumber"; + /** an XPATH-Expression */ + protected static final String TRUSTED_CA_CERTIFICATES_XPATH = + ROOT + CONF + "TrustedCACertificates"; + + /** an XPATH-Expression */ + protected static final String VERIFY_INFOBOXES_DEFAULT_TRUST_PROFILE_XPATH = CONF + "DefaultTrustProfile"; + /** an XPATH-Expression */ + protected static final String VERIFY_INFOBOXES_TRUST_PROFILE_ID_XPATH = CONF + "TrustProfileID"; + /** an XPATH-Expression */ + protected static final String VERIFY_INFOBOXES_INFOBOX_XPATH = CONF + "Infobox"; + + + + + /** + * main configuration file directory name used to configure MOA-ID + */ + protected String rootConfigFileDir_; + + /** The root element of the MOA-ID configuration */ + protected Element configElem_; + + /** + * Creates a new MOAConfigurationProvider. + * + * @param configElem The root element of the MOA-ID configuration. + */ + public ConfigurationBuilder(Element configElem, String rootConfigDir) { + configElem_ = configElem; + rootConfigFileDir_ = rootConfigDir; + } + + /** + * Returns the root element of the MOA-ID configuration. + * + * @return The root element of the MOA-ID configuration. + */ + public Element getConfigElem() { + return configElem_; + } + + /** + * Build a ConnectionParameter object containing all information + * of the moa-sp element in the authentication component + * @return ConnectionParameter of the authentication component moa-sp element + */ + public ConnectionParameter buildAuthBKUConnectionParameter() { + + Element authBKU = (Element) XPathUtils.selectSingleNode(configElem_, AUTH_BKU_XPATH); + if (authBKU==null) return null; + return buildConnectionParameter(authBKU); + } + + /** + * Method buildAuthBKUSelectionType. + * + * Build a string with the configuration value of BKUSelectionAlternative + * + * @return String + */ + public String buildAuthBKUSelectionType() { + + Element authBKU = (Element) XPathUtils.selectSingleNode(configElem_, AUTH_BKU_XPATH); + if (authBKU==null) return null; + return (authBKU).getAttribute("BKUSelectionAlternative"); + } + + /** + * Build a string array with all filenames leading + * to the Transforms Information for the Security Layer + * @param contextNode The node from which should be searched + * @param xpathExpr The XPATH expression for the search + * @return String[] of filenames to the Security Layer Transforms Information + * or null if no transforms are included + */ + public String[] buildTransformsInfoFileNames(Node contextNode, String xpathExpr) { + + List transformsInfoFileNames = new ArrayList(); + + try { + NodeIterator tiIter = XPathUtils.selectNodeIterator(contextNode, xpathExpr); + + Attr tiElem; + while ((tiElem = (Attr) tiIter.nextNode()) != null) { + String tiFileName = tiElem.getNodeValue(); + transformsInfoFileNames.add(tiFileName); + } + + String[] result = new String[transformsInfoFileNames.size()]; + transformsInfoFileNames.toArray(result); + + return result; + } catch (XPathException xpe) { + return new String[0]; + } + } + + + /** + * Loads the transformsInfos from files. + * @throws Exception on any exception thrown + */ + public String[] loadTransformsInfos(String[] transformsInfoFileNames) throws Exception { + + String[] transformsInfos = new String[transformsInfoFileNames.length]; + for (int i = 0; i < transformsInfoFileNames.length; i++) { + String fileURL = transformsInfoFileNames[i]; + + //if fileURL is relative to rootConfigFileDir make it absolute + fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir_); + String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING); + transformsInfos[i] = transformsInfo; + } + return transformsInfos; + } + + /** + * Build a ConnectionParameter bean containing all information + * of the authentication component moa-sp element + * @return ConnectionParameter of the authentication component moa-sp element + */ + public ConnectionParameter buildMoaSpConnectionParameter() { + + Element connectionParameter = (Element) XPathUtils.selectSingleNode(configElem_, AUTH_MOA_SP_XPATH); + if (connectionParameter==null) return null; + return buildConnectionParameter(connectionParameter); + } + + /** + * Return a string with a url-reference to the VerifyIdentityLink trust + * profile id within the moa-sp part of the authentication component + * @return String with a url-reference to the VerifyIdentityLink trust profile ID + */ + public String getMoaSpIdentityLinkTrustProfileID() { + return XPathUtils.getElementValue( + configElem_, + AUTH_MOA_SP_VERIFY_IDENTITY_TRUST_ID_XPATH, + ""); + } + /** + * Return a string representation of an URL pointing to trusted CA Certificates + * @return String representation of an URL pointing to trusted CA Certificates + */ + public String getTrustedCACertificates() { + return XPathUtils.getElementValue( + configElem_, + TRUSTED_CA_CERTIFICATES_XPATH,null); + } + + /** + * Return a string with a url-reference to the VerifyAuthBlock trust + * profile id within the moa-sp part of the authentication component + * @return String with a url-reference to the VerifyAuthBlock trust profile ID + */ + public String getMoaSpAuthBlockTrustProfileID() { + return XPathUtils.getElementValue( + configElem_, + AUTH_MOA_SP_VERIFY_AUTH_TRUST_ID_XPATH, + ""); + } + /** + * Build a string array with references to all verify transform info + * IDs within the moa-sp part of the authentication component + * @return A string array containing all urls to the + * verify transform info IDs + */ + public String[] buildMoaSpAuthBlockVerifyTransformsInfoIDs() { + + List verifyTransformsInfoIDs = new ArrayList(); + NodeIterator vtIter = + XPathUtils.selectNodeIterator( + configElem_, + AUTH_MOA_SP_VERIFY_AUTH_VERIFY_ID_XPATH); + Element vtElem; + + while ((vtElem = (Element) vtIter.nextNode()) != null) { + + String vtInfoIDs = DOMUtils.getText(vtElem); + verifyTransformsInfoIDs.add(vtInfoIDs); + } + String[] result = new String[verifyTransformsInfoIDs.size()]; + verifyTransformsInfoIDs.toArray(result); + + return result; + } + + + /** + * Returns a list containing all X509 Subject Names + * of the Identity Link Signers + * @return a list containing the configured identity-link signer X509 subject names + */ + public List getIdentityLink_X509SubjectNames() { + + Vector x509SubjectNameList = new Vector(); + NodeIterator x509Iter = + XPathUtils.selectNodeIterator( + configElem_, + AUTH_IDENTITY_LINK_X509SUBJECTNAME_XPATH); + Element x509Elem; + + while ((x509Elem = (Element) x509Iter.nextNode()) != null) { + String vtInfoIDs = DOMUtils.getText(x509Elem); + x509SubjectNameList.add(vtInfoIDs); + } + + // now add the default identity link signers + String[] identityLinkSignersWithoutOID = MOAIDAuthConstants.IDENTITY_LINK_SIGNERS_WITHOUT_OID; + for (int i=0; inull
. + * @param moaSpIdentityLinkTrustProfileID The ID of the trust profile used for validating + * the identity link signer certificate. Needed for + * checking if this ID is not used for validating other + * infoboxes. + * + * @return An OAProxyParameter array containing beans + * with all relevant information for the authentication component of the online + * application + */ + public OAAuthParameter[] buildOnlineApplicationAuthParameters( + VerifyInfoboxParameters defaultVerifyInfoboxParameters, String moaSpIdentityLinkTrustProfileID) + throws ConfigurationException + { + + String bkuSelectionTemplateURL = + XPathUtils.getAttributeValue(configElem_, AUTH_BKUSELECT_TEMPLATE_XPATH, null); + String templateURL = + XPathUtils.getAttributeValue(configElem_, AUTH_TEMPLATE_XPATH, null); + + List OA_set = new ArrayList(); + NodeList OAIter = XPathUtils.selectNodeList(configElem_, OA_XPATH); + + for (int i = 0; i < OAIter.getLength(); i++) { + Element oAElem = (Element) OAIter.item(i); + Element authComponent = + (Element) XPathUtils.selectSingleNode(oAElem, OA_AUTH_COMPONENT_XPATH); + + OAAuthParameter oap = new OAAuthParameter(); + String publicURLPrefix = oAElem.getAttribute("publicURLPrefix"); + oap.setPublicURLPrefix(publicURLPrefix); + oap.setKeyBoxIdentier(oAElem.getAttribute("keyBoxIdentifier")); + + // get the type of the online application + String oaType = oAElem.getAttribute("type"); + oap.setOaType(oaType); + String slVersion = "1.1"; + if ("businessService".equalsIgnoreCase(oaType)) { + if (authComponent==null) { + Logger.error("Missing \"AuthComponent\" for OA of type \"businessService\""); + throw new ConfigurationException("config.02", null); + } + Element identificationNumberElem = + (Element) XPathUtils.selectSingleNode(authComponent, OA_AUTH_COMPONENT_IDENT_NUMBER_XPATH); + if (identificationNumberElem==null) { + Logger.error("Missing \"IdentificationNumber\" for OA of type \"businessService\""); + throw new ConfigurationException("config.02", null); + } + Element identificationNumberChild = DOMUtils.getElementFromNodeList(identificationNumberElem.getChildNodes()); + if (identificationNumberChild == null) { + Logger.error("Missing \"IdentificationNumber\" for OA of type \"businessService\""); + throw new ConfigurationException("config.02", null); + } + if ("false".equalsIgnoreCase(oAElem.getAttribute("calculateHPI"))) { + oap.setIdentityLinkDomainIdentifier(buildIdentityLinkDomainIdentifier(identificationNumberChild)); + } else { + // If we have business service and want to dealt with GDA, the security layer can be advised to calulate + // the Health Professional Identifier HPI instead of the wbPK + Logger.info("OA uses HPI for Identification"); + oap.setIdentityLinkDomainIdentifier(Constants.URN_PREFIX_HPI); + } + + // if OA type is "businessSErvice" set slVersion to 1.2 and ignore parameter in config file + Logger.info("OA type is \"businessService\"; setting Security Layer version to 1.2"); + slVersion = "1.2"; + + } else { + + if (authComponent!=null) { + slVersion = authComponent.getAttribute("slVersion"); + } + + } + oap.setSlVersion(slVersion); + //Check if there is an Auth-Block to read from configuration + + if (authComponent!=null) + { + oap.setProvideStammzahl(BoolUtils.valueOf(authComponent.getAttribute("provideStammzahl"))); + oap.setProvideAuthBlock(BoolUtils.valueOf(authComponent.getAttribute("provideAUTHBlock"))); + oap.setProvideIdentityLink(BoolUtils.valueOf(authComponent.getAttribute("provideIdentityLink"))); + oap.setProvideCertificate(BoolUtils.valueOf(authComponent.getAttribute("provideCertificate"))); + oap.setBkuSelectionTemplateURL(buildTemplateURL(authComponent, OA_AUTH_COMPONENT_BKUSELECT_TEMPLATE_XPATH, bkuSelectionTemplateURL)); + oap.setTemplateURL(buildTemplateURL(authComponent, OA_AUTH_COMPONENT_TEMPLATE_XPATH, templateURL)); + // load OA specific transforms if present + String[] transformsInfoFileNames = buildTransformsInfoFileNames(authComponent, OA_AUTH_COMPONENT_TRANSFORMS_INFO_FILENAME_XPATH); + try { + oap.setTransformsInfos(loadTransformsInfos(transformsInfoFileNames)); + } catch (Exception ex) { + Logger.error("Error loading transforms specified for OA \"" + publicURLPrefix + "\"; using default transforms."); + } + Node verifyInfoboxParamtersNode = XPathUtils.selectSingleNode(authComponent, OA_AUTH_COMPONENT_VERIFY_INFOBOXES_XPATH); + oap.setVerifyInfoboxParameters(buildVerifyInfoboxParameters( + verifyInfoboxParamtersNode, defaultVerifyInfoboxParameters, moaSpIdentityLinkTrustProfileID)); + } + OA_set.add(oap); + } + OAAuthParameter[] result = + new OAAuthParameter[OA_set.size()]; + OA_set.toArray(result); + + return result; + + } + + /** + * Builds the URL for a BKUSelectionTemplate or a Template. The method selects + * the uri string from the MOA ID configuration file via the given xpath expression + * and returns either this string or the default value. + * + * @param oaAuthComponent The AuthComponent element to get the template from. + * @param xpathExpr The xpath expression for selecting the template uri. + * @param defaultURL The default template url. + * @return The template url. This may either the via xpath selected uri + * or, if no template is specified within the online appliacation, + * the default url. Both may be null. + */ + protected String buildTemplateURL(Element oaAuthComponent, String xpathExpr, String defaultURL) { + String templateURL = XPathUtils.getAttributeValue(oaAuthComponent, xpathExpr, defaultURL); + if (templateURL != null) { + templateURL = FileUtils.makeAbsoluteURL(templateURL, rootConfigFileDir_); + } + return templateURL; + } + + + /** + * Method buildConnectionParameter: internal Method for creating a + * ConnectionParameter object with all data found in the incoming element + * @param root This Element contains the ConnectionParameter + * @return ConnectionParameter + */ + protected ConnectionParameter buildConnectionParameter(Element root) + { + ConnectionParameter result = new ConnectionParameter(); + result.setAcceptedServerCertificates( + XPathUtils.getElementValue(root,CONNECTION_PARAMETER_ACCEPTED_CERTS_XPATH,null)); + + result.setAcceptedServerCertificates(FileUtils.makeAbsoluteURL( + result.getAcceptedServerCertificates(), rootConfigFileDir_)); + + result.setUrl( + XPathUtils.getAttributeValue(root, CONNECTION_PARAMETER_URL_XPATH, "")); + result.setClientKeyStore( + XPathUtils.getElementValue(root,CONNECTION_PARAMETERN_KEYSTORE_XPATH,null)); + + result.setClientKeyStore(FileUtils.makeAbsoluteURL( + result.getClientKeyStore(), rootConfigFileDir_)); + + result.setClientKeyStorePassword( + XPathUtils.getAttributeValue(root,CONNECTION_PARAMETER_KEYSTORE_PASS_XPATH,"")); + + if ((result.getAcceptedServerCertificates()==null) + && (result.getUrl()=="") + && (result.getClientKeyStore()==null) + && (result.getClientKeyStorePassword()=="")) + return null; + + return result; + } + + + /** + * Build the mapping of generic configuration properties. + * + * @return a {@link Map} of generic configuration properties (a name to value + * mapping) from the configuration. + */ + public Map buildGenericConfiguration() { + + Map genericConfiguration = new HashMap(); + NodeIterator gcIter = + XPathUtils.selectNodeIterator( + configElem_, + GENERIC_CONFIGURATION_XPATH); + Element gcElem; + + while ((gcElem = (Element) gcIter.nextNode()) != null) { + String gcName = gcElem.getAttribute("name"); + String gcValue = gcElem.getAttribute("value"); + + genericConfiguration.put(gcName, gcValue); + } + + return genericConfiguration; + } + + + /** + * Returns the default chaining mode from the configuration. + * + * @return The default chaining mode. + */ + public String getDefaultChainingMode() { + String defaultChaining = + XPathUtils.getAttributeValue( + configElem_, + CHAINING_MODES_DEFAULT_XPATH, + CM_CHAINING); + + return translateChainingMode(defaultChaining); + + } + /** + * Build the chaining modes for all configured trust anchors. + * + * @return The mapping from trust anchors to chaining modes. + */ + public Map buildChainingModes() { + Map chainingModes = new HashMap(); + NodeIterator trustIter = + XPathUtils.selectNodeIterator(configElem_, TRUST_ANCHOR_XPATH); + Element trustAnchorElem; + + while ((trustAnchorElem = (Element) trustIter.nextNode()) != null) { + IssuerAndSerial issuerAndSerial = buildIssuerAndSerial(trustAnchorElem); + String mode = trustAnchorElem.getAttribute("mode"); + + if (issuerAndSerial != null) { + chainingModes.put(issuerAndSerial, translateChainingMode(mode)); + } + } + + return chainingModes; + } + + /** + * Build an IssuerAndSerial from the DOM representation. + * + * @param root The root element (being of type dsig: + * X509IssuerSerialType. + * @return The issuer and serial number contained in the root + * element or null if could not be built for any reason. + */ + protected IssuerAndSerial buildIssuerAndSerial(Element root) { + String issuer = XPathUtils.getElementValue(root, ISSUER_XPATH, null); + String serial = XPathUtils.getElementValue(root, SERIAL_XPATH, null); + + if (issuer != null && serial != null) { + try { + RFC2253NameParser nameParser = new RFC2253NameParser(issuer); + Principal issuerDN = nameParser.parse(); + + return new IssuerAndSerial(issuerDN, new BigInteger(serial)); + } catch (RFC2253NameParserException e) { + warn("config.09", new Object[] { issuer, serial }, e); + return null; + } catch (NumberFormatException e) { + warn("config.09", new Object[] { issuer, serial }, e); + return null; + } + } + return null; + } + + /** + * Translate the chaining mode from the configuration file to one used in the + * IAIK MOA API. + * + * @param chainingMode The chaining mode from the configuration. + * @return The chaining mode as provided by the ChainingModes + * interface. + * @see iaik.pki.pathvalidation.ChainingModes + */ + protected String translateChainingMode(String chainingMode) { + if (chainingMode.equals(CM_CHAINING)) { + return ChainingModes.CHAIN_MODE; + } else if (chainingMode.equals(CM_PKIX)) { + return ChainingModes.PKIX_MODE; + } else { + return ChainingModes.CHAIN_MODE; + } + } + + /** + * Builds the IdentityLinkDomainIdentifier as needed for providing it to the + * SecurityLayer for computation of the wbPK. + *

e.g.:
+ * input element: + *
+ * <pr:Firmenbuchnummer Identifier="FN">000468 i</pr:Firmenbuchnummer> + *

+ * return value: urn:publicid:gv.at+wbpk+FN468i + * + * @param number The element holding the identification number of the business + * company. + * @return The domain identifier + */ + protected String buildIdentityLinkDomainIdentifier(Element number) { + if (number == null) { + return null; + } + String identificationNumber = number.getFirstChild().getNodeValue(); + String identifier = number.getAttribute("Identifier"); + // remove all blanks + identificationNumber = StringUtils.removeBlanks(identificationNumber); + if (number.getLocalName().equals("Firmenbuchnummer") || identifier.equalsIgnoreCase("fn")) { + // delete zeros from the beginning of the number + identificationNumber = StringUtils.deleteLeadingZeros(identificationNumber); + // remove hyphens + identificationNumber = StringUtils.removeToken(identificationNumber, "-"); + } + StringBuffer identityLinkDomainIdentifier = new StringBuffer(Constants.URN_PREFIX_WBPK); + identityLinkDomainIdentifier.append("+"); + if (!identificationNumber.startsWith(identifier)) { + identityLinkDomainIdentifier.append(identifier); + } + identityLinkDomainIdentifier.append("+"); + identityLinkDomainIdentifier.append(identificationNumber); + return identityLinkDomainIdentifier.toString(); + } + + /** + * Builds the parameters for verifying additional infoboxes (additional to the + * IdentityLink infobox). + * + * @param verifyInfoboxesElem The VerifyInfoboxes element from the + * config file. This maybe the global element or the + * elment from an Online application. + * @param defaultVerifyInfoboxParameters Default parameters to be used, if no + * VerifyInfoboxes element is present. + * This only applies to parameters + * of an specific online application and is set to + * null when building the global parameters. + * @param moaSpIdentityLinkTrustProfileID The ID of the trust profile used for validating + * the identity link signer certificate. Needed for + * checking if this ID is not used for validating other + * infoboxes. + * + * @return A {@link at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters VerifyInfoboxParameters} + * object needed for verifying additional infoboxes. + * + * @throws ConfigurationException If the trust profile for validating the identity link + * signer certificate is used for validating another infobox. + */ + public VerifyInfoboxParameters buildVerifyInfoboxParameters( + Node verifyInfoboxesElem, + VerifyInfoboxParameters defaultVerifyInfoboxParameters, + String moaSpIdentityLinkTrustProfileID) + throws ConfigurationException + { + + if ((verifyInfoboxesElem == null) && (defaultVerifyInfoboxParameters == null)) { + return null; + } + Vector identifiers = new Vector(); + List defaultIdentifiers = null; + Map defaultInfoboxParameters = null; + if (defaultVerifyInfoboxParameters != null) { + defaultIdentifiers = defaultVerifyInfoboxParameters.getIdentifiers(); + defaultInfoboxParameters = defaultVerifyInfoboxParameters.getInfoboxParameters(); + } + Hashtable infoboxParameters = new Hashtable(); + if (verifyInfoboxesElem != null) { + // get the DefaultTrustProfileID + String defaultTrustProfileID = null; + Node defaultTrustProfileNode = + XPathUtils.selectSingleNode(verifyInfoboxesElem, VERIFY_INFOBOXES_DEFAULT_TRUST_PROFILE_XPATH); + if (defaultTrustProfileNode != null) { + Node trustProfileIDNode = + XPathUtils.selectSingleNode(defaultTrustProfileNode, VERIFY_INFOBOXES_TRUST_PROFILE_ID_XPATH); + defaultTrustProfileID = trustProfileIDNode.getFirstChild().getNodeValue(); + if (defaultTrustProfileID.equals(moaSpIdentityLinkTrustProfileID)) { + throw new ConfigurationException("config.15", new Object[] {moaSpIdentityLinkTrustProfileID}); + } + } + // get the Infoboxes + NodeList infoboxes = + XPathUtils.selectNodeList(verifyInfoboxesElem, VERIFY_INFOBOXES_INFOBOX_XPATH); + for (int i=0; iMOAConfigurationException. + */ + public ConfigurationException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Create a MOAConfigurationException. + */ + public ConfigurationException( + String messageId, + Object[] parameters, + Throwable wrapped) { + + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java new file mode 100644 index 000000000..e65c47bad --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java @@ -0,0 +1,128 @@ +package at.gv.egovernment.moa.id.config; + +import java.math.BigInteger; +import java.security.Principal; +import java.security.cert.X509Certificate; +import java.util.Map; + +import at.gv.egovernment.moa.id.data.IssuerAndSerial; + +/** + * Base class for AuthConfigurationProvider and ProxyConfigurationProvider, + * providing functions common to both of them. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ConfigurationProvider { + + /** + * Constructor + */ + public ConfigurationProvider() { + super(); + } + + /** + * The name of the system property which contains the file name of the + * configuration file. + */ + public static final String CONFIG_PROPERTY_NAME = + "moa.id.configuration"; + + /** + * The name of the generic configuration property giving the certstore directory path. + */ + public static final String DIRECTORY_CERTSTORE_PARAMETER_PROPERTY = + "DirectoryCertStoreParameters.RootDir"; + + /** + * The name of the generic configuration property switching the ssl revocation checking on/off + */ + public static final String TRUST_MANAGER_REVOCATION_CHECKING = + "TrustManager.RevocationChecking"; + + + /** + * A Map which contains generic configuration information. Maps a + * configuration name (a String) to a configuration value (also a + * String). + */ + protected Map genericConfiguration; + + /** The default chaining mode. */ + protected String defaultChainingMode; + + /** + * A Map which contains the IssuerAndSerial to + * chaining mode (a String) mapping. + */ + protected Map chainingModes; + + /** + * the URL for the trusted CA Certificates + */ + protected String trustedCACertificates; + + /** + * main configuration file directory name used to configure MOA-ID + */ + protected String rootConfigFileDir; + + /** + * Returns the main configuration file directory used to configure MOA-ID + * + * @return the directory + */ + public String getRootConfigFileDir() { + return rootConfigFileDir; + } + + /** + * Returns the mapping of generic configuration properties. + * + * @return The mapping of generic configuration properties (a name to value + * mapping) from the configuration. + */ + public Map getGenericConfiguration() { + return genericConfiguration; + } + + /** + * Returns the value of a parameter from the generic configuration section. + * + * @return the parameter value; null if no such parameter + */ + public String getGenericConfigurationParameter(String parameter) { + if (! genericConfiguration.containsKey(parameter)) + return null; + return (String)genericConfiguration.get(parameter); + } + + /** + * Return the chaining mode for a given trust anchor. + * + * @param trustAnchor The trust anchor for which the chaining mode should be + * returned. + * @return The chaining mode for the given trust anchor. If the trust anchor + * has not been configured separately, the system default will be returned. + */ + public String getChainingMode(X509Certificate trustAnchor) { + Principal issuer = trustAnchor.getIssuerDN(); + BigInteger serial = trustAnchor.getSerialNumber(); + IssuerAndSerial issuerAndSerial = new IssuerAndSerial(issuer, serial); + + String mode = (String) chainingModes.get(issuerAndSerial); + return mode != null ? mode : defaultChainingMode; + } + + /** + * Returns the trustedCACertificates. + * @return String + */ + public String getTrustedCACertificates() { + + return trustedCACertificates; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConnectionParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConnectionParameter.java new file mode 100644 index 000000000..30b09cfe0 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConnectionParameter.java @@ -0,0 +1,106 @@ +package at.gv.egovernment.moa.id.config; + +/** + * This bean class is used to store data for various connectionParameter + * within the MOA-ID configuration + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class ConnectionParameter { + + /** + * Server URL + */ + private String url; + /** + * File URL for a directory containing PKCS#12 server SSL certificates. + * From these certificates, a X509 trust store will be assembled for use + * by a JSSE TrustManager. + * This field will only be used in case of an HTTPS URL. + */ + private String acceptedServerCertificates; + /** + * File URL of a X509 key store containing the private key to be used + * for an HTTPS connection when the server requires client authentication. + * This field will only be used in case of an HTTPS URL. + */ + private String clientKeyStore; + /** + * Password protecting the client key store. + */ + private String clientKeyStorePassword; + + /** + * Checks whether the URL scheme is "https". + * @return true in case of an URL starting with "https" + */ + public boolean isHTTPSURL() { + return getUrl().indexOf("https") == 0; + } + + /** + * Returns the url. + * @return String + */ + public String getUrl() { + return url; + } + + /** + * Returns the acceptedServerCertificates. + * @return String + */ + public String getAcceptedServerCertificates() { + return acceptedServerCertificates; + } + + /** + * Sets the acceptedServerCertificates. + * @param acceptedServerCertificates The acceptedServerCertificates to set + */ + public void setAcceptedServerCertificates(String acceptedServerCertificates) { + this.acceptedServerCertificates = acceptedServerCertificates; + } + + /** + * Sets the url. + * @param url The url to set + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * Returns the clientKeyStore. + * @return String + */ + public String getClientKeyStore() { + return clientKeyStore; + } + + /** + * Returns the clientKeyStorePassword. + * @return String + */ + public String getClientKeyStorePassword() { + return clientKeyStorePassword; + } + + /** + * Sets the clientKeyStore. + * @param clientKeyStore The clientKeyStore to set + */ + public void setClientKeyStore(String clientKeyStore) { + this.clientKeyStore = clientKeyStore; + } + + /** + * Sets the clientKeyStorePassword. + * @param clientKeyStorePassword The clientKeyStorePassword to set + */ + public void setClientKeyStorePassword(String clientKeyStorePassword) { + this.clientKeyStorePassword = clientKeyStorePassword; + } + +} 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 new file mode 100644 index 000000000..19a27b463 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/OAParameter.java @@ -0,0 +1,76 @@ +package at.gv.egovernment.moa.id.config; + +/** + * Configuration parameters belonging to an online application, + * to be used within both, the MOA ID Auth and the + * MOA ID PROXY component. + * + * @author Harald Bratko + */ +public class OAParameter { + + /** + * type of the online application (maybe "PublicService" or "BusinessService") + */ + private String oaType; + + /** + * specifies whether the online application is a business application or not + * (true if value of {@link #oaType} is "businessService" + */ + private boolean businessService; + + /** + * public URL prefix of the online application + */ + private String publicURLPrefix; + + /** + * Returns the type of the online application. + * @return the type of the online application. + */ + public String getOaType() { + return oaType; + } + + /** + * Returns true is the OA is a businss application, otherwise + * false. + * @return true is the OA is a businss application, otherwise + * false + */ + public boolean getBusinessService() { + return this.businessService; + } + + /** + * Returns the publicURLPrefix. + * @return String + */ + public String getPublicURLPrefix() { + return publicURLPrefix; + } + + /** + * + * Sets the type of the online application. + * If the type is "businessService" the value of businessService + * ({@link #getBusinessService()}) is also set to true + * @param oaType The type of the online application. + */ + public void setOaType(String oaType) { + this.oaType = oaType; + if ("businessService".equalsIgnoreCase(oaType)) { + this.businessService = true; + } + } + + /** + * Sets the publicURLPrefix. + * @param publicURLPrefix The publicURLPrefix to set + */ + public void setPublicURLPrefix(String publicURLPrefix) { + this.publicURLPrefix = publicURLPrefix; + } + +} 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 new file mode 100644 index 000000000..b4af6592c --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -0,0 +1,414 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import at.gv.egovernment.moa.id.config.ConfigurationBuilder; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * A class providing access to the Auth Part of the MOA-ID configuration data. + * + *

Configuration data is read from an XML file, whose location is given by + * the moa.id.configuration system property.

+ *

This class implements the Singleton pattern. The reload() + * method can be used to update the configuration data. Therefore, it is not + * guaranteed that consecutive calls to getInstance() will return + * the same AuthConfigurationProvider all the time. During the + * processing of a web service request, the current + * TransactionContext should be used to obtain the + * AuthConfigurationProvider local to that request.

+ * + * @author Patrick Peck + * @author Stefan Knirsch + * + * @version $Id$ + */ +public class AuthConfigurationProvider extends ConfigurationProvider { + + /** DEFAULT_ENCODING is "UTF-8" */ + private static final String DEFAULT_ENCODING="UTF-8"; + /** + * The name of the generic configuration property giving the authentication session time out. + */ + public static final String AUTH_SESSION_TIMEOUT_PROPERTY = + "AuthenticationSession.TimeOut"; + /** + * The name of the generic configuration property giving the authentication data time out. + */ + public static final String AUTH_DATA_TIMEOUT_PROPERTY = + "AuthenticationData.TimeOut"; + + /** + * BKUSelectionType HTMLComplete, according to schema type BKUSelectionType + */ + public static final String BKU_SELECTION_TYPE_HTMLCOMPLETE = + "HTMLComplete"; + + /** + * BKUSelectionType HTMLSelect, according to schema type BKUSelectionType + */ + public static final String BKU_SELECTION_TYPE_HTMLSELECT = + "HTMLSelect"; + + /** + * The name of the generic configuration property allowing https connection to + * the user frontend servlets ("StartAuthentication" and "SelectBKU" servlets) + */ + public static final String FRONTEND_SERVLETS_ENABLE_HTTP_CONNECTION_PROPERTY = + "FrontendServlets.EnableHTTPConnection"; + + /** + * The name of the generic configuration property allowing to set a individual + * DATA URL used to communicate with the BKU (SecurityLayer) + */ + public static final String INDIVIDUAL_DATA_URL_PREFIX = + "FrontendServlets.DataURLPrefix"; + + /** Singleton instance. null, if none has been created. */ + private static AuthConfigurationProvider instance; + + // + // configuration data + // + + /** + * configuration files containing transformations for rendering in the + * secure viewer of the security layer implementation; + * multiple files can be given for different mime types + */ + private String[] transformsInfoFileNames; + + /** + * transformations for rendering in the secure viewer of the security layer implementation, + * read from {@link transformsInfoFileNames}; + * multiple transformation can be given for different mime types + */ + private String[] transformsInfos; + + /** + * parameters for connection to MOA SP component + */ + private ConnectionParameter moaSpConnectionParameter; + /** + * trust profile ID to be used for verifying the identity link signature via MOA ID SP + */ + private String moaSpIdentityLinkTrustProfileID; + /** + * trust profile ID to be used for verifying the AUTH block signature via MOA ID SP + */ + private String moaSpAuthBlockTrustProfileID; + /** + * transformations to be used for verifying the AUTH block signature via MOA ID SP + */ + private String[] moaSpAuthBlockVerifyTransformsInfoIDs; + /** + * X509 SubjectNames which will be trusted + */ + private List identityLinkX509SubjectNames; + /** + * default parameters for verifying additional infoboxes. + */ + private VerifyInfoboxParameters defaultVerifyInfoboxParameters; + + /** + * configuration parameters for online applications + */ + private OAAuthParameter[] onlineApplicationAuthParameters; + /** + * the Selection Type of the bku Selection Element + */ + private String bKUSelectionType; + /** + * is the bku Selection Element present? + */ + private boolean bKUSelectable; + /** + * the bku Selection Connection Parameters + */ + private ConnectionParameter bKUConnectionParameter; + + /** + * Return the single instance of configuration data. + * + * @return AuthConfigurationProvider The current configuration data. + * @throws ConfigurationException + */ + public static synchronized AuthConfigurationProvider getInstance() + throws ConfigurationException { + + if (instance == null) { + reload(); + } + return instance; + } + + /** + * Reload the configuration data and set it if successful. + * + * @return AuthConfigurationProvider The loaded configuration data. + * @throws ConfigurationException Failure to load the configuration data. + */ + public static synchronized AuthConfigurationProvider reload() + throws ConfigurationException { + String fileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); + if (fileName == null) { + throw new ConfigurationException("config.01", null); + } + Logger.info("Loading MOA-ID-AUTH configuration " + fileName); + + instance = new AuthConfigurationProvider(fileName); + return instance; + } + + /** + * Constructor for AuthConfigurationProvider. + * @param fileName + * @throws ConfigurationException + */ + public AuthConfigurationProvider(String fileName) + throws ConfigurationException { + + load(fileName); + } + + /** + * Load the configuration data from XML file with the given name and build + * the internal data structures representing the MOA ID configuration. + * + * @param fileName The name of the XML file to load. + * @throws ConfigurationException The MOA configuration could not be + * read/built. + */ + private void load(String fileName) throws ConfigurationException { + InputStream stream = null; + Element configElem; + ConfigurationBuilder builder; + + try { + // load the main config file + stream = new BufferedInputStream(new FileInputStream(fileName)); + configElem = DOMUtils.parseXmlValidating(stream); + } catch (Throwable t) { + throw new ConfigurationException("config.03", null, t); + } + finally { + try { + if (stream != null) { + stream.close(); + } + } catch (IOException e) { + } + } + try { + // determine the directory of the root config file + rootConfigFileDir = new File(fileName).getParent(); + try { + rootConfigFileDir = new File(rootConfigFileDir).toURL().toString(); + } catch (MalformedURLException t) { + throw new ConfigurationException("config.03", null, t); + } + + // build the internal datastructures + builder = new ConfigurationBuilder(configElem, rootConfigFileDir); + bKUConnectionParameter = builder.buildAuthBKUConnectionParameter(); + bKUSelectable = (bKUConnectionParameter!=null); + bKUSelectionType = builder.buildAuthBKUSelectionType(); + genericConfiguration = builder.buildGenericConfiguration(); + transformsInfoFileNames = builder.buildTransformsInfoFileNames(builder.getConfigElem(), ConfigurationBuilder.AUTH_SECLAYER_TRANSFORMS_INFO_FILENAME_XPATH); + transformsInfos = builder.loadTransformsInfos(transformsInfoFileNames); + moaSpConnectionParameter = builder.buildMoaSpConnectionParameter(); + moaSpIdentityLinkTrustProfileID = builder.getMoaSpIdentityLinkTrustProfileID(); + moaSpAuthBlockTrustProfileID = builder.getMoaSpAuthBlockTrustProfileID(); + moaSpAuthBlockVerifyTransformsInfoIDs = builder.buildMoaSpAuthBlockVerifyTransformsInfoIDs(); + defaultVerifyInfoboxParameters = null; + Node defaultVerifyInfoboxParamtersElem = XPathUtils.selectSingleNode(configElem, ConfigurationBuilder.AUTH_VERIFY_INFOBOXES_XPATH); + if (defaultVerifyInfoboxParamtersElem != null) { + defaultVerifyInfoboxParameters = + builder.buildVerifyInfoboxParameters((Element)defaultVerifyInfoboxParamtersElem, null, moaSpIdentityLinkTrustProfileID); + } + onlineApplicationAuthParameters = builder.buildOnlineApplicationAuthParameters(defaultVerifyInfoboxParameters, moaSpIdentityLinkTrustProfileID); + identityLinkX509SubjectNames = builder.getIdentityLink_X509SubjectNames(); + defaultChainingMode = builder.getDefaultChainingMode(); + chainingModes = builder.buildChainingModes(); + trustedCACertificates = builder.getTrustedCACertificates(); + trustedCACertificates = FileUtils.makeAbsoluteURL(trustedCACertificates, rootConfigFileDir); + + } catch (Throwable t) { + throw new ConfigurationException("config.02", null, t); + } + } + + /** + * Loads the transformsInfos from files. + * @throws Exception on any exception thrown + */ +// private void loadTransformsInfos() throws Exception { +// +// transformsInfos = new String[transformsInfoFileNames.length]; +// for (int i = 0; i < transformsInfoFileNames.length; i++) { +// String fileURL = transformsInfoFileNames[i]; +// +// //if fileURL is relative to rootConfigFileDir make it absolute +// fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir); +// String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING); +// transformsInfos[i] = transformsInfo; +// } +// } + + /** + * Loads the transformsInfos from files. + * @throws Exception on any exception thrown + */ + private String[] loadTransformsInfos(String[] transformsInfoFileNames) throws Exception { + + String[] transformsInfos = new String[transformsInfoFileNames.length]; + for (int i = 0; i < transformsInfoFileNames.length; i++) { + String fileURL = transformsInfoFileNames[i]; + + //if fileURL is relative to rootConfigFileDir make it absolute + fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir); + String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING); + transformsInfos[i] = transformsInfo; + } + return transformsInfos; + } + /** + * Return a string array with all filenames leading + * to the Transforms Information for the Security Layer + * @return String[] of filenames to the Security Layer Transforms Information + */ + public String[] getTransformsInfoFileNames() { + return transformsInfoFileNames; + } + + /** + * Build an array of the OnlineApplication Parameters containing information + * about the authentication component + * @return An OAProxyParameter array containing beans + * with all relevant information for theauthentication component of the online + * application + */ + public OAAuthParameter[] getOnlineApplicationParameters() { + return onlineApplicationAuthParameters; + } + + /** + * Provides configuration information regarding the online application behind + * the given URL, relevant to the MOA-ID Auth component. + * + * @param oaURL URL requested for an online application + * @return an OAAuthParameter, or null + * if none is applicable + */ + public OAAuthParameter getOnlineApplicationParameter(String oaURL) { + OAAuthParameter[] oaParams = getOnlineApplicationParameters(); + for (int i = 0; i < oaParams.length; i++) { + OAAuthParameter oaParam = oaParams[i]; + if (oaURL.indexOf(oaParam.getPublicURLPrefix()) == 0) + return oaParam; + } + return null; + } + + /** + * Return a string with a url-reference to the VerifyAuthBlock trust + * profile id within the moa-sp part of the authentication component + * + * @return String with a url-reference to the VerifyAuthBlock trust profile ID + */ + public String getMoaSpAuthBlockTrustProfileID() { + return moaSpAuthBlockTrustProfileID; + } + + /** + * Return a string array with references to all verify transform info + * IDs within the moa-sp part of the authentication component + * @return A string array containing all urls to the + * verify transform info IDs + */ + public String[] getMoaSpAuthBlockVerifyTransformsInfoIDs() { + return moaSpAuthBlockVerifyTransformsInfoIDs; + } + + /** + * Return a ConnectionParameter bean containing all information + * of the authentication component moa-sp element + * @return ConnectionParameter of the authentication component moa-sp element + */ + public ConnectionParameter getMoaSpConnectionParameter() { + return moaSpConnectionParameter; + } + + /** + * Return a string with a url-reference to the VerifyIdentityLink trust + * profile id within the moa-sp part of the authentication component + * @return String with a url-reference to the VerifyIdentityLink trust profile ID + */ + public String getMoaSpIdentityLinkTrustProfileID() { + return moaSpIdentityLinkTrustProfileID; + } + /** + * Returns the transformsInfos. + * @return String[] + */ + public String[] getTransformsInfos() { + return transformsInfos; + } + + /** + * Returns the identityLinkX509SubjectNames. + * @return List + */ + public List getIdentityLinkX509SubjectNames() { + return identityLinkX509SubjectNames; + } + + /** + * Returns the bKUConnectionParameter. + * @return ConnectionParameter + */ + public ConnectionParameter getBKUConnectionParameter() { + return bKUConnectionParameter; + } + + /** + * Returns the bKUSelectable. + * @return boolean + */ + public boolean isBKUSelectable() { + return bKUSelectable; + } + + /** + * Returns the bKUSelectionType. + * @return String + */ + public String getBKUSelectionType() { + return bKUSelectionType; + } + + /** + * Returns the defaultVerifyInfoboxParameters. + * + * @return The defaultVerifyInfoboxParameters. + */ + public VerifyInfoboxParameters getDefaultVerifyInfoboxParameters() { + return defaultVerifyInfoboxParameters; + } + +} \ No newline at end of file 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 new file mode 100644 index 000000000..ba3b61f9d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java @@ -0,0 +1,268 @@ +package at.gv.egovernment.moa.id.config.auth; + +import at.gv.egovernment.moa.id.config.OAParameter; + +/** + * Configuration parameters belonging to an online application, + * to use with the MOA ID Auth component. + * + * @author Stefan Knirsch + * @version $Id$ + */ +/** + * + * + * @author Harald Bratko + */ +public class OAAuthParameter extends OAParameter { + /** + * Sercurity Layer version + */ + private String slVersion; + /** + * true, if the Security Layer version is version 1.2, otherwise false + */ + private boolean slVersion12; + /** + * identityLinkDomainIdentifier + * (e.g urn:publicid:gv.at+wbpk+FN468i for a "Firmenbuchnummer") + *
+ * only used within a business application context for providing it to the + * security layer as input for wbPK computation + */ + private String identityLinkDomainIdentifier; + /** + * key box Identifier (e.g. CertifiedKeypair, SecureSignatureKeypair) + */ + private String keyBoxIdentifier; + /** + * transformations for rendering in the secure viewer of the security layer + * implementation; multiple transformation can be given for different mime types + */ + private String[] transformsInfos; + /** + * determines whether "Stammzahl" is to be included in the authentication data + */ + private boolean provideStammzahl; + /** + * determines whether AUTH block is to be included in the authentication data + */ + private boolean provideAuthBlock; + /** + * determines whether identity link is to be included in the authentication data + */ + private boolean provideIdentityLink; + /** + * determines whether the certificate is to be included in the authentication data + */ + private boolean provideCertificate; + /** + * url to a template for web page "Auswahl der Bürgerkartenumgebung" + */ + private String bkuSelectionTemplateURL; + /** + * template for web page "Anmeldung mit Bürgerkarte" + */ + private String templateURL; + /** + * Parameters for verifying infoboxes. + */ + private VerifyInfoboxParameters verifyInfoboxParameters; + + /** + * Returns true if the Security Layer version is version 1.2, + * otherwise false. + * @return true if the Security Layer version is version 1.2, + * otherwise false + */ + public boolean getSlVersion12() { + return slVersion12; + } + + /** + * Returns the security layer version. + * @return the security layer version. + */ + public String getSlVersion() { + return slVersion; + } + + /** + * Returns the identityLinkDomainIdentifier. + * @return the identityLinkDomainIdentifier. + */ + public String getIdentityLinkDomainIdentifier() { + return identityLinkDomainIdentifier; + } + + /** + * Returns the transformsInfos. + * @return the transformsInfos. + */ + public String[] getTransformsInfos() { + return transformsInfos; + } + + /** + * Returns the provideAuthBlock. + * @return String + */ + public boolean getProvideAuthBlock() { + return provideAuthBlock; + } + + /** + * Returns the provideIdentityLink. + * @return String + */ + public boolean getProvideIdentityLink() { + return provideIdentityLink; + } + + /** + * Returns the provideStammzahl. + * @return String + */ + public boolean getProvideStammzahl() { + return provideStammzahl; + } + + /** + * Returns true if the certificate should be provided within the + * authentication data, otherwise false. + * @return true if the certificate should be provided, + * otherwise false + */ + public boolean getProvideCertifcate() { + return provideCertificate; + } + + /** + * Returns the key box identifier. + * @return String + */ + public String getKeyBoxIdentifier() { + return keyBoxIdentifier; + } + + /** + * Returns the BkuSelectionTemplate url. + * @return The BkuSelectionTemplate url or null if no url for + * a BkuSelectionTemplate is set. + */ + public String getBkuSelectionTemplateURL() { + return bkuSelectionTemplateURL; + } + + /** + * Returns the TemplateURL url. + * @return The TemplateURL url or null if no url for + * a Template is set. + */ + public String getTemplateURL() { + return templateURL; + } + + /** + * Returns the parameters for verifying additional infoboxes. + * + * @return The parameters for verifying additional infoboxes. + * Maybe null. + */ + public VerifyInfoboxParameters getVerifyInfoboxParameters() { + return verifyInfoboxParameters; + } + + /** + * Sets the security layer version. + * Also sets slVersion12 ({@link #getSlVersion12()}) + * to true if the Security Layer version is 1.2. + * @param slVersion The security layer version to be used. + */ + public void setSlVersion(String slVersion) { + this.slVersion = slVersion; + if ("1.2".equals(slVersion)) { + this.slVersion12 = true; + } + } + /** + * Sets the IdentityLinkDomainIdentifier. + * @param identityLinkDomainIdentifier The IdentityLinkDomainIdentifiern number of the online application. + */ + public void setIdentityLinkDomainIdentifier(String identityLinkDomainIdentifier) { + this.identityLinkDomainIdentifier = identityLinkDomainIdentifier; + } + /** + * Sets the transformsInfos. + * @param transformsInfos The transformsInfos to be used. + */ + public void setTransformsInfos(String[] transformsInfos) { + this.transformsInfos = transformsInfos; + } + /** + * Sets the provideAuthBlock. + * @param provideAuthBlock The provideAuthBlock to set + */ + public void setProvideAuthBlock(boolean provideAuthBlock) { + this.provideAuthBlock = provideAuthBlock; + } + + /** + * Sets the provideIdentityLink. + * @param provideIdentityLink The provideIdentityLink to set + */ + public void setProvideIdentityLink(boolean provideIdentityLink) { + this.provideIdentityLink = provideIdentityLink; + } + + /** + * Sets the provideStammzahl. + * @param provideStammzahl The provideStammzahl to set + */ + public void setProvideStammzahl(boolean provideStammzahl) { + this.provideStammzahl = provideStammzahl; + } + + /** + * Sets the provideCertificate variable. + * @param provideCertificate The provideCertificate value to set + */ + public void setProvideCertificate(boolean provideCertificate) { + this.provideCertificate = provideCertificate; + } + + /** + * Sets the key box identifier. + * @param keyBoxIdentifier to set + */ + public void setKeyBoxIdentier(String keyBoxIdentifier) { + this.keyBoxIdentifier = keyBoxIdentifier; + } + + /** + * Sets the BkuSelectionTemplate url. + * @param bkuSelectionTemplateURL The url string specifying the location + * of a BkuSelectionTemplate. + */ + public void setBkuSelectionTemplateURL(String bkuSelectionTemplateURL) { + this.bkuSelectionTemplateURL = bkuSelectionTemplateURL; + } + + /** + * Sets the Template url. + * @param templateURL The url string specifying the location + * of a Template. + */ + public void setTemplateURL(String templateURL) { + this.templateURL = templateURL; + } + + /** + * Sets the parameters for verifying additonal (to the identitylink infobox) infoboxes. + * + * @param verifyInfoboxParameters The verifyInfoboxParameters to set. + */ + public void setVerifyInfoboxParameters(VerifyInfoboxParameters verifyInfoboxParameters) { + this.verifyInfoboxParameters = verifyInfoboxParameters; + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java new file mode 100644 index 000000000..fbd42f975 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java @@ -0,0 +1,360 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import javax.xml.transform.TransformerException; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.auth.data.Schema; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.StringUtils; + +/** + * This class is a container for parameters that maybe needed for verifying an infobox. + * + * @author Harald Bratko + */ +public class VerifyInfoboxParameter { + + /** + * The default package name (first part) of a infobox validator class. + */ + public static final String DEFAULT_PACKAGE_TRUNK = "at.gv.egovernment.moa.id.auth.validator."; + + /** + * The identifier of the infobox to be verified. This identifier must exactly the + * identifier of the infobox returned by BKU. + */ + protected String identifier_; + + /** + * The friendly name of the infobox. + * This name is used within browser messages, thus it should be the german equivalent of + * the {@link #identifier_ infobox identifier} (e.g. "Stellvertretungen" + * for "Mandates" or "GDAToken" for + * "EHSPToken". + *
If not specified within the config file the {@link #identifier_ infobox identifier} + * will be used. + */ + protected String friendlyName_; + + /** + * The Id of the TrustProfile to be used for validating certificates. + */ + protected String trustProfileID_; + + /** + * The full name of the class to be used for verifying the infobox. + */ + protected String validatorClassName_; + + /** + * Schema location URIs that may be needed by the + * validator to parse infobox tokens. + * Each entry in the list is a {@link at.gv.egovernment.moa.id.auth.data.Schema Schema} + * specifying the location of an XML schema. + */ + protected List schemaLocations_; + + /** + * Application specific parameters that may be needed for verifying an infobox. + */ + protected Element applicationSpecificParams_; + + /** + * Specifies if the infobox is be required to be returned by the BKU. + */ + protected boolean required_; + + /** + * Specifies whether the Stammzahl should be passed to the verifying + * application or not. + */ + protected boolean provideStammzahl_; + + /** + * Specifies whether the identity link should be passed to the verifying + * application or not. + */ + protected boolean provideIdentityLink_; + + /** + * Initializes this VerifiyInfoboxParamater with the given identifier and a default + * validator class name. + * + * @param identifier The identifier of the infobox to be verified. + */ + public VerifyInfoboxParameter(String identifier) { + identifier_ = identifier; + StringBuffer sb = new StringBuffer(DEFAULT_PACKAGE_TRUNK); + sb.append(identifier.toLowerCase()); + sb.append("."); + sb.append(identifier.substring(0, 1).toUpperCase()); + sb.append(identifier.substring(1)); + sb.append("Validator"); + validatorClassName_ = sb.toString(); + } + + /** + * Returns application specific parameters. + * Each child element of this element contains a verifying application specific parameter. {@link #applicationSpecificParams_} + * + * @see #applicationSpecificParams_ + * + * @return Application specific parameters. + */ + public Element getApplicationSpecificParams() { + return applicationSpecificParams_; + } + + /** + * Sets the application specific parameters. + * + * @see #applicationSpecificParams_ + * + * @param applicationSpecificParams The application specific parameters to set. + */ + public void setApplicationSpecificParams(Element applicationSpecificParams) { + applicationSpecificParams_ = applicationSpecificParams; + } + + /** + * Returns the friendly name. + * + * @see #friendlyName_ + * + * @return The friendly name. + */ + public String getFriendlyName() { + return friendlyName_; + } + + /** + * Sets the friendly name. + * + * @param friendlyName The friendly name to set. + */ + public void setFriendlyName(String friendlyName) { + friendlyName_ = friendlyName; + } + + /** + * Returns the infobox identifier. + * + * @see #identifier_ + * + * @return The infobox identifier. + */ + public String getIdentifier() { + return identifier_; + } + + /** + * Sets the the infobox identifier. + * + * @see #identifier_ + * + * @param identifier The infobox identifier to set. + */ + public void setIdentifier(String identifier) { + identifier_ = identifier; + } + + /** + * Specifies whether the identity link should be passed to the verifying application + * or not. + * + * @return True if the identity link should be passed to the verifying + * application, otherwise false. + */ + public boolean getProvideIdentityLink() { + return provideIdentityLink_; + } + + /** + * Sets the {@link #provideIdentityLink_} parameter. + * + * @param provideIdentityLink True if the identity link should be passed to + * the verifying application, otherwise false. + */ + public void setProvideIdentityLink(boolean provideIdentityLink) { + provideIdentityLink_ = provideIdentityLink; + } + + /** + * Specifies whether the Stammzahl should be passed to the verifying + * application or not. + * + * @return True if the Stammzahl should be passed to the + * verifying application, otherwise false. + */ + public boolean getProvideStammzahl() { + return provideStammzahl_; + } + + /** + * Sets the {@link #provideStammzahl_} parameter. + * + * @param provideStammzahl True if the Stammzahl should be + * passed to the verifying application, otherwise false. + */ + public void setProvideStammzahl(boolean provideStammzahl) { + provideStammzahl_ = provideStammzahl; + } + + /** + * Specifies whether the infobox is required or not. + * + * @return True if the infobox is required to be returned by the BKU, + * otherwise false. + */ + public boolean isRequired() { + return required_; + } + + /** + * Sets the {@link #required_} parameter. + * + * @param required True if the infobox is required to be returned by the + * BKU, otherwise false. + */ + public void setRequired(boolean required) { + required_ = required; + } + + /** + * Schema location URIs that may be needed by the + * validator to parse infobox tokens. + * Each entry in the list is a {@link at.gv.egovernment.moa.id.auth.data.Schema Schema} + * specifying the location of an XML schema. + * + * @return A list of {@link at.gv.egovernment.moa.id.auth.data.Schema Schema} objects + * each of them specifying the location of an XML schema. + */ + public List getSchemaLocations() { + return schemaLocations_; + } + + /** + * Sets the schema locations. + * + * @see #schemaLocations_ + * + * @param schemaLocations The schema location list to be set. + */ + public void setSchemaLocations(List schemaLocations) { + schemaLocations_ = schemaLocations; + } + + /** + * Returns the ID of the trust profile to be used for verifying certificates. + * + * @return The ID of the trust profile to be used for verifying certificates. + * Maybe null. + */ + public String getTrustProfileID() { + return trustProfileID_; + } + + /** + * Sets the ID of the trust profile to be used for verifying certificates. + * + * @param trustProfileID The ID of the trust profile to be used for verifying certificates. + */ + public void setTrustProfileID(String trustProfileID) { + trustProfileID_ = trustProfileID; + } + + /** + * Returns the name of the class to be used for verifying this infobox. + * + * @return The name of the class to be used for verifying this infobox. + */ + public String getValidatorClassName() { + return validatorClassName_; + } + + /** + * Sets the name of the class to be used for verifying this infobox. + * + * @param validatorClassName The name of the class to be used for verifying this infobox. + */ + public void setValidatorClassName(String validatorClassName) { + validatorClassName_ = validatorClassName; + } + + /** + * Get a string representation of this object. + * This method is for debugging purposes only. + * + * @return A string representation of this object. + */ + public String toString() { + + StringBuffer buffer = new StringBuffer(1024); + + buffer.append(" "); + buffer.append("\n"); + if (friendlyName_ != null) { + buffer.append(" "); + buffer.append(friendlyName_); + buffer.append(""); + buffer.append("\n"); + } + if (trustProfileID_ != null) { + buffer.append(" "); + buffer.append(trustProfileID_); + buffer.append(""); + buffer.append("\n"); + } + if (validatorClassName_ != null) { + buffer.append(" "); + buffer.append(validatorClassName_); + buffer.append(""); + buffer.append("\n"); + } + if (schemaLocations_ != null) { + buffer.append(" "); + buffer.append("\n"); + Iterator it = schemaLocations_.iterator(); + while (it.hasNext()) { + buffer.append(" \n"); + } + buffer.append(" "); + buffer.append("\n"); + } + if (applicationSpecificParams_ != null) { + try { + String applicationSpecificParams = DOMUtils.serializeNode(applicationSpecificParams_); + buffer.append(" "); + buffer.append(StringUtils.removeXMLDeclaration(applicationSpecificParams)); + buffer.append("\n"); + } catch (TransformerException e) { + // do nothing + } catch (IOException e) { + // do nothing + } + } + buffer.append(" "); + + + return buffer.toString() ; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java new file mode 100644 index 000000000..15c0c328c --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameters.java @@ -0,0 +1,135 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * This class contains the parameters for verifying all the infoboxes configured for an + * online application. + * + * @author Harald Bratko + */ +public class VerifyInfoboxParameters { + + /** + * A map of {@link VerifyInfoboxParameter} objects. + * Each of these objects contains parameters that maybe needed for validating an + * infobox. + */ + protected Map infoboxParameters_; + + /** + * A list of the identifiers of the infoboxes supported by this + * VerifyInfoboxParameters; + */ + protected List identifiers_; + + /** + * Holds the (comma separated) identifiers of those infoboxes MOA-IF is able to validate + * in the context of the actual online application. + * The string will be added as value of the PushInfobox parameter in the + * HTML form used for reading the infoboxes from the BKU. + */ + protected String pushInfobox_; + + /** + * Initializes this VerifyInfoboxParameters with an empty {@link #infoboxParameters_} + * map. + */ + public VerifyInfoboxParameters() { + infoboxParameters_ = new Hashtable(); + pushInfobox_ = ""; + } + + /** + * Initializes this VerifyInfoboxParameters with the given + * infoboxParameters map and builds the {@link #pushInfobox_} string + * from the keys of the given map. + */ + public VerifyInfoboxParameters(List identifiers, Map infoboxParameters) { + identifiers_ = identifiers; + infoboxParameters_ = infoboxParameters; + // build the pushInfobox string + if ((identifiers != null) && (!identifiers.isEmpty())) { + StringBuffer identifiersSB = new StringBuffer(); + int identifiersNum = identifiers.size(); + int i = 1; + Iterator it = identifiers.iterator(); + while (it.hasNext()) { + identifiersSB.append((String)it.next()); + if (i != identifiersNum) { + identifiersSB.append(","); + } + i++; + } + pushInfobox_ = identifiersSB.toString(); + } else { + pushInfobox_ = ""; + } + } + + /** + * Returns the (comma separated) identifiers of the infoboxes configured for the actual + * online application. + * + * @see #pushInfobox_ + * + * @return The (comma separated) identifiers of the infoboxes configured for the actual + * online application. + */ + public String getPushInfobox() { + return pushInfobox_; + } + + /** + * Sets the {@link #pushInfobox_} string. + * + * @param pushInfobox The pushInfobox string to be set. + */ + public void setPushInfobox(String pushInfobox) { + pushInfobox_ = pushInfobox; + } + + /** + * Returns map of {@link VerifyInfoboxParameter} objects. + * Each of these objects contains parameters that maybe needed for validating an + * infobox. + * + * @return The map of {@link VerifyInfoboxParameter} objects. + */ + public Map getInfoboxParameters() { + return infoboxParameters_; + } + + /** + * Sets the map of {@link VerifyInfoboxParameter} objects. + * + * @see #infoboxParameters_ + * + * @param infoboxParameters The infoboxParameters to set. + */ + public void setInfoboxParameters(Map infoboxParameters) { + infoboxParameters_ = infoboxParameters; + } + + /** + * Returns the identifiers of the supported infoboxes. + * + * @return The identifiers. + */ + public List getIdentifiers() { + return identifiers_; + } + + /** + * Sets the identifiers. + * + * @param identifiers The identifiers to set. + */ + public void setIdentifiers(List identifiers) { + identifiers_ = identifiers; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java new file mode 100644 index 000000000..d25cb3b2b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java @@ -0,0 +1,173 @@ +package at.gv.egovernment.moa.id.config.proxy; + +import java.util.HashMap; +import java.util.Map; + +/** + * Holds configuration data concerning an online application for use by the MOA-ID Proxy component. + * These include the login type (stateful or stateless), the HTTP authentication type, + * and information needed to add authentication parameters or headers for a URL connection + * to the remote online application. + * @see MOAIDConfiguration-1.1.xsd, element Configuration + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class OAConfiguration { + + /** Constant for an login method */ + public static final String LOGINTYPE_STATEFUL = "stateful"; + /** Constant for an login method */ + public static final String LOGINTYPE_STATELESS = "stateless"; + + /** Constant for an auth method */ + public static final String BASIC_AUTH = "basic"; + /** Constant for an auth method */ + public static final String HEADER_AUTH = "header"; + /** Constant for an auth method */ + public static final String PARAM_AUTH = "param"; + + + /** Constant for binding */ + public static final String BINDUNG_USERNAME = "userName"; + /** Constant for binding */ + public static final String BINDUNG_FULL = "full"; + /** Constant for binding */ + public static final String BINDUNG_NONE = "none"; + /** Constant for binding */ + public static final String BINDUNG_NOMATCH = "noMatch"; + + /** login type: stateful or stateless */ + String loginType; + /** authentication type: basic, header, or param */ + String authType; + /** + * mapping of parameter names to AuthenticationData field names + * in case of authentication type "header-auth" + */ + Map paramAuthMapping; + /** + * mapping of parameter names to AuthenticationData field names + * in case of authentication type "param-auth" + */ + Map headerAuthMapping; + /** mapping for user ID to be used in case of authentication type "basic-auth" */ + String basicAuthUserIDMapping; + /** mapping for password to be used in case of authentication type "basic-auth" */ + String basicAuthPasswordMapping; + /** Binding for basic authentication */ + String binding; + + /** + * Returns the basicAuthPasswordMapping. + * @return String + */ + public String getBasicAuthPasswordMapping() { + return basicAuthPasswordMapping; + } + + /** + * Returns the basicAuthUserIDMapping. + * @return String + */ + public String getBasicAuthUserIDMapping() { + return basicAuthUserIDMapping; + } + + /** + * Returns the headerAuthMapping. + * @return HashMap + */ + public Map getHeaderAuthMapping() { + return headerAuthMapping; + } + + /** + * Returns the loginType. + * @return String + */ + public String getLoginType() { + return loginType; + } + + /** + * Returns the paramAuthMapping. + * @return HashMap + */ + public Map getParamAuthMapping() { + return paramAuthMapping; + } + + /** + * Returns the binding. + * @return String + */ + public String getBinding() { + return binding; + } + + /** + * Sets the basicAuthPasswordMapping. + * @param basicAuthPassword The basicAuthPasswordMapping to set + */ + public void setBasicAuthPasswordMapping(String basicAuthPassword) { + this.basicAuthPasswordMapping = basicAuthPassword; + } + + /** + * Sets the basicAuthUserIDMapping. + * @param basicAuthUserID The basicAuthUserIDMapping to set + */ + public void setBasicAuthUserIDMapping(String basicAuthUserID) { + this.basicAuthUserIDMapping = basicAuthUserID; + } + + /** + * Sets the headerAuthMapping. + * @param headerAuth The headerAuthMapping to set + */ + public void setHeaderAuthMapping(HashMap headerAuth) { + this.headerAuthMapping = headerAuth; + } + + /** + * Sets the loginType. + * @param loginType The loginType to set + */ + public void setLoginType(String loginType) { + this.loginType = loginType; + } + + /** + * Sets the paramAuthMapping. + * @param paramAuth The paramAuthMapping to set + */ + public void setParamAuthMapping(HashMap paramAuth) { + this.paramAuthMapping = paramAuth; + } + + /** + * Returns the authType. + * @return String + */ + public String getAuthType() { + return authType; + } + + /** + * Sets the authType. + * @param authLoginType The authType to set + */ + public void setAuthType(String authLoginType) { + this.authType = authLoginType; + } + + /** + * Sets the binding. + * @param binding The binding to be set. + */ + public void setBinding (String binding) { + this.binding = binding; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java new file mode 100644 index 000000000..83ab73dcd --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java @@ -0,0 +1,184 @@ +package at.gv.egovernment.moa.id.config.proxy; + +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.OAParameter; + +/** + * Configuration parameters belonging to an online application, + * to use with the MOA ID Proxy component. + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class OAProxyParameter extends OAParameter { + +// /** +// * public URL prefix of the online application +// */ +// private String publicURLPrefix; + /** + * URL of online application configuration file; + * defaults to relative URL /moaconfig.xml + */ + private String configFileURL; + /** + * implementation of {@link at.gv.egovernment.moa.id.proxy.LoginParameterResolver} interface + * to be used for authenticating the online application; + * defaults to {@link at.gv.egovernment.moa.id.proxy.DefaultLoginParameterResolver} + */ + private String loginParameterResolverImpl; + + /** + * Configuration Parameter of LoginParameterResolver + */ + private String loginParameterResolverConfiguration; + + /** + * implementation of {@link at.gv.egovernment.moa.id.proxy.ConnectionBuilder} interface + * to be used for connecting to the online application; + * defaults to {@link at.gv.egovernment.moa.id.proxy.DefaultConnectionBuilder} + */ + private String connectionBuilderImpl; + /** + * session time out to be used in case of a stateless online application + */ + private int sessionTimeOut; + /** + * parameters regarding the connection from the proxy to the online application + */ + private ConnectionParameter connectionParameter; + /** + * parameters for logging into the online application + */ + private OAConfiguration oaConfiguration; + + + /** + * Returns the configFileURL. + * @return String + */ + public String getConfigFileURL() { + return configFileURL; + } + + /** + * Returns the sessionTimeOut. + * @return int + */ + public int getSessionTimeOut() { + return sessionTimeOut; + } + + /** + * Returns the connectionParameter. + * @return ConnectionParameter + */ + public ConnectionParameter getConnectionParameter() { + return connectionParameter; + } + + /** + * Sets the configFileURL for the proxy. + * @param oaProxyConfigFileURL The configFileURL to set + */ + public void setConfigFileURL(String oaProxyConfigFileURL) { + this.configFileURL = oaProxyConfigFileURL; + } + + /** + * Sets the sessionTimeOut for the proxy. + * @param oaProxySessionTimeOut The sessionTimeOut to set + */ + public void setSessionTimeOut(int oaProxySessionTimeOut) { + this.sessionTimeOut = oaProxySessionTimeOut; + } + + /** + * Sets the connectionParameter for the proxy. + * @param proxyConnectionParameter The connectionParameter to set + */ + public void setConnectionParameter(ConnectionParameter proxyConnectionParameter) { + this.connectionParameter = proxyConnectionParameter; + } + +// /** +// * Returns the publicURLPrefix. +// * @return String +// */ +// public String getPublicURLPrefix() { +// return publicURLPrefix; +// } +// +// /** +// * Sets the publicURLPrefix. +// * @param publicURLPrefix The publicURLPrefix to set +// */ +// public void setPublicURLPrefix(String url) { +// this.publicURLPrefix = url; +// } + + /** + * Returns the connectionBuilderImpl. + * @return String + */ + public String getConnectionBuilderImpl() { + return connectionBuilderImpl; + } + + /** + * Returns the loginParameterResolverImpl. + * @return String + */ + public String getLoginParameterResolverImpl() { + return loginParameterResolverImpl; + } + + /** + * Returns the loginParameterResolverConfiguration. + * @return String + */ + public String getLoginParameterResolverConfiguration() { + return loginParameterResolverConfiguration; + } + + /** + * Sets the connectionBuilderImpl for the proxy. + * @param connectionBuilderImpl The connectionBuilderImpl to set + */ + public void setConnectionBuilderImpl(String connectionBuilderImpl) { + this.connectionBuilderImpl = connectionBuilderImpl; + } + + /** + * Sets the loginParameterResolverImpl for the proxy. + * @param loginParameterResolverImpl The loginParameterResolverImpl to set + */ + public void setLoginParameterResolverImpl(String loginParameterResolverImpl) { + this.loginParameterResolverImpl = loginParameterResolverImpl; + } + + /** + * Sets the loginParameterResolverConfiguration for the proxy. + * @param loginParameterResolverConfiguration The loginParameterResolverImpl to set + */ + public void setLoginParameterResolverConfiguration(String loginParameterResolverConfiguration) { + this.loginParameterResolverConfiguration = loginParameterResolverConfiguration; + } + + /** + * Returns the oaConfiguration. + * @return OAConfiguration + */ + public OAConfiguration getOaConfiguration() { + return oaConfiguration; + } + + /** + * Sets the oaConfiguration. + * @param oaConfiguration The oaConfiguration to set + */ + public void setOaConfiguration(OAConfiguration oaConfiguration) { + this.oaConfiguration = oaConfiguration; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java new file mode 100644 index 000000000..f578ea634 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java @@ -0,0 +1,268 @@ +// Copyright (C) 2002 IAIK +// http://jce.iaik.tugraz.at +// +// Copyright (C) 2007 Stiftung Secure Information and +// Communication Technologies SIC +// http://www.sic.st +// +// All rights reserved. +// +// This source is provided for inspection purposes and recompilation only, +// unless specified differently in a contract with IAIK. This source has to +// be kept in strict confidence and must not be disclosed to any third party +// under any circumstances. Redistribution in source and binary forms, with +// or without modification, are permitted in any case! +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. + +package at.gv.egovernment.moa.id.config.proxy; + +import java.io.ByteArrayInputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.id.config.ConfigurationBuilder; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Builds the configuration for MOA-ID Proxy. + */ +public class ProxyConfigurationBuilder extends ConfigurationBuilder { + + /** + * Default online application configuration file name + * (used when /OnlineApplication/ProxyComponent@configFileURL is null). + */ + public static final String DEFAULT_OA_CONFIG_FILENAME = "MOAConfig.xml"; + + /** an XPATH-Expression */ + private static final String PROXY_AUTH_XPATH = + ROOT + CONF + "ProxyComponent/" + CONF + "AuthComponent"; + /** an XPATH-Expression */ + protected static final String ROOTOA = "/" + CONF + "Configuration/"; + /** an XPATH-Expression */ + private static final String OA_PROXY_COMPONENT_XPATH = CONF + "ProxyComponent"; + /** an XPATH-Expression */ + private static final String OA_PROXY_COMPONENT_ABSOLUTE_XPATH = ROOT + CONF + "OnlineApplication/" + CONF + "ProxyComponent"; + /** an XPATH-Expression */ + private static final String OA_PROXY_URL_XPATH = CONF + "ProxyComponent/@configFileURL"; + /** an XPATH-Expression */ + private static final String OA_PROXY_SESSION_TIMEOUT_XPATH = CONF + "ProxyComponent/@sessionTimeOut"; + /** an XPATH-Expression */ + private static final String OA_PROXY_LOGIN_PARA_XPATH = CONF + "ProxyComponent/@loginParameterResolverImpl"; + /** an XPATH-Expression */ + private static final String OA_PROXY_LOGIN_PARA_CONF_XPATH = CONF + "ProxyComponent/@loginParameterResolverConfiguration"; + /** an XPATH-Expression */ + private static final String OA_PROXY_CONNECTION_BUILDER_XPATH = CONF + "ProxyComponent/@connectionBuilderImpl"; + /** an XPATH-Expression */ + protected static final String OACONF_LOGIN_TYPE_XPATH = + ROOTOA + CONF + "LoginType"; + /** an XPATH-Expression */ + protected static final String OACONF_BINDING_TYPE_XPATH = + ROOTOA + CONF + "Binding"; + /** an XPATH-Expression */ + protected static final String OACONF_PARAM_AUTH_PARAMETER_XPATH = + ROOTOA + CONF + "ParamAuth/" + CONF + "Parameter"; + /** an XPATH-Expression */ + protected static final String OACONF_USER_ID_XPATH = + ROOTOA + CONF + "BasicAuth/" + CONF + "UserID"; + /** an XPATH-Expression */ + protected static final String OACONF_PASSWORD_XPATH = + ROOTOA + CONF + "BasicAuth/" + CONF + "Password"; + /** an XPATH-Expression */ + protected static final String OACONF_HEADER_AUTH_HEADER_XPATH = + ROOTOA + CONF + "HeaderAuth/" + CONF + "Header"; + + /** + * Creates a new MOAConfigurationProvider. + * + * @param configElem The root element of the MOA-ID configuration. + */ + public ProxyConfigurationBuilder(Element configElem, String rootConfigDir) { + super(configElem, rootConfigDir); + } + + /** + * Method buildOAConfiguration. + * + * Build an {@link OAConfiguration} Object from the given configuration DOM element + * + * @param root + * @return OAConfiguration + * @throws ConfigurationException + */ + public OAConfiguration buildOAConfiguration(Element root) throws ConfigurationException{ + + OAConfiguration oaConfiguration = new OAConfiguration(); + + //The LoginType hast to be "stateless" or "stateful" to be valid + + oaConfiguration.setLoginType( + XPathUtils.getElementValue(root, OACONF_LOGIN_TYPE_XPATH, null)); + + oaConfiguration.setBinding( + XPathUtils.getElementValue(root, OACONF_BINDING_TYPE_XPATH, OAConfiguration.BINDUNG_FULL)); + + //Try to build the Parameter Auth Parameters + NodeIterator paramAuthIter = + XPathUtils.selectNodeIterator( + root, + OACONF_PARAM_AUTH_PARAMETER_XPATH); + Element paramAuthElem; + HashMap paramAuthMap = new HashMap(); + while ((paramAuthElem = (Element) paramAuthIter.nextNode()) != null) { + String name = XPathUtils.getAttributeValue(paramAuthElem, "@Name", null); + String value = XPathUtils.getAttributeValue(paramAuthElem, "@Value", null); + if (paramAuthMap.containsKey(name)) + throw new ConfigurationException("config.06", new Object[]{"Doppelter Wert für Parameter per HeaderAuthentication"}); + paramAuthMap.put(name, value); + } + oaConfiguration.setParamAuthMapping(paramAuthMap); + // Try to build the BasicAuthParameters + oaConfiguration.setBasicAuthUserIDMapping( + XPathUtils.getElementValue(root, OACONF_USER_ID_XPATH, null)); + oaConfiguration.setBasicAuthPasswordMapping( + XPathUtils.getElementValue(root, OACONF_PASSWORD_XPATH, null)); + + //Try to build the Parameter Auth Parameters + NodeIterator headerAuthIter = XPathUtils.selectNodeIterator(root,OACONF_HEADER_AUTH_HEADER_XPATH); + + Element headerAuthElem; + HashMap headerAuthMap = new HashMap(); + while ((headerAuthElem = (Element) headerAuthIter.nextNode()) != null) { + String name = + XPathUtils.getAttributeValue(headerAuthElem, "@Name", null); + String value = + XPathUtils.getAttributeValue(headerAuthElem, "@Value", null); + // Contains Key (Neue Config-Exception: doppelte werte) + if (headerAuthMap.containsKey(name)) + throw new ConfigurationException("config.06", new Object[]{"Doppelter Wert für Parameter per HeaderAuthentication"}); + headerAuthMap.put(name, value); + } + oaConfiguration.setHeaderAuthMapping(headerAuthMap); + + if (paramAuthMap.size() == 0) { + if (oaConfiguration.getBasicAuthUserIDMapping() == null) { + oaConfiguration.setAuthType(OAConfiguration.HEADER_AUTH); + } + else + oaConfiguration.setAuthType(OAConfiguration.BASIC_AUTH); + } + else + oaConfiguration.setAuthType(OAConfiguration.PARAM_AUTH); + + return oaConfiguration; + } + + + /** + * Build an array of OnlineApplication Parameter Beans containing information + * about the proxy component + * @return An OAProxyParameter array containing beans + * with all relevant information for the proxy component of the online + * application + */ + public OAProxyParameter[] buildOnlineApplicationProxyParameters() throws ConfigurationException{ + + List oA_list = new ArrayList(); + NodeList OAIter = XPathUtils.selectNodeList(configElem_, OA_XPATH); + + for (int i = 0; i < OAIter.getLength(); i++) { + Element oAElem = (Element) OAIter.item(i); + + Element proxyComponentElem = (Element) XPathUtils.selectSingleNode(oAElem,OA_PROXY_COMPONENT_XPATH); + if (proxyComponentElem != null) { + OAProxyParameter oap = new OAProxyParameter(); + + oap.setPublicURLPrefix(oAElem.getAttribute("publicURLPrefix")); + oap.setOaType(oAElem.getAttribute("type")); + oap.setConfigFileURL(XPathUtils.getAttributeValue(oAElem, OA_PROXY_URL_XPATH, null)); + oap.setConfigFileURL(FileUtils.makeAbsoluteURL(oap.getConfigFileURL(), rootConfigFileDir_)); + // default session time out: 3600 sec = 1 h + oap.setSessionTimeOut(new Integer(XPathUtils.getAttributeValue(oAElem,OA_PROXY_SESSION_TIMEOUT_XPATH,"3600")).intValue()); + oap.setLoginParameterResolverImpl(XPathUtils.getAttributeValue(oAElem, OA_PROXY_LOGIN_PARA_XPATH, null)); + oap.setLoginParameterResolverConfiguration(XPathUtils.getAttributeValue(oAElem, OA_PROXY_LOGIN_PARA_CONF_XPATH, null)); + oap.setLoginParameterResolverConfiguration(FileUtils.makeAbsoluteURL(oap.getLoginParameterResolverConfiguration(), rootConfigFileDir_)); + oap.setConnectionBuilderImpl(XPathUtils.getAttributeValue(oAElem,OA_PROXY_CONNECTION_BUILDER_XPATH, null)); + + ConnectionParameter conPara = buildConnectionParameter(proxyComponentElem); + oap.setConnectionParameter(conPara); + + OAConfiguration oaConf = buildOAConfiguration(getOAConfigElement(oap)); + oap.setOaConfiguration(oaConf); + + oA_list.add(oap); + } + } + OAProxyParameter[] result = + new OAProxyParameter[oA_list.size()]; + oA_list.toArray(result); + + return result; + + } + + /** + * Reads the configuration file of the online application, and creates a DOM tree from it. + * If /OnlineApplication/ProxyComponent@configFileURL is not given, + * uses default configuration file location. + * + * @param oap configuration data of online application, meant for use by MOA-ID-PROXY + * @return Element DOM tree root element + * @throws ConfigurationException on any exception thrown + */ + private Element getOAConfigElement(OAProxyParameter oap) throws ConfigurationException + { + try { + String configFileURL = oap.getConfigFileURL(); + if (configFileURL == null) { + // use default config file URL, when config file URL is not given + configFileURL = oap.getConnectionParameter().getUrl(); + if (configFileURL.charAt(configFileURL.length() - 1) != '/') + configFileURL += "/"; + configFileURL += DEFAULT_OA_CONFIG_FILENAME; + } + Logger.info("Loading MOA-OA configuration " + configFileURL); + Element configElem = DOMUtils.parseXmlValidating( + new ByteArrayInputStream(FileUtils.readURL(configFileURL))); + return configElem; + } + catch (Throwable t) { + throw new ConfigurationException("config.03", new Object[] {"OAConfiguration"} , t); + } + } + + /** + * Build a bean containing all information about the ProxyComponent + * @return The ConnectionParameter for the Proxy Component + */ + public ConnectionParameter buildAuthComponentConnectionParameter() + { + + Element connectionParameter = (Element) XPathUtils.selectSingleNode(configElem_, PROXY_AUTH_XPATH); + if (connectionParameter==null) return null; + return buildConnectionParameter(connectionParameter); + + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java new file mode 100644 index 000000000..572ce5708 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java @@ -0,0 +1,188 @@ +package at.gv.egovernment.moa.id.config.proxy; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.MalformedURLException; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.FileUtils; + +/** + * A class providing access to the Proxy Part of the MOA-ID configuration data. + * + *

Configuration data is read from an XML file, whose location is given by + * the moa.id.configuration system property.

+ *

This class implements the Singleton pattern. The reload() + * method can be used to update the configuration data. Therefore, it is not + * guaranteed that consecutive calls to getInstance() will return + * the same ProxyConfigurationProvider all the time. During the + * processing of a web service request, the current + * TransactionContext should be used to obtain the + * ProxyConfigurationProvider local to that request.

+ * + * @author Stefan Knirsch + */ +public class ProxyConfigurationProvider extends ConfigurationProvider { + + /** Singleton instance. null, if none has been created. */ + private static ProxyConfigurationProvider instance; + + + // + // configuration data + // + /** + * connection parameters for connection to MOA ID Auth component + */ + private ConnectionParameter authComponentConnectionParameter; + /** + * configuration parameters for online applications + */ + private OAProxyParameter[] onlineApplicationProxyParameter; + + /** + * Return the single instance of configuration data. + * + * @return ProxyConfigurationProvider The current configuration data. + * @throws ConfigurationException + */ + public static synchronized ProxyConfigurationProvider getInstance() + throws ConfigurationException { + + if (instance == null) { + reload(); + } + return instance; + } + + /** + * Reload the configuration data and set it if successful. + * + * @return ProxyConfigurationProvider The loaded configuration data. + * @throws ConfigurationException Failure to load the configuration data. + */ + public static synchronized ProxyConfigurationProvider reload() + throws ConfigurationException { + String fileName = System.getProperty(CONFIG_PROPERTY_NAME); + if (fileName == null) { + throw new ConfigurationException("config.01", null); + } + Logger.info("Loading MOA-ID-PROXY configuration " + fileName); + + instance = new ProxyConfigurationProvider(fileName); + return instance; + } + + /** + * Constructor for ProxyConfigurationProvider. + */ + public ProxyConfigurationProvider(String fileName) + throws ConfigurationException { + + load(fileName); + } + + /** + * Load the configuration data from XML file with the given name and build + * the internal data structures representing the MOA configuration. + * + * @param fileName The name of the XML file to load. + * @throws ConfigurationException The MOA configuration could not be + * read/built. + */ + private void load(String fileName) throws ConfigurationException { + FileInputStream stream = null; + Element configElem; + ProxyConfigurationBuilder builder; + + try { + // load the main config file + stream = new FileInputStream(fileName); + configElem = DOMUtils.parseXmlValidating(stream); + } + catch (Throwable t) { + throw new ConfigurationException("config.03", null, t); + } + finally { + try { + if (stream != null) { + stream.close(); + } + } + catch (IOException e) { + } + } + try { + // determine the directory of the root config file + rootConfigFileDir = new File(fileName).getParent(); + try { + rootConfigFileDir = new File(rootConfigFileDir).toURL().toString(); + } catch (MalformedURLException t) { + throw new ConfigurationException("config.03", null, t); + } + + // build the internal datastructures + builder = new ProxyConfigurationBuilder(configElem, rootConfigFileDir); + authComponentConnectionParameter = builder.buildAuthComponentConnectionParameter(); + + onlineApplicationProxyParameter = builder.buildOnlineApplicationProxyParameters(); + for(int i = 0; i < onlineApplicationProxyParameter.length; i++) { + onlineApplicationProxyParameter[i].setConfigFileURL(FileUtils.makeAbsoluteURL(onlineApplicationProxyParameter[i].getConfigFileURL(), rootConfigFileDir)); + } + + genericConfiguration = builder.buildGenericConfiguration(); + defaultChainingMode = builder.getDefaultChainingMode(); + chainingModes = builder.buildChainingModes(); + trustedCACertificates = builder.getTrustedCACertificates(); + trustedCACertificates = FileUtils.makeAbsoluteURL(trustedCACertificates, rootConfigFileDir); + + } + catch (Throwable t) { + throw new ConfigurationException("config.02", null, t); + } + } + + /** + * Return a bean containing all information about the ProxyComponent + * @return The ConnectionParameter for the Proxy Component + */ + public ConnectionParameter getAuthComponentConnectionParameter() { + return authComponentConnectionParameter; + } + + /** + * Build an array of OnlineApplication Parameter Beans containing all + * information about the proxy component of the online application + * @return An OAProxyParameter array containing beans + * with all relevant information for the proxy component of the online + * application + */ + public OAProxyParameter[] getOnlineApplicationParameters() { + return onlineApplicationProxyParameter; + } + /** + * Provides configuration information regarding the online application behind + * the given URL, relevant to the MOA-ID Proxy component. + * + * @param oaURL URL requested for an online application + * @return an OAProxyParameter, or null + * if none is applicable + */ + public OAProxyParameter getOnlineApplicationParameter(String oaURL) { + OAProxyParameter[] oaParams = getOnlineApplicationParameters(); + for (int i = 0; i < oaParams.length; i++) { + OAProxyParameter oaParam = oaParams[i]; + if (oaURL.startsWith(oaParam.getPublicURLPrefix())) + return oaParam; + } + return null; + } + +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java new file mode 100644 index 000000000..4fc35c1e6 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java @@ -0,0 +1,394 @@ +package at.gv.egovernment.moa.id.data; + +import java.util.Date; + +/** + * Encapsulates authentication data contained in a <saml:Assertion>. + * + * @author Paul Ivancsics + * @version $Id$ + */ + +public class AuthenticationData { + /** + * major version number of the SAML assertion + */ + private int majorVersion; + /** + * minor version number of the SAML assertion + */ + private int minorVersion; + /** + * identifier for this assertion + */ + private String assertionID; + /** + * URL of the MOA-ID Auth component issueing this assertion + */ + private String issuer; + /** + * time instant of issue of this assertion + */ + private String issueInstant; + /** + * user identification value (Stammzahl); null, + * if the authentication module is configured not to return this data + */ + private String identificationValue; + /** + * user identification type + */ + private String identificationType; + /** + * application specific user identifier (bPK) + */ + private String bPK; + /** + * private sector-specific personal identifier (wbPK) + */ + private String wbPK; + /** + * given name of the user + */ + private String givenName; + /** + * family name of the user + */ + private String familyName; + /** + * date of birth of the user + */ + private String dateOfBirth; + /** + * says whether the certificate is a qualified certificate or not + */ + private boolean qualifiedCertificate; + /** + * says whether the certificate is a public authority or not + */ + private boolean publicAuthority; + /** + * public authority code (Behördenkennzeichen - BKZ) + */ + private String publicAuthorityCode; + /** + * The base64 encoded signer certificate. + */ + private String signerCertificate; + /** + * URL of the BKU + */ + private String bkuURL; + /** + * the corresponding lt;saml:Assertion> + */ + private String samlAssertion; + /** + * creation timestamp + */ + Date timestamp; + + /** + * Constructor for AuthenticationData. + */ + public AuthenticationData() { + timestamp = new Date(); + } + + /** + * Returns the minorVersion. + * @return int + */ + public int getMinorVersion() { + return minorVersion; + } + + /** + * Returns the publicAuthority. + * @return boolean + */ + public boolean isPublicAuthority() { + return publicAuthority; + } + + /** + * Returns the publicAuthorityCode. + * @return String + */ + public String getPublicAuthorityCode() { + return publicAuthorityCode; + } + + /** + * Returns the qualifiedCertificate. + * @return boolean + */ + public boolean isQualifiedCertificate() { + return qualifiedCertificate; + } + + /** + * Returns the bPK. + * @return String + */ + public String getBPK() { + return bPK; + } + + /** + * Returns the wbPK. + * @return String the wbPK. + */ + public String getWBPK() { + return wbPK; + } + + /** + * Sets the minorVersion. + * @param minorVersion The minorVersion to set + */ + public void setMinorVersion(int minorVersion) { + this.minorVersion = minorVersion; + } + + /** + * Sets the publicAuthority. + * @param publicAuthority The publicAuthority to set + */ + public void setPublicAuthority(boolean publicAuthority) { + this.publicAuthority = publicAuthority; + } + + /** + * Sets the publicAuthorityCode. + * @param publicAuthorityIdentification The publicAuthorityCode to set + */ + public void setPublicAuthorityCode(String publicAuthorityIdentification) { + this.publicAuthorityCode = publicAuthorityIdentification; + } + + /** + * Sets the qualifiedCertificate. + * @param qualifiedCertificate The qualifiedCertificate to set + */ + public void setQualifiedCertificate(boolean qualifiedCertificate) { + this.qualifiedCertificate = qualifiedCertificate; + } + + /** + * Sets the bPK. + * @param bPK The bPK to set + */ + public void setBPK(String bPK) { + this.bPK = bPK; + } + + /** + * Sets the wbPK. + * @param wbPK The wbPK to set + */ + public void setWBPK(String wbPK) { + this.wbPK = wbPK; + } + + /** + * Returns the assertionID. + * @return String + */ + public String getAssertionID() { + return assertionID; + } + + /** + * Returns the dateOfBirth. + * @return String + */ + public String getDateOfBirth() { + return dateOfBirth; + } + + /** + * Returns the familyName. + * @return String + */ + public String getFamilyName() { + return familyName; + } + + /** + * Returns the givenName. + * @return String + */ + public String getGivenName() { + return givenName; + } + + /** + * Returns the identificationValue. + * @return String + */ + public String getIdentificationValue() { + return identificationValue; + } + + /** + * Returns the identificationType + * @return String + */ + public String getIdentificationType() { + return identificationType; + } + + /** + * Returns the issueInstant. + * @return String + */ + public String getIssueInstant() { + return issueInstant; + } + + /** + * Returns the issuer. + * @return String + */ + public String getIssuer() { + return issuer; + } + + /** + * Returns the majorVersion. + * @return int + */ + public int getMajorVersion() { + return majorVersion; + } + + /** + * Returns the BKU URL. + * @return String + */ + public String getBkuURL() { + return bkuURL; + } + + /** + * Returns the signer certificate. + * @return String + */ + public String getSignerCertificate() { + return signerCertificate; + } + + /** + * Sets the assertionID. + * @param assertionID The assertionID to set + */ + public void setAssertionID(String assertionID) { + this.assertionID = assertionID; + } + + /** + * Sets the dateOfBirth. + * @param dateOfBirth The dateOfBirth to set + */ + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + /** + * Sets the familyName. + * @param familyName The familyName to set + */ + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + /** + * Sets the givenName. + * @param givenName The givenName to set + */ + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + /** + * Sets the identificationValue. + * @param identificationValue The identificationValue to set + */ + public void setIdentificationValue(String identificationValue) { + this.identificationValue = identificationValue; + } + + /** + * Sets the identificationType. + * @param identificationType The identificationType to set + */ + public void setIdentificationType(String identificationType) { + this.identificationType = identificationType; + } + + /** + * Sets the issueInstant. + * @param issueInstant The issueInstant to set + */ + public void setIssueInstant(String issueInstant) { + this.issueInstant = issueInstant; + } + + /** + * Sets the issuer. + * @param issuer The issuer to set + */ + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + /** + * Sets the majorVersion. + * @param majorVersion The majorVersion to set + */ + public void setMajorVersion(int majorVersion) { + this.majorVersion = majorVersion; + } + + /** + * Sets the bkuURL + * @param url The BKU URL to set + */ + public void setBkuURL(String url) { + this.bkuURL = url; + } + + /** + * Sets the signer certificate + * @param signerCertificate The signer certificate + */ + public void setSignerCertificate(String signerCertificate) { + this.signerCertificate = signerCertificate; + } + + /** + * Returns the samlAssertion. + * @return String + */ + public String getSamlAssertion() { + return samlAssertion; + } + + /** + * Sets the samlAssertion. + * @param samlAssertion The samlAssertion to set + */ + public void setSamlAssertion(String samlAssertion) { + this.samlAssertion = samlAssertion; + } + + /** + * Returns the timestamp. + * @return Date + */ + public Date getTimestamp() { + return timestamp; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/Cookie.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/Cookie.java new file mode 100644 index 000000000..6ed133c5a --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/Cookie.java @@ -0,0 +1,119 @@ +package at.gv.egovernment.moa.id.data; +import java.util.HashMap; +import java.util.Iterator; +import java.util.StringTokenizer; + +import at.gv.egovernment.moa.logging.Logger; + +/** + * The Cookie-class provides methods to save and return cookies for + * each single session + * + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class Cookie { + /** A HahsMap containing all our cookies */ + HashMap cookies = new HashMap(); + /** A HashMap to temporarely store 'Set-Cookie' values from the OnlineApplication + * to send them back to the client/browser as soon as possible */ + HashMap cookies401 = new HashMap(); + + /** + * Adds a Cookie from a response with response-code 401 to the cookie-pool + * for sending it back to the browser / client + * @param cookieString The complete 'Set-Cookie' - String + */ + public void add401(String cookieString) + { + cookies401.put(getKey(cookieString),cookieString); + } + + /** + * Get the HashMap containing all cookies to be sent to the browser / client + * @return HashMap with all cookies + */ + public HashMap get401() + { + return cookies401; + } + + /** + * Clear the 401 cookie-pool + */ + public void clear401() + { + cookies401.clear(); + } + + /** + * Set a cookie that comes from the Online-Application + * and save it in our "normal" cookie-pool + * @param value The complete "Set-Cookie" - String from the Online-Application + */ + public void setCookie(String value) { + cookies.put(getKey(value), getValue(value)); + } + + /** + * Method saveOldCookies. + * @param value The complete "Set-Cookie" - String from the Online-Application + */ + public void saveOldCookies(String value) { + StringTokenizer st = new StringTokenizer(value,";"); + while (st.hasMoreTokens()) + { + // We have to trim because the Tokenizer returns cookies including spaces at the beginning + StringTokenizer st2 = new StringTokenizer(st.nextToken().trim(),"="); + String cookieKey = st2.nextToken().trim(); + if (st2.hasMoreTokens()) + { + String cookieValue = st2.nextToken().trim(); + if (!cookies.containsKey(cookieKey)) + cookies.put(cookieKey , cookieValue); + } + } + Logger.debug("Found these cookies: " + getCookies()); + } + + /** + * Get a String containing all cookies saved in that session seperated by '; ' + * to be sent back to the Online-Application + * @return String containing all cookies saved in that session seperated by '; ' + */ + public String getCookies() { + String result = ""; + if (cookies.size()==0) + return null; + Iterator i = cookies.keySet().iterator(); + while (i.hasNext()) { + String key = (String) i.next(); + result += key + "=" + (String)cookies.get(key) + "; "; + } + return result.substring(0, result.length() - 2); + } + + /** + * Returns the key of a key-value-pair of a cookie + * getKey("CookieA=1234") returns CookieA + * @param String the complete "Set-cookie" String containing a key-value-pair of a cookie + * @return String the key of a key-value-pair of a cookie + */ + private String getKey(String input) { + return input.substring(0, input.indexOf("=")); + } + + /** + * Returns the value of a key-value-pair of a cookie + * getKey("CookieA=1234") returns 1234 + * @param String the complete "Set-cookie" String containing a key-value-pair of a cookie + * @return String the value of a key-value-pair of a cookie + */ + private String getValue(String input) { + if (input.indexOf(";") == -1) + return input.substring(input.indexOf("=") + 1, input.getBytes().length); + return input.substring(input.indexOf("=") + 1, input.indexOf(";")); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/CookieManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/CookieManager.java new file mode 100644 index 000000000..1762a52b7 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/CookieManager.java @@ -0,0 +1,114 @@ +package at.gv.egovernment.moa.id.data; + +import java.util.HashMap; + +/** + * The CookieManager is a singleton to manage a Cookie-Object for + * each session + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class CookieManager { + /** the singleton instance of the CookieManager */ + private static CookieManager instance; + /** a HashMap to bind a Cookie-object to every single session*/ + private static HashMap cookies = new HashMap(); + + /** + * Create a singleton of the CookieManager + * @return CookieManager + */ + public static CookieManager getInstance() + { + if(instance==null) instance=new CookieManager(); + return instance; + } + + /** + * Save a cookie to a specified session-id + * @param id The session id + * @param cookie_string The complete 'Set-Cookie' String from the OnlineApplication + */ + public void saveCookie(String id, String cookie_string) + { + getCookieWithID(id).setCookie(cookie_string); + } + + /** + * Method saveOldCookies. + * @param id + * @param cookie_string + */ + public void saveOldCookies(String id,String cookie_string) + { + getCookieWithID(id).saveOldCookies(cookie_string); + } + + /** + * Get a Cookie-Object for a specified session-id + * @param id The session id + * @return Cookie object containing all saved cookies for this session + */ + public Cookie getCookieWithID(String id) + { + Cookie c = null; + if(cookies.containsKey(id)) + c = (Cookie)cookies.get(id); + else + { + c = new Cookie(); + cookies.put(id,c); + } + return c; + } + + + /** + * Get a String containing all cookies of a specified session-id + * saved in that session seperated by '; ' to be sent back to + * the Online-Application + * @param id the session-id + * @return String containing all cookies saved in that session seperated by '; ' + */ + public String getCookie(String id) + { + Cookie result = (Cookie)cookies.get((String)id); + if (result==null) + return null; + return result.getCookies(); + + } + + /** + * Adds a Cookie for a special session from a response with + * response-code 401 to the cookie-pool for sending it back + * to the browser / client + * @param id The session-id + * @param value The complete 'Set-Cookie' - String + */ + public void add401(String id,String value) + { + getCookieWithID(id).add401(value); + } + + /** + * Clear the 401 cookie-pool of a session + * @param id the session-id + */ + public void clear401(String id) + { + getCookieWithID(id).clear401(); + } + + /** + * Get the HashMap containing all cookies of a session to be sent to the browser / client + * @param id the session-id + * @return HashMap with all cookies + */ + public HashMap get401(String id) + { + return getCookieWithID(id).get401(); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/IssuerAndSerial.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/IssuerAndSerial.java new file mode 100644 index 000000000..a47dd8b29 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/IssuerAndSerial.java @@ -0,0 +1,111 @@ +package at.gv.egovernment.moa.id.data; + +import java.math.BigInteger; +import java.security.Principal; + +import iaik.asn1.structures.Name; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; + +/** + * A class containing the issuer and serial number of a certificate, which can + * be used to uniquely identify the certificate. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IssuerAndSerial { + /** store the issuer as String*/ + private String issuerDN; + /** store the serial as BigInteger*/ + private BigInteger serial; + + /** + * Create an IssuerAndSerial object. + * + * The name of the issuer is converted to RFC2253. If it cannot be parsed, the + * DN contained in the issuer is set. + * + * @param issuer The isser of a certificate. + * @param serial The serial number of the certificate. + */ + public IssuerAndSerial(Principal issuer, BigInteger serial) { + RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); + + try { + this.issuerDN = ((Name) parser.parse()).getRFC2253String(); + } catch (RFC2253NameParserException e) { + this.issuerDN = issuer.getName(); + } + this.serial = serial; + } + + /** + * Create an IssuerAndSerial object. + * + * @param issuerDN The issuer distinguished name. Should be an RFC2253 name. + * @param serial The serial number of the certificate. + */ + public IssuerAndSerial(String issuerDN, BigInteger serial) { + this.issuerDN = issuerDN; + this.serial = serial; + } + + /** + * Return the issuer DN in RFC2253 format. + * + * @return The issuer part of this object. + */ + public String getIssuerDN() { + return issuerDN; + } + + /** + * Return the serial number. + * + * @return The serial number of this object. + */ + public BigInteger getSerial() { + return serial; + } + + /** + * Compare this IssuerAndSerial to another object. + * + * @return true, if other is an + * IssuerAndSerial object and the issuer and + * serial fields are both equal. false otherwise. + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object other) { + if (other instanceof IssuerAndSerial) { + IssuerAndSerial ias = (IssuerAndSerial) other; + return getIssuerDN().equals(ias.getIssuerDN()) + && getSerial().equals(ias.getSerial()); + } + return false; + } + + /** + * Return the hash code of this IssuerAndSerial. + * + * @return The hash code of this IssuerAndSerial. + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return issuerDN.hashCode() ^ serial.hashCode(); + } + + /** + * Return a String representation of this + * IssuerAndSerial object. + * + * @return The String representation. + * @see java.lang.Object#toString() + */ + public String toString() { + return ("(IssuerAndSerial - Issuer<" + getIssuerDN()) + + ("> Serial<" + serial.toString() + ">)"); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/SAMLStatus.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/SAMLStatus.java new file mode 100644 index 000000000..ed61827b6 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/SAMLStatus.java @@ -0,0 +1,59 @@ +package at.gv.egovernment.moa.id.data; + +/** + * Data contained in a <samlp:Status> + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLStatus { + + /** main status code */ + private String statusCode; + /** sub status code */ + private String subStatusCode; + /** status message */ + private String statusMessage; + + /** + * @return status code + */ + public String getStatusCode() { + return statusCode; + } + + /** + * @return status message + */ + public String getStatusMessage() { + return statusMessage; + } + + /** + * @return enclosed sub-status code + */ + public String getSubStatusCode() { + return subStatusCode; + } + + /** + * @param string the status code + */ + public void setStatusCode(String string) { + statusCode = string; + } + + /** + * @param string the status message + */ + public void setStatusMessage(String string) { + statusMessage = string; + } + + /** + * @param string the enclosed sub-status code + */ + public void setSubStatusCode(String string) { + subStatusCode = string; + } + +} 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 new file mode 100644 index 000000000..c338e96fc --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/CertStoreConfigurationImpl.java @@ -0,0 +1,96 @@ +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 iaik.pki.store.certstore.CertStoreConfiguration; +import iaik.pki.store.certstore.CertStoreParameters; +import iaik.pki.store.certstore.CertStoreTypes; +import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; + +/** + * Implementation of interface needed to initialize an IAIK JSSE TrustManager + * @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 CertStoreConfigurationImpl. + * + * @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 paramName = ConfigurationProvider.DIRECTORY_CERTSTORE_PARAMETER_PROPERTY; + String certStoreRootDirParam = conf.getGenericConfigurationParameter(paramName); + if (certStoreRootDirParam == null) + throw new ConfigurationException( + "config.08", new Object[] {paramName}); + + 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[] {paramName}); + + 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 CertStoreTypes.DIRECTORY + * @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/iaik/config/LoggerConfigImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java new file mode 100644 index 000000000..3cd02a2b5 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/LoggerConfigImpl.java @@ -0,0 +1,51 @@ +package at.gv.egovernment.moa.id.iaik.config; + +import iaik.logging.LogConfigurationException; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Properties; + +/** + * Implementation of interface TrustManager + * @author Paul Ivancsics + * @version $Id$ + */ +public class LoggerConfigImpl implements iaik.logging.LoggerConfig { + + /** logging properties **/ + private Properties loggingProperties; + + /** + * Constructor + */ + public LoggerConfigImpl(String propertyFileURL) throws IOException { + InputStream in = new URL(propertyFileURL).openStream(); + loggingProperties = new Properties(); + loggingProperties.load(in); + in.close(); + } + + /** + * @see iaik.logging.LoggerConfig#getFactory() + */ + public String getFactory() { + return "iaik.logging.impl.Log4jFactory"; + } + + /** + * @see iaik.logging.LoggerConfig#getProperties() + */ + public Properties getProperties() throws LogConfigurationException { + return loggingProperties; + } + + /** + * @see iaik.logging.LoggerConfig#getNodeId() + */ + public String getNodeId() { + return "iaik"; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java new file mode 100644 index 000000000..b41de3c44 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/PKIConfigurationImpl.java @@ -0,0 +1,66 @@ +package at.gv.egovernment.moa.id.iaik.config; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import iaik.pki.PKIConfiguration; +import iaik.pki.pathvalidation.ValidationConfiguration; +import iaik.pki.revocation.RevocationConfiguration; +import iaik.pki.store.certstore.CertStoreConfiguration; +import iaik.pki.store.revocation.archive.ArchiveConfiguration; + +/** + * Implementation of interface PKIConfiguration needed to + * initialize an IAIK JSSE TrustManager + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class PKIConfigurationImpl implements PKIConfiguration { + /** The configuration for the CertStore */ + private CertStoreConfiguration certStoreConfiguration; + /** The configuration for the RevocationChecks */ + private RevocationConfiguration revocationConfiguration; + /** The configuration for the Validation */ + private ValidationConfiguration validationConfiguration; + + /** + * Constructor + * @param conf the Configuration for the PKIConfig + * @throws ConfigurationException for any config error + */ + public PKIConfigurationImpl(ConfigurationProvider conf) throws ConfigurationException { + + certStoreConfiguration = new CertStoreConfigurationImpl(conf); + revocationConfiguration = new RevocationConfigurationImpl(); + validationConfiguration = new ValidationConfigurationImpl(conf); + } + + /** + * @see iaik.pki.PKIConfiguration#getCertStoreConfiguration() + */ + public CertStoreConfiguration getCertStoreConfiguration() { + return certStoreConfiguration; + } + + /** + * @see iaik.pki.PKIConfiguration#getRevocationConfiguration() + */ + public RevocationConfiguration getRevocationConfiguration() { + return revocationConfiguration; + } + + /** + * @see iaik.pki.PKIConfiguration#getArchiveConfiguration() + */ + public ArchiveConfiguration getArchiveConfiguration() { + return null; + } + + /** + * @see iaik.pki.PKIConfiguration#getValidationConfiguration() + */ + public ValidationConfiguration getValidationConfiguration() { + return validationConfiguration; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java new file mode 100644 index 000000000..fff75775d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/RevocationConfigurationImpl.java @@ -0,0 +1,36 @@ +package at.gv.egovernment.moa.id.iaik.config; + +import iaik.pki.revocation.RevocationConfiguration; + +import java.security.cert.X509Certificate; +import java.util.Collections; +import java.util.Date; +import java.util.Set; + +import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl; + +/** + * Implementation of interface needed to initialize an IAIK JSSE TrustManager + * @author Paul Ivancsics + * @version $Id$ + */ +public class RevocationConfigurationImpl extends ObservableImpl implements RevocationConfiguration { + + /** + * @see iaik.pki.revocation.RevocationConfiguration#getAlternativeDistributionPoints(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date) + */ + public Set getAlternativeDistributionPoints( + X509Certificate arg0, + X509Certificate arg1, + Date arg2) { + return Collections.EMPTY_SET; + } + + /** + * @see iaik.pki.revocation.RevocationConfiguration#archiveRevocationInfo(java.lang.String, java.lang.String) + */ + public boolean archiveRevocationInfo(String arg0, String arg1) { + return false; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java new file mode 100644 index 000000000..c500e2e8e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/config/ValidationConfigurationImpl.java @@ -0,0 +1,51 @@ +package at.gv.egovernment.moa.id.iaik.config; + +import iaik.pki.pathvalidation.ValidationConfiguration; + +import java.security.cert.X509Certificate; +import java.security.spec.AlgorithmParameterSpec; + +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl; + +/** + * Implementation of interface needed to initialize an IAIK JSSE TrustManager + * @author Paul Ivancsics + * @version $Id$ + */ +public class ValidationConfigurationImpl extends ObservableImpl + implements ValidationConfiguration { + /** The ConfigurationProvider for the validation*/ + private ConfigurationProvider conf; + + /** + * Constructor + * @param conf with the configuration + */ + public ValidationConfigurationImpl(ConfigurationProvider conf) { + this.conf = conf; + } + + /** + * @see iaik.pki.pathvalidation.ValidationConfiguration#getChainingMode(java.security.cert.X509Certificate) + */ + public String getChainingMode(X509Certificate trustAnchor) { + String chainingMode = conf.getChainingMode(trustAnchor); + return chainingMode; + } + + /** + * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsSpec(java.security.cert.X509Certificate) + */ + public AlgorithmParameterSpec getPublicKeyParamsAsSpec(X509Certificate arg0) { + return null; + } + + /** + * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsCert(java.security.cert.X509Certificate) + */ + public X509Certificate getPublicKeyParamsAsCert(X509Certificate arg0) { + return null; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java new file mode 100644 index 000000000..3c37706e1 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/PKIProfileImpl.java @@ -0,0 +1,186 @@ +package at.gv.egovernment.moa.id.iaik.pki; + +import java.security.cert.X509Certificate; +import java.util.Collections; +import java.util.Set; + +import iaik.pki.PKIProfile; +import iaik.pki.pathvalidation.ValidationProfile; +import iaik.pki.revocation.RevocationProfile; +import iaik.pki.revocation.RevocationSourceTypes; +import iaik.pki.store.truststore.TrustStoreProfile; +import iaik.pki.store.truststore.TrustStoreTypes; + +import at.gv.egovernment.moa.id.iaik.servertools.observer.ObservableImpl; + +/** + * Implementation of the PKIProfile interface and subinterfaces + * providing information needed for certificate path validation. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class PKIProfileImpl extends ObservableImpl + implements PKIProfile, RevocationProfile, TrustStoreProfile, ValidationProfile { + + /** + * URI to the truststore + */ + private String trustStoreURI; + + /** + * revocation checking; + */ + private boolean revocationChecking; + + /** + * The trust profile identifier. + */ + private String id; + + + /** + * Create a new PKIProfileImpl. + * + * @param trustStoreURI trust store URI + */ + public PKIProfileImpl(String trustStoreURI, boolean revocationChecking) { + this.trustStoreURI = trustStoreURI; + this.revocationChecking = revocationChecking; + String id = String.valueOf(System.currentTimeMillis()); + setId("id-" + id); + } + + /** + * @see iaik.pki.PKIProfile#autoAddCertificates() + */ + public boolean autoAddCertificates() { + return true; + } + + /** + * @see iaik.pki.PKIProfile#getRevocationProfile() + */ + public RevocationProfile getRevocationProfile() { + return this; + } + + /** + * @see iaik.pki.PKIProfile#getTrustStoreProfile() + */ + public TrustStoreProfile getTrustStoreProfile() { + return this; + } + + /** + * @see iaik.pki.PKIProfile#getValidationProfile() + */ + public ValidationProfile getValidationProfile() { + return this; + } + + /** + * @see iaik.pki.PKIProfile#useAuthorityInfoAccess() + */ + public boolean useAuthorityInfoAccess() { + return true; + } + + /** + * @see iaik.pki.revocation.RevocationProfile#getMaxRevocationAge(java.lang.String) + */ + public long getMaxRevocationAge(String arg0) { + return 0; + } + + /** + * @see iaik.pki.revocation.RevocationProfile#getOCSPRequestHashAlgorithm() + */ + public String getOCSPRequestHashAlgorithm() { + return null; + } + + /** + * @see iaik.pki.revocation.RevocationProfile#getPreferredServiceOrder(java.security.cert.X509Certificate) + */ + public String[] getPreferredServiceOrder(X509Certificate arg0) { + return new String[] {RevocationSourceTypes.CRL}; + } + + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getType() + */ + public String getType() { + return TrustStoreTypes.DIRECTORY; + } + + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getURI() + */ + public String getURI() { + return trustStoreURI; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialAnyPolicyInhibit() + */ + public boolean getInitialAnyPolicyInhibit() { + return false; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialExplicitPolicy() + */ + public boolean getInitialExplicitPolicy() { + return false; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicyMappingInhibit() + */ + public boolean getInitialPolicyMappingInhibit() { + return false; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicySet() + */ + public Set getInitialPolicySet() { + return Collections.EMPTY_SET; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getNameConstraintsProcessing() + */ + public boolean getNameConstraintsProcessing() { + return false; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getPolicyProcessing() + */ + public boolean getPolicyProcessing() { + return false; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getRevocationChecking() + */ + public boolean getRevocationChecking() { + return this.revocationChecking; + } + + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getId() + */ + public String getId() { + return id; + } + /** + * Sets the trust profile identifier. + * @param id The id to set. + */ + public void setId(String id) { + this.id = id; + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java new file mode 100644 index 000000000..9da006d35 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/pki/jsse/MOAIDTrustManager.java @@ -0,0 +1,119 @@ +package at.gv.egovernment.moa.id.iaik.pki.jsse; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; + +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; + +import iaik.pki.jsse.IAIKX509TrustManager; + +/** + * TrustManager implementation featuring CRL checking (inherited from + * IAIKX509TrustManager), plus server-end-SSL-certificate checking. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class MOAIDTrustManager extends IAIKX509TrustManager { + + /** an x509Certificate array containing all accepted server certificates*/ + private X509Certificate[] acceptedServerCertificates; + + /** + * Constructor + * @param acceptedServerCertificateStoreURL the url leading to the acceptedServer cert store + * @throws GeneralSecurityException occurs on security errors + * @throws IOException occurs on IO errors + */ + public MOAIDTrustManager(String acceptedServerCertificateStoreURL) + throws IOException, GeneralSecurityException { + + if (acceptedServerCertificateStoreURL != null) + buildAcceptedServerCertificates(acceptedServerCertificateStoreURL); + else + acceptedServerCertificates = null; + } + + + /** + * Initializes the LoggingContextManager logging context. + * Fixes a bug occuring in the case MOA-SP is called by API. + * In this case, IAIKX509TrustManager uses the LogginConfig of MOA-SP. + * This method must be called before a MOAIDTrustManager is constructed, + * from every thread. + */ + public static void initializeLoggingContext() { + if (LoggingContextManager.getInstance().getLoggingContext() == null) + LoggingContextManager.getInstance().setLoggingContext( + new LoggingContext(Thread.currentThread().getName())); + } + + + /** + * Builds an Array of accepted server certificates from an URL, + * and stores it in acceptedServerCertificates. + * @param acceptedServerCertificateStoreURL file URL pointing to the directory + * containing accepted server X509 certificates + * @throws GeneralSecurityException on security errors + * @throws IOException on any IO errors + */ + private void buildAcceptedServerCertificates(String acceptedServerCertificateStoreURL) + throws IOException, GeneralSecurityException { + + List certList = new ArrayList(); + URL storeURL = new URL(acceptedServerCertificateStoreURL); + File storeDir = new File(storeURL.getFile()); + // list certificate files in directory + File[] certFiles = storeDir.listFiles(); + for (int i = 0; i < certFiles.length; i++) { + // for each: create an X509Certificate and store it in list + File certFile = certFiles[i]; + FileInputStream fis = new FileInputStream(certFile.getPath()); + CertificateFactory certFact = CertificateFactory.getInstance("X.509"); + X509Certificate cert = (X509Certificate)certFact.generateCertificate(fis); + fis.close(); + certList.add(cert); + } + // store acceptedServerCertificates + acceptedServerCertificates = (X509Certificate[]) certList.toArray(new X509Certificate[0]); + } + + /** + * Does additional server-end-SSL-certificate checking. + * @see com.sun.net.ssl.X509TrustManager#isServerTrusted(java.security.cert.X509Certificate[]) + */ + public boolean isServerTrusted(X509Certificate[] certChain) { + boolean trusted = super.isServerTrusted(certChain); + if (! trusted || acceptedServerCertificates == null) + return trusted; + else { + // check server-end-SSL-certificate with acceptedServerCertificates + X509Certificate serverCert = certChain[0]; + for (int i = 0; i < acceptedServerCertificates.length; i++) { + X509Certificate acceptedServerCert = acceptedServerCertificates[i]; + if (serverCert.equals(acceptedServerCert)) + return true; + } + Logger.warn(MOAIDMessageProvider.getInstance().getMessage("ssl.01", null)); + return false; + } + } + /** + * In rare cases, this method is being called although it should not be. + * @see com.sun.net.ssl.X509TrustManager#isClientTrusted(X509Certificate[]) + */ + public boolean isClientTrusted(java.security.cert.X509Certificate arg0[]) + { + return true; + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java new file mode 100644 index 000000000..8f36ac5c0 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/iaik/servertools/observer/ObservableImpl.java @@ -0,0 +1,46 @@ +package at.gv.egovernment.moa.id.iaik.servertools.observer; + +import iaik.pki.store.observer.NotificationData; +import iaik.pki.store.observer.Observable; +import iaik.pki.store.observer.Observer; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + + +/** + * Implementation of interface TrustManager + * @author Paul Ivancsics + * @version $Id$ + */ +public class ObservableImpl implements Observable { + /** a List for all observers */ + private List observers = new ArrayList(); + + /** + * @see iaik.pki.store.observer.Observable#addObserver(iaik.pki.store.observer.Observer) + */ + public void addObserver(Observer observer) { + observers.add(observer); + } + + /** + * @see iaik.pki.store.observer.Observable#removeObserver(iaik.pki.store.observer.Observer) + */ + public boolean removeObserver(Observer observer) { + return observers.remove(observer); + } + + /** + * @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData) + */ + public void notify(NotificationData data) { + Iterator iter = observers.iterator(); + for (iter = observers.iterator(); iter.hasNext();) { + Observer observer = (Observer) iter.next(); + observer.notify(data); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java new file mode 100644 index 000000000..731212ef8 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java @@ -0,0 +1,64 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.util.Vector; + +import javax.net.ssl.SSLSocketFactory; +import javax.servlet.http.HttpServletRequest; + +/** + * Builder for {@link java.net.URLConnection} objects used to forward requests + * to the remote online application. + * + * @author Paul Ivancsics + * @version $Id$ + */ + +public interface ConnectionBuilder { + + /** + * Builds an HttpURLConnection to a {@link java.net.URL} which is derived + * from an {@link HttpServletRequest} URL, by substitution of a + * public URL prefix for the real URL prefix.
+ * The HttpURLConnection has been created by {@link java.net.URL#openConnection}, but + * it has not yet been connected to by {@link java.net.URLConnection#connect}.
+ * The field settings of the HttpURLConnection are: + *
    + *
  • allowUserInteraction = false
  • + *
  • doInput = true
  • + *
  • doOutput = true
  • + *
  • requestMethod = request.getMethod()
  • + *
  • useCaches = false
  • + *
+ * + * @param request the incoming request which shall be forwarded + * @param publicURLPrefix the public URL prefix to be substituted by the real URL prefix + * @param realURLPrefix the URL prefix to substitute the public URL prefix + * @param sslSocketFactory factory to be used for creating an SSL socket in case + * of a URL for scheme "https:"; + *
if null, the default SSL socket factory would be used + * @param parameters parameters to be forwarded + * @return a URLConnection created by {@link java.net.URL#openConnection}, connecting to + * the requested URL with publicURLPrefix substituted by realURLPrefix + * @throws IOException if an I/O exception occurs during opening the connection + * @see java.net.URL#openConnection() + * @see com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory() + */ + public HttpURLConnection buildConnection( + HttpServletRequest request, + String publicURLPrefix, + String realURLPrefix, + SSLSocketFactory sslSocketFactory, + Vector parameters) throws IOException; + + + /** + * Disconnects the HttpURLConnection if necessary. + * The implementation of the Connectionbuilder decides wether + * if this should be happen or not. + * + * @param con the HttpURLConnection which is normaly to be closed + */ + public void disconnect(HttpURLConnection con); +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java new file mode 100644 index 000000000..ff7787839 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java @@ -0,0 +1,68 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.util.HashMap; +import java.util.Map; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; + +/** + * Factory delivering a {@link ConnectionBuilder} implementation for + * an online application, initialized from configuration data. + * @author Paul Ivancsics + * @version $Id$ + */ +public class ConnectionBuilderFactory { + + /** default connection builder to be used for online application + * where no special implementation of the ConnectionBuilder + * interface is configured + */ + private static ConnectionBuilder defaultConnectionBuilder; + /** mapping from online application public URL prefix to an implementation + * of the ConnectionBuilder interface to be used; + * if no mapping is given for an online application, the + * DefaultConnectionBuilder will be used */ + private static Map connectionBuilderMap; + + /** + * Initializes the ConnectionBuilder map from the configuration data. + * @throws ConfigurationException when the configuration cannot be read, + * or when a class name configured cannot be instantiated + */ + public static void initialize() throws ConfigurationException { + defaultConnectionBuilder = new DefaultConnectionBuilder(); + connectionBuilderMap = new HashMap(); + ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); + for (int i = 0; i < proxyConf.getOnlineApplicationParameters().length; i++) { + OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameters()[i]; + String publicURLPrefix = oaParam.getPublicURLPrefix(); + String className = oaParam.getConnectionBuilderImpl(); + if (className != null) { + try { + ConnectionBuilder cb = (ConnectionBuilder)Class.forName(className).newInstance(); + connectionBuilderMap.put(publicURLPrefix, cb); + } + catch (Throwable ex) { + throw new ConfigurationException("config.07", new Object[] {publicURLPrefix}, ex); + } + } + } + } + + /** + * Gets the ConnectionBuilder implementation to be used for the given + * online application. + * @param publicURLPrefix public URL prefix of the online application + * @return ConnectionBuilder implementation + */ + public static ConnectionBuilder getConnectionBuilder(String publicURLPrefix) { + ConnectionBuilder cb = (ConnectionBuilder) connectionBuilderMap.get(publicURLPrefix); + if (cb == null) + return defaultConnectionBuilder; + else + return cb; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java new file mode 100644 index 000000000..151b1cec3 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java @@ -0,0 +1,149 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import at.gv.egovernment.moa.util.URLEncoder; //java.net.URLEncoder; +import java.util.Iterator; +import java.util.Vector; + +import javax.net.ssl.SSLSocketFactory; +import javax.servlet.http.HttpServletRequest; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.BoolUtils; + +import com.sun.net.ssl.HostnameVerifier; +import com.sun.net.ssl.HttpsURLConnection; + +/** + * Defaultimplementierung von ConnectionBuilder. + * @author Paul Ivancsics + * @version $Id$ + */ +public class DefaultConnectionBuilder implements ConnectionBuilder { + + /** a boolean to disable the HostnameVerification (default = false)*/ + private static boolean cbDisableHostnameVerification = false; + + /** + * Constructor for DefaultConnectionBuilder. + * @throws ConfigurationException on any config error + */ + public DefaultConnectionBuilder() throws ConfigurationException { + cbDisableHostnameVerification = BoolUtils.valueOf( + ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( + "ProxyComponent.DisableHostnameVerification")); + //TODO MOA-ID BRZ undocumented feature + if (cbDisableHostnameVerification) + Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); + } + + /** + * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection + */ + public HttpURLConnection buildConnection( + HttpServletRequest req, + String publicURLPrefix, + String realURLPrefix, + SSLSocketFactory sslSocketFactory, + Vector parameters) + throws IOException { + + String requestedURL = req.getRequestURL().toString(); + // check whether requested URL starts with publicURLPrefix + + //Temporary allow http:// urls instead of the https:// in publicURLPrefix + //if (req.getSession().getAttribute("authorizationkey")==null) { + // if (! requestedURL.startsWith(publicURLPrefix)) + // throw new IOException(MOAIDMessageProvider.getInstance().getMessage( + // "proxy.01", new Object[] {requestedURL, publicURLPrefix})); + //} + + // in case of GET request, append query string to requested URL; + // otherwise, HttpURLConnection would perform a POST request + if ("get".equalsIgnoreCase(req.getMethod()) && ! parameters.isEmpty()) { + requestedURL = appendQueryString(requestedURL, parameters); + } + // build real URL in online application + String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); + URL url = new URL(realURLString); + Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); + + HttpURLConnection conn = (HttpURLConnection)url.openConnection(); + conn.setRequestMethod(req.getMethod()); + conn.setDoInput(true); + conn.setDoOutput(true); + //conn.setUseCaches(false); + //conn.setAllowUserInteraction(true); + conn.setInstanceFollowRedirects(false); + if (conn instanceof HttpsURLConnection && sslSocketFactory != null) { + HttpsURLConnection httpsConn = (HttpsURLConnection) conn; + httpsConn.setSSLSocketFactory(sslSocketFactory); + if (cbDisableHostnameVerification) + httpsConn.setHostnameVerifier(new HostnameNonVerifier()); + } + return conn; + } + + + /** + * Disconnects the HttpURLConnection if necessary. + * The implementation of the Connectionbuilder decides wether + * if this should be happen or not. + * + * @param conn the HttpURLConnection which is normaly to be closed + */ + public void disconnect(HttpURLConnection conn) { + conn.disconnect(); + } + + + /** + * @param requestedURL + * @param parameters + * @return + */ + private String appendQueryString(String requestedURL, Vector parameters) { + String newURL = requestedURL; + String parameter[] = new String[2]; + String paramValue =""; + String paramName =""; + String paramString =""; + for (Iterator iter = parameters.iterator(); iter.hasNext();) { + try { + parameter = (String[]) iter.next(); + //next two lines work not with OWA-SSL-Login-form + paramName = URLEncoder.encode((String) parameter[0], "UTF-8"); + paramValue = URLEncoder.encode((String) parameter[1], "UTF-8"); + + } catch (UnsupportedEncodingException e) { + //UTF-8 should be supported + } + paramString = "&" + paramName + "=" + paramValue + paramString; + } + if (paramString.length()>0) newURL = newURL + "?" + paramString.substring(1); + return newURL; + } + + /** + * @author Stefan Knirsch + * @version $Id$ + * A private class to change the standard HostName verifier to disable the + * Hostname Verification Check + */ + private class HostnameNonVerifier implements HostnameVerifier { + + /** + * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) + */ + public boolean verify(String arg0, String arg1) { + return true; + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java new file mode 100644 index 000000000..3df76656b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java @@ -0,0 +1,142 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.URLEncoder; + +/** + * Implementation of interface LoginParameterResolver + * @author Paul Ivancsics + * @version $Id$ + */ +public class DefaultLoginParameterResolver implements LoginParameterResolver { + + /** + * Constructor + */ + public DefaultLoginParameterResolver() { + } + + /** + * Configuration mehtod (not used) + */ + public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { + } + + + /** + * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationHeaders(OAConfiguration, AuthenticationData, String, boolean, String) + */ + public Map getAuthenticationHeaders( + OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress, + boolean businessService, + String publicURLPrefix) { + + Map result = new HashMap(); + + if (oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) { + String useridPredicate = oaConf.getBasicAuthUserIDMapping(); + String userid = resolveValue(useridPredicate, authData, clientIPAddress); + String passwordPredicate = oaConf.getBasicAuthPasswordMapping(); + String password = resolveValue(passwordPredicate, authData, clientIPAddress); + + try { + String userIDPassword = userid + ":" + password; + String credentials = Base64Utils.encode(userIDPassword.getBytes()); + result.put("Authorization", "Basic " + credentials); + } + catch (IOException ignore) { + } + } + else if (oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) { + for (Iterator iter = oaConf.getHeaderAuthMapping().keySet().iterator(); iter.hasNext();) { + String key = (String) iter.next(); + String predicate = (String) oaConf.getHeaderAuthMapping().get(key); + String resolvedValue = resolveValue(predicate, authData, clientIPAddress); + result.put(key, resolvedValue); + } + } + + return result; + } + + /** + * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationParameters(OAConfiguration, AuthenticationData, String, boolean, String) + */ + public Map getAuthenticationParameters( + OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress, + boolean businessService, + String publicURLPrefix) { + + Map result = new HashMap(); + + if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { + for (Iterator iter = oaConf.getParamAuthMapping().keySet().iterator(); iter.hasNext();) { + String key = (String) iter.next(); + String predicate = (String) oaConf.getParamAuthMapping().get(key); + String resolvedValue; + try { + resolvedValue = + URLEncoder.encode(resolveValue(predicate, authData, clientIPAddress), "ISO-8859-1"); + } catch (UnsupportedEncodingException e) { + //ISO-8859-1 is supported + resolvedValue = null; + } + result.put(key, resolvedValue); + } + } + + return result; + } + + /** + * Resolves a login header or parameter value. + * @param predicate header or parameter predicate name from online application configuration + * @param authData authentication data for current login + * @param clientIPAddress client IP address + * @return header or parameter value resolved; null if unknown name is given + */ + private static String resolveValue(String predicate, AuthenticationData authData, String clientIPAddress) { + if (predicate.equals(MOAGivenName)) + return authData.getGivenName(); + if (predicate.equals(MOAFamilyName)) + return authData.getFamilyName(); + if (predicate.equals(MOADateOfBirth)) + return authData.getDateOfBirth(); + if (predicate.equals(MOABPK)) + return authData.getBPK(); + if (predicate.equals(MOAWBPK)) + return authData.getWBPK(); + if (predicate.equals(MOAPublicAuthority)) + if (authData.isPublicAuthority()) + return "true"; + else + return "false"; + if (predicate.equals(MOABKZ)) + return authData.getPublicAuthorityCode(); + if (predicate.equals(MOAQualifiedCertificate)) + if (authData.isQualifiedCertificate()) + return "true"; + else + return "false"; + if (predicate.equals(MOAStammzahl)) + return authData.getIdentificationValue(); + if (predicate.equals(MOAIdentificationValueType)) + return authData.getIdentificationType(); + if (predicate.equals(MOAIPAddress)) + return clientIPAddress; + else return null; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java new file mode 100644 index 000000000..909e2d51e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java @@ -0,0 +1,249 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; + +import com.ibm.webdav.HTTPHeaders; +import com.ibm.webdav.protocol.URLStreamHandlerFactory; +import com.ibm.webdav.protocol.http.WebDAVURLConnection; +import java.util.StringTokenizer; +import java.net.URL; +import at.gv.egovernment.moa.util.URLEncoder; //java.net.URLEncoder; +import java.net.URLStreamHandler; +import java.util.Iterator; +import java.util.Vector; + +import javax.net.ssl.SSLSocketFactory; +import javax.servlet.http.HttpServletRequest; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.BoolUtils; + +import com.sun.net.ssl.HostnameVerifier; +import com.sun.net.ssl.HttpsURLConnection; + +/** + * Defaultimplementierung von ConnectionBuilder. + * @author Paul Ivancsics + * @version $Id$ + */ +public class ElakConnectionBuilder implements ConnectionBuilder { + + /** a boolean to disable the HostnameVerification (default = false)*/ + private static boolean cbDisableHostnameVerification = false; + + /** a boolean to indicat if webdav protocol handler was already set */ + private static boolean webdavPHSet = false; + + /** + * The system property name used to register a protocol handler. + */ + public final static String PROTOCOL_HANDLER_PROPERTY_NAME = "java.protocol.handler.pkgs"; + + /** + * The package providing the ldap protocol handler. + */ + public final static String WEBDAV_PROTOCOL_HANDLER = "com.ibm.webdav.protocol"; + + /** + * The pipe character used to sepearte different protocol handlers. + */ + public final static char PIPE_CHAR = '|'; + + + + + + /** + * Constructor for ElakConnectionBuilder. + * @throws ConfigurationException on any config error + */ + public ElakConnectionBuilder() throws ConfigurationException { + cbDisableHostnameVerification = BoolUtils.valueOf( + ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( + "ProxyComponent.DisableHostnameVerification")); + //TODO MOA-ID BRZ undocumented feature + if (cbDisableHostnameVerification) + Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); + } + + /** + * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection + */ + public HttpURLConnection buildConnection( + HttpServletRequest req, + String publicURLPrefix, + String realURLPrefix, + SSLSocketFactory sslSocketFactory, + Vector parameters) + throws IOException { + + String requestedURL = req.getRequestURL().toString(); + // check whether requested URL starts with publicURLPrefix + if (! requestedURL.startsWith(publicURLPrefix)) + throw new IOException(MOAIDMessageProvider.getInstance().getMessage( + "proxy.01", new Object[] {requestedURL, publicURLPrefix})); + + + + // in case of GET request, append query string to requested URL; + // otherwise, HttpURLConnection would perform a POST request + //FIXME right parameters + /* + if ("get".equalsIgnoreCase(req.getMethod()) && ! parameters.isEmpty()) { + requestedURL = appendQueryString(requestedURL, parameters); + } + */ + //TODO RSCH check functionality + if (null != req.getQueryString() && 0 != req.getQueryString().length() ) { + String query = req.getQueryString(); + requestedURL = requestedURL + "?" + query; + + String parameter[] = new String[2]; + for (Iterator iter = parameters.iterator(); iter.hasNext();) { + parameter = (String[]) iter.next(); + if(query.indexOf(parameter[0]) >= 0) iter.remove(); + } + } + + // build real URL in online application + String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); + + + Logger.info("Registering WebDAV protocol handler"); + String protocolHandlers = System.getProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME); + if (protocolHandlers == null) { + protocolHandlers = ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER; + System.setProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME, protocolHandlers); + } else { + // check, if WEBDAV protocol handler is already configured + boolean isConfigured = false; + StringTokenizer tokenizer = new StringTokenizer(protocolHandlers, "| "); + while (tokenizer.hasMoreTokens()) { + String protocolHandler = tokenizer.nextToken(); + if (protocolHandler.equals(ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER)) { + isConfigured = true; + break; + } + } + // if it has not been configured yet, configure it + if (!isConfigured) { + protocolHandlers = ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER + ElakConnectionBuilder.PIPE_CHAR + protocolHandlers; + System.setProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME, protocolHandlers); + } + } + Logger.info("Registered protocol handlers: " + protocolHandlers); + Class webdavSH = null; + try + { + webdavSH = Class.forName(ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER + ".http.Handler"); + } + catch (ClassNotFoundException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + URLStreamHandler urlStreamHandler = null; + try + { + urlStreamHandler = (URLStreamHandler) webdavSH.newInstance(); + } + catch (InstantiationException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + catch (IllegalAccessException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + //URL testURL = new URL("http", realURLString.substring("http://localhost:82".length()), 82, "", urlStreamHandler); + //WebDAVURLConnection webDavTest = (WebDAVURLConnection) testURL.openConnection(); + + + URL testURL = new URL(realURLString); + Logger.debug("TEST URL ist von der Klasse: " + testURL.getClass().getName()); + + //URL url = new URL(realURLString); + URL testURL2 = new URL(realURLString); + + URL url = new URL("http", "localhost", 82, realURLString.substring("http://localhost:82".length()), urlStreamHandler); + + Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); + WebDAVURLConnection webDavConn = (WebDAVURLConnection) url.openConnection(); + HttpURLConnection conn = (HttpURLConnection)webDavConn; + webDavConn.setRequestMethod(req.getMethod()); + webDavConn.setDoInput(true); + webDavConn.setDoOutput(true); + //conn.setUseCaches(false); + webDavConn.setAllowUserInteraction(true); + webDavConn.setInstanceFollowRedirects(false); + if (conn instanceof HttpsURLConnection && sslSocketFactory != null) { + HttpsURLConnection httpsConn = (HttpsURLConnection) conn; + httpsConn.setSSLSocketFactory(sslSocketFactory); + if (cbDisableHostnameVerification) + httpsConn.setHostnameVerifier(new HostnameNonVerifier()); + } + return conn; + } + + /** + * Disconnects the HttpURLConnection if necessary. + * The implementation of the Connectionbuilder decides wether + * if this should be happen or not. + * + * @param conn the HttpURLConnection which is normaly to be closed + */ + public void disconnect(HttpURLConnection conn) { + conn.disconnect(); + } + + /** + * @param requestedURL + * @param parameters + * @return + */ + private String appendQueryString(String requestedURL, Vector parameters) { + String newURL = requestedURL; + String parameter[] = new String[2]; + String paramValue =""; + String paramName =""; + String paramString =""; + for (Iterator iter = parameters.iterator(); iter.hasNext();) { + try { + parameter = (String[]) iter.next(); + //Following two lines do not work with OWA-SSL-Login-form + paramName = URLEncoder.encode((String) parameter[0], "UTF-8"); + paramValue = URLEncoder.encode((String) parameter[1], "UTF-8"); + + } catch (UnsupportedEncodingException e) { + //UTF-8 should be supported + } + paramString = "&" + paramName + "=" + paramValue + paramString; + } + if (paramString.length()>0) newURL = newURL + "?" + paramString.substring(1); + return newURL; + } + + /** + * @author Stefan Knirsch + * @version $Id$ + * A private class to change the standard HostName verifier to disable the + * Hostname Verification Check + */ + private class HostnameNonVerifier implements HostnameVerifier { + + /** + * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) + */ + public boolean verify(String arg0, String arg1) { + return true; + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java new file mode 100644 index 000000000..f934ab80b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java @@ -0,0 +1,211 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.io.IOException; +import java.net.URL; +import java.net.URLStreamHandler; +import java.util.Iterator; +import java.util.Vector; + +import javax.net.ssl.SSLSocketFactory; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.BoolUtils; + +import com.sun.net.ssl.HostnameVerifier; +import HTTPClient.HttpURLConnection; +import HTTPClient.HTTPConnection; + + +/** + * Outlook Web Access (OWA) Implementierung von ConnectionBuilder. + * uses the HTTP(s)Client from Ronald Tschalär. + * origin version (without https support) is available at http://www.innovation.ch/java/HTTPClient/ + * + * @author pdanner + */ +public class EnhancedConnectionBuilder implements ConnectionBuilder { + + /** a boolean to disable the HostnameVerification (default = false)*/ + private static boolean cbDisableHostnameVerification = false; + /** Name of the Parameter for the Target */ + private static final String PARAM_TARGET = "Target"; + /** Name of the Parameter for the SAMLArtifact */ + private static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; + /** Name of the Attribute for marking the session as authenticated*/ + private static final String ATT_AUTHDATAFETCHED = "AuthDataFetched"; + + static { + HTTPConnection.setDefaultTimeout(0); + try { + HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.AuthorizationModule")); + HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.RedirectionModule")); + HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.CookieModule")); + //HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.RetryModule")); + } catch (ClassNotFoundException e) { + + } + } + + /** + * Constructor for OWAConnectionBuilder. + * @throws ConfigurationException on any config error + */ + public EnhancedConnectionBuilder() throws ConfigurationException { + cbDisableHostnameVerification = BoolUtils.valueOf( + ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( + "ProxyComponent.DisableHostnameVerification")); + //TODO MOA-ID BRZ undocumented feature + if (cbDisableHostnameVerification) + Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); + } + + /** + * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection + */ + public java.net.HttpURLConnection buildConnection(HttpServletRequest req, String publicURLPrefix, String realURLPrefix, SSLSocketFactory sslSocketFactory, Vector parameters) throws IOException { + + String requestedURL = req.getRequestURL().toString(); + // check whether requested URL starts with publicURLPrefix + + if (! requestedURL.startsWith(publicURLPrefix.substring(0,5))) + throw new IOException(MOAIDMessageProvider.getInstance().getMessage( + "proxy.01", new Object[] {requestedURL, publicURLPrefix})); + + String query = req.getQueryString(); + if (req.getSession().getAttribute(ATT_AUTHDATAFETCHED)!=null) { + query = removeParameter(query, PARAM_SAMLARTIFACT); + query = removeParameter(query, PARAM_TARGET); + req.getSession().removeAttribute(ATT_AUTHDATAFETCHED); + } + if (null != query && 0 != query.length() ) { + requestedURL = requestedURL + "?" + query; + + String parameter[] = new String[2]; + for (Iterator iter = parameters.iterator(); iter.hasNext();) { + parameter = (String[]) iter.next(); + if(query.indexOf(parameter[0]) >= 0) iter.remove(); + } + } + + // build real URL in online application + String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); + + // build real URL in online application + URLStreamHandler urlStreamHandler = null; + + //URL url = new URL(realURLString); + if (realURLString.startsWith("https")) { + urlStreamHandler = new HTTPClient.https.Handler(); + } else{ + urlStreamHandler = new HTTPClient.http.Handler(); + } + URL url = new URL(null, realURLString, urlStreamHandler); + Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); + + HttpURLConnection conn = (HttpURLConnection)url.openConnection(); + + conn.setRequestMethod(req.getMethod()); + conn.setDoInput(true); + conn.setDoOutput(true); + //conn.setUseCaches(false); + //conn.setAllowUserInteraction(true); + conn.setInstanceFollowRedirects(false); + + if (realURLString.startsWith("https") && sslSocketFactory != null) { + conn.setSSLSocketFactory(sslSocketFactory); + //Not available in HTTPClient + //if (cbDisableHostnameVerification) + // conn.setHostnameVerifier(new HostnameNonVerifier()); + } + + return conn; + + } + + /** + * Disconnects the HttpURLConnection if necessary. + * The implementation of the Connectionbuilder decides wether + * if this should be happen or not. + * + * @param conn the HttpURLConnection which is normaly to be closed + */ + public void disconnect(java.net.HttpURLConnection conn) { + // In HTTPClient there must not be an diconnect! + // conn.disconnect(); + } + + /** + * @author Stefan Knirsch + * @version $Id$ + * A private class to change the standard HostName verifier to disable the + * Hostname Verification Check + */ + private class HostnameNonVerifier implements HostnameVerifier { + + /** + * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) + */ + public boolean verify(String arg0, String arg1) { + return true; + } + } + + /** + * Removes parameters from the query-URL recursively + * + * @param query the query from which the parameter is to be removed + * @param parameter the parameter to be removed + * @return the parameterclean query + */ + private String removeParameter(String query, String parameter) { + return removeParameter(query, parameter, true); + } + + /** + * Removes one parameter from the query-URL recursively + * + * @param query the query from which the parameter is to be removed + * @param parameter the parameter to be removed + * @param remove. Boolean value wether a parameter was removed in last call or not. In initial call set to true to check for new occurrences + * @return the parameterclean query + */ + private String removeParameter(String query, String parameter, boolean remove) { + String result = query; + if (remove && query!=null && !query.equals("") && parameter!=null && !parameter.equals("")) { + String param = parameter; + int capEnd=0; + if (!param.endsWith("=")) param=param+"="; + if (query.startsWith(param)) { + //remove leading + result=""; + } else { + if (!param.startsWith("&")) param="&"+param; + capEnd = query.indexOf(param); + if (capEnd!=-1) { + //leading part + result=query.substring(0, capEnd); + } + } + if (capEnd!=-1) { + //trailing part + capEnd += param.length(); + int capBegin = -1; + if (capEnd MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, + * naming predicates used by the LoginParameterResolver. */ + public static final String MOAGivenName = "MOAGivenName"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOAFamilyName = "MOAFamilyName"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOADateOfBirth = "MOADateOfBirth"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOABPK = "MOABPK"; + /** Constant used in MOAIDConfiguration-1.3.xsd, type MOAAuthDataType */ + public static final String MOAWBPK = "MOAWBPK"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOAPublicAuthority = "MOAPublicAuthority"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOABKZ = "MOABKZ"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOAQualifiedCertificate = "MOAQualifiedCertificate"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOAStammzahl = "MOAStammzahl"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOAIdentificationValueType = "MOAIdentificationValueType"; + /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ + public static final String MOAIPAddress = "MOAIPAddress"; + + /** + * Returns authentication headers to be added to a URLConnection. + * + * @param oaConf configuration data + * @param authData authentication data + * @param clientIPAddress client IP address + * @param businessService boolean value for recognizing (w)bPK-mode + * @param publicURLPrefix to distinguish different online applications + * @return A map, the keys being header names and values being corresponding header values. + *
In case of authentication type "basic-auth", header fields + * username and password. + *
In case of authentication type "header-auth", header fields + * derived from parameter mapping and authentication data provided. + *
Otherwise, an empty map. + */ + public Map getAuthenticationHeaders( + OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress, + boolean businessService, + String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException; + + /** + * Returns request parameters to be added to a URLConnection. + * + * @param oaConf configuration data + * @param authData authentication data + * @param clientIPAddress client IP address + * @param businessService boolean value for recognizing (w)bPK-mode + * @param publicURLPrefix to distinguish different online applications + * @return A map, the keys being parameter names and values being corresponding parameter values. + *
In case of authentication type "param-auth", parameters + * derived from parameter mapping and authentication data provided. + *
Otherwise, an empty map. + */ + public Map getAuthenticationParameters( + OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress, + boolean businessService, + String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException; + + public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException; + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java new file mode 100644 index 000000000..3aa2368bf --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.id.proxy; + +import at.gv.egovernment.moa.id.MOAIDException; + +/** + * Exception thrown while proxying a request to the online application + * + * @author Rudolf Schamberger + * @version $Id$ + */ +public class LoginParameterResolverException extends MOAIDException { + + /** + * Constructor for LoginParameterResolverException. + * @param messageId + * @param parameters + */ + public LoginParameterResolverException( + String messageId, + Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for LoginParameterResolverException. + * @param messageId + * @param parameters + * @param wrapped + */ + public LoginParameterResolverException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java new file mode 100644 index 000000000..8edd23438 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java @@ -0,0 +1,82 @@ +package at.gv.egovernment.moa.id.proxy; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; + +/** + * Factory delivering a {@link LoginParameterResolver} implementation for + * an online application, initialized from configuration data. + * @author Paul Ivancsics + * @version $Id$ + */ +public class LoginParameterResolverFactory { + + /** default login parameter resolver to be used for online application + * where no special implementation of the LoginParameterResolver + * interface is configured + */ + private static LoginParameterResolver defaultLoginParameterResolver; + /** mapping from online application public URL prefix to an implementation + * of the LoginParameterResolver interface to be used; + * if no mapping is given for an online application, the + * DefaultLoginParameterResolver will be used */ + private static Map loginParameterResolverMap; + + /** + * Initializes the LoginParameterResolver map from the configuration data. + * @throws ConfigurationException when the configuration cannot be read, + * or when a class name configured cannot be instantiated + */ + public static void initialize() throws ConfigurationException { + defaultLoginParameterResolver = new DefaultLoginParameterResolver(); + loginParameterResolverMap = new HashMap(); + ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); + for (int i = 0; i < proxyConf.getOnlineApplicationParameters().length; i++) { + OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameters()[i]; + String publicURLPrefix = oaParam.getPublicURLPrefix(); + String className = oaParam.getLoginParameterResolverImpl(); + String configuration = oaParam.getLoginParameterResolverConfiguration(); + if (className != null) { + try { + Class lprClass = Class.forName(className); + LoginParameterResolver lpr = (LoginParameterResolver)Class.forName(className).newInstance(); + + Class[] argumentTypes = { String.class, Boolean.class }; + Method confMethod = lprClass.getMethod( "configure", argumentTypes ); + + Object[] arguments = { new String(configuration), new Boolean(oaParam.getBusinessService()) }; + confMethod.invoke( lpr, arguments ); + + loginParameterResolverMap.put(publicURLPrefix, lpr); + } + catch (InvocationTargetException lpex) { + throw new ConfigurationException("config.11", new Object[] {className}, lpex); + } + catch (Throwable ex) { + throw new ConfigurationException("config.07", new Object[] {publicURLPrefix}, ex); + } + } + } + } + + /** + * Gets the LoginParameterResolver implementation to be used for the given + * online application. + * @param publicURLPrefix public URL prefix of the online application + * @return LoginParameterResolver implementation + */ + public static LoginParameterResolver getLoginParameterResolver(String publicURLPrefix) { + LoginParameterResolver lpr = (LoginParameterResolver) loginParameterResolverMap.get(publicURLPrefix); + if (lpr == null) + return defaultLoginParameterResolver; + else + return lpr; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java new file mode 100644 index 000000000..3f615b01c --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java @@ -0,0 +1,95 @@ +package at.gv.egovernment.moa.id.proxy; + +import iaik.pki.PKIException; +import iaik.pki.jsse.IAIKX509TrustManager; + +import java.io.IOException; +import java.security.GeneralSecurityException; + +import javax.net.ssl.SSLSocketFactory; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; +import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Web application initializer + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class MOAIDProxyInitializer { + + /** + * Initializes the web application components which need initialization: + * logging, JSSE, MOA-ID Auth configuration, Axis, session cleaner. + */ + public static void initialize() + throws ConfigurationException, IOException, GeneralSecurityException, PKIException { + + Logger.setHierarchy("moa.id.proxy"); + + // Restricts TLS cipher suites + System.setProperty("https.cipherSuites", "SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_3DES_EDE_CBC_SHA"); + + // load some jsse classes so that the integrity of the jars can be verified + // before the iaik jce is installed as the security provider + // this workaround is only needed when sun jsse is used in conjunction with + // iaik-jce (on jdk1.3) + ClassLoader cl = MOAIDProxyInitializer.class.getClassLoader(); + try { + cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar + } + catch (ClassNotFoundException e) { + Logger.warn(MOAIDMessageProvider.getInstance().getMessage("init.01", null), e); + } + + // Initializes the SSLSocketFactory store + SSLUtils.initialize(); + + // Initializes IAIKX509TrustManager logging + String log4jConfigURL = System.getProperty("log4j.configuration"); + if (log4jConfigURL != null) { + IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); + } + + // Loads the configuration + ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.reload(); + + // Initializes the Axis secure socket factory for use in calling the MOA-Auth web service, + // using configuration data + ConnectionParameter connParamAuth = proxyConf.getAuthComponentConnectionParameter(); + if (connParamAuth!=null) { + if (connParamAuth.isHTTPSURL()) { + SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(proxyConf, connParamAuth); + AxisSecureSocketFactory.initialize(ssf); + } + } else { + throw new ConfigurationException("config.16", null); + } + + // Initializes the Axis secure socket factories for use in calling the online applications, + // using configuration data + OAProxyParameter[] oaParams = proxyConf.getOnlineApplicationParameters(); + for (int i = 0; i < oaParams.length; i++) { + OAProxyParameter oaParam = oaParams[i]; + ConnectionParameter oaConnParam = oaParam.getConnectionParameter(); + if (oaConnParam.isHTTPSURL()) + SSLUtils.getSSLSocketFactory(proxyConf, oaConnParam); + } + + // Initializes the ConnectionBuilderFactory from configuration data + ConnectionBuilderFactory.initialize(); + + // Initializes the LoginParameterResolverFactory from configuration data + LoginParameterResolverFactory.initialize(); + + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java new file mode 100644 index 000000000..849160a7b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java @@ -0,0 +1,39 @@ +package at.gv.egovernment.moa.id.proxy; + +import at.gv.egovernment.moa.id.MOAIDException; + +/** + * Exception thrown while proxying a request to the online application + * Reason for this exception: the dedicated LoginParameterResolver does + * not allow access to the desired ressource. + * + * @author Rudolf Schamberger + * @version $Id$ + */ +public class NotAllowedException extends MOAIDException { + + /** + * Constructor for NotAllowedException. + * @param messageId + * @param parameters + */ + public NotAllowedException( + String messageId, + Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for NotAllowedException. + * @param messageId + * @param parameters + * @param wrapped + */ + public NotAllowedException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java new file mode 100644 index 000000000..9bfd9de9b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java @@ -0,0 +1,678 @@ +package at.gv.egovernment.moa.id.proxy; + +import iaik.security.provider.IAIK; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.Security; +import java.util.HashMap; +import java.util.Map; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.URLEncoder; + +/** + * XMLLoginParameterResolver an implementation of implementation of interface + * LoginParameterResolver + * This implementation used to map identities stored in an XML file to parameters + * which are given to OAs. + * + * @author Rudolf Schamberger + * @version $Id$ + */ +public class XMLLoginParameterResolverEncryptedData implements LoginParameterResolver { + + //file which is parsed and interpreted for paremeter resolving. + private String identityFile; + + private Cipher blowfishCipher; + private Key key; + /** + * inner class used to store mapped parameters + */ + class LPRParams { + + /** + * getter method for parameter Enabled. + * Parameter Enabled decides if mapped parameters should be used by XMLLoginParameterResolver + */ + public boolean getEnabled() { + return enabled.booleanValue(); + } + + /** + * getter method for parameter UN (username) + * @return Parameter UN or null not set. + */ + public String getUN() { + return UN; + } + + /** + * getter method for parameter UN (username) + * @return Parameter UN or null not set. + */ + //TODO XMLLPR decrypt + public String getPlainUN() { + //Security.addProvider(); + + + return UN; + } + + + /** + * getter method for parameter PW (password) + * @return Parameter PW or null not set. + */ + public String getPW() { + return PW; + } + + /** + * getter method for generic parameter Param1 + * @return Parameter Param1 or null not set. + */ + public String getParam1() { + return Param1; + } + + /** + * getter method for generic parameter Param2 + * @return Parameter Param2 or null not set. + */ + public String getParam2() { + return Param2; + } + + /** + * getter method for generic parameter Param3 + * @return Parameter Param3 or null not set. + */ + public String getParam3() { + return Param3; + } + + /** + * Returns a string representation of LPRParams + * + * @return a String representation of this object. + * @see XMLLoginParameterResolver.LPRParams + */ + public String toString() { + return "Enabled: " + + enabled.toString() + + "UN: '" + + UN + + "' PW: '" + + PW + + "' Param1: '" + + Param1 + + "' Param2: '" + + Param2 + + "' Param3: '" + + Param3 + + "'\n"; + } + + //private member variables used to store the parameters + private Boolean enabled = null; + private String UN = null; + private String PW = null; + private String Param1 = null; + private String Param2 = null; + private String Param3 = null; + + /** + * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. + * + * @param enabled enable user mapping to parameter set for the parameter set. + * @param UN username used in HTTP 401 - BasicAuthentication + * @param PW password used in HTTP 401 - BasicAuthentication + * @param Param1 generic parameter1 used in HeaderAuthentication and ParameterAuthentication + * @param Param2 generic parameter2 used in HeaderAuthentication and ParameterAuthentication + * @param Param3 generic parameter3 used in HeaderAuthentication and ParameterAuthentication + **/ + LPRParams(boolean enabled, String UN, String PW, String Param1, String Param2, String Param3) { + this.enabled = new Boolean(enabled); + this.UN = UN; + this.PW = PW; + this.Param1 = Param1; + this.Param2 = Param2; + this.Param3 = Param3; + } + + /** + * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. + * + * @param enabled enable user mapping to parameter set for the parameter set. + * @param UN username used in HTTP 401 - BasicAuthentication + * @param PW password used in HTTP 401 - BasicAuthentication + **/ + LPRParams(boolean enabled, String UN, String PW) { + this(enabled, UN, PW, null, null, null); + } + } + + /** + * Constructs a newly allocated XMLLoginParameterResolver object. + **/ + public XMLLoginParameterResolverEncryptedData() { + bPKMap = new HashMap(); + namedMap = new HashMap(); + } + + /** + * configuration method + * @param configuration enabled enable user mapping to parameter set for the parameter set. + */ + public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { + File idFile; + Element rootElement; + + Security.addProvider(new IAIK()); + try { + blowfishCipher = Cipher.getInstance("Blowfish/CBC/PKCS5Padding", "IAIK"); + + } catch (NoSuchPaddingException e) { + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: NoSuchPaddingException \n" + e.toString()}); + } catch (NoSuchProviderException e) { + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: NoSuchProviderException \n" + e.toString()}); + } catch (NoSuchAlgorithmException e) { + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: NoSuchAlgorithmException \n" + e.toString()}); + } + + String plaintext = "start"; + String encrypted = encryptData(plaintext, "1234567890123456", "123hochgeheim"); + String decrypted = decryptData(encrypted, "1234567890123456", "123hochgeheim"); + Logger.debug("plaintext: " + plaintext); + Logger.debug("encrypted: " + encrypted); + Logger.debug("decrypted: " + decrypted); + + //make file name absolut (if it is relative to main config file) + //TODO MOAID XMLLPR check + String moaIDConfigFileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); + String rootConfigFileDir = new File(moaIDConfigFileName).getParent(); + this.identityFile = FileUtils.makeAbsoluteURL(configuration, rootConfigFileDir); + + if (null == identityFile || false == (idFile = new File(identityFile)).canRead()) { + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: could not read '" + identityFile + "' " }); + } + try { + rootElement = readXMLFile(identityFile); + } catch (IOException lex) { + Logger.error(lex.toString()); + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: could not read '" + identityFile + "' " }); + + } catch (SAXException sex) { + Logger.error(sex.toString()); + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: parsing problem in file:'" + identityFile + "' ", sex.toString() }); + } catch (ParserConfigurationException e) { + // TODO XMLPR Auto-generated catch block + Logger.error(e.toString()); + throw new LoginParameterResolverException("config.11", + new Object[] { "XMLLoginParameterResolver: parsing problem in file:'" + identityFile + "' ", e.toString() }); + } + buildInfo(rootElement, businessService.booleanValue()); + isConfigured = true; + } + + /** + * encryptData method uses parameters masterSecret and bPK as key information to encrypt plaintext + * @param plaintext + * @param bPK + * @param masterSecret + * @return encrypted data (blowfish encrypted, base64 encoded) + * @throws LoginParameterResolverException + */ + public String encryptData(String plaintext, String bPK, String masterSecret) throws LoginParameterResolverException + { + try { + String keyString = bPK + masterSecret; + key = new iaik.security.cipher.SecretKey(keyString.getBytes("UTF-8"), "Blowfish"); + IvParameterSpec param = new IvParameterSpec(new byte [] {0,0,0,0,0,0,0,0}); + + blowfishCipher.init(Cipher.ENCRYPT_MODE, key, param); + byte [] cipherText = blowfishCipher.doFinal(plaintext.getBytes("UTF-8")); + return Base64Utils.encode(cipherText); + } catch (UnsupportedEncodingException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (InvalidKeyException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (BadPaddingException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (IllegalBlockSizeException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (IllegalStateException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (InvalidAlgorithmParameterException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (IOException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } + } + + + /** + * encryptData method uses parameters masterSecret and bPK as key information to decrypt ciphertext + * @param ciphertext (blowfish encrypted, base64encoded) + * @param bPK + * @param masterSecret + * @return decrypted Data (plaintext) + * @throws LoginParameterResolverException + */ + public String decryptData(String ciphertext, String bPK, String masterSecret) throws LoginParameterResolverException + { + try { + String keyString = bPK + masterSecret; + key = new iaik.security.cipher.SecretKey(keyString.getBytes("UTF-8"), "Blowfish"); + IvParameterSpec param = new IvParameterSpec(new byte [] {0,0,0,0,0,0,0,0}); + blowfishCipher.init(Cipher.DECRYPT_MODE, key, param); + byte [] plaintext = blowfishCipher.doFinal(Base64Utils.decode(ciphertext, true)); + return new String(plaintext); + } catch (UnsupportedEncodingException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (InvalidKeyException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (BadPaddingException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (IllegalBlockSizeException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (IllegalStateException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (InvalidAlgorithmParameterException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } catch (IOException e) { + throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); + } + } + + + + /** + * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationHeaders(OAConfiguration, AuthenticationData, String, boolean, String) + */ + public Map getAuthenticationHeaders( + OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress, + boolean businessService, + String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException { + Map result = new HashMap(); + + if (!isConfigured) { + //TODO XMLLPR + throw new LoginParameterResolverException("XMLLoginParameterResolver with configuration '" + + identityFile + "' is not configured!", null); + } + + //get the Identity of the user + String famName = resolveValue("MOAFamilyName", authData, clientIPAddress); + String givenName = resolveValue("MOAGivenName", authData, clientIPAddress); + String dateOfBirth = resolveValue("MOADateOfBirth", authData, clientIPAddress); + String bPK =""; + String wType= ""; + if (businessService) { + bPK = resolveValue(MOAWBPK, authData, clientIPAddress); + wType = "w"; + } else { + bPK = resolveValue(MOABPK, authData, clientIPAddress); + } + String userid = ""; + String password = ""; + LPRParams params = null; + boolean userFound = false; + + //try (w)bPK and named search + params = bPKIdentitySearch(bPK, wType); + + if (null == params) + params = namedIdentitySearch(famName, givenName, dateOfBirth); + + //if both searches failed, report error. + if(null == params) + throw new NotAllowedException("User:_" + wType + "bPK:'" +bPK+ ", " + famName + ", " + givenName + "' not authorized.", null); + + //HTTP 401 - Basic Authentication + if (oaConf.getAuthType().equals("basic")) { + userid = (null != params.getUN()) ? params.getUN() : ""; + password = (null != params.getPW()) ? params.getPW() : ""; + + try { + String userIDPassword = userid + ":" + password; + String credentials = Base64Utils.encode(userIDPassword.getBytes("UTF-8")); + Logger.debug("XMLLoginParameterResolver: calculated credentials: " + credentials); + result.put("Authorization", "Basic " + credentials); + } catch (IOException ignore) { + throw new LoginParameterResolverException("config.14", new Object[] {"internal error while encoding in Base64"}); + } + } else if (oaConf.getAuthType().equals("header")) { //HTTP Authentication + String key; + String resolvedValue; + //TODO MOAID XMLLPR select value through OA-ConfigFile; + if(null != params.getUN()) result.put("UN", params.getUN()); + if(null != params.getPW()) result.put("UN", params.getPW()); + if(null != params.getParam1()) result.put("UN", params.getParam1()); + if(null != params.getParam2()) result.put("UN", params.getParam2()); + if(null != params.getParam3()) result.put("UN", params.getParam3()); + + } else { + throw new LoginParameterResolverException("config.14", new Object[] {"AuthType not supported"}); + } + + return result; + } + + /** + * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationParameters(OAConfiguration, AuthenticationData, String, boolean, String) + */ + public Map getAuthenticationParameters( + OAConfiguration oaConf, + AuthenticationData authData, + String clientIPAddress, + boolean businessService, + String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException { + + Map result = new HashMap(); + + if (!isConfigured) { + Logger.warn("XMLLoginParameterResolver with configuration '" + identityFile + " is not configured"); + return result; + } + + String famName = resolveValue("MOAFamilyName", authData, clientIPAddress); + String givenName = resolveValue("MOAGivenName", authData, clientIPAddress); + String dateOfBirth = resolveValue("MOADateOfBirth", authData, clientIPAddress); + String bPK =""; + String wType= ""; + if (businessService) { + bPK = resolveValue(MOAWBPK, authData, clientIPAddress); + wType = "w"; + } else { + bPK = resolveValue(MOABPK, authData, clientIPAddress); + } + String userid = ""; + String password = ""; + LPRParams params = null; + + //try (w)bPK and named search + params = bPKIdentitySearch(bPK, wType); + + if (null == params) + params = namedIdentitySearch(famName, givenName, dateOfBirth); + + //if both searches failed, report error. + if(null == params) + throw new NotAllowedException("User:_" + wType + "bPK:'" +bPK+ ", " + famName + ", " + givenName + "' not authorized.", null); + + //TODO MOAID XMLLPR URLEncoder.encode + if (oaConf.getAuthType().equals("param")) { + try { + if(null != params.getUN()) result.put(XSD_UNATTR, URLEncoder.encode(params.getUN(),"ISO-8859-1")); + if(null != params.getPW()) result.put(XSD_PWATTR, URLEncoder.encode(params.getPW(),"ISO-8859-1")); + if(null != params.getParam1()) result.put(XSD_PARAM1ATTR, URLEncoder.encode(params.getParam1(),"ISO-8859-1")); + if(null != params.getParam2()) result.put(XSD_PARAM2ATTR, URLEncoder.encode(params.getParam2(),"ISO-8859-1")); + if(null != params.getParam3()) result.put(XSD_PARAM3ATTR, URLEncoder.encode(params.getParam3(),"ISO-8859-1")); + } catch (UnsupportedEncodingException e) { + // ISO-8859-1 is supported + throw new LoginParameterResolverException("URLEncoder error", null); + } + } else { + throw new LoginParameterResolverException("AuthType not supported", null); + } + return result; + } + + /** + * Resolves a login header or parameter value. + * @param predicate header or parameter predicate name from online application configuration + * @param authData authentication data for current login + * @param clientIPAddress client IP address + * @return header or parameter value resolved; null if unknown name is given + */ + private static String resolveValue( + String predicate, + AuthenticationData authData, + String clientIPAddress) { + if (predicate.equals("MOAGivenName")) + return authData.getGivenName(); + if (predicate.equals("MOAFamilyName")) + return authData.getFamilyName(); + if (predicate.equals("MOADateOfBirth")) + return authData.getDateOfBirth(); + if (predicate.equals("MOABPK")) + return authData.getBPK(); + if (predicate.equals("MOAWBPK")) + return authData.getWBPK(); + if (predicate.equals("MOAPublicAuthority")) + if (authData.isPublicAuthority()) + return "true"; + else + return "false"; + if (predicate.equals("MOABKZ")) + return authData.getPublicAuthorityCode(); + if (predicate.equals("MOAQualifiedCertificate")) + if (authData.isQualifiedCertificate()) + return "true"; + else + return "false"; + if (predicate.equals("MOAStammzahl")) + return authData.getIdentificationValue(); + if (predicate.equals(MOAIdentificationValueType)) + return authData.getIdentificationType(); + if (predicate.equals("MOAIPAddress")) + return clientIPAddress; + else + return null; + } + + /** + * reads, parses the configuration file of XMLLoginParameterResolver and returns the document element. + * @param fileName of the configuration file. + */ + private Element readXMLFile(String fileName) throws ParserConfigurationException, SAXException, IOException { + Logger.info("XMLLoginParameterResolver: Loading and parsing XMLPLoginParameterConfiguration configuration: " + fileName); + + InputStream stream = null; + Element configElem; + + stream = new BufferedInputStream(new FileInputStream(fileName)); + configElem = DOMUtils.parseDocument(stream, true, Constants.ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + return configElem; + } + + /** + * buildInfo builds up the internal data mapping between the "Identities" and the "Parameters" from the parsed XML file. + * @param root document root element. + */ + private void buildInfo(Element root, boolean businessService) { + NodeList idList = root.getElementsByTagName(XSD_IDELEM); + NodeList paramList = root.getElementsByTagName(XSD_PARAMELEM); + String wType =""; + if (businessService) wType = "w"; + for (int i = 0; i < idList.getLength(); i++) + Logger.debug("XMLLoginParameterResolver: LocalName idList: " + idList.item(i).getLocalName()); + + for (int i = 0; i < paramList.getLength(); i++) + Logger.debug("XMLLoginParameterResolver: LocalName paramList: " + paramList.item(i).getLocalName()); + + for (int i = 0; i < idList.getLength(); i++) { + Element tmpElem = (Element) idList.item(i); + NodeList tmpList = tmpElem.getElementsByTagName(XSD_NAMEDIDELEM); + for (int j = 0; j < tmpList.getLength(); j++) + Logger.debug("XMLLoginParameterResolver: LocalName tmp: " + tmpList.item(j).getLocalName()); + + //Search for NamedIdentity Elements + if (1 == tmpList.getLength()) { + tmpElem = (Element) tmpList.item(0); + String tmpStr = tmpElem.getAttribute(XSD_SURNAMEATTR) + "," + + tmpElem.getAttribute(XSD_GIVENNAMEATTR) + "," + + tmpElem.getAttribute(XSD_BIRTHDATEATTR); + boolean tmpBool = false; + if (tmpElem.getFirstChild() != null + && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) + tmpBool = true; + //TODO XMLLPR remove + Logger.debug("XMLLoginParameterResolver: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); + tmpElem = (Element) paramList.item(i); + Logger.debug("XMLLoginParameterResolver: attribute UN: " + tmpElem.getAttribute(XSD_UNATTR) + + " attribute PW: " + tmpElem.getAttribute(XSD_PWATTR) + + " attribute Param1: " + tmpElem.getAttribute(XSD_PARAM1ATTR) + + " attribute Param2: " + tmpElem.getAttribute(XSD_PARAM2ATTR) + + " attribute Param3: " + tmpElem.getAttribute(XSD_PARAM3ATTR) ); + namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute(XSD_UNATTR), tmpElem.getAttribute(XSD_PWATTR), + tmpElem.getAttribute(XSD_PARAM1ATTR), tmpElem.getAttribute(XSD_PARAM2ATTR), + tmpElem.getAttribute(XSD_PARAM3ATTR)) ); + } else { + + //(w)bPKIdentity Elements + if (businessService) { + tmpList = tmpElem.getElementsByTagName(XSD_WBPKIDELEM); + } else { + tmpList = tmpElem.getElementsByTagName(XSD_BPKIDELEM); + } + if (1 == tmpList.getLength()) { + tmpElem = (Element) tmpList.item(0); + String tmpStr = ""; + if (businessService) { + tmpStr = tmpElem.getAttribute(XSD_WBPKATTR); + } else { + tmpStr = tmpElem.getAttribute(XSD_BPKATTR); + } + boolean tmpBool = false; + if (tmpElem.getFirstChild() != null + && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) + tmpBool = true; + Logger.debug("XMLLoginParameterResolver: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); + tmpElem = (Element) paramList.item(i); + Logger.debug("XMLLoginParameterResolver: attribute UN: " + tmpElem.getAttribute(XSD_UNATTR) + + " attribute PW: " + tmpElem.getAttribute(XSD_PWATTR) + + " attribute Param1: " + tmpElem.getAttribute(XSD_PARAM1ATTR) + + " attribute Param2: " + tmpElem.getAttribute(XSD_PARAM2ATTR) + + " attribute Param3: " + tmpElem.getAttribute(XSD_PARAM3ATTR) ); + namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute(XSD_UNATTR), tmpElem.getAttribute(XSD_PWATTR), + tmpElem.getAttribute(XSD_PARAM1ATTR), tmpElem.getAttribute(XSD_PARAM2ATTR), + tmpElem.getAttribute(XSD_PARAM3ATTR)) ); + } else { + if (businessService) { + Logger.warn("XMLLoginParameterResolver: wrong format no Elements " + XSD_NAMEDIDELEM + " or " + XSD_WBPKIDELEM + " found"); + } else { + Logger.warn("XMLLoginParameterResolver: wrong format no Elements " + XSD_NAMEDIDELEM + " or " + XSD_BPKIDELEM + " found"); + } + } + } + } + + Logger.debug("namedMap:" + namedMap.toString()); + Logger.debug(wType + "bPKMap:" + bPKMap.toString()); + } + + + + + /** + * searches for a given bPK and returns the appropriate LPRParams structure + * @param bPK search argument + * @return LPRParams if bPK could be found in internal mappings or null otherwise. + */ + LPRParams bPKIdentitySearch(String bPK, String wType) { + //search for mapping with (w)bPK of the user + Logger.info("XMLLoginParameterResolver: search for login data mapped to " + wType + "bPK:" + bPK); + LPRParams params = (LPRParams) bPKMap.get(bPK); + if (null == params) { + Logger.info("XMLLoginParameterResolver: params for " + wType + "bPK: " + bPK + " not found!"); + return null; + } else if (params.getEnabled()) { + Logger.info("XMLLoginParameterResolver: " + wType + "bPK: " + bPK + "found in list; user is enabled"); + Logger.debug("XMLLoginParameterResolver: using: " + params.toString()); + return params; + } + Logger.info("XMLLoginParameterResolver: " + wType + "bPK: " + bPK + "found in list but user is NOT enabled"); + return null; + } + + /** + * searches for a given namedIdentity and returns the appropriate LPRParams structure + * @param surName surname search argument + * @param givenName givenname search argument + * @param dateOfBirth dateofbirth search argument + * @return LPRParams if (w)bPK could be found in internal mappings or null otherwise. + */ + LPRParams namedIdentitySearch(String surName, String givenName, String dateOfBirth) { + Logger.info("XMLLoginParameterResolver: search for login data for SurName:" + surName + " GivenName: " + givenName + " DateOfBirth" + dateOfBirth); + //try first a search with surname, givenname and birthdate + LPRParams params = (LPRParams) namedMap.get(surName + "," + givenName + "," + dateOfBirth); + if (null == params) { + Logger.debug("XMLLoginParameterResolver: params for Surname: " + surName + " GivenName: " + givenName + "BirthDate: " + dateOfBirth + " not found!"); + //try a search with surname, givenname only + params = (LPRParams) namedMap.get(surName + "," + givenName + "," + XSD_BIRTHDATEBLANKATTR); + if(null == params) { + Logger.debug("XMLLoginParameterResolver: params for Surname: " + surName + " GivenName: " + givenName + " not found!"); + return null; + } + } + + if (params.getEnabled()) { + Logger.info("XMLLoginParameterResolver: Surname:" + surName + " GivenName: " + givenName + " found in list; user is enabled"); + Logger.debug("XMLLoginParameterResolver: using: " + params.toString()); + return params; + } + Logger.info("XMLLoginParameterResolver: SurName:" + surName + " GivenName: " + givenName + "found in list; user is NOT enabled"); + return null; + } + + //public static final String XSD_MAPPING = "Mapping"; + //public static final String XSD_DOCELEM = "MOAIdentities"; + public static final String XSD_IDELEM = "Identity"; + public static final String XSD_NAMEDIDELEM = "NamedIdentity"; + public static final String XSD_BPKIDELEM = "bPKIdentity"; + public static final String XSD_WBPKIDELEM = "wbPKIdentity"; + public static final String XSD_PARAMELEM = "Parameters"; + public static final String XSD_SURNAMEATTR = "SurName"; + public static final String XSD_GIVENNAMEATTR = "GivenName"; + public static final String XSD_BIRTHDATEATTR = "BirthDate"; + public static final String XSD_BIRTHDATEBLANKATTR = "any"; + public static final String XSD_BPKATTR = "bPK"; + public static final String XSD_WBPKATTR = "wbPK"; + public static final String XSD_UNATTR = "UN"; + public static final String XSD_PWATTR = "PW"; + public static final String XSD_PARAM1ATTR = "Param1"; + public static final String XSD_PARAM2ATTR = "Param2"; + public static final String XSD_PARAM3ATTR = "Param3"; + private Map bPKMap; + private Map namedMap; + private boolean isConfigured = false; +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java new file mode 100644 index 000000000..aedafdf85 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java @@ -0,0 +1,422 @@ +package at.gv.egovernment.moa.id.proxy; + +import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Base64Utils; +import java.io.IOException; +import java.util.*; +import org.apache.xerces.parsers.DOMParser; +import org.w3c.dom.*; + +// Referenced classes of package at.gv.egovernment.moa.id.proxy: +// +// TODO MOA-ID test full functionality + +public class XMLLoginParameterResolverPlainData + implements LoginParameterResolver +{ + private String configuration; + + /** + * inner class used to store mapped parameters + */ + class LPRParams { + + /** + * getter method for parameter Enabled. + * Parameter Enabled decides if mapped parameters should be used by XMLLoginParameterResolver + */ + public boolean getEnabled() { + return enabled.booleanValue(); + } + + /** + * getter method for parameter UN (username) + * @return Parameter UN or null not set. + */ + public String getUN() { + return UN; + } + + /** + * getter method for parameter UN (username) + * @return Parameter UN or null not set. + */ + public String getPlainUN() { + return UN; + } + + + /** + * getter method for parameter PW (password) + * @return Parameter PW or null not set. + */ + public String getPW() { + return PW; + } + + /** + * getter method for generic parameter Param1 + * @return Parameter Param1 or null not set. + */ + public String getParam1() { + return Param1; + } + + /** + * getter method for generic parameter Param2 + * @return Parameter Param2 or null not set. + */ + public String getParam2() { + return Param2; + } + + /** + * getter method for generic parameter Param3 + * @return Parameter Param3 or null not set. + */ + public String getParam3() { + return Param3; + } + + /** + * Returns a string representation of LPRParams + * + * @return a String representation of this object. + * @see XMLLoginParameterResolver.LPRParams + */ + public String toString() { + return "Enabled: " + + enabled.toString() + + "UN: '" + + UN + + "' PW: '" + + PW + + "' Param1: '" + + Param1 + + "' Param2: '" + + Param2 + + "' Param3: '" + + Param3 + + "'\n"; + } + + //private member variables used to store the parameters + private Boolean enabled = null; + private String UN = null; + private String PW = null; + private String Param1 = null; + private String Param2 = null; + private String Param3 = null; + + /** + * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. + * + * @param enabled enable user mapping to parameter set for the parameter set. + * @param UN username used in HTTP 401 - BasicAuthentication + * @param PW password used in HTTP 401 - BasicAuthentication + * @param Param1 generic parameter1 used in HeaderAuthentication and ParameterAuthentication + * @param Param2 generic parameter2 used in HeaderAuthentication and ParameterAuthentication + * @param Param3 generic parameter3 used in HeaderAuthentication and ParameterAuthentication + **/ + LPRParams(boolean enabled, String UN, String PW, String Param1, String Param2, String Param3) { + this.enabled = new Boolean(enabled); + this.UN = UN; + this.PW = PW; + this.Param1 = Param1; + this.Param2 = Param2; + this.Param3 = Param3; + } + + /** + * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. + * + * @param enabled enable user mapping to parameter set for the parameter set. + * @param UN username used in HTTP 401 - BasicAuthentication + * @param PW password used in HTTP 401 - BasicAuthentication + **/ + LPRParams(boolean enabled, String UN, String PW) { + this(enabled, UN, PW, null, null, null); + } + } + + //TODO document + public XMLLoginParameterResolverPlainData() + { + bPKMap = new HashMap(); + namedMap = new HashMap(); + + } + + //TODO document + public Map getAuthenticationHeaders(OAConfiguration oaConf, AuthenticationData authData, String clientIPAddress, boolean businessService, String publicURLPrefix) throws NotAllowedException + { + Map result = new HashMap(); + if(oaConf.getAuthType().equals("basic")) + { + String famName = resolveValue(MOAFamilyName, authData, clientIPAddress); + String givenName = resolveValue(MOAGivenName, authData, clientIPAddress); + String dateOfBirth = resolveValue(MOADateOfBirth, authData, clientIPAddress); + String bPK =""; + String wType= ""; + if (businessService) { + bPK = resolveValue(MOAWBPK, authData, clientIPAddress); + wType = "w"; + } else { + bPK = resolveValue(MOABPK, authData, clientIPAddress); + } + String userid = ""; + String password = ""; + String param1 = ""; + String param2 = ""; + String param3 = ""; + + LPRParams params = null; + boolean userFound = false; + + //first step: search for (w)bPK entry in user list + Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for "+ wType + "bPK:" + bPK); + params = (LPRParams)bPKMap.get(bPK); + if(params == null) + Logger.debug("XMLLoginParameterResolverPlainData: params for "+ wType + "bPK: " + bPK + " not found in file!"); + else + if(params.getEnabled()) + { //if user is enabled: get related parameters + Logger.debug("XMLLoginParameterResolverPlainData: "+ wType + "bPK: " + bPK + " found in list; user is enabled"); + Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); + userid = params.getUN(); + password = params.getPW(); + param1 = params.getParam1(); + param2 = params.getParam2(); + param3 = params.getParam3(); + userFound = true; + } else + { + Logger.info("XMLLoginParameterResolverPlainData: "+ wType + "bPK: " + bPK + " found in list; user is NOT enabled"); + } + if(!userFound) //secound step: search for name entry in user list + { + Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for SurName:" + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth); + params = (LPRParams)namedMap.get(famName + "," + givenName + "," + dateOfBirth); + if(params == null) { + Logger.debug("XMLLoginParameterResolverPlainData: params for Surname: " + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth + " not found in file!"); + //try also with wildcard ("*") birthdate + params = (LPRParams)namedMap.get(famName + "," + givenName + "," + "*"); + if(params != null) Logger.debug("XMLLoginParameterResolverPlainData: params for Surname: " + famName + " GivenName: " + givenName + " DateOfBirth: " + "*" + " found!"); + } + + if(null != params && params.getEnabled()) + { + Logger.debug("XMLLoginParameterResolverPlainData: SurName:" + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth + " found in file; user is enabled"); + Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); + userid = params.getUN(); + password = params.getPW(); + param1 = params.getParam1(); + param2 = params.getParam2(); + param3 = params.getParam3(); + userFound = true; + } + } + if(!userFound) //third step: search for default user in user list + { + //third step: search for (w)bPK for the default user entry in user list + Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for default user"); + params = (LPRParams)bPKMap.get("default"); + if(params == null) + Logger.debug("XMLLoginParameterResolverPlainData: params for default user not found in file!"); + else + if(params.getEnabled()) + { //if user is enabled: get related parameters + Logger.debug("XMLLoginParameterResolverPlainData: default user found in list; user is enabled"); + Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); + userid = params.getUN(); + password = params.getPW(); + param1 = params.getParam1(); + param2 = params.getParam2(); + param3 = params.getParam3(); + userFound = true; + } else + { + Logger.info("XMLLoginParameterResolverPlainData: default user found in list; user is NOT enabled"); + } + } + + if(!userFound) //if user is not found then throw NotAllowedException exception + { + //TODO MOA-ID proove this with testcases! + Logger.info("XMLLoginParameterResolverPlainData: Person is not allowed No automatic login"); + throw new NotAllowedException("XMLLoginParameterResolverPlainData: Person is not allowed No automatic login ", new Object[] { }); + } + try //if user was found: generate Authorization header entry with associated credemtials + { + String userIDPassword = userid + ":" + password; + String credentials = Base64Utils.encode(userIDPassword.getBytes()); + Logger.debug("XMLLoginParameterResolverPlainData: calculated credentials: " + credentials); + result.put("Authorization", "Basic " + credentials); + } + catch(IOException ignore) { } + } else + if(oaConf.getAuthType().equals("header")) + { + String key; + String resolvedValue; + for(Iterator iter = oaConf.getHeaderAuthMapping().keySet().iterator(); iter.hasNext(); result.put(key, resolvedValue)) + { + key = (String)iter.next(); + String predicate = (String)oaConf.getHeaderAuthMapping().get(key); + resolvedValue = resolveValue(predicate, authData, clientIPAddress); + } + + } + return result; + } + + public Map getAuthenticationParameters(OAConfiguration oaConf, AuthenticationData authData, String clientIPAddress, boolean businessService, String publicURLPrefix) + { + Map result = new HashMap(); + if(oaConf.getAuthType().equals("param")) + { + String key; + String resolvedValue; + for(Iterator iter = oaConf.getParamAuthMapping().keySet().iterator(); iter.hasNext(); result.put(key, resolvedValue)) + { + key = (String)iter.next(); + String predicate = (String)oaConf.getParamAuthMapping().get(key); + resolvedValue = resolveValue(predicate, authData, clientIPAddress); + } + + } + return result; + } + + private static String resolveValue(String predicate, AuthenticationData authData, String clientIPAddress) + { + if(predicate.equals(MOAGivenName)) + return authData.getGivenName(); + if(predicate.equals(MOAFamilyName)) + return authData.getFamilyName(); + if(predicate.equals(MOADateOfBirth)) + return authData.getDateOfBirth(); + if(predicate.equals(MOABPK)) + return authData.getBPK(); + if(predicate.equals(MOAWBPK)) + return authData.getWBPK(); + if(predicate.equals(MOAPublicAuthority)) + if(authData.isPublicAuthority()) + return "true"; + else + return "false"; + if(predicate.equals(MOABKZ)) + return authData.getPublicAuthorityCode(); + if(predicate.equals(MOAQualifiedCertificate)) + if(authData.isQualifiedCertificate()) + return "true"; + else + return "false"; + if(predicate.equals(MOAStammzahl)) + return authData.getIdentificationValue(); + if (predicate.equals(MOAIdentificationValueType)) + return authData.getIdentificationType(); + if(predicate.equals(MOAIPAddress)) + return clientIPAddress; + else + return null; + } + + private Document readXMLFile(String fileName) throws LoginParameterResolverException + { + Logger.info("XMLLoginParameterResolverPlainData: Loading MOA-OA configuration " + fileName); + DOMParser parser = new DOMParser(); + try + { + parser.setFeature("http://xml.org/sax/features/validation", true); + parser.setFeature("http://apache.org/xml/features/validation/schema", true); + parser.parse(fileName); + return parser.getDocument(); + } + catch(Exception e) + { + String msg = e.toString(); + throw new LoginParameterResolverException("proxy.13", new Object[] {": XMLLoginParameterResolverPlainData: Error parsing file " + fileName, "detail problem: " + msg}); + } + } + + private void buildInfo(Document doc, boolean businessService) + { + Element root = doc.getDocumentElement(); + NodeList idList = root.getElementsByTagName("Identity"); + NodeList paramList = root.getElementsByTagName("Parameters"); + String wType =""; + if (businessService) wType = "w"; + for(int i = 0; i < idList.getLength(); i++) + Logger.debug("XMLLoginParameterResolverPlainData: LocalName idList: " + idList.item(i).getLocalName()); + + for(int i = 0; i < paramList.getLength(); i++) + Logger.debug("XMLLoginParameterResolverPlainData: LocalName paramList: " + paramList.item(i).getLocalName()); + + for(int i = 0; i < idList.getLength(); i++) + { + Element tmpElem = (Element)idList.item(i); + NodeList tmpList = tmpElem.getElementsByTagName("NamedIdentity"); + for(int j = 0; j < tmpList.getLength(); j++) + Logger.debug("XMLLoginParameterResolverPlainData: LocalName tmp: " + tmpList.item(j).getLocalName()); + + if(1 == tmpList.getLength()) + { + tmpElem = (Element)tmpList.item(0); + String tmpStr = tmpElem.getAttribute("SurName") + "," + tmpElem.getAttribute("GivenName") + "," + tmpElem.getAttribute("BirthDate"); + boolean tmpBool = false; + if(tmpElem.getFirstChild() != null && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) + tmpBool = true; + Logger.debug("XMLLoginParameterResolverPlainData: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); + tmpElem = (Element)paramList.item(i); + Logger.debug("XMLLoginParameterResolverPlainData: attribute UN: " + tmpElem.getAttribute("UN") + " attribute PW: " + tmpElem.getAttribute("PW")); + namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute("UN"), tmpElem.getAttribute("PW"))); + } else + { + tmpList = tmpElem.getElementsByTagName(wType + "bPKIdentity"); + if(1 == tmpList.getLength()) + { + tmpElem = (Element)tmpList.item(0); + String tmpStr = tmpElem.getAttribute(wType + "bPK"); + boolean tmpBool = false; + if(tmpElem.getFirstChild() != null && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) + tmpBool = true; + Logger.debug("XMLLoginParameterResolverPlainData: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); + tmpElem = (Element)paramList.item(i); + Logger.debug("XMLLoginParameterResolverPlainData: attribute UN: " + tmpElem.getAttribute("UN") + " attribute PW: " + tmpElem.getAttribute("PW") + " attribute Param1: " + tmpElem.getAttribute("Param1")); + bPKMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute("UN"), tmpElem.getAttribute("PW"))); + } else + { + Logger.warn("XMLLoginParameterResolverPlainData: wrong format or incorrect mode; no NamedIdentity or " + wType + "bPKIdentity found"); + } + } + } + + Logger.debug("namedMap:" + namedMap.toString()); + Logger.debug(wType + "bPKMap:" + bPKMap.toString()); + } + + //public static final String XSD_DOCELEM = "MOAIdentities"; + //public static final String XSD_IDELEM = "Identity"; + //public static final String XSD_NAMEDIDELEM = "NamedIdentity"; + //public static final String XSD_BPKIDELEM = "bPKIdentity"; + //public static final String XSD_PARAMELEM = "Parameters"; + //public static final String XML_LPR_CONFIG_PROPERTY_NAME1 = "moa.id.xmllpr1.configuration"; + private Map bPKMap; + private Map namedMap; + + + public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { + Logger.info("XMLLoginParameterResolverPlainData: initialization string: " + configuration); + this.configuration = configuration; + String fileName = configuration; + if(fileName == null) { + fileName = "file:conf/moa-id/Identities.xml"; + Logger.info("XMLLoginParameterResolverPlainData: used file name string: " + fileName); + } + Document doc = readXMLFile(fileName); + buildInfo(doc, businessService.booleanValue() ); + } +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java new file mode 100644 index 000000000..e0e1fde4a --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java @@ -0,0 +1,55 @@ +package at.gv.egovernment.moa.id.proxy.builder; + +import java.text.MessageFormat; +import java.util.Calendar; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.DateTimeUtils; + +/** + * Builder for the <samlp:Request> used for querying + * the authentication data <saml:Assertion>. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLRequestBuilder implements Constants { + /** samlp-Request template */ + private static final String REQUEST = + "" + + "{2}" + + ""; + + /** + * Constructor for SAMLRequestBuilder. + */ + public SAMLRequestBuilder() { + super(); + } + + /** + * Builds the <samlp:Request>. + * @param requestID request ID + * @param samlArtifactBase64 SAML artifact, encoded BASE64 + * @return the DOM element + */ + public Element build(String requestID, String samlArtifactBase64) throws BuildException { + try { + String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); + String request = MessageFormat.format(REQUEST, new Object[] {requestID, issueInstant, samlArtifactBase64}); + Element requestElem = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + return requestElem; + } + catch (Throwable ex) { + throw new BuildException( + "builder.00", + new Object[] {"samlp:Request", ex.toString()}, + ex); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java new file mode 100644 index 000000000..f7e5299ab --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java @@ -0,0 +1,143 @@ +package at.gv.egovernment.moa.id.proxy.invoke; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Vector; + +import javax.xml.namespace.QName; +import javax.xml.rpc.Call; +import javax.xml.rpc.Service; +import javax.xml.rpc.ServiceFactory; + +import org.apache.axis.message.SOAPBodyElement; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.ServiceException; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.data.SAMLStatus; +import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; +import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; +import at.gv.egovernment.moa.id.proxy.servlet.ProxyException; +import at.gv.egovernment.moa.id.util.Random; + +/** + * Invoker of + *
    + *
  • either the GetAuthenticationData web service of MOA-ID Auth
  • + *
  • or the API call {@link at.gv.egovernment.moa.id.auth.AuthenticationServer#getAuthenticationData},
  • + *
+ * depending of the configuration. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class GetAuthenticationDataInvoker { + /** Create a new QName object for the webservice endpoint */ + private static final QName SERVICE_QNAME = new QName("GetAuthenticationData"); + + /** invoked object for API call of MOA-ID Auth */ + private static Object apiServer = null; + /** invoked method for API call of MOA-ID Auth */ + private static Method apiMethod = null; + + /** + * Invokes the service passing domain model objects. + * @param samlArtifact SAML artifact + * @return AuthenticationData object + * @throws ServiceException on any exception thrown + */ + /** + * Get authentication data from the MOA-ID Auth component, + * either via API call or via web service call. + * @param samlArtifact SAML artifact to be used as a parameter + * @return AuthenticationData + */ + public AuthenticationData getAuthenticationData(String samlArtifact) + throws ConfigurationException, ProxyException, BuildException, ServiceException, ParseException, AuthenticationException { + + ConnectionParameter authConnParam = + ProxyConfigurationProvider.getInstance().getAuthComponentConnectionParameter(); + if (authConnParam == null) { + try { + if (apiServer == null) { + Class serverClass = Class.forName("at.gv.egovernment.moa.id.auth.AuthenticationServer"); + Method getInstanceMethod = serverClass.getMethod("getInstance", (Class[]) null); + apiServer = getInstanceMethod.invoke(null, (Object[]) null); + apiMethod = serverClass.getMethod( + "getAuthenticationData", new Class[] {String.class}); + } + AuthenticationData authData = (AuthenticationData)apiMethod.invoke(apiServer, new Object[] {samlArtifact}); + return authData; + } + catch (InvocationTargetException ex) { + Throwable targetEx = ex.getTargetException(); + if (targetEx instanceof AuthenticationException) + throw (AuthenticationException) targetEx; + else + throw new ProxyException("proxy.09", new Object[] {targetEx.toString()}); + } + catch (Throwable ex) { + throw new ProxyException("proxy.09", new Object[] {ex.toString()}); + } + } + else { + Element samlpRequest = new SAMLRequestBuilder().build(Random.nextRandom(), samlArtifact); + Element samlpResponse = getAuthenticationData(samlpRequest); + SAMLResponseParser srp = new SAMLResponseParser(samlpResponse); + SAMLStatus status = srp.parseStatusCode(); + if (! "samlp:Success".equals(status.getStatusCode())) { + // on error status throw exception + String code = status.getStatusCode(); + if (status.getSubStatusCode() != null && status.getSubStatusCode().length() > 0) + code += "(" + status.getSubStatusCode() + ")"; + throw new ServiceException("service.02", new Object[] {code, status.getStatusMessage()}); + } + return srp.parseAuthenticationData(); + } + } + + /** + * Invokes the service passing DOM elements. + * @param request request DOM element + * @return response DOM element + * @throws ServiceException on any exception thrown + */ + public Element getAuthenticationData(Element request) throws ServiceException { + try { + Service service = ServiceFactory.newInstance().createService(SERVICE_QNAME); + Call call = service.createCall(); + SOAPBodyElement body = + new SOAPBodyElement(request); + SOAPBodyElement[] params = new SOAPBodyElement[] {body}; + Vector responses; + SOAPBodyElement response; + + String endPoint; + ConnectionParameter authConnParam = + ProxyConfigurationProvider.getInstance().getAuthComponentConnectionParameter(); + + //If the ConnectionParameter do NOT exist, we throw an exception .... + if (authConnParam!=null) { + endPoint = authConnParam.getUrl(); + call.setTargetEndpointAddress(endPoint); + responses = (Vector) call.invoke(SERVICE_QNAME, params); + response = (SOAPBodyElement) responses.get(0); + return response.getAsDOM(); + } + else + { + throw new ServiceException("service.01", null); + } + } + catch (Exception ex) { + throw new ServiceException("service.00", new Object[] {ex.toString()}, ex); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java new file mode 100644 index 000000000..6bf5da02b --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java @@ -0,0 +1,158 @@ +package at.gv.egovernment.moa.id.proxy.parser; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.util.BoolUtils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Parser for the <saml:Assertion> returned by the + * GetAuthenticationData web service. + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationDataAssertionParser implements Constants { + + /** Prefix for SAML-Xpath-expressions */ + private static String SAML = SAML_PREFIX + ":"; + /** Prefix for PersonData-Xpath-expressions */ + private static String PR = PD_PREFIX + ":"; + /** Prefix for Attribute MajorVersion in an Xpath-expression */ + private static String MAJOR_VERSION_XPATH = + "@MajorVersion"; + /** Prefix for Attribute MinorVersion in an Xpath-expression */ + private static String MINOR_VERSION_XPATH = + "@MinorVersion"; + /** Prefix for Attribute AssertionID in an Xpath-expression */ + private static String ASSERTION_ID_XPATH = + "@AssertionID"; + /** Prefix for Attribute Issuer in an Xpath-expression */ + private static String ISSUER_XPATH = + "@Issuer"; + /** Prefix for Attribute IssueInstant in an Xpath-expression */ + private static String ISSUE_INSTANT_XPATH = + "@IssueInstant"; + /** Prefix for Element AttributeStatement in an Xpath-expression */ + private static String ATTRIBUTESTATEMENT_XPATH = + SAML + "AttributeStatement/"; + /** Prefix for Element NameIdentifier in an Xpath-expression */ + private static String PK_XPATH = + ATTRIBUTESTATEMENT_XPATH + + SAML + "Subject/" + + SAML + "NameIdentifier"; + private static String NAME_QUALIFIER_XPATH = + PK_XPATH + "/@NameQualifier"; + /** Prefix for Element Person in an Xpath-expression */ + private static String PERSONDATA_XPATH = + ATTRIBUTESTATEMENT_XPATH + + SAML + "Attribute[@AttributeName=\"PersonData\"]/" + + SAML + "AttributeValue/" + + PR + "Person/"; + /** Prefix for Element Value in an Xpath-expression */ + private static String IDENTIFICATION_VALUE_XPATH = + PERSONDATA_XPATH + + PR + "Identification/" + + PR + "Value"; + private static String IDENTIFICATION_TYPE_XPATH = + PERSONDATA_XPATH + + PR + "Identification/" + + PR + "Type"; + /** Prefix for Element GivenName in an Xpath-expression */ + private static String GIVEN_NAME_XPATH = + PERSONDATA_XPATH + + PR + "Name/" + + PR + "GivenName"; + /** Prefix for Element FamilyName in an Xpath-expression */ + private static String FAMILY_NAME_XPATH = + PERSONDATA_XPATH + + PR + "Name/" + + PR + "FamilyName"; + /** Prefix for Element DateOfBirth in an Xpath-expression */ + private static String DATE_OF_BIRTH_XPATH = + PERSONDATA_XPATH + + PR + "DateOfBirth"; + /** Prefix for Element AttributeValue in an Xpath-expression */ + private static String IS_QUALIFIED_CERT_XPATH = + ATTRIBUTESTATEMENT_XPATH + + SAML + "Attribute[@AttributeName=\"isQualifiedCertificate\"]/" + + SAML + "AttributeValue"; + /** Prefix for Element AttributeValue in an Xpath-expression */ + private static String PUBLIC_AUTHORITY_XPATH = + ATTRIBUTESTATEMENT_XPATH + + SAML + "Attribute[@AttributeName=\"isPublicAuthority\"]/" + + SAML + "AttributeValue"; + /** Element samlAssertion represents the SAML:Assertion */ + private Element samlAssertion; + + /** + * Constructor + * @param samlAssertion samlpResponse the <samlp:Response> as a DOM element + */ + public AuthenticationDataAssertionParser(Element samlAssertion) { + this.samlAssertion = samlAssertion; + } + + /** + * Parses the <saml:Assertion>. + * @return AuthenticationData object + * @throws ParseException on any error + */ + public AuthenticationData parseAuthenticationData() + throws ParseException { + + try { + AuthenticationData authData = new AuthenticationData(); + //ÄNDERN: NUR der Identification-Teil + authData.setSamlAssertion(DOMUtils.serializeNode(samlAssertion)); + authData.setMajorVersion(new Integer( + XPathUtils.getAttributeValue(samlAssertion, MAJOR_VERSION_XPATH, "-1")).intValue()); + authData.setMinorVersion(new Integer( + XPathUtils.getAttributeValue(samlAssertion, MINOR_VERSION_XPATH, "-1")).intValue()); + authData.setAssertionID( + XPathUtils.getAttributeValue(samlAssertion, ASSERTION_ID_XPATH, "")); + authData.setIssuer( + XPathUtils.getAttributeValue(samlAssertion, ISSUER_XPATH, "")); + authData.setIssueInstant( + XPathUtils.getAttributeValue(samlAssertion, ISSUE_INSTANT_XPATH, "")); + String pkValue = XPathUtils.getElementValue(samlAssertion, PK_XPATH, ""); + if (XPathUtils.getAttributeValue(samlAssertion, NAME_QUALIFIER_XPATH, "").equalsIgnoreCase(URN_PREFIX_BPK)) { + authData.setBPK(pkValue); + } else { + authData.setWBPK(pkValue); + } + authData.setIdentificationValue( + XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_VALUE_XPATH, "")); + authData.setIdentificationType( + XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_TYPE_XPATH, "")); + authData.setGivenName( + XPathUtils.getElementValue(samlAssertion, GIVEN_NAME_XPATH, "")); + authData.setFamilyName( + XPathUtils.getElementValue(samlAssertion, FAMILY_NAME_XPATH, "")); + authData.setDateOfBirth( + XPathUtils.getElementValue(samlAssertion, DATE_OF_BIRTH_XPATH, "")); + authData.setQualifiedCertificate(BoolUtils.valueOf( + XPathUtils.getElementValue(samlAssertion, IS_QUALIFIED_CERT_XPATH, ""))); + String publicAuthority = + XPathUtils.getElementValue(samlAssertion, PUBLIC_AUTHORITY_XPATH, null); + if (publicAuthority == null) { + authData.setPublicAuthority(false); + authData.setPublicAuthorityCode(""); + } + else { + authData.setPublicAuthority(true); + if (! publicAuthority.equalsIgnoreCase("true")) + authData.setPublicAuthorityCode(publicAuthority); + } + return authData; + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString() }, t); + } + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java new file mode 100644 index 000000000..9f77578fd --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java @@ -0,0 +1,100 @@ +package at.gv.egovernment.moa.id.proxy.parser; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.data.SAMLStatus; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Parser for the <samlp:Response> returned by the + * GetAuthenticationData web service. + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLResponseParser implements Constants { + /** Element containing the samlResponse */ + private Element samlResponse; + /** Xpath prefix for reaching SAMLP Namespaces */ + private static String SAMLP = SAMLP_PREFIX + ":"; + /** Xpath prefix for reaching SAML Namespaces */ + private static String SAML = SAML_PREFIX + ":"; + /** Xpath prefix for reaching PersonData Namespaces */ + private static String PR = PD_PREFIX + ":"; + /** Xpath expression for reaching the SAMLP:Response element */ + private static final String ROOT = + "/" + SAMLP + "Response/"; + /** Xpath expression for reaching the SAMLP:Status element */ + private static final String STATUS_XPATH = + ROOT + + SAMLP + "Status/"; + /** Xpath expression for reaching the SAMLP:StatusCode_Value attribute */ + private static final String STATUSCODE_XPATH = + STATUS_XPATH + + SAMLP + "StatusCode/@Value"; + /** Xpath expression for reaching the SAMLP:SubStatusCode_Value attribute */ + private static final String SUBSTATUSCODE_XPATH = + STATUS_XPATH + + SAMLP + "StatusCode/" + + SAMLP + "StatusCode/@Value"; + /** Xpath expression for reaching the SAMLP:StatusMessage element */ + private static final String STATUSMESSAGE_XPATH = + STATUS_XPATH + + SAMLP + "StatusMessage"; + /** Xpath expression for reaching the SAML:Assertion element */ + private static String ASSERTION_XPATH = + ROOT + + SAML + "Assertion"; + + /** + * Constructor + * @param samlResponse the <samlp:Response> as a DOM element + */ + public SAMLResponseParser(Element samlResponse) { + this.samlResponse = samlResponse; + } + + /** + * Parses the <samlp:StatusCode> from the <samlp:Response>. + * @return AuthenticationData object + * @throws ParseException on any parsing error + */ + public SAMLStatus parseStatusCode() + throws ParseException { + + SAMLStatus status = new SAMLStatus(); + try { + status.setStatusCode( + XPathUtils.getAttributeValue(samlResponse, STATUSCODE_XPATH, "")); + status.setSubStatusCode( + XPathUtils.getAttributeValue(samlResponse, SUBSTATUSCODE_XPATH, "")); + status.setStatusMessage( + XPathUtils.getElementValue(samlResponse, STATUSMESSAGE_XPATH, "")); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString() }, t); + } + return status; + } + + /** + * Parses the <saml:Assertion> from the <samlp:Response>. + * @return AuthenticationData object + * @throws ParseException on any parsing error + */ + public AuthenticationData parseAuthenticationData() + throws ParseException { + + Element samlAssertion; + try { + samlAssertion = (Element)XPathUtils.selectSingleNode(samlResponse, ASSERTION_XPATH); + } + catch (Throwable t) { + throw new ParseException("parser.01", new Object[] { t.toString() }, t); + } + return new AuthenticationDataAssertionParser(samlAssertion).parseAuthenticationData(); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java new file mode 100644 index 000000000..4ab2e2cf7 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java @@ -0,0 +1,71 @@ +package at.gv.egovernment.moa.id.proxy.servlet; + +import java.io.IOException; +import java.text.DateFormat; +import java.util.Date; +import java.util.Locale; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import at.gv.egovernment.moa.id.proxy.MOAIDProxyInitializer; +import at.gv.egovernment.moa.id.util.HTTPRequestJSPForwarder; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Servlet requested for updating the MOA-ID Auth configuration from configuration file + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ConfigurationServlet extends HttpServlet { + + /** + * Handle a HTTP GET request, used to indicated that the MOA + * configuration needs to be updated (reloaded). + * + * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) + */ + public void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance(); + try { + MOAIDProxyInitializer.initialize(); + + String message = msg.getMessage("config.00", new Object[] + { DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.GERMAN).format(new Date())} ); + Logger.info(message); + + HTTPRequestJSPForwarder.forwardNamed(message, "/message-proxy.jsp", getServletContext(), request, response); + } catch (Throwable t) { + String errorMessage = msg.getMessage("config.04", null); + Logger.error(errorMessage, t); + HTTPRequestJSPForwarder.forwardNamed(errorMessage, "/message-proxy.jsp", getServletContext(), request, response); + } + } + + /** + * Do the same as doGet. + * + * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) + */ + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + doGet(request, response); + } + +/** + * Calls the web application initializer. + * + * @see javax.servlet.Servlet#init(ServletConfig) + */ +public void init(ServletConfig servletConfig) throws ServletException { + super.init(servletConfig); +} + +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java new file mode 100644 index 000000000..0080c010e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java @@ -0,0 +1,35 @@ +package at.gv.egovernment.moa.id.proxy.servlet; + +import at.gv.egovernment.moa.id.MOAIDException; + +/** + * Exception thrown while proxying a request to the online application + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ProxyException extends MOAIDException { + + /** + * Constructor for ProxyException. + * @param messageId + * @param parameters + */ + public ProxyException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Constructor for ProxyException. + * @param messageId + * @param parameters + * @param wrapped + */ + public ProxyException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java new file mode 100644 index 000000000..6d215c35e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java @@ -0,0 +1,879 @@ +package at.gv.egovernment.moa.id.proxy.servlet; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Vector; + +import javax.net.ssl.SSLSocketFactory; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletConfig; +import javax.servlet.ServletContext; +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 at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.MOAIDException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.ServiceException; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.data.CookieManager; +import at.gv.egovernment.moa.id.proxy.ConnectionBuilder; +import at.gv.egovernment.moa.id.proxy.ConnectionBuilderFactory; +import at.gv.egovernment.moa.id.proxy.LoginParameterResolver; +import at.gv.egovernment.moa.id.proxy.LoginParameterResolverException; +import at.gv.egovernment.moa.id.proxy.LoginParameterResolverFactory; +import at.gv.egovernment.moa.id.proxy.MOAIDProxyInitializer; +import at.gv.egovernment.moa.id.proxy.NotAllowedException; +import at.gv.egovernment.moa.id.proxy.invoke.GetAuthenticationDataInvoker; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Base64Utils; + +/** + * Servlet requested for logging in at an online application, + * and then for proxying requests to the online application. + * @author Paul Ivancsics + * @version $Id$ + */ +public class ProxyServlet extends HttpServlet { + /** Name of the Parameter for the Target */ + private static final String PARAM_TARGET = "Target"; + /** Name of the Parameter for the SAMLArtifact */ + private static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; + + /** Name of the Attribute for marking the session as authenticated*/ + private static final String ATT_AUTHDATAFETCHED = "AuthDataFetched"; + /** Name of the Attribute for the PublicURLPrefix */ + private static final String ATT_PUBLIC_URLPREFIX = "PublicURLPrefix"; + /** Name of the Attribute for the RealURLPrefix */ + private static final String ATT_REAL_URLPREFIX = "RealURLPrefix"; + /** Name of the Attribute for the SSLSocketFactory */ + private static final String ATT_SSL_SOCKET_FACTORY = "SSLSocketFactory"; + /** Name of the Attribute for the LoginHeaders */ + private static final String ATT_LOGIN_HEADERS = "LoginHeaders"; + /** Name of the Attribute for the LoginParameters */ + private static final String ATT_LOGIN_PARAMETERS = "LoginParameters"; + /** Name of the Attribute for the SAMLARTIFACT */ + private static final String ATT_SAML_ARTIFACT = "SamlArtifact"; + /** Name of the Attribute for the state of the browser request for login dialog*/ + private static final String ATT_BROWSERREQU = "BrowserLoginRequest"; + /** Name of the Attribute for the state of the browser request for login dialog*/ + private static final String ATT_OA_CONF = "oaConf"; + /** Name of the Attribute for the Logintype of the OnlineApplication*/ + private static final String ATT_OA_LOGINTYPE = "LoginType"; + /** Name of the Attribute for the number of the try to login into the OnlineApplication*/ + private static final String ATT_OA_LOGINTRY = "LoginTry"; + /** Maximum permitted login tries */ + private static final int MAX_OA_LOGINTRY = 3; + /** Name of the Attribute for authorization value for further connections*/ + private static final String ATT_OA_AUTHORIZATION_HEADER = "authorizationkey"; + /** Name of the Attribute for user binding */ + private static final String ATT_OA_USER_BINDING = "UserBinding"; + /** For extended internal debug messages */ + private static final boolean INTERNAL_DEBUG = false; + /** Message to be given if browser login failed */ + private static final String RET_401_MSG = "Ein Fehler ist aufgetreten

Fehler bei der Anmeldung

Bei der Anmeldung ist ein Fehler aufgetreten.

Fehler bei der Anmeldung.
Prüfen Sie bitte ihre Berechtigung.
Abbruch durch den Benutzer.

"; + + /** + * @see javax.servlet.http.HttpServlet#service(HttpServletRequest, HttpServletResponse) + */ + protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + Logger.debug("getRequestURL:" + req.getRequestURL().toString()); + try { + if (req.getParameter(PARAM_SAMLARTIFACT) != null) { + // check if SAML Artifact was already used in this session (in case of page reload) + HttpSession session = req.getSession(); + if (null != session && req.getParameter(PARAM_SAMLARTIFACT).equals(session.getAttribute(ATT_SAML_ARTIFACT))) { + if (session.getAttribute(ATT_BROWSERREQU)==null) { + tunnelRequest(req, resp); + }else{ + login(req, resp); //login after browser login dialog + } + } else + // it is the first time that the SAML Artifact was used + login(req, resp); + } + else + tunnelRequest(req, resp); + } + catch (MOAIDException ex) { + handleError(ex.getMessage(), ex, req, resp); + } + catch (Throwable ex) { + handleError(ex.getMessage(), ex, req, resp); + } + } + + /** + * Login to online application at first call of servlet for a user session.
+ *
    + *
  • Acquires authentication data from the MOA-ID Auth component.
  • + *
  • Reads configuration data for the online application.
  • + *
  • Resolves login parameters.
  • + *
  • Sets up an SSLSocketFactory in case of a secure connection to the online application.
  • + *
  • For a stateless online application, stores data in the HttpSession.
  • + *
  • Tunnels the request to the online application.
  • + *
+ * @param req + * @param resp + * @throws ConfigurationException when wrong configuration is encountered + * @throws ProxyException when wrong configuration is encountered + * @throws BuildException while building the request for MOA-ID Auth + * @throws ServiceException while invoking MOA-ID Auth + * @throws ParseException while parsing the response from MOA-ID Auth + */ + private void login(HttpServletRequest req, HttpServletResponse resp) throws ConfigurationException, ProxyException, BuildException, ServiceException, ParseException, AuthenticationException { + + HttpSession session = req.getSession(); + String samlArtifact = ""; + Map loginHeaders = null; + Map loginParameters = null; + String publicURLPrefix = ""; + String realURLPrefix = ""; + SSLSocketFactory ssf = null; + String urlRequested = req.getRequestURL().toString(); + OAConfiguration oaConf = null; + String loginType = ""; + String binding = ""; + + if (session.getAttribute(ATT_BROWSERREQU)==null) { + + samlArtifact = req.getParameter(PARAM_SAMLARTIFACT); + Logger.debug("moa-id-proxy login " + PARAM_SAMLARTIFACT + ": " + samlArtifact); + // String target = req.getParameter(PARAM_TARGET); parameter given but not processed + // boolean targetprovided = req.getParameter(PARAM_TARGET) != null; + + // get authentication data from the MOA-ID Auth component + AuthenticationData authData; + try { + authData = new GetAuthenticationDataInvoker().getAuthenticationData(samlArtifact); + } catch (ServiceException ex) { + throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); + } catch (ProxyException ex) { + throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); + } + session.setAttribute(ATT_AUTHDATAFETCHED, "true"); + + // read configuration data + ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); + OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(urlRequested); + if (oaParam == null) { + throw new ProxyException("proxy.02", new Object[] { urlRequested }); + } + publicURLPrefix = oaParam.getPublicURLPrefix(); + Logger.debug("OA: " + publicURLPrefix); + oaConf = oaParam.getOaConfiguration(); + ConnectionParameter oaConnParam = oaParam.getConnectionParameter(); + realURLPrefix = oaConnParam.getUrl(); + + // resolve login parameters to be forwarded to online application + LoginParameterResolver lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); + String clientIPAddress = req.getRemoteAddr(); + boolean businessService = oaParam.getBusinessService(); + try { + if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { + loginParameters = lpr.getAuthenticationParameters(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); + } else { + loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); + for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { + //extract user-defined bindingValue + String headerKey = (String) iter.next(); + String headerKeyValue = (String) loginHeaders.get(headerKey); + if (headerKey.equalsIgnoreCase("binding")) { + binding = (String) loginHeaders.get(headerKey); + } + for (int i = 1; i <= 3; i++) { + if (headerKey.equalsIgnoreCase("param" + i)) { + int sep = headerKeyValue.indexOf("="); + if (sep>-1) { + if (sep>0) { + String value = ""; + if (headerKeyValue.length()>sep+1) value = headerKeyValue.substring(sep+1); + if (loginParameters == null) loginParameters = new HashMap(); + loginParameters.put(headerKeyValue.substring(0,sep) , value); + } + } else { + loginParameters.put(headerKey, ""); + } + } + } + } + loginHeaders.remove("binding"); + loginHeaders.remove("param1"); + loginHeaders.remove("param2"); + loginHeaders.remove("param3"); + } + } catch (LoginParameterResolverException ex) { + throw new ProxyException("proxy.13", new Object[] { publicURLPrefix }); + } catch (NotAllowedException e) { + throw new ProxyException("proxy.15", new Object[] { }); + } + + // setup SSLSocketFactory for communication with the online application + if (oaConnParam.isHTTPSURL()) { + try { + ssf = SSLUtils.getSSLSocketFactory(proxyConf, oaConnParam); + } catch (Throwable ex) { + throw new ProxyException( + "proxy.05", + new Object[] { oaConnParam.getUrl(), ex.toString()}, + ex); + } + } + + // for stateless online application, store data in HttpSession + loginType = oaConf.getLoginType(); + if ("".equalsIgnoreCase(binding)) { + binding = oaConf.getBinding(); + if ("".equalsIgnoreCase(binding)) binding = "full"; + } + Logger.debug("Login type: " + loginType); + if (loginType.equals(OAConfiguration.LOGINTYPE_STATELESS)) { + int sessionTimeOut = oaParam.getSessionTimeOut(); + if (sessionTimeOut == 0) + sessionTimeOut = 60 * 60; // default 1 h + + session.setMaxInactiveInterval(sessionTimeOut); + session.setAttribute(ATT_PUBLIC_URLPREFIX, publicURLPrefix); + session.setAttribute(ATT_REAL_URLPREFIX, realURLPrefix); + session.setAttribute(ATT_SSL_SOCKET_FACTORY, ssf); + session.setAttribute(ATT_LOGIN_HEADERS, loginHeaders); + session.setAttribute(ATT_LOGIN_PARAMETERS, loginParameters); + session.setAttribute(ATT_SAML_ARTIFACT, samlArtifact); + session.setAttribute(ATT_OA_CONF, oaConf); + session.setAttribute(ATT_OA_LOGINTYPE, loginType); + session.setAttribute(ATT_OA_USER_BINDING, binding); + session.removeAttribute(ATT_BROWSERREQU); + session.removeAttribute(ATT_OA_AUTHORIZATION_HEADER); + session.removeAttribute(ATT_OA_LOGINTRY); + Logger.debug("moa-id-proxy: HTTPSession " + session.getId() + " angelegt"); + } + + } else { + loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); + publicURLPrefix = (String) session.getAttribute(ATT_PUBLIC_URLPREFIX); + realURLPrefix = (String) session.getAttribute(ATT_REAL_URLPREFIX); + ssf = (SSLSocketFactory) session.getAttribute(ATT_SSL_SOCKET_FACTORY); + loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); + loginParameters = (Map) session.getAttribute(ATT_LOGIN_PARAMETERS); + samlArtifact = (String) session.getAttribute(ATT_SAML_ARTIFACT); + oaConf = (OAConfiguration) session.getAttribute(ATT_OA_CONF); + loginType = (String) session.getAttribute(ATT_OA_LOGINTYPE); + binding = (String) session.getAttribute(ATT_OA_USER_BINDING); + session.removeAttribute(ATT_BROWSERREQU); + Logger.debug("moa-id-proxy: HTTPSession " + session.getId() + " aufgenommen"); + } + + try { + int respcode = 0; + + // tunnel request to the online application + respcode = tunnelRequest(req, resp, loginHeaders, loginParameters, publicURLPrefix, realURLPrefix, ssf, binding); + if (respcode == 401) { + if (OAConfiguration.BINDUNG_FULL.equals(binding) && oaConf.getLoginType().equals(OAConfiguration.LOGINTYPE_STATELESS)) { + throw new ProxyException("proxy.12", new Object[] { realURLPrefix }); + } + } + } catch (ProxyException ex) { + throw new ProxyException("proxy.12", new Object[] { realURLPrefix }); + } catch (Throwable ex) { + throw new ProxyException("proxy.04", new Object[] { urlRequested, ex.toString()}, ex); + } + } + + /** + * Tunnels a request to the stateless online application using data stored in the HTTP session. + * @param req HTTP request + * @param resp HTTP response + * @throws IOException if an I/O error occurs + */ + private void tunnelRequest(HttpServletRequest req, HttpServletResponse resp) throws ProxyException, IOException { + + //Logger.debug("Tunnel request (stateless)"); + HttpSession session = req.getSession(false); + + if (session == null) + throw new ProxyException("proxy.07", null); + String publicURLPrefix = (String) session.getAttribute(ATT_PUBLIC_URLPREFIX); + //A session is automatically created when forwarded 1st time to errorpage-proxy.jsp (with the handleError method) + //additional check if publicURLPrefix is OK, if not throw an Exception + if (publicURLPrefix == null) + throw new ProxyException("proxy.07", null); + + String realURLPrefix = (String) session.getAttribute(ATT_REAL_URLPREFIX); + SSLSocketFactory ssf = (SSLSocketFactory) session.getAttribute(ATT_SSL_SOCKET_FACTORY); + Map loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); + Map loginParameters = (Map) session.getAttribute(ATT_LOGIN_PARAMETERS); + String binding = (String) session.getAttribute(ATT_OA_USER_BINDING); + if (publicURLPrefix == null || realURLPrefix == null) + throw new ProxyException("proxy.08", new Object[] { req.getRequestURL().toString()}); + + int respcode = tunnelRequest(req, resp, loginHeaders, loginParameters, publicURLPrefix, realURLPrefix, ssf, binding); + if (respcode == -401) // #tries to login exceeded + throw new ProxyException("proxy.16", new Object[] {realURLPrefix, Integer.toString(MAX_OA_LOGINTRY)}); + } + +/** + * Tunnels a request to the online application using given URL mapping and SSLSocketFactory. + * This method returns the ResponseCode of the request to the online application. + * @param req HTTP request + * @param resp HTTP response + * @param loginHeaders header field/values to be inserted for purposes of authentication; + * may be null + * @param loginParameters parameter name/values to be inserted for purposes of authentication; + * may be null + * @param publicURLPrefix prefix of request URL to be substituted for the realURLPrefix + * @param realURLPrefix prefix of online application URL to substitute the publicURLPrefix + * @param ssf SSLSocketFactory to use + * @throws IOException if an I/O error occurs + */ +private int tunnelRequest(HttpServletRequest req, HttpServletResponse resp, Map loginHeaders, Map loginParameters, String publicURLPrefix, String realURLPrefix, SSLSocketFactory ssf, String binding) + throws IOException { + + String originBinding = binding; + String browserUserID = ""; + String browserPassword = ""; + //URL url = new URL(realURLPrefix); + //String realURLHost = url.getHost(); + if (INTERNAL_DEBUG && !binding.equals("")) Logger.debug("Binding: " + binding); + + // collect headers from request + Map headers = new HashMap(); + for (Enumeration enu = req.getHeaderNames(); enu.hasMoreElements();) { + String headerKey = (String) enu.nextElement(); + String headerKeyValue = req.getHeader(headerKey); + if (INTERNAL_DEBUG) Logger.debug("Incoming:" + headerKey + "=" + headerKeyValue); + //Analyze Basic-Auth-Headers from the client + if (headerKey.equalsIgnoreCase("Authorization")) { + if (headerKeyValue.substring(0,6).equalsIgnoreCase("Basic ")) { + String credentials = headerKeyValue.substring(6); + byte [] bplaintextcredentials = Base64Utils. decode(credentials, true); + String plaintextcredentials = new String(bplaintextcredentials); + browserUserID = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); + browserPassword = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); + //deactivate following line for security + //if (INTERNAL_DEBUG) Logger.debug("Analyzing authorization-header from browser: " + headerKeyValue + "gives UN:PW=" + browserUserID + ":" + browserPassword ); + } + if (headerKeyValue.substring(0,9).equalsIgnoreCase("Negotiate")) { + //deactivate following line for security + //if (INTERNAL_DEBUG) Logger.debug("Analyzing authorization-header from browser: Found NTLM Aut.: " + headerKeyValue + "gives UN:PW=" + browserUserID + ":" + browserPassword ); + } + } + else + { + /* Headers MUST NOT be repaced according to our Spec. + if (headerKey.equalsIgnoreCase("Host")) { + headerKeyValue = realURLHost; + //headerKeyValue= realURLPrefix.substring(hoststartpos); + if (INTERNAL_DEBUG) Logger.debug("replaced:" + headerKey + "=" + headerKeyValue); + } + */ + headers.put(headerKey, headerKeyValue); + } + } + + + // collect login headers, possibly overwriting headers from request + String authorizationvalue=""; + if (req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER)==null) { + + if (OAConfiguration.BINDUNG_NOMATCH.equals(binding)) { + int loginTry = getLoginTry(req); + Logger.debug("Binding: mode = " + OAConfiguration.BINDUNG_NOMATCH + "(try #" + Integer.toString(loginTry) + ")"); + if (loginTry==1) { + binding = OAConfiguration.BINDUNG_FULL; + } else { + binding = OAConfiguration.BINDUNG_USERNAME; + } + } + + /* Soll auch bei anderen bindings zuerst ein passwort probiert werden können: + //if we have the first Login-Try and we have Binding to Username and a predefined Password we try this one first + // full binding will be covered by next block + if (loginTry==1 && !OAConfiguration.BINDUNG_FULL.equals(binding)) { + //1st try: if we have a password, try this one first + for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { + String headerKey = (String) iter.next(); + String headerKeyValue = (String) loginHeaders.get(headerKey); + if (isBasicAuthenticationHeader(headerKey, headerKeyValue)) { + String credentials = headerKeyValue.substring(6); + byte [] bplaintextcredentials = Base64Utils.decode(credentials, true); + String plaintextcredentials = new String(bplaintextcredentials); + String password = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); + if (password!=null && !password.equals("")) { + Logger.debug("Binding: found predefined password. Trying full binding first"); + binding = OAConfiguration.BINDUNG_FULL; + break; + } + } + } + } + */ + + + + //we have a connection with not having logged on + if (loginHeaders != null && (browserPassword.length()!=0 || browserUserID.length()!=0 || OAConfiguration.BINDUNG_FULL.equals(binding))) { + for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { + String headerKey = (String) iter.next(); + String headerKeyValue = (String) loginHeaders.get(headerKey); + //customize loginheaders if necessary + if (isBasicAuthenticationHeader(headerKey, headerKeyValue)) + { + if (OAConfiguration.BINDUNG_FULL.equals(binding)) { + authorizationvalue = headerKeyValue; + Logger.debug("Binding: full binding to user established"); + } else { + String credentials = headerKeyValue.substring(6); + byte [] bplaintextcredentials = Base64Utils.decode(credentials, true); + String plaintextcredentials = new String(bplaintextcredentials); + String userID = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); + String password = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); + String userIDPassword = ":"; + if (OAConfiguration.BINDUNG_USERNAME.equals(binding)) { + Logger.debug("Binding: Access with necessary binding to user"); + userIDPassword = userID + ":" + browserPassword; + } else if (OAConfiguration.BINDUNG_NONE.equals(binding)) { + Logger.debug("Binding: Access without binding to user"); + //If first time + if (browserUserID.length()==0) browserUserID = userID; + if (browserPassword.length()==0) browserPassword = password; + userIDPassword = browserUserID + ":" + browserPassword; + } else { + userIDPassword = userID + ":" + password; + } + credentials = Base64Utils.encode(userIDPassword.getBytes()); + authorizationvalue = "Basic " + credentials; + headerKeyValue = authorizationvalue; + } + } + headers.put(headerKey, headerKeyValue); + } + } + }else{ + //if OA needs Authorization header in each further request + authorizationvalue = (String) req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER); + if (loginHeaders != null) headers.put("Authorization", authorizationvalue); + } + + + Vector parameters = new Vector(); + + for (Enumeration enu = req.getParameterNames(); enu.hasMoreElements();) { + String paramName = (String) enu.nextElement(); + if (!(paramName.equals(PARAM_SAMLARTIFACT) || paramName.equals(PARAM_TARGET))) { + if (INTERNAL_DEBUG) Logger.debug("Req Parameter-put: " + paramName + ":" + req.getParameter(paramName)); + String parameter[] = new String[2]; + parameter[0]= paramName; + parameter[1]= req.getParameter(paramName); + parameters.add(parameter); + } + } + // collect login parameters, possibly overwriting parameters from request + if (loginParameters != null) { + for (Iterator iter = loginParameters.keySet().iterator(); iter.hasNext();) { + String paramName = (String) iter.next(); + if (!(paramName.equals(PARAM_SAMLARTIFACT) || paramName.equals(PARAM_TARGET))) { + if (INTERNAL_DEBUG) Logger.debug("Req Login-Parameter-put: " + paramName + ":" + loginParameters.get(paramName)); + String parameter[] = new String[2]; + parameter[0]= paramName; + parameter[1]= (String) loginParameters.get(paramName); + parameters.add(parameter); + } + } + } + + ConnectionBuilder cb = ConnectionBuilderFactory.getConnectionBuilder(publicURLPrefix); + HttpURLConnection conn = cb.buildConnection(req, publicURLPrefix, realURLPrefix, ssf, parameters); + + // set headers as request properties of URLConnection + for (Iterator iter = headers.keySet().iterator(); iter.hasNext();) { + String headerKey = (String) iter.next(); + String headerValue = (String) headers.get(headerKey); + String LogStr = "Req header " + headerKey + ": " + headers.get(headerKey); + if (isBasicAuthenticationHeader(headerKey, headerValue)) { + String credentials = headerValue.substring(6); + byte [] bplaintextcredentials = Base64Utils. decode(credentials, true); + String plaintextcredentials = new String(bplaintextcredentials); + String uid = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); + String pwd = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); + //Sollte AuthorizationInfo vom HTTPClient benutzt werden: cb.addBasicAuthorization(publicURLPrefix, uid, pwd); + //deactivate following line for security + //if (INTERNAL_DEBUG && Logger.isDebugEnabled()) LogStr = LogStr + " >UserID:Password< >" + uid + ":" + pwd + "<"; + } + conn.setRequestProperty(headerKey, headerValue); + if (INTERNAL_DEBUG) Logger.debug(LogStr); + } + + StringWriter sb = new StringWriter(); + + // Write out parameters into output stream of URLConnection. + // On GET request, do not send parameters in any case, + // otherwise HttpURLConnection would send a POST. + if (!"get".equalsIgnoreCase(req.getMethod()) && !parameters.isEmpty()) { + boolean firstParam = true; + String parameter[] = new String[2]; + for (Iterator iter = parameters.iterator(); iter.hasNext();) { + parameter = (String[]) iter.next(); + String paramName = parameter[0]; + String paramValue = parameter[1]; + if (firstParam) + firstParam = false; + else + sb.write("&"); + sb.write(paramName); + sb.write("="); + sb.write(paramValue); + if (INTERNAL_DEBUG) Logger.debug("Req param " + paramName + ": " + paramValue); + } + } + + // For WebDAV and POST: copy content + if (!"get".equalsIgnoreCase(req.getMethod())) { + if (INTERNAL_DEBUG && !"post".equalsIgnoreCase(req.getMethod())) Logger.debug("---- WEBDAV ---- copying content"); + try { + OutputStream out = conn.getOutputStream(); + InputStream in = req.getInputStream(); + if (!parameters.isEmpty()) out.write(sb.toString().getBytes()); //Parameter nicht mehr mittels Printwriter schreiben + copyStream(in, out, null, req.getMethod()); + out.flush(); + out.close(); + } catch (IOException e) { + if (!"post".equalsIgnoreCase(req.getMethod())) + Logger.debug("---- WEBDAV ---- streamcopy problem"); + else + Logger.debug("---- POST ---- streamcopy problem"); + } + } + + // connect + if (INTERNAL_DEBUG) Logger.debug("Connect Request"); + conn.connect(); + if (INTERNAL_DEBUG) Logger.debug("Connect Response"); + + // check login tries + if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { + int loginTry = getLoginTry(req); + req.getSession().setAttribute(ATT_OA_LOGINTRY, Integer.toString(loginTry)); + if (loginTry > MAX_OA_LOGINTRY) { + Logger.debug("Found 401 UNAUTHORIZED, maximum tries exceeded; leaving..."); + cb.disconnect(conn); + return -401; + } + } + + + + if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED && OAConfiguration.BINDUNG_FULL.equals(originBinding)) { + Logger.debug("Found 401 UNAUTHORIZED, leaving..."); + cb.disconnect(conn); + return conn.getResponseCode(); + } + + + resp.setStatus(conn.getResponseCode()); + resp.setContentType(conn.getContentType()); + + if (loginHeaders != null && (conn.getResponseCode()==HttpURLConnection.HTTP_OK || conn.getResponseCode()==HttpURLConnection.HTTP_MOVED_TEMP) && req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER)==null) { + req.getSession().setAttribute(ATT_OA_AUTHORIZATION_HEADER, authorizationvalue); + Logger.debug("Login OK. Saving authorization header to remember in further requests"); + } + + // Read response headers + // Omit response header "content-length" if response header "Transfer-encoding: chunked" is set. + // Otherwise, the connection will not be kept alive, resulting in subsequent missing requests. + // See JavaDoc of javax.servlet.http.HttpServlet: + // When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. + Vector respHeaders = new Vector(); + + boolean chunked = false; + String contentLengthKey = null; + String transferEncodingKey = null; + int i = 1; + String headerKey; + String loginType = (String) req.getSession().getAttribute(ATT_OA_LOGINTYPE); + while ((headerKey = conn.getHeaderFieldKey(i)) != null) { + String headerValue = conn.getHeaderField(i); + // Überschrift im Browser-Passworteingabedialog setzen (sonst ist der reale host eingetragen) + if (headerKey.equalsIgnoreCase("WWW-Authenticate") && headerValue.startsWith("Basic realm=\"")) { + headerValue = "Basic realm=\"" + publicURLPrefix + "\""; + if (OAConfiguration.BINDUNG_USERNAME.equals(originBinding) || OAConfiguration.BINDUNG_NOMATCH.equals(originBinding)) { + headerValue = "Basic realm=\"Bitte Passwort eingeben\""; + } else if (OAConfiguration.BINDUNG_NONE.equals(originBinding)) { + headerValue = "Basic realm=\"Bitte Benutzername und Passwort eingeben\""; + } + } + String respHeader[] = new String[2]; + if ((conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) && headerKey.equalsIgnoreCase("content-length")) { + //alter the unauthorized message with template for login + //TODO: supply a special login form on unauthorized messages with bindings!=full + headerValue = Integer.toString(RET_401_MSG.length()); + } + respHeader[0]= headerKey; + respHeader[1]= headerValue; + + if (!(OAConfiguration.BINDUNG_FULL.equals(originBinding) && OAConfiguration.LOGINTYPE_STATELESS.equals(loginType) && headerKey.equalsIgnoreCase("WWW-Authenticate") && headerValue.startsWith("Basic realm=\""))) { + respHeaders.add(respHeader); + if (INTERNAL_DEBUG) Logger.debug("Resp header " + headerKey + ": " + headerValue); + } else { + Logger.debug("Resp header ---REMOVED--- " + headerKey + ": " + headerValue); + } + if (isTransferEncodingChunkedHeader(headerKey, headerValue)) { + chunked = true; + transferEncodingKey = headerKey; + } + if ("content-length".equalsIgnoreCase(headerKey)) + contentLengthKey = headerKey; + i++; + } + if (chunked && contentLengthKey != null) { + respHeaders.remove(transferEncodingKey); + Logger.debug("Resp header " + transferEncodingKey + " REMOVED"); + } + + String headerValue; + String respHeader[] = new String[2]; + + //write out all Responseheaders + for (Iterator iter = respHeaders.iterator(); iter.hasNext();) { + respHeader = (String[]) iter.next(); + headerKey = respHeader[0]; + headerValue = respHeader[1]; + resp.addHeader(headerKey, headerValue); + } + + //Logger.debug(">>>> Copy Content"); + //Logger.debug(" from ()" + conn.getURL()); + //Logger.debug(" to (" + req.getRemoteAddr() + ":"+ ") " +req.getRequestURL()); + + // read response stream + Logger.debug("Resp from " + conn.getURL().toString() + ": status " + conn.getResponseCode()); + // Load content unless the server lets us know that the content is NOT MODIFIED... + if (conn.getResponseCode()!=HttpURLConnection.HTTP_NOT_MODIFIED ) { + BufferedInputStream respIn = new BufferedInputStream(conn.getInputStream()); + //Logger.debug("Got Inputstream"); + BufferedOutputStream respOut = new BufferedOutputStream(resp.getOutputStream()); + //Logger.debug("Got Outputstream"); + + byte [] buffer = new byte[4096]; + if (respOut != null) { + int bytesRead; + while ((bytesRead = respIn.read(buffer)) >= 0) { + if (conn.getResponseCode()!=HttpURLConnection.HTTP_UNAUTHORIZED) respOut.write(buffer, 0, bytesRead); + } + } else { + while (respIn.read(buffer) >= 0); + } + + + /* + int ch; + StringBuffer strBuf = new StringBuffer(""); + while ((ch = respIn.read()) >= 0) { + if (conn.getResponseCode()!=HttpURLConnection.HTTP_UNAUTHORIZED) respOut.write(ch); + strBuf.append((char)ch); + } + Logger.debug("Resp Content:"); + if (strBuf.toString().length()>500) + Logger.debug(strBuf.toString().substring(0,500)); + else + Logger.debug(strBuf.toString()); + */ + + + if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { + respOut.write(RET_401_MSG.getBytes()); + } + respOut.flush(); + respOut.close(); + respIn.close(); + if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { + Logger.debug("Found 401 UNAUTHORIZED..."); + cb.disconnect(conn); + return conn.getResponseCode(); + } + } else { + //if (conn.getResponseCode()==HttpURLConnection.HTTP_NOT_MODIFIED) + Logger.debug("Found 304 NOT MODIFIED..."); + } + + cb.disconnect(conn); + Logger.debug("Request done"); + + return conn.getResponseCode(); +} + +/** + * Gets the current amount of the login try at the online application + * + * @param req the HttpServletRequest + * @return the number off the current login try + */ +private int getLoginTry(HttpServletRequest req) { + String oa_loginTry = (String) req.getSession().getAttribute(ATT_OA_LOGINTRY); + int loginTry = 1; + if (oa_loginTry!=null) loginTry = Integer.parseInt(oa_loginTry)+1; + return loginTry; +} +/** + * Determines whether a HTTP header is a basic authentication header of the kind "Authorization: Basic ..." + * + * @param headerKey header name + * @param headerValue header value + * @return true for a basic authentication header + */ +private boolean isBasicAuthenticationHeader(String headerKey, String headerValue) { + if (!"authorization".equalsIgnoreCase(headerKey)) + return false; + if (headerValue.length() < "basic".length()) + return false; + String authenticationSchema = headerValue.substring(0, "basic".length()); + return "basic".equalsIgnoreCase(authenticationSchema); +} +/** + * Determines whether a basic authentication header of the kind "Authorization: Basic ..." + * is included in a HTTP request + * @param req HTTP request + * @return true for a basic authentication header provided + */ +private boolean isBasicAuthenticationHeaderProvided(HttpServletRequest req) { + for (Enumeration enu = req.getHeaderNames(); enu.hasMoreElements();) { + String headerKey = (String) enu.nextElement(); + String headerValue = req.getHeader(headerKey); + if (isBasicAuthenticationHeader(headerKey, headerValue)) + return true; + } + return false; +} +/** + * Determines whether a HTTP header is "Transfer-encoding" header with value containing "chunked" + * + * @param headerKey header name + * @param headerValue header value + * @return true for a "Transfer-encoding: chunked" header + */ +private boolean isTransferEncodingChunkedHeader(String headerKey, String headerValue) { + if (!"transfer-encoding".equalsIgnoreCase(headerKey)) + return false; + return headerValue.indexOf("chunked") >= 0 || headerValue.indexOf("Chunked") >= 0 || headerValue.indexOf("CHUNKED") >= 0; +} + +/** + * Calls the web application initializer. + * + * @see javax.servlet.Servlet#init(ServletConfig) + */ +public void init(ServletConfig servletConfig) throws ServletException { + super.init(servletConfig); + try { + MOAIDProxyInitializer.initialize(); + Logger.info(MOAIDMessageProvider.getInstance().getMessage("proxy.00", null)); + } + catch (Exception ex) { + Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("proxy.06", null), ex); + throw new ServletException(ex); + } +} + +/** + * Handles an error.
+ *
    + *
  • Logs the error
  • + *
  • Places error message and exception thrown into the request + * as request attributes (to be used by "/errorpage-proxy.jsp")
  • + *
  • Sets HTTP status 500 (internal server error)
  • + *
+ * + * @param errorMessage error message + * @param exceptionThrown exception thrown + * @param req servlet request + * @param resp servlet response + */ +protected void handleError( + String errorMessage, Throwable exceptionThrown, HttpServletRequest req, HttpServletResponse resp) { + + + if(null != errorMessage) { + Logger.error(errorMessage); + req.setAttribute("ErrorMessage", errorMessage ); + } + + if (null != exceptionThrown) { + if(null == errorMessage) errorMessage = exceptionThrown.getMessage(); + Logger.error(errorMessage, exceptionThrown); + //req.setAttribute("ExceptionThrown", exceptionThrown); + } + + //forward this to errorpage-proxy.jsp where the HTML error page is generated + ServletContext context = getServletContext(); + RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-proxy.jsp"); + try { + dispatcher.forward(req, resp); + } catch (ServletException e) { + Logger.error(e); + } catch (IOException e) { + Logger.error(e); + } + +} + + +// * taken from iaik.utils.util.copyStream: +/** + * Reads all data (until EOF is reached) from the given source to the + * destination stream. If the destination stream is null, all data is dropped. + * It uses the given buffer to read data and forward it. If the buffer is + * null, this method allocates a buffer. + * + * @param source The stream providing the data. + * @param destination The stream that takes the data. If this is null, all + * data from source will be read and discarded. + * @param buffer The buffer to use for forwarding. If it is null, the method + * allocates a buffer. + * @exception IOException If reading from the source or writing to the + * destination fails. + */ +private static void copyStream(InputStream source, OutputStream destination, byte[] buffer, String method) throws IOException { + if (source == null) { + throw new NullPointerException("Argument \"source\" must not be null."); + } + if (buffer == null) { + buffer = new byte[4096]; + } + + if (destination != null) { + int bytesRead; + while ((bytesRead = source.read(buffer)) >= 0) { + destination.write(buffer, 0, bytesRead); + //if (method.equalsIgnoreCase("POST")) Logger.debug(buffer.toString()); + } + } else { + while (source.read(buffer) >= 0); + } +} + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java new file mode 100644 index 000000000..954a87e62 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AxisSecureSocketFactory.java @@ -0,0 +1,212 @@ +package at.gv.egovernment.moa.id.util; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.Socket; +import java.security.GeneralSecurityException; +import java.util.Hashtable; + +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +import org.apache.axis.components.net.BooleanHolder; +import org.apache.axis.components.net.DefaultSocketFactory; +import org.apache.axis.components.net.SecureSocketFactory; +import org.apache.axis.components.net.TransportClientProperties; +import org.apache.axis.components.net.TransportClientPropertiesFactory; +import org.apache.axis.utils.Messages; +import org.apache.axis.utils.XMLUtils; + +import at.gv.egovernment.moa.logging.Logger; + +/** + * Secure socket factory for Axis webs service clients of the MOA-ID component, + * which are the MOA-SP calls from MOA-ID Auth, + * and the MOA-ID Auth calls from MOA-ID Proxy. + *
Use this initialization code:
+ * // ConnectionParameter connParam = ... get from ConfigurationProvider + * AxisSecureSocketFactory.initialize(connParam); + *
See the Apache Axis documentation on how to configure this class + * as the default secure socket factory to be used by Axis. + *
+ * This code has been copied from JSSESocketFactory, the + * method initialize() has been added. + * + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class AxisSecureSocketFactory + extends DefaultSocketFactory implements SecureSocketFactory { + + /** Field sslFactory */ + private static SSLSocketFactory sslFactory; + + /** + * Constructor for AxisSecureSocketFactory. + * @param attributes ??? + */ + public AxisSecureSocketFactory(Hashtable attributes) { + super(attributes); + } + /** + * Initializes the factory by setting the connection parameters to be used for + * setting the secure socket factory, and by setting the system property + * axis.socketSecureFactory. + * @param ssf SSLSocketFactory to initialize with + */ + public static void initialize(SSLSocketFactory ssf) + throws IOException, GeneralSecurityException { + + Logger.debug("Initialize AxisSecureSocketFactory"); + sslFactory = ssf; + } + + /** + * creates a secure socket + * + * @param host + * @param port + * @param otherHeaders + * @param useFullURL + * + * @return Socket + * @throws Exception + */ + public Socket create( + String host, + int port, + StringBuffer otherHeaders, + BooleanHolder useFullURL) + throws Exception { + if (port == -1) { + port = 443; + } + + TransportClientProperties tcp = + TransportClientPropertiesFactory.create("https"); + + boolean hostInNonProxyList = + isHostInNonProxyList(host, tcp.getNonProxyHosts()); + + Socket sslSocket = null; + if (tcp.getProxyHost().length() == 0 || hostInNonProxyList) { + // direct SSL connection + sslSocket = sslFactory.createSocket(host, port); + } + else { + + // Default proxy port is 80, even for https + int tunnelPort = + (tcp.getProxyPort().length() != 0) + ? Integer.parseInt(tcp.getProxyPort()) + : 80; + if (tunnelPort < 0) + tunnelPort = 80; + + // Create the regular socket connection to the proxy + Socket tunnel = new Socket(tcp.getProxyHost(), tunnelPort); + + // The tunnel handshake method (condensed and made reflexive) + OutputStream tunnelOutputStream = tunnel.getOutputStream(); + PrintWriter out = + new PrintWriter( + new BufferedWriter(new OutputStreamWriter(tunnelOutputStream))); + + // More secure version... engage later? + // PasswordAuthentication pa = + // Authenticator.requestPasswordAuthentication( + // InetAddress.getByName(tunnelHost), + // tunnelPort, "SOCK", "Proxy","HTTP"); + // if(pa == null){ + // printDebug("No Authenticator set."); + // }else{ + // printDebug("Using Authenticator."); + // tunnelUser = pa.getUserName(); + // tunnelPassword = new String(pa.getPassword()); + // } + out.print( + "CONNECT " + + host + + ":" + + port + + " HTTP/1.0\r\n" + + "User-Agent: AxisClient"); + if (tcp.getProxyUser().length() != 0 + && tcp.getProxyPassword().length() != 0) { + + // add basic authentication header for the proxy + String encodedPassword = + XMLUtils.base64encode( + (tcp.getProxyUser() + ":" + tcp.getProxyPassword()).getBytes()); + + out.print("\nProxy-Authorization: Basic " + encodedPassword); + } + out.print("\nContent-Length: 0"); + out.print("\nPragma: no-cache"); + out.print("\r\n\r\n"); + out.flush(); + InputStream tunnelInputStream = tunnel.getInputStream(); + + if (log.isDebugEnabled()) { + log.debug( + Messages.getMessage( + "isNull00", + "tunnelInputStream", + "" + (tunnelInputStream == null))); + } + String replyStr = ""; + + // Make sure to read all the response from the proxy to prevent SSL negotiation failure + // Response message terminated by two sequential newlines + int newlinesSeen = 0; + boolean headerDone = false; /* Done on first newline */ + + while (newlinesSeen < 2) { + int i = tunnelInputStream.read(); + + if (i < 0) { + throw new IOException("Unexpected EOF from proxy"); + } + if (i == '\n') { + headerDone = true; + ++newlinesSeen; + } + else if (i != '\r') { + newlinesSeen = 0; + if (!headerDone) { + replyStr += String.valueOf((char) i); + } + } + } + if (!replyStr.startsWith("HTTP/1.0 200") + && !replyStr.startsWith("HTTP/1.1 200")) { + throw new IOException( + Messages.getMessage( + "cantTunnel00", + new String[] { tcp.getProxyHost(), "" + tunnelPort, replyStr })); + } + + // End of condensed reflective tunnel handshake method + sslSocket = sslFactory.createSocket(tunnel, host, port, true); + if (log.isDebugEnabled()) { + log.debug( + Messages.getMessage( + "setupTunnel00", + tcp.getProxyHost(), + "" + tunnelPort)); + } + } + + ((SSLSocket) sslSocket).startHandshake(); + if (log.isDebugEnabled()) { + log.debug(Messages.getMessage("createdSSL00")); + } + return sslSocket; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAConstants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAConstants.java new file mode 100644 index 000000000..c5dad8bc4 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAConstants.java @@ -0,0 +1,36 @@ +/* + * Created on 20.01.2005 + * + * @author rschamberger + * $ID$ + */ +package at.gv.egovernment.moa.id.util; + + +/** + * Class used to define Constants used in Class ECDSAKeyValueConverter + * + * * @author rschamberger + */ +public class ECDSAConstants { + + /* ECDSA Namespace + */ + static String NAMESPACE_ECDSAKEYVALUE_ = "http://www.w3.org/2001/04/xmldsig-more#"; + + /* Schema instance NS + */ + static String NAMESPACE_XSI_ = "http://www.w3.org/2001/XMLSchema-instance"; + + /* ecdsa prefix value + */ + static String NS_PREFIX_ECDSAKEYVALUE_ = "ecdsa"; + + /* namespace namespace + */ + static String NAMESPACE_NAMESPACES_ = "http://www.w3.org/XML/1998/namespace"; + + /* si prefix value + */ + static String NS_PREFIX_XSI_ = "si"; +}; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java new file mode 100644 index 000000000..6fb78edb7 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ECDSAKeyValueConverter.java @@ -0,0 +1,572 @@ +package at.gv.egovernment.moa.id.util; + +import iaik.security.ecc.ecdsa.ECDSAParameter; +import iaik.security.ecc.ecdsa.ECPublicKey; +import iaik.security.ecc.math.ecgroup.AffineCoordinate; +import iaik.security.ecc.math.ecgroup.Coordinate; +import iaik.security.ecc.math.ecgroup.CoordinateTypes; +import iaik.security.ecc.math.ecgroup.ECGroupFactory; +import iaik.security.ecc.math.ecgroup.ECPoint; +import iaik.security.ecc.math.ecgroup.EllipticCurve; +import iaik.security.ecc.math.field.Field; +import iaik.security.ecc.math.field.FieldElement; +import iaik.security.ecc.math.field.PrimeField; +import iaik.security.ecc.parameter.ECCParameterFactory; +import iaik.security.ecc.spec.ECCParameterSpec; + +import java.math.BigInteger; +import java.security.PublicKey; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Vector; + +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class ECDSAKeyValueConverter +{ + + + //TODO enhance javadoc + + /** + * converter class which can be used to convert ECDSA keys encoded in XML + * to a PublicKey data structure + * @param keyValueElem ECDSAKeyValue Element + * @return ECPublicKey encoded in PublicKey data structure + * @throws Exception + */ + public static PublicKey element2ECDSAPublicKey(Element keyValueElem) throws Exception + { + String ecdsaNS = ECDSAConstants.NAMESPACE_ECDSAKEYVALUE_; + + // Domain parameters + Element domainParams = getChildElement(keyValueElem, ecdsaNS, "DomainParameters", 1); + if (domainParams == null) throw new Exception("Domain parameters must not be implicit."); + + Element namedCurve = getChildElement(domainParams, ecdsaNS, "NamedCurve", 1); + ECCParameterSpec eccParameterSpec; + + if (namedCurve != null) + { + // URL curveNameURN = new URL(namedCurve.getAttributeNS(null, "URN")); + String curveNameOID = namedCurve.getAttributeNS(null, "URN").substring(8); + ECCParameterFactory eccParamFactory = ECCParameterFactory.getInstance(); + // eccParameterSpec = eccParamFactory.getParameterByOID(curveNameURN.getPath().substring(4)); + eccParameterSpec = eccParamFactory.getParameterByOID(curveNameOID); + } + else + { + Element excplicitParams = getChildElement(domainParams, ecdsaNS, "ExplicitParams", 1); + Element fieldParams = getChildElement(excplicitParams, ecdsaNS, "FieldParams", 1); + Element curveParams = getChildElement(excplicitParams, ecdsaNS, "CurveParams", 1); + Element basePointParams = getChildElement(excplicitParams, ecdsaNS, "BasePointParams", 1); + + // Field parameters + String fieldParamsTypeStr = fieldParams.getAttributeNS(ECDSAConstants.NAMESPACE_XSI_, "type"); + String ecdsaNSPrefix = getECDSANSPrefix(fieldParams); + BigInteger p = null; + int fieldParamsType = 0; + final int FIELD_TYPE_PRIME = 1; + final int FIELD_TYPE_TNB = 2; + final int FIELD_TYPE_PNB = 3; + int m = -1, k = -1, k1 = -1, k2 = -1, k3 = -1; + if (fieldParamsTypeStr.equals(ecdsaNSPrefix + ":PrimeFieldParamsType")) + { + fieldParamsType = FIELD_TYPE_PRIME; + String pStr = getChildElementText(fieldParams, ecdsaNS, "P", 1); + p = new BigInteger(pStr, 10); + } + else if (fieldParamsTypeStr.equals(ecdsaNSPrefix + ":TnBFieldParamsType")) + { + fieldParamsType = FIELD_TYPE_TNB; + String mStr = getChildElementText(fieldParams, ecdsaNS, "M", 1); + m = Integer.parseInt(mStr); + String kStr = getChildElementText(fieldParams, ecdsaNS, "K", 1); + k = Integer.parseInt(kStr); + } + else if (fieldParamsTypeStr.equals(ecdsaNSPrefix + ":PnBFieldParamsType")) + { + fieldParamsType = FIELD_TYPE_PNB; + String mStr = getChildElementText(fieldParams, ecdsaNS, "M", 1); + m = Integer.parseInt(mStr); + String k1Str = getChildElementText(fieldParams, ecdsaNS, "K1", 1); + k1 = Integer.parseInt(k1Str); + String k2Str = getChildElementText(fieldParams, ecdsaNS, "K2", 1); + k2 = Integer.parseInt(k2Str); + String k3Str = getChildElementText(fieldParams, ecdsaNS, "K3", 1); + k3 = Integer.parseInt(k3Str); + } + else throw new Exception("Unknown field parameters."); + + // Curve parameters + Element aElem = getChildElement(curveParams, ecdsaNS, "A", 1); + String aStr = aElem.getAttributeNS(null, "Value"); + Element bElem = getChildElement(curveParams, ecdsaNS, "B", 1); + String bStr = bElem.getAttributeNS(null, "Value"); + String seedStr = getChildElementText(curveParams, ecdsaNS, "Seed", 1); + BigInteger seed = (seedStr != null) ? new BigInteger(seedStr, 10) : null; + + // Base point parameters + Element basePoint = getChildElement(basePointParams, ecdsaNS, "BasePoint", 1); + Element basePointXElem = getChildElement(basePoint, ecdsaNS, "X", 1); + String basePointXStr = basePointXElem.getAttributeNS(null, "Value"); + Element basePointYElem = getChildElement(basePoint, ecdsaNS, "Y", 1); + String basePointYStr = basePointYElem.getAttributeNS(null, "Value"); + String orderStr = getChildElementText(basePointParams, ecdsaNS, "Order", 1); + BigInteger order = new BigInteger(orderStr, 10); + String cofactorStr = getChildElementText(basePointParams, ecdsaNS, "Cofactor", 1); + BigInteger cofactor = (cofactorStr != null) ? new BigInteger(cofactorStr, 10) : null; + + if (fieldParamsType == FIELD_TYPE_PRIME) + { + BigInteger a = new BigInteger(aStr, 10); + BigInteger b = new BigInteger(bStr, 10); + BigInteger basePointX = new BigInteger(basePointXStr, 10); + BigInteger basePointY = new BigInteger(basePointYStr, 10); + eccParameterSpec = new ECCParameterSpec(p, cofactor, order, seed, null, a, b, basePointX, + basePointY, null); + } + else + { + int[] irreducible = new int[m/32 + ((m % 32 != 0) ? 1 : 0)]; + if (fieldParamsType == FIELD_TYPE_TNB) + { + irreducible[m/32] = 1 << m % 32; + irreducible[k/32] += 1 << k % 32; + irreducible[0] += 1; + } + else + { + irreducible[m/32] = 1 << m % 32; + irreducible[k3/32] += 1 << k3 % 32; + irreducible[k2/32] += 1 << k2 % 32; + irreducible[k1/32] += 1 << k1 % 32; + irreducible[0] += 1; + } + eccParameterSpec = new ECCParameterSpec(irreducible, cofactor, order, octetString2IntArray(aStr), + octetString2IntArray(bStr), octetString2IntArray(basePointXStr), + octetString2IntArray(basePointYStr), null); + } + } + + // Public key + Element publicKeyElem = getChildElement(keyValueElem, ecdsaNS, "PublicKey", 1); + Element publicKeyXElem = getChildElement(publicKeyElem, ecdsaNS, "X", 1); + String publicKeyXStr = publicKeyXElem.getAttributeNS(null, "Value"); + Element publicKeyYElem = getChildElement(publicKeyElem, ecdsaNS, "Y", 1); + String publicKeyYStr = publicKeyYElem.getAttributeNS(null, "Value"); + + ECDSAParameter ecdsaParams = new ECDSAParameter(eccParameterSpec, CoordinateTypes.PROJECTIVE_COORDINATES); + ECGroupFactory ecGroupFactory = ECGroupFactory.getInstance(); + EllipticCurve eCurve = ecGroupFactory.getCurve(eccParameterSpec.getA(), + eccParameterSpec.getB(), eccParameterSpec.getR(), CoordinateTypes.PROJECTIVE_COORDINATES); + Field field = eCurve.getField(); + + // Detect type of public key field elements + String elementType = publicKeyXElem.getAttributeNS(ECDSAConstants.NAMESPACE_XSI_, "type"); + String elementTypeLocalName = elementType.substring(elementType.indexOf(':') + 1); + int FIELD_TYPE_PRIME = 1, FIELD_TYPE_CHAR_TWO = 2; + int fieldElemType = ("PrimeFieldElemType".equals(elementTypeLocalName)) + ? FIELD_TYPE_PRIME + : FIELD_TYPE_CHAR_TWO; + + FieldElement publicKeyPointX, publicKeyPointY; + if (fieldElemType == FIELD_TYPE_PRIME) + { + +// Value xValue = FieldFactory.getInstance().getPrimeFieldValue(new BigInteger(publicKeyXStr, 10)); +// publicKeyPointX = field.newElement(xValue); + PrimeField pf = (PrimeField) field; + publicKeyPointX = pf.newElement(new BigInteger(publicKeyXStr, 10)); +// Value yValue = FieldFactory.getInstance().getPrimeFieldValue(new BigInteger(publicKeyYStr, 10)); +// publicKeyPointY = field.newElement(yValue); + publicKeyPointY = pf.newElement(new BigInteger(publicKeyYStr, 10)); + } + else + { + publicKeyPointX = field.newElement(octetString2ByteArray(publicKeyXStr)); + publicKeyPointY = field.newElement(octetString2ByteArray(publicKeyYStr)); + } +// ProjectiveCoordinate publicKeyPointCoordinate = new ProjectiveCoordinate(publicKeyPointX, +// publicKeyPointY, field.getONEelement()); + Coordinate publicKeyPointCoordinate = new AffineCoordinate(publicKeyPointX, + publicKeyPointY).toProjective(); + ECPoint publicKeyPoint = eCurve.newPoint(publicKeyPointCoordinate); + ECPublicKey publicKey = new ECPublicKey(ecdsaParams, publicKeyPoint); + + return publicKey; + } + + /* ---------------------------------------------------------------------------------------------------- */ + + /* + public static Element publicKey2ECDSAKeyValueElement(boolean implParams, String curveOID, + ECDSAPublicKey publicKey, Document factoryDoc) + { + String ecdsaNS = ECDSAConstants.NAMESPACE_ECDSAKEYVALUE_; + String ecdsaNSP = ECDSAConstants.NS_PREFIX_ECDSAKEYVALUE_; + String nsNS = ECDSAConstants.NAMESPACE_NAMESPACES_; + String xsiNS = ECDSAConstants.NAMESPACE_XSI_; + String xsiNSP = ECDSAConstants.NS_PREFIX_XSI_; + + ECDSAParameter params = (ECDSAParameter)publicKey.getParameter(); + EllipticCurve curve = params.getG().getCurve(); + Field field = curve.getField(); + int fieldId = curve.getField().getFieldId(); + + Element eCDSAKeyValue = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":ECDSAKeyValue"); + eCDSAKeyValue.setAttributeNS(nsNS, "xmlns:" + ecdsaNSP, ecdsaNS); + eCDSAKeyValue.setAttributeNS(nsNS, "xmlns:" + xsiNSP, xsiNS); + + // Detect field type + int coeffPositions[] = new int[3]; + int fieldType = 0; + String fieldElemTypeString = null; + final int FT_PRIME = 1, FT_TNB = 2, FT_PNB = 3; + if (fieldId == Field.PRIME_FIELD) + { + fieldType = FT_PRIME; + fieldElemTypeString = ecdsaNSP + ":PrimeFieldElemType"; + } + else + { + // Get irreducible polynomal + BinaryField binaryField = (BinaryField)field; + BinaryFieldValue irreducible = binaryField.getIrreducible(); + + // Get coefficients of irreducible polynomal + int order = irreducible.getOrder(); + int coeffCount = 2; + for (int i = 1; i < order - 1; i++) + { + if (irreducible.testBit(i)) + { + coeffPositions[coeffCount - 2] = i; + coeffCount++; + if (coeffCount == 5) break; + } + } + + // Set polynomal type (TNB or + fieldType = (coeffCount == 3) ? FT_TNB : FT_PNB; + fieldElemTypeString = ecdsaNSP + ":CharTwoFieldElemType"; + } + + if (!implParams) + { + Element domainParameters = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":DomainParameters"); + eCDSAKeyValue.appendChild(factoryDoc.createTextNode("\n ")); + eCDSAKeyValue.appendChild(domainParameters); + + if (curveOID != null) + { + // Named curve + Element namedCurve = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":NamedCurve"); + namedCurve.setAttributeNS(null, "URN", "urn:oid:" + curveOID); + domainParameters.appendChild(factoryDoc.createTextNode("\n ")); + domainParameters.appendChild(namedCurve); + domainParameters.appendChild(factoryDoc.createTextNode("\n ")); + } + else + { + // Explicit parameters + Element explicitParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":ExplicitParams"); + + // Field parameters + Element fieldParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":FieldParams"); + explicitParams.appendChild(factoryDoc.createTextNode("\n ")); + explicitParams.appendChild(fieldParams); + + if (fieldType == FT_PRIME) + { + fieldParams.setAttributeNS(xsiNS, xsiNSP + ":type", ecdsaNSP + ":PrimeFieldParamsType"); + Element p = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":P"); + p.appendChild(factoryDoc.createTextNode(curve.getField().getSize().toString(10))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(p); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + } + else if (fieldType == FT_TNB) + { + fieldParams.setAttributeNS(xsiNS, xsiNSP + ":type", ecdsaNSP + ":TnBFieldParamsType"); + Element m = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":M"); + m.appendChild(factoryDoc.createTextNode(Integer.toString(curve.getField().getOrder()))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(m); + + Element k = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K"); + k.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[0], 10))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(k); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + } + else + { + fieldParams.setAttributeNS(xsiNS, xsiNSP + ":type", ecdsaNSP + ":PnBFieldParamsType"); + Element m = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":M"); + m.appendChild(factoryDoc.createTextNode(Integer.toString(curve.getField().getOrder()))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(m); + + Element k1 = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K1"); + k1.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[0]))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(k1); + + Element k2 = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K2"); + k2.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[1]))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(k2); + + Element k3 = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":K3"); + k3.appendChild(factoryDoc.createTextNode(Integer.toString(coeffPositions[2]))); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + fieldParams.appendChild(k3); + fieldParams.appendChild(factoryDoc.createTextNode("\n ")); + } + + // Curve parameters + Element curveParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":CurveParams"); + explicitParams.appendChild(factoryDoc.createTextNode("\n ")); + explicitParams.appendChild(curveParams); + + Element a = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":A"); + a.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); + a.setAttributeNS(null, "Value", + (fieldId == Field.PRIME_FIELD) + ? curve.getA().getValue().toBigInt().toString(10) + : evenStringLength(curve.getA().getValue().toBigInt().toString(16))); + curveParams.appendChild(factoryDoc.createTextNode("\n ")); + curveParams.appendChild(a); + + Element b = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":B"); + b.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); + b.setAttributeNS(null, "Value", + (fieldId == Field.PRIME_FIELD) + ? curve.getB().getValue().toBigInt().toString(10) + : evenStringLength(curve.getB().getValue().toBigInt().toString(16))); + curveParams.appendChild(factoryDoc.createTextNode("\n ")); + curveParams.appendChild(b); + + if (params.getS() != null) + { + Element seed = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Seed"); + seed.appendChild(factoryDoc.createTextNode(evenStringLength(params.getS().toString(16)))); + curveParams.appendChild(factoryDoc.createTextNode("\n ")); + curveParams.appendChild(seed); + } + + curveParams.appendChild(factoryDoc.createTextNode("\n ")); + + // Base point params + Element basePointParams = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":BasePointParams"); + explicitParams.appendChild(factoryDoc.createTextNode("\n ")); + explicitParams.appendChild(basePointParams); + + Element basePoint = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":BasePoint"); + basePointParams.appendChild(factoryDoc.createTextNode("\n ")); + basePointParams.appendChild(basePoint); + + Element x = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":X"); + x.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); + x.setAttributeNS(null, "Value", + (fieldId == Field.PRIME_FIELD) + ? params.getG().getCoordinates().getX().getValue().toBigInt().toString(10) + : evenStringLength(params.getG().getCoordinates().getX().getValue().toBigInt().toString(16))); + basePoint.appendChild(factoryDoc.createTextNode("\n ")); + basePoint.appendChild(x); + + Element y = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Y"); + y.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); + y.setAttributeNS(null, "Value", + (fieldId == Field.PRIME_FIELD) + ? params.getG().getCoordinates().getY().getValue().toBigInt().toString(10) + : evenStringLength(params.getG().getCoordinates().getY().getValue().toBigInt().toString(16))); + basePoint.appendChild(factoryDoc.createTextNode("\n ")); + basePoint.appendChild(y); + basePoint.appendChild(factoryDoc.createTextNode("\n ")); + + Element order = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Order"); + order.appendChild(factoryDoc.createTextNode(params.getR().toString(10))); + basePointParams.appendChild(factoryDoc.createTextNode("\n ")); + basePointParams.appendChild(order); + + if (params.getK() != null) + { + Element cofactor = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Cofactor"); + cofactor.appendChild(factoryDoc.createTextNode(params.getK().toString(10))); + basePointParams.appendChild(factoryDoc.createTextNode("\n ")); + basePointParams.appendChild(cofactor); + } + + basePointParams.appendChild(factoryDoc.createTextNode("\n ")); + explicitParams.appendChild(factoryDoc.createTextNode("\n ")); + + domainParameters.appendChild(factoryDoc.createTextNode("\n ")); + domainParameters.appendChild(explicitParams); + domainParameters.appendChild(factoryDoc.createTextNode("\n ")); + } + } + + // Public key point + Element publicKeyPoint = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":PublicKey"); + + Element publicKeyX = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":X"); + publicKeyX.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); + publicKeyX.setAttributeNS(null, "Value", + (fieldId == Field.PRIME_FIELD) + ? publicKey.getW().getCoordinates().getX().getValue().toBigInt().toString(10) + : evenStringLength(publicKey.getW().getCoordinates().getX().getValue().toBigInt().toString(16))); + publicKeyPoint.appendChild(factoryDoc.createTextNode("\n ")); + publicKeyPoint.appendChild(publicKeyX); + + Element publicKeyY = factoryDoc.createElementNS(ecdsaNS, ecdsaNSP + ":Y"); + publicKeyY.setAttributeNS(xsiNS, xsiNSP + ":type", fieldElemTypeString); + publicKeyY.setAttributeNS(null, "Value", + (fieldId == Field.PRIME_FIELD) + ? publicKey.getW().getCoordinates().getY().getValue().toBigInt().toString(10) + : evenStringLength(publicKey.getW().getCoordinates().getY().getValue().toBigInt().toString(16))); + publicKeyPoint.appendChild(factoryDoc.createTextNode("\n ")); + publicKeyPoint.appendChild(publicKeyY); + publicKeyPoint.appendChild(factoryDoc.createTextNode("\n ")); + + eCDSAKeyValue.appendChild(factoryDoc.createTextNode("\n ")); + eCDSAKeyValue.appendChild(publicKeyPoint); + eCDSAKeyValue.appendChild(factoryDoc.createTextNode("\n ")); + + return eCDSAKeyValue; + } + */ + /* ---------------------------------------------------------------------------------------------------- */ + + private static String getECDSANSPrefix(Element element) + { + // FIXXME: Review this function (GK, 11.06.2002) - should return a list of strings, since more than + // one NS prefix can be bound to the ECDSA namespace + + HashMap inScopeNSAttrs = getInScopeNSAttrs(element); + Iterator inScopeNSAttrsIt = inScopeNSAttrs.keySet().iterator(); + while (inScopeNSAttrsIt.hasNext()) + { + Attr currentAttr = (Attr)inScopeNSAttrs.get(inScopeNSAttrsIt.next()); + if (ECDSAConstants.NAMESPACE_ECDSAKEYVALUE_.equals(currentAttr.getValue())) + { + return ("xmlns".equals(currentAttr.getNodeName())) ? "" : currentAttr.getNodeName().substring(6); + } + } + return null; + } + + /* ---------------------------------------------------------------------------------------------------- */ + + // Converts an octet string representation into an int array as needed for the IAIK ECC library + // String: rightmost byte is least significant byte + // IntArray: rightmost byte is LEAST significant byte + private static int[] octetString2IntArray(String octetString) + { + int byteCount = octetString.length()/2; + int[] intArray = new int[byteCount/4 + ((byteCount % 4 != 0) ? 1 : 0)]; + for (int i = 0; i < byteCount; i++) + { + int oSStartPos = octetString.length() - (i + 1) * 2; + int currentByte = Integer.parseInt(octetString.substring(oSStartPos, oSStartPos + 2), 16); + intArray[i/4] += (currentByte & 0xFF) << ((i % 4) * 8); + } + return intArray; + } + + /* ---------------------------------------------------------------------------------------------------- */ + + // Converts an octet string representation into a byte array as needed for the IAIK ECC library + // String: rightmost byte is least significant byte + // ByteArray: rightmost byte is MOST significant byte + private static byte[] octetString2ByteArray(String octetString) + { + int byteCount = octetString.length()/2; + byte[] byteArray = new byte[byteCount]; + for (int i = 0; i < byteCount; i++) + { + int oSStartPos = octetString.length() - (i + 1) * 2; + byteArray[byteCount - i - 1] = (byte) Integer.parseInt(octetString.substring( + oSStartPos, oSStartPos + 2), 16); + } + return byteArray; + } + + /* ---------------------------------------------------------------------------------------------------- */ + + private static String evenStringLength(String hexString) + { + return (hexString.length() % 2 != 0) ? "0" + hexString : hexString; + } + + /* ---------------------------------------------------------------------------------------------------- */ + + private static Element getChildElement(Element parent, String namespace, String localName, + int instance) + { + NodeList namedElements = parent.getElementsByTagNameNS(namespace, localName); + if (namedElements.getLength() < instance) return null; + return (Element)namedElements.item(instance - 1); + } + + /* ---------------------------------------------------------------------------------------------------- */ + + private static String getChildElementText(Element parent, String namespace, String localName, + int instance) + { + Element child = getChildElement(parent, namespace, localName, instance); + if (child == null) return null; + NodeList childNodes = child.getChildNodes(); + int nodeCount = 0; + while (nodeCount < childNodes.getLength()) + { + Node currentNode = childNodes.item(nodeCount); + if (currentNode.getNodeType() == Node.TEXT_NODE) return currentNode.getNodeValue(); + nodeCount++; + } + return null; + } + + /* ---------------------------------------------------------------------------------------------------- */ + + public static HashMap getInScopeNSAttrs(Element element) + { + // Get all ancestors of element + Vector ancestors = new Vector(); + ancestors.add(element); + Node currentAncestor = element; + while ((currentAncestor = currentAncestor.getParentNode()) != null && + currentAncestor.getNodeType() == Node.ELEMENT_NODE) + { + ancestors.add(currentAncestor); + } + + // Scan all ancestors for NS attributes + HashMap inScopeNSAttrs = new HashMap(); + for (int i = ancestors.size() - 1; i >= 0; i--) + { + Element currentAncestorElem = (Element)ancestors.get(i); + NamedNodeMap attrs = currentAncestorElem.getAttributes(); + for (int j = 0; j < attrs.getLength(); j++) + { + Attr currentAttr = (Attr)attrs.item(j); + String currentAttrName = currentAttr.getNodeName(); + if ("xmlns".equals(currentAttrName) || currentAttrName.startsWith("xmlns:")) + { + inScopeNSAttrs.put(currentAttrName, currentAttr); + } + } + } + + // Check if default NS attribute is in list; if value is empty remove it from list + Attr defaultNSAttr = (Attr)inScopeNSAttrs.get("xmlns"); + if (defaultNSAttr != null && "".equals(defaultNSAttr.getValue())) inScopeNSAttrs.remove("xmlns"); + + return inScopeNSAttrs; + } +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java new file mode 100644 index 000000000..7c4731555 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPRequestJSPForwarder.java @@ -0,0 +1,76 @@ +/* + * Created on 17.02.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package at.gv.egovernment.moa.id.util; + +import java.io.IOException; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import at.gv.egovernment.moa.logging.Logger; + +/** + * @author rschamberger + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class HTTPRequestJSPForwarder { + + /** + * Forwards the HttpServletRequest to a customizable JSP Page and serves the Response.
+ *
    + *
  • Logs the message
  • + *
+ * + * @param message message text + * @param jspPageURI URI of the JSP page + * @param context the servlet context of the servlet belonging to the req, resp + * @param req servlet request + * @param resp servlet response + */ + public static void forwardNamed( + String message, + String jspPageURI, + ServletContext context, + HttpServletRequest req, + HttpServletResponse resp) { + + if (null != message) { + Logger.info(message); + req.setAttribute("Message", message); + } + + //forward this to the given jsp page where the HTML response is generated + try { + context.getRequestDispatcher(jspPageURI).forward(req, resp); + } catch (IOException e) { + Logger.error(e); + } catch (ServletException e) { + Logger.error(e); + } + } + + /** + * Forwards the HttpServletRequest to the customizable JSP Page 'message.jsp' and serves the Response.
+ *
    + *
  • Logs the message
  • + *
+ * + * @param message message text + * @param context the servlet context of the servlet belonging to the req, resp + * @param req servlet request + * @param resp servlet response + */ + public static void forwardDefault( + String message, + ServletContext context, + HttpServletRequest req, + HttpServletResponse resp) { + forwardNamed(message, "/message.jsp", context, req, resp); + } +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPUtils.java new file mode 100644 index 000000000..035c47eb9 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/HTTPUtils.java @@ -0,0 +1,68 @@ +package at.gv.egovernment.moa.id.util; + +/** + * HTTP Utilities + * + * @author Rudolf Schamberger + * @version $Id$ + */ + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.HttpURLConnection; +import java.net.URL; + +import org.apache.regexp.RE; +import org.apache.regexp.RESyntaxException; + +/** + * + * @author Rudolf Schamberger + * + */ +public class HTTPUtils { + + /** + * Utility used to obtainin correct encoded HTTP content. + * Reads a given Content adressed by HTTP-URL into String. + * Content encoding is considered by using the Content-Type HTTP header charset value. + * @param URL HTTP URL to read from. + * @return String representation of content + * @throws IOException on data-reading problems + */ + public static String readHttpURL(String URL) + throws IOException { + + URL url = new URL(URL); + HttpURLConnection conn = (HttpURLConnection)url.openConnection(); + conn.setRequestMethod("GET"); + String contentType = conn.getContentType(); + RE regExp = null; + try { + regExp = new RE("(;.*charset=)(\"*)(.*[^\"])"); + } catch (RESyntaxException e) { + //RESyntaxException is not possible = expr. is costant + } + boolean charsetSupplied = regExp.match(contentType); + String encoding = "ISO-8859-1"; //default HTTP encoding + if (charsetSupplied) { + encoding = regExp.getParen(3); + } + InputStream instream = new BufferedInputStream(conn.getInputStream()); + InputStreamReader isr = new InputStreamReader(instream, encoding); + Reader in = new BufferedReader(isr); + int ch; + StringBuffer buffer = new StringBuffer(); + while ((ch = in.read()) > -1) { + buffer.append((char)ch); + } + in.close(); + conn.disconnect(); + return buffer.toString(); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java new file mode 100644 index 000000000..4330133f0 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/InOrderServletRequestWrapper.java @@ -0,0 +1,374 @@ +/* + * Created on 01.10.2004 + * + * @author rschamberger + * $ID$ + */ +package at.gv.egovernment.moa.id.util; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.StringTokenizer; +import java.util.Vector; + +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequestWrapper; + +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.URLDecoder; + +/** + * Special ServletRequestWrapper class which provides a more precise implementation of the getParameter* + * family. This implementation cares about the order of the parameters from Query String and HTTP POST + * Body. Use this as Filter class for Servlets which such needs. + * + * @author Rudolf Schamberger + * @version $Id$ + */ +public class InOrderServletRequestWrapper extends HttpServletRequestWrapper { + + /** + * standard encoding used to decode the URL string. + */ + // + public static final String DEFAULT_CHARACTER_ENCODING = "ISO-8859-1"; + /** + * Vector that stores the order of the query paramters + */ + private Vector queryParamOrder; + + /** + * Hashtable that stores the content of the query paramters + */ + private Hashtable queryParameters; + + /** + * Vector that stores the order of the HTTP body paramters + */ + private Vector bodyParamOrder; + + /** + * Hashtable that stores the content of the HTTP body paramters + */ + private Hashtable bodyParameters; + + /** + * ServletContext + */ + private ServletContext context; + + /** + * Identifier used to identify query parameters + */ + public static final int QUERY_PARAM = 1; + + /** + * Identifier used to identify HTTP body parameters + */ + public static final int BODY_PARAM = 2; + + /** + * @see HttpServletRequestWrapper + */ + public InOrderServletRequestWrapper(final HttpServletRequest request, final ServletContext sContext) { + super(request); + this.context = sContext; + } + + /** + * parses the Query and if availlable also HTTP POST parameters + * + * @param req a HttpServletRequest which should be parsed + */ + protected final void parseParameters(final HttpServletRequest req) + { + queryParamOrder = new Vector(); + queryParameters = new Hashtable(); + bodyParamOrder = new Vector(); + bodyParameters = new Hashtable(); + + //Insert code for Query string parsing + String rawQuery = req.getQueryString(); + queryParameters = tokenize(queryParameters, queryParamOrder, rawQuery, DEFAULT_CHARACTER_ENCODING, true); + + //analyze HTTP Post body parameters + if (req.getMethod().equalsIgnoreCase("POST")) + { + //get body encoding + String enc = req.getCharacterEncoding(); + if (enc == null) enc = DEFAULT_CHARACTER_ENCODING; + + if (req.getContentType().equals("application/x-www-form-urlencoded")) + { + try + { + bodyParameters = parsePostData(bodyParameters, req.getContentLength(), req.getInputStream(), enc); + } + catch (IOException e) + { + context.log("could not open input stream of reqest \n" + e.toString()); + } + } + else + { + //TODO add multipart code + context.log( + "ERROR other Content-Types than 'application/x-www-form-urlencoded' not supported!"); + } + + }// end POST + } + + /** + * parses the HTTP POST parameters + * + * @param ht parameter Hashtable to put parameters in. + * @param length of content + * @param instream the ServletInputStream of the request + * @param encoding encoding of the instream + * + * @return the Hashtable with the parsed data + */ + private Hashtable parsePostData(Hashtable ht, final int length, final ServletInputStream instream, + final String encoding) + { + int inputLen, offset; + byte[] postedBytes = null; + boolean dataRemaining = true; + String postedBody; + + StringBuffer sb = new StringBuffer(); + + if (length <= 0) + { + return null; + } + + postedBytes = new byte[length]; + try + { + offset = 0; + while (dataRemaining) + { + inputLen = instream.read(postedBytes, offset, length - offset); + if (inputLen <= 0) + { + throw new IOException("read error during reading the HTTP POST body"); + } + offset += inputLen; + if ((length - offset) == 0) + { + dataRemaining = false; + } + } + } + catch (IOException e) + { + System.out.println("Exception =" + e); + return null; + } + + postedBody = new String(postedBytes); + Hashtable ht2 = tokenize(ht, bodyParamOrder, postedBody, encoding, false); + return ht2; + } + + + /** + * tokenizes parameter strings + * + * @param ht parameter Hashtable to put parameters in. + * @param order Vector in which the order of the tokenized parameters will be stored. + * @param parameterString String to tokenize. + * @param encoding which will be used to decode the parameterString. + * + * @return the Hashtable with the parsed data + */ + private Hashtable tokenize(Hashtable ht, Vector order, final String parameterString, final String encoding, boolean decode) + { + String[] valArray = null; + + if (null == parameterString) return ht; + + StringTokenizer st = new StringTokenizer(parameterString, "&"); + + String key = null; + String val = null; + + while (st.hasMoreTokens()) + { + String pair = (String) st.nextToken(); + int pos = pair.indexOf('='); + if (pos == -1) + { + throw new IllegalArgumentException(); + } + try + { + if (decode) { + key = URLDecoder.decode(pair.substring(0, pos), encoding); + val = URLDecoder.decode(pair.substring(pos + 1, pair.length()), encoding); + } else { + key = pair.substring(0, pos); + val = pair.substring(pos + 1, pair.length()); + } + //Logger.debug("(" + Integer.toString(key.length()) + "=" + Integer.toString(pair.substring(0, pos).length()) + ")"+key+"|--|"+pair.substring(0, pos)); + //Logger.debug("(" + Integer.toString(val.length()) + "=" + Integer.toString(pair.substring(pos + 1, pair.length()).length()) + ")"+val+"|--|"+pair.substring(pos + 1, pair.length())); + } + catch (Exception e) + { + throw new IllegalArgumentException(); + } + if (ht.containsKey(key)) + { + String oldVals[] = (String[]) ht.get(key); + valArray = new String[oldVals.length + 1]; + for (int i = 0; i < oldVals.length; i++) + { + valArray[i] = oldVals[i]; + } + valArray[oldVals.length] = val; + } + else + { + valArray = new String[1]; + valArray[0] = val; + } + ht.put(key, valArray); + order.addElement(key); + } + return ht; + + } + + /** + * Returns the value of a request parameter as a String, or null if the + * parameter does not exist. Request parameters are extra information sent with the request. For HTTP + * servlets, parameters are contained in the query string or posted form data. + * + *

+ * You should only use this method when you are sure the parameter has only one value. If the parameter + * might have more than one value, use {@link #getParameterValues(String, int)}. + * + *

+ * If you use this method with a multivalued parameter, the value returned is equal to the first value in + * the array returned by getParameterValues. + * + *

+ * If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then + * reading the body directly via {@link #getInputStream} or {@link #getReader}can interfere with the + * execution of this method. + * + * @param name a String containing the name of the parameter whose value is requested + * + * @return a String representing the single value of the parameter + * + * @see #getParameterValues(String, int) + * + */ + public final String getParameter(final String name) { + String val = getParameter(name, QUERY_PARAM); + return (null != val) ? val : getParameter(name, BODY_PARAM); + } + + /** + * Returns the value of a request parameter as a String, or null if the + * parameter does not exist. + * + * @param name a String containing the name of the parameter whose value is requested + * @param parameterType type of parameter + * @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#QUERY_PARAM + * and @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#BODY_PARAM + * @see #getParameterValues(String) + * @return value of the (single) parameter or null if not availlable + **/ + public final String getParameter(final String name, final int parameterType) + { + + Hashtable parameters = (parameterType == QUERY_PARAM) ? queryParameters : bodyParameters; + String[] vals = (String[]) parameters.get(name); + if (vals == null) + { + return null; + } + return vals[0]; + } + + + /** + * Returns an array of String objects containing all of the values the given request + * parameter has, or null if the parameter does not exist. + * + *

+ * If the parameter has a single value, the array has a length of 1. + * + * @param name a String containing the name of the parameter whose value is requested + * @param parameterType type of parameter + * @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#QUERY_PARAM + * and @see at.gv.egovernment.moa.id.util.InOrderServletRequestWrapper#BODY_PARAM + * @return an array of String objects containing the parameter's values or null + * + * @see #getParameter + */ + public final String getParameterValues(final String name, final int parameterType) + { + Hashtable parameters = (parameterType == QUERY_PARAM) ? queryParameters : bodyParameters; + String[] vals = (String[]) parameters.get(name); + if (vals == null) + { + return null; + } + String vallist = vals[0]; + for (int i = 1; i < vals.length; i++) + { + vallist = vallist + "," + vals[i]; + } + return vallist; + } + + /** + * + * Returns an Enumeration of String objects containing the names of the + * parameters. If there are no parameters, the method returns an empty + * Enumeration. + * + * @return an Enumeration of String objects, each String + * containing the name of a request parameter; or an empty Enumeration if the + * request has no parameters + * + */ + public final Enumeration getParameterNames() + { + Vector FullParamOrder = new Vector(); + for (Enumeration enu = queryParamOrder.elements(); enu.hasMoreElements();) { + FullParamOrder.addElement(enu.nextElement()); + } + for (Enumeration enu = bodyParamOrder.elements(); enu.hasMoreElements();) { + FullParamOrder.addElement(enu.nextElement()); + } + return FullParamOrder.elements(); + } + + /** + * + * Returns an Enumeration of String objects containing the names of the + * parameters contained in this request. If the request has no parameters, the method returns an empty + * Enumeration. + * @param parameterType type of parameter + * + * @return an Enumeration of String objects, each String + * containing the name of a request parameter; or an empty Enumeration if the + * request has no parameters + * + */ + public final Enumeration getParameterNames(final int parameterType) + { + if (QUERY_PARAM == parameterType) + return queryParamOrder.elements(); + else + return bodyParamOrder.elements(); + } +} //End InOrderServletRequestWrapper \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java new file mode 100644 index 000000000..d31aa6ec1 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/MOAIDMessageProvider.java @@ -0,0 +1,58 @@ +package at.gv.egovernment.moa.id.util; + +import java.util.Locale; + +import at.gv.egovernment.moa.util.Messages; + +/** + * A singleton wrapper around a Message object, providing the messages used in MOA-ID. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class MOAIDMessageProvider { + + /** DEFAULT_MESSAGE_RESOURCES are resources/properties/id_messages */ + private static final String[] DEFAULT_MESSAGE_RESOURCES = + { "resources/properties/id_messages" }; + /** DEFAULT_MESSAGE_LOCALES are "de", "AT" */ + private static final Locale[] DEFAULT_MESSAGE_LOCALES = + new Locale[] { new Locale("de", "AT") }; + /** The instance for our singleton */ + private static MOAIDMessageProvider instance; + /** The Messages */ + private Messages messages; + + /** + * Returns the single instance of MOAIDMessageProvider. + * + * @return the single instance of MOAIDMessageProvider + */ + public static MOAIDMessageProvider getInstance() { + if (instance == null) + instance = new MOAIDMessageProvider(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); + return instance; + } + + /** + * Create a MOAIDMessageProvider. + * + * @param resourceNames The names of the resources containing the messages. + * @param locales The corresponding locales. + */ + protected MOAIDMessageProvider(String[] resourceNames, Locale[] locales) { + this.messages = new Messages(resourceNames, locales); + } + + /** + * Get the message corresponding to a given message ID. + * + * @param messageId The ID of the message. + * @param parameters The parameters to fill in into the message arguments. + * @return The formatted message. + */ + public String getMessage(String messageId, Object[] parameters) { + return messages.getMessage(messageId, parameters); + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java new file mode 100644 index 000000000..3f5fddba2 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParameterInOrderFilter.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.id.util; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; + +/** + * @author rschamberger + * + */ +/** + * A Filter class wich uses the InOrderServletRequestWrapper to provide servlets a more precise + * implementation of the getParameter* family. This implementation cares about the order of the parameters + * from Query String and HTTP POST Body. Use this as Filter class for Servlets which such needs. + * + * @author Rudolf Schamberger + * @version $Id$ + */ +public class ParameterInOrderFilter implements Filter +{ + + /** + * filterConfig + */ + private FilterConfig filterConfig; + + /** + * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) + */ + public final void init(final FilterConfig config) + { + this.filterConfig = config; + } + + /** + * @see javax.servlet.Filter#destroy() + */ + public final void destroy() + { + }; + + /** + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, + * javax.servlet.FilterChain) + */ + public final void doFilter(final ServletRequest request, final ServletResponse response, + final FilterChain chain) throws IOException, ServletException + { + InOrderServletRequestWrapper sRequ = new InOrderServletRequestWrapper((HttpServletRequest) request, + filterConfig.getServletContext()); + //parse the Query (and Body) parameters + sRequ.parseParameters((HttpServletRequest) request); + //process the rest of filter chain + chain.doFilter(sRequ, response); + } +} \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java new file mode 100644 index 000000000..da75b4213 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/Random.java @@ -0,0 +1,22 @@ +package at.gv.egovernment.moa.id.util; + +import java.util.Date; + +/** + * Random number generator used to generate ID's + * @author Paul Ivancsics + * @version $Id$ + */ +public class Random { + + /** random number generator used */ + private static java.util.Random random = new java.util.Random(new Date().getTime()); + /** + * Creates a new random number, to be used as an ID. + * + * @return random long as a String + */ + public static String nextRandom() { + return "" + random.nextLong(); + } +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java new file mode 100644 index 000000000..9fa0803c4 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java @@ -0,0 +1,180 @@ +package at.gv.egovernment.moa.id.util; + +import iaik.pki.PKIConfiguration; +import iaik.pki.PKIException; +import iaik.pki.PKIFactory; +import iaik.pki.PKIProfile; +import iaik.pki.jsse.IAIKX509TrustManager; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.URL; +import java.security.GeneralSecurityException; +import java.security.Security; +import java.util.HashMap; +import java.util.Map; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; + +import org.apache.regexp.RE; +import org.apache.regexp.RESyntaxException; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.iaik.config.PKIConfigurationImpl; +import at.gv.egovernment.moa.id.iaik.pki.PKIProfileImpl; +import at.gv.egovernment.moa.id.iaik.pki.jsse.MOAIDTrustManager; +import at.gv.egovernment.moa.logging.Logger; + +/** + * Utility for a obtaining a secure socket factory using IAIKX509TrustManager. + * This TrustManager implementation features CRL checking.
+ * SSLUtils caches secure socket factories for given ConnectionParameters. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class SSLUtils { + + /** SSLSocketFactory store, mapping URL->SSLSocketFactory **/ + private static Map sslSocketFactories = new HashMap(); + + /** + * Initializes the SSLSocketFactory store. + */ + public static void initialize() { + sslSocketFactories = new HashMap(); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + } + + /** + * Creates an SSLSocketFactory which utilizes an + * IAIKX509TrustManager for the given trust store, + * and the given key store. + * + * @param conf configuration provider providing a generic properties pointing + * to trusted CA store and certificate store root + * @param connParam connection parameter containing the client key store settings + * to be used in case of client authentication; + * if connParam.getClientKeyStore() == null, client authentication + * is assumed to be disabled + * @return SSLSocketFactory to be used by an HttpsURLConnection + * @throws IOException thrown while reading key store file + * @throws GeneralSecurityException thrown while creating the socket factory + * @throws ConfigurationException on invalid configuration data + * @throws PKIException while initializing the IAIKX509TrustManager + */ + public static SSLSocketFactory getSSLSocketFactory( + ConfigurationProvider conf, + ConnectionParameter connParam) + throws IOException, GeneralSecurityException, ConfigurationException, PKIException { + + Logger.debug("Get SSLSocketFactory for " + connParam.getUrl()); + // retrieve SSLSocketFactory if already created + SSLSocketFactory ssf = (SSLSocketFactory)sslSocketFactories.get(connParam.getUrl()); + if (ssf != null) + return ssf; + // else create new SSLSocketFactory + String trustStoreURL = conf.getTrustedCACertificates(); + if (trustStoreURL == null) + throw new ConfigurationException( + "config.08", new Object[] {"TrustedCACertificates"}); + String acceptedServerCertURL = connParam.getAcceptedServerCertificates(); + TrustManager[] tms = getTrustManagers(conf, trustStoreURL, acceptedServerCertURL); + KeyManager[] kms = at.gv.egovernment.moa.util.SSLUtils.getKeyManagers( + "pkcs12", connParam.getClientKeyStore(), connParam.getClientKeyStorePassword()); + SSLContext ctx = SSLContext.getInstance("TLS"); + ctx.init(kms, tms, null); + ssf = ctx.getSocketFactory(); + // store SSLSocketFactory + sslSocketFactories.put(connParam.getUrl(), ssf); + return ssf; + } + + /** + * Initializes an IAIKX509TrustManager for a given trust store, + * using configuration data. + * + * @param conf MOA-ID configuration provider + * @param trustStoreURL trust store URL + * @param acceptedServerCertURL file URL pointing to directory containing accepted server SSL certificates + * @return TrustManager array containing the IAIKX509TrustManager + * @throws ConfigurationException on invalid configuration data + * @throws IOException on data-reading problems + * @throws PKIException while initializing the IAIKX509TrustManager + */ + public static TrustManager[] getTrustManagers( + ConfigurationProvider conf, String trustStoreURL, String acceptedServerCertURL) + throws ConfigurationException, PKIException, IOException, GeneralSecurityException { + + PKIConfiguration cfg = null; + if (! PKIFactory.getInstance().isAlreadyConfigured()) + cfg = new PKIConfigurationImpl(conf); + String boolString = conf.getGenericConfigurationParameter(ConfigurationProvider.TRUST_MANAGER_REVOCATION_CHECKING); + //not using BoolUtils because default value hast to be true! + boolean checkRevocation = !("false".equals(boolString) || "0".equals(boolString)); + PKIProfile profile = new PKIProfileImpl(trustStoreURL, checkRevocation); + // This call fixes a bug occuring when PKIConfiguration is + // initialized by the MOA-SP initialization code, in case + // MOA-SP is called by API + MOAIDTrustManager.initializeLoggingContext(); + IAIKX509TrustManager tm = new MOAIDTrustManager(acceptedServerCertURL); + tm.init(cfg, profile); + return new TrustManager[] {tm}; + } + /** + * Reads a file, given by URL, into a byte array, + * securing the connection by IAIKX509TrustManager. + * @param connParam containing URL and accepted server certificates + * @param conf ConfigurationProvider for reading + * @return String representation of content + * @throws ConfigurationException on invalid configuration data + * @throws PKIException on invalid configuration data + * @throws IOException on data-reading problems + * @throws GeneralSecurityException on security issues + */ + public static String readHttpsURL(ConfigurationProvider conf, ConnectionParameter connParam) + throws ConfigurationException, PKIException, IOException, GeneralSecurityException { + + URL url = new URL(connParam.getUrl()); + HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); + conn.setRequestMethod("GET"); + conn.setDoInput(true); + SSLSocketFactory sslSocketFactory = getSSLSocketFactory(conf, connParam); + conn.setSSLSocketFactory(sslSocketFactory); + conn.connect(); + String contentType = conn.getContentType(); + RE regExp = null; + try { + regExp = new RE("(;.*charset=)(\"*)(.*[^\"])"); + } catch (RESyntaxException e) { + //RESyntaxException is not possible = expr. is costant + } + boolean charsetSupplied = regExp.match(contentType); + String encoding = "ISO-8859-1"; //default HTTP encoding + if (charsetSupplied) { + encoding = regExp.getParen(3); + } + InputStream instream = new BufferedInputStream(conn.getInputStream()); + InputStreamReader isr = new InputStreamReader(instream, encoding); + Reader in = new BufferedReader(isr); + int ch; + StringBuffer buffer = new StringBuffer(); + while ((ch = in.read()) > -1) { + buffer.append((char)ch); + } + in.close(); + conn.disconnect(); + return buffer.toString(); + } +} diff --git a/id/server/idserverlib/src/test/java/test/MOAIDTestCase.java b/id/server/idserverlib/src/test/java/test/MOAIDTestCase.java new file mode 100644 index 000000000..725fa1386 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/MOAIDTestCase.java @@ -0,0 +1,203 @@ +package test; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.transform.TransformerException; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.StreamUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import iaik.ixsil.algorithms.Transform; +import iaik.ixsil.algorithms.TransformImplExclusiveCanonicalXML; +import iaik.ixsil.exceptions.AlgorithmException; +import iaik.ixsil.exceptions.InitException; +import iaik.ixsil.exceptions.URIException; +import iaik.ixsil.init.IXSILInit; +import iaik.ixsil.util.URI; +import test.at.gv.egovernment.moa.MOATestCase; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class MOAIDTestCase extends MOATestCase implements Constants { + + public static final String XML_DECL = + ""; + protected static final String nl = "\n"; + + public MOAIDTestCase(String name) { + super(name); + } + + protected void initIxsil() throws InitException, URIException { + IXSILInit.init(new URI("init/properties/init.properties")); + // Switch on debug information + IXSILInit.setPrintDebugLog(true); + } + //STRING <==> STRING + protected void assertXmlEquals(String xml1, String xml2) + throws AlgorithmException, IOException, InitException, URIException{ + initIxsil(); + String canXml1 = canonicalTransform(xml1); + String canXml2 = canonicalTransform(xml2); + assertEquals(canXml1, canXml2); } + // ELEMENT <==> ELEMENT + protected void assertXmlEquals(Element xml1, Element xml2) + throws AlgorithmException, IOException, InitException , URIException, TransformerException{ + initIxsil(); + assertEquals(canonicalTransform(DOMUtils.serializeNode(xml1)),canonicalTransform(DOMUtils.serializeNode(xml2))); + } + // INPUTSTREAM <==> INPUTSTREAM + protected void assertXmlEquals(InputStream xml1, InputStream xml2) + throws AlgorithmException, IOException, InitException , URIException{ + initIxsil(); + assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); + } + // ELEMENT <==> STRING + protected void assertXmlEquals(Element xml1, String xml2) + throws AlgorithmException, IOException, InitException , URIException, TransformerException { + initIxsil(); + assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); + } + // ELEMENT <==> INPUTSTREAM + protected void assertXmlEquals(Element xml1, InputStream xml2) + throws AlgorithmException, IOException, InitException , URIException, TransformerException{ + initIxsil(); + assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); + } + // STRING <==> INPUTSTREAM + protected void assertXmlEquals(String xml1, InputStream xml2) + throws AlgorithmException, IOException, InitException , URIException{ + initIxsil(); + assertEquals(canonicalTransform(xml1),canonicalTransform(xml2)); + } + + /** + * Method canonicalTransform. + * @param input as STRING + * @return String + */ + protected String canonicalTransform(String input) + throws AlgorithmException, IOException { + + Transform tr = new TransformImplExclusiveCanonicalXML(); + InputStream s = new ByteArrayInputStream(input.getBytes("UTF-8")); + tr.setInput(s, null); + ByteArrayInputStream transResult = (ByteArrayInputStream) tr.transform(); + return killWhiteSpace(readString(transResult)); + } + /** + * Method canonicalTransform. + * @param input as Element + * @return String + */ + protected String canonicalTransform(Element input) + throws AlgorithmException, IOException { + + Transform tr = new TransformImplExclusiveCanonicalXML(); + tr.setInput(XPathUtils.selectNodeList(input, XPathUtils.ALL_NODES_XPATH), null); + ByteArrayInputStream transResult = (ByteArrayInputStream) tr.transform(); + + return killWhiteSpace(readString(transResult)); + } + + /** + * Method canonicalTransform. + * @param input as InputStream + * @return String + */ + protected String canonicalTransform(InputStream input) + throws AlgorithmException, IOException { + + Transform tr = new TransformImplExclusiveCanonicalXML(); tr.setInput(input, null); + ByteArrayInputStream transResult = (ByteArrayInputStream) tr.transform(); + + return killWhiteSpace(readString(transResult)); + } + + public static String killWhiteSpace(String input) + { + int start=0; + int ende; + String result; + String middle; + result = input; + do { + start = result.indexOf(">", start); + ende = result.indexOf("<", start); + middle = result.substring(start+1,ende).trim(); + result = result.substring(0,start+1) +middle + result.substring(ende,result.length()); + start++; + } while (result.indexOf("<", ende + 1)>0); + + return result; + } + + /** + * Method killExclusive.: The values startsWith and endsWith will be included into the answer. + * @param input + * @param startsWith + * @param endsWith + * @param newValue + * @return String + */ + public static String killExclusive(String input, String startsWith, String endsWith, String newValue) + { + int start=0; + int ende; + String result; + result = input; + do { + start = result.indexOf(startsWith, start) + startsWith.length(); + ende = result.indexOf(endsWith, start); + result = result.substring(0,start) + newValue + result.substring(ende,result.length()); + start++; + } while (result.indexOf(startsWith, ende + 1)>0); + + return result; + } + + /** + * Method killInclusive. : The values startsWith and endsWith will NOT be included into the answer. + * @param input + * @param startsWith + * @param endsWith + * @param newValue + * @return String + */ + public static String killInclusive(String input, String startsWith, String endsWith, String newValue) + { + int start=0; + int ende; + String result; + result = input; + do { + start = result.indexOf(startsWith, start) + startsWith.length(); + ende = result.indexOf(endsWith, start); + result = result.substring(0,start - startsWith.length() ) + newValue + result.substring(ende + endsWith.length(),result.length()); + start++; + } while (result.indexOf(startsWith, ende + 1)>0); + + return result; + } + + protected String readFile(String filename) throws IOException { + return readFile(filename, "UTF-8"); + } + protected String readFile(String filename, String encoding) throws IOException { + return FileUtils.readFile(filename, encoding); + } + protected String readString(InputStream input) throws IOException + { + return StreamUtils.readStream(input, "UTF-8"); + } + +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java new file mode 100644 index 000000000..0d72691aa --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java @@ -0,0 +1,171 @@ +package test.abnahme.A; + +import test.abnahme.AbnahmeTestCase; +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.auth.WrongParametersException; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class Test100StartAuthentication extends AbnahmeTestCase { + + public Test100StartAuthentication(String name) { + super(name); + } + + public void testA101() throws Exception { + try { + String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL + "gb", //target + "http://localhost:9080/", //oaURL + "file:" + findXmldata("AuthTemplate.html"), + "http://localhost:3495/http-security-layer-request", + null); + htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); + //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); + assertEquals(readXmldata("htmlForm.html"),htmlForm); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA102() throws Exception { + try { + String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL + "gb", //target + "http://localhost:9080/", //oaURL + null, + "http://localhost:3495/http-security-layer-request", null); + htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); + //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); + assertEquals(readXmldata("htmlForm.html"),htmlForm); + + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA103() throws Exception { + try { + String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL + "gb", //target + "http://localhost:9080/", //oaURL + "file:" + findXmldata("AuthTemplate.html"), + null, + null); + htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); + //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); + assertEquals(readXmldata("htmlForm.html"),htmlForm); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA151() throws Exception { + try { + try { + server.startAuthentication(null, //authURL + "gb", //target + "http://localhost:9080/", //oaURL + null, null, null); + //assertEquals("",htmlForm); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (WrongParametersException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA152() throws Exception { + try { + try { + server.startAuthentication("http://localhost:8080/auth", //authURL + "gb", "http://localhost:9080/", //oaURL + null, null, null); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA153() throws Exception { + try { + try { + server.startAuthentication("https://localhost:8443/auth", //authURL + "gb", "http://host_not_in_config/", //oaURL + null, null, null); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA154() throws Exception { + try { + try { + server.startAuthentication("https://localhost:8443/auth", //authURL + "gb", null, //oaURL + null, null, null); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (WrongParametersException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA155() throws Exception { + try { + try { + server.startAuthentication("https://localhost:8443/auth", //authURL + null, "http://localhost:9080/", //oaURL + null, null, null); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (WrongParametersException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + //assertEquals("",htmlForm); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test200VerifyIdentityLink.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test200VerifyIdentityLink.java new file mode 100644 index 000000000..043f51398 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test200VerifyIdentityLink.java @@ -0,0 +1,369 @@ +package test.abnahme.A; + +import java.util.HashMap; +import java.util.Vector; + +import org.w3c.dom.Element; + +import test.abnahme.AbnahmeTestCase; +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; +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.validator.ValidateException; +import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class Test200VerifyIdentityLink extends AbnahmeTestCase { + + public Test200VerifyIdentityLink(String name) { + super(name); + } + + public void testA201() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, parameters); + + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + + VerifyXMLSignatureResponseParser respParser = new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames(), VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, true); + + /* + * HINWEIS: clearSamlAssertion löscht aus einer beliebiegen String-Repräsentation einer XML-Struktur + * AUSSLIESSLICH die Attribute IssueInstand und die AssertionID heraus, von dem her ist diese + * Method hier verwendbar + */ + + assertXmlEquals(clearSamlAssertion(readXmldata("CreateXMLSignatureRequest.xml")), clearSamlAssertion(createXMLSignatureRequest)); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + + } + public void testA251() throws Exception { + try { + startAuthentication(); + String sessionID = "0"; + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA252() throws Exception { + try { + String sessionID = startAuthentication(); + + server.setSecondsSessionTimeOut(-100); + server.cleanup(); + server.setSecondsSessionTimeOut(1000); + + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA253() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA254() throws Exception { + try { + String sessionID = startAuthentication(); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA255() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + } + catch (ParseException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA256() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA257() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA258() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA259() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA260() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA261() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA262() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + new InfoboxReadResponseParser(infoboxReadResponse).parseIdentityLink(); + // System.out.println(infoboxReadResponse); + + try { + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA263() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + + VerifyXMLSignatureResponseParser respParser = new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + + // String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, infoboxReadResponse); + // System.out.println(createXMLSignatureRequest); + // String createXMLSignatureResponse = readFile(TESTDATA_ROOT + "xmldata/standard/"+"CreateXMLSignatureResponse.xml"); + // String samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + Vector identityLinkSigners = new Vector(); + identityLinkSigners.add("CN=TEST,OU=TEST,O=TEST,C=AT"); + try { + VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), identityLinkSigners, VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, true); + System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); + fail(this.getName() + " hat KEINE FEHLER geworfen"); + } + catch (ValidateException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java new file mode 100644 index 000000000..9bf92e54b --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java @@ -0,0 +1,609 @@ +package test.abnahme.A; + +import java.util.Calendar; +import java.util.HashMap; + +import org.w3c.dom.Element; +import test.abnahme.AbnahmeTestCase; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.ParseException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder; +import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder; +import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +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.data.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; +import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; +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.validator.CreateXMLSignatureResponseValidator; +import at.gv.egovernment.moa.id.auth.validator.ValidateException; +import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.util.Random; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.DateTimeUtils; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ + +public class Test300VerifyAuthBlock extends AbnahmeTestCase { + + public Test300VerifyAuthBlock(String name) { + super(name); + } + + public void testA301() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + //authDataWriter(authData,this.getName()+"new.xml"); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA302() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + //authDataWriter(authData,this.getName()+"new.xml"); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA303() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA304() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA305() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA306() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA307() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA308() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServer(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + + } + + public void testA309() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServerWithoutValidateAuthBlock(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA310() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServerWithoutValidateAuthBlock(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA311() throws Exception { + try { + String sessionID = startAuthentication(); + AuthenticationData authData = initServerWithoutValidateAuthBlock(sessionID); + assertXmlEquals(readXmldata("AuthenticationData.xml"), clearSamlAssertion(authData.getSamlAssertion())); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA351() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); + // System.out.println(createXMLSignatureRequest); + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + + // nicht existierende Session.... + try { + server.verifyAuthenticationBlock("0", createXMLSignatureResponse); + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA352() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + server.setSecondsSessionTimeOut(-100); + server.cleanup(); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); + // System.out.println(createXMLSignatureRequest); + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + + // abgelaufene Session.... + server.setSecondsSessionTimeOut(1000); + try { + server.verifyAuthenticationBlock("0", createXMLSignatureResponse); + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA353() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + + // Session for VerifyIdentityLink-Aufruf + try { + + server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + fail(); + } + //NOCH SEHR UNSCHÖN..... (fliegt raus im AuthenticationServer, Methode buildAuthenticationData + // ( IdentityLink identityLink = session.getIdentityLink(); ==> liefert dann NULL... + catch (NullPointerException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA354() throws Exception { + try { + String sessionID = startAuthentication(); + System.out.println(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); + // System.out.println(createXMLSignatureRequest); + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + + // nicht existierende Session.... + + server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + try { + server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA355() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ParseException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA356() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ParseException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA357() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA358() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA359() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA360() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA361() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA362() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA363() throws Exception { + try { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA364() throws Exception { + try { + String sessionID = startAuthentication(); + try { + + initServer(sessionID); + fail(); + } + catch (ValidateException e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + /* public void testA365() throws Exception { + String sessionID = startAuthentication(); + try { + // wegen sinnlosigkeit gestrichen + initServer(sessionID); + fail(); + } + catch (ValidateException e) {System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage()+ "-----------------------");} + }*/ + + public void testA366() throws Exception { + + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) {System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage()+ "-----------------------");} + } + public void testA367() throws Exception { + String sessionID = startAuthentication(); + try { + initServer(sessionID); + fail(); + } + catch (ValidateException e) {System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage()+ "-----------------------");} + } + + + private AuthenticationData initServer(String sessionID) throws Exception { + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, "TrustProfile1"); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); + // System.out.println(createXMLSignatureRequest); + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + // CreateXMLSignatureResponseValidator.getInstance().validate(new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(),"gb","https://localhost:9443/"); + String samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + AuthenticationData authData = server.getAuthenticationData(samlArtifact); + return authData; + } + + private AuthenticationData initServerWithoutValidateAuthBlock(String sessionID) throws Exception { + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, "TrustProfile1"); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); + // System.out.println(createXMLSignatureRequest); + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + // CreateXMLSignatureResponseValidator.getInstance().validate(new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(),"gb","https://localhost:9443/"); + + AuthenticationSession session = AuthenticationServer.getSession(sessionID); + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + // parses + CreateXMLSignatureResponse csresp = + new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(); + // validates + new CreateXMLSignatureResponseValidator().validate(csresp, session); + // builds a for a MOA-SPSS call + String[] vtids = authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(); + String tpid = authConf.getMoaSpAuthBlockTrustProfileID(); + Element domVsreq = new VerifyXMLSignatureRequestBuilder().build(csresp, vtids, tpid); + // invokes the call + Element domVsresp = new SignatureVerificationInvoker().verifyXMLSignature(domVsreq); + // parses the + VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponseParser(domVsresp).parseData(); + // validates the + VerifyXMLSignatureResponseValidator.getInstance().validate(vsresp, null, VerifyXMLSignatureResponseValidator.CHECK_AUTH_BLOCK, true); + // compares the public keys from the identityLink with the AuthBlock + + // builds authentication data and stores it together with a SAML artifact + AuthenticationData authData = buildAuthenticationData(session, vsresp); + return authData; + } + private AuthenticationData buildAuthenticationData( + AuthenticationSession session, + VerifyXMLSignatureResponse verifyXMLSigResp) + throws ConfigurationException, BuildException { + + IdentityLink identityLink = session.getIdentityLink(); + AuthenticationData authData = new AuthenticationData(); + authData.setMajorVersion(1); + authData.setMinorVersion(0); + authData.setAssertionID(Random.nextRandom()); + authData.setIssuer(session.getAuthURL()); + authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance())); + String vpkBase64 = new BPKBuilder().buildBPK( + identityLink.getIdentificationValue(), session.getTarget()); + authData.setBPK(vpkBase64); + authData.setGivenName(identityLink.getGivenName()); + authData.setFamilyName(identityLink.getFamilyName()); + authData.setDateOfBirth(identityLink.getDateOfBirth()); + authData.setQualifiedCertificate(verifyXMLSigResp.isQualifiedCertificate()); + authData.setPublicAuthority(verifyXMLSigResp.isPublicAuthority()); + authData.setPublicAuthorityCode(verifyXMLSigResp.getPublicAuthorityCode()); + OAAuthParameter oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + session.getPublicOAURLPrefix()); + String prPerson = new PersonDataBuilder().build( + identityLink, oaParam.getProvideStammzahl()); + + try { + String ilAssertion = + oaParam.getProvideIdentityLink() ? DOMUtils.serializeNode(identityLink.getSamlAssertion()) : ""; + String authBlock = oaParam.getProvideAuthBlock() ? session.getAuthBlock() : ""; + String samlAssertion = new AuthenticationDataAssertionBuilder().build( + authData, prPerson, authBlock, ilAssertion, session.getBkuURL(), "", false, null); + authData.setSamlAssertion(samlAssertion); + return authData; + } + catch (Throwable ex) { + throw new BuildException( + "builder.00", + new Object[] { "AuthenticationData", ex.getMessage() }, + ex); + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test400GetAuthenticationData.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test400GetAuthenticationData.java new file mode 100644 index 000000000..3db0a6d69 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test400GetAuthenticationData.java @@ -0,0 +1,137 @@ +package test.abnahme.A; + +import java.util.HashMap; + +import org.w3c.dom.Element; +import test.abnahme.AbnahmeTestCase; + +import at.gv.egovernment.moa.id.AuthenticationException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +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.invoke.SignatureVerificationInvoker; +import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; +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.validator.CreateXMLSignatureResponseValidator; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.data.AuthenticationData; + +/** + * @author Stefan Knirsch + * @version $Id$ + */ + +public class Test400GetAuthenticationData extends AbnahmeTestCase { + + private String samlArtifact; + + public Test400GetAuthenticationData(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + String sessionID = startAuthentication(); + AuthenticationSession session = AuthenticationServer.getSession(sessionID); + String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + server.verifyIdentityLink(sessionID, parameters); + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID()); + Element domVerifyXMLSignatureResponse = new SignatureVerificationInvoker().verifyXMLSignature(domVerifyXMLSignatureRequest); + new VerifyXMLSignatureResponseParser(domVerifyXMLSignatureResponse); + //VerifyXMLSignatureResponseValidator.getInstance().validate(respParser.parseData(), AuthConfigurationProvider.getInstance().getIdentityLinkX509SubjectNames()); + // System.out.println(createXMLSignatureRequest); + String createXMLSignatureResponse = readXmldata("CreateXMLSignatureResponse.xml"); + CreateXMLSignatureResponseValidator.getInstance().validate(new CreateXMLSignatureResponseParser(createXMLSignatureResponse).parseResponse(), session); + samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + } + + public void testA401() throws Exception { + try { + + AuthenticationData authData = server.getAuthenticationData(samlArtifact); +// authDataWriter(authData,"NEWA401"); + assertXmlEquals(clearSamlAssertion(authData.getSamlAssertion()), readXmldata("AuthenticationData.xml")); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA451() throws Exception { + try { + try { + AuthenticationData authData = server.getAuthenticationData("AAGu1JFbyGKqJ+3NAonwMu5bNyUc7kooeMK6bxeXBbnK6NL0DfuVJsGi"); + authDataWriter(authData, "A45"); + if (authData != null) + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA452() throws Exception { + try { + server.getAuthenticationData(samlArtifact); + try { + server.getAuthenticationData(samlArtifact); + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA453() throws Exception { + try { + server.setSecondsAuthDataTimeOut(-1000); + server.cleanup(); + try { + server.getAuthenticationData(samlArtifact); + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA454() throws Exception { + try { + try { + server.getAuthenticationData("blabla123"); + fail(); + } + catch (AuthenticationException e) { + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------"); + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test500StartAuthenticationServlet.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test500StartAuthenticationServlet.java new file mode 100644 index 000000000..f4f37a871 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test500StartAuthenticationServlet.java @@ -0,0 +1,305 @@ +package test.abnahme.A; + +import java.io.OutputStream; +import java.net.URL; +import java.security.Security; + +import javax.net.ssl.SSLSocketFactory; + +import test.abnahme.AbnahmeTestCase; + +import at.gv.egovernment.moa.util.StreamUtils; +import at.gv.egovernment.moa.util.URLEncoder; + +import com.sun.net.ssl.HostnameVerifier; +import com.sun.net.ssl.HttpsURLConnection; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class Test500StartAuthenticationServlet extends AbnahmeTestCase { + + private String testdataRoot = TESTDATA_ROOT + "xmldata/standard/"; + SSLSocketFactory ssf; + public Test500StartAuthenticationServlet(String name) { + super(name); + } + protected void setUp() throws Exception { + super.setUp(); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); + } + + public void testA501() throws Exception { + //NUR einmal für alle folgenden Testfälle + //---------------------------------------- + + //---------------------------------------- + + try { + String targetURL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(targetURL, "GET"); + conn.connect(); + int resultCode = conn.getResponseCode(); + String contentType = conn.getHeaderField("Content-Type"); + if (resultCode != 200) + fail("Wrong HTTP-Code"); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) + fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); + conn.disconnect(); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA502() throws Exception { + try { + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + int resultCode = conn.getResponseCode(); + String contentType = conn.getHeaderField("Content-Type"); + if (resultCode != 200) + fail("Wrong HTTP-Code: expected '200' and was '" + resultCode + "'"); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) + fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + + conn.disconnect(); + + URL = parseDataURL(result); + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + System.out.println("File gelesen, Daten in Outputstream einpflegen"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes("UTF-8")); + out.flush(); + out.close(); + + System.out.println("Verbinden zu " + URL); + conn.connect(); + resultCode = conn.getResponseCode(); + System.out.println("resultCode :" + resultCode); + String redirectLoc = conn.getHeaderField("Location"); + System.out.println("redirectLoc :" + redirectLoc); + // Austausch von VerifyIdentityLink in der POST-URL durch VerifyAuthBlock... rest MUSS gleich sein! + if (!killInclusive(URL, "VerifyI", "Link", "VerifyAuthBlock").equals(redirectLoc)) + fail("Wrong Redirect-Location: expected " + URL + " and was " + conn.getHeaderField("Location")); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/xml")) + fail("Wrong contentType: expected text/xml and was " + conn.getHeaderField("Content-Type")); + conn.disconnect(); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA503() throws Exception { + try { + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + + assertEquals(200,conn.getResponseCode()); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) + fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + URL = parseDataURL(result); + + conn.disconnect(); + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + String redirectLoc = conn.getHeaderField("Location"); + // Austausch von VerifyIdentityLink in der POST-URL durch VerifyAuthBlock... rest MUSS gleich sein! + if (!killInclusive(URL, "VerifyI", "Link", "VerifyAuthBlock").equals(redirectLoc)) + fail("Wrong Redirect-Location: expected " + URL + " and was " + conn.getHeaderField("Location")); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/xml")) + fail("Wrong contentType: expected text/xml and was " + conn.getHeaderField("Content-Type")); + conn.disconnect(); + + conn = giveConnection(redirectLoc, "POST"); + System.out.println("Redirect Location: " + redirectLoc); + String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + out = conn.getOutputStream(); + out.write(("XMLResponse=" +createXMLSignatureResponse).getBytes()); + out.flush(); + out.close(); + + System.out.println("Sending Data to " + redirectLoc); + conn.connect(); + + redirectLoc = conn.getHeaderField("Location"); + System.out.println("redirectLoc: " + redirectLoc); + /* RandomAccessFile raf = new RandomAccessFile("C://503.xml", "rw"); + raf.write(StreamUtils.readStream(conn.getInputStream())); + raf.close();*/ + conn.disconnect(); + assertEquals(302, conn.getResponseCode()); + assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA551() throws Exception { + try { + String targetURL = getURL("https://localhost:8443/moa-id-auth/", "gb", ""); + HttpsURLConnection conn = giveConnection(targetURL, "GET"); + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + assertTrue(result.indexOf("Die Angabe der Parameter ist unvollständig") >= 0); + conn.disconnect(); + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: Die Angabe der Parameter ist unvollständig.\n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA552() throws Exception { + try { + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + int resultCode = conn.getResponseCode(); + assertEquals(200, resultCode); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) + fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); + conn.disconnect(); + URL = "https://localhost:8443/moa-id-auth/" + "VerifyIdentityLink?MOASessionID=0000"; + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + assertTrue(result.indexOf("MOASessionID ist unbekannt") >= 0); + System.out.println("Fehler in testA552 erfolgreich abgefangen: MOASessionID ist unbekannt"); + conn.disconnect(); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testA553() throws Exception { + try { + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + int resultCode = conn.getResponseCode(); + assertEquals(200,resultCode); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/html")) + fail("Wrong contentType: expected text/html and was " + conn.getHeaderField("Content-Type")); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + String MOASessionID = parseSessionIDFromForm(result); + URL = parseDataURL(result); + conn.disconnect(); + + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + result = new String(StreamUtils.readStream(conn.getInputStream())); + String redirectLoc = conn.getHeaderField("Location"); + // Austausch von VerifyIdentityLink in der POST-URL durch VerifyAuthBlock... rest MUSS gleich sein! + if (!killInclusive(URL, "VerifyI", "Link", "VerifyAuthBlock").equals(redirectLoc)) + fail("Wrong Redirect-Location: expected " + URL + " and was " + conn.getHeaderField("Location")); + if (!conn.getHeaderField("Content-Type").equalsIgnoreCase("text/xml")) + fail("Wrong contentType: expected text/xml and was " + conn.getHeaderField("Content-Type")); + conn.disconnect(); + conn = giveConnection(redirectLoc + "XXX", "POST"); + System.out.println("Redirect Location: " + redirectLoc + "XXX"); + String createXMLSignatureResponse = "XMLResponse=" + URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + + out = conn.getOutputStream(); + out.write(new String("MOASessionID=" + MOASessionID + "&").getBytes()); + out.write(createXMLSignatureResponse.getBytes("UTF-8")); + out.flush(); + out.close(); + System.out.println("Sending Data to " + redirectLoc); + conn.connect(); + resultCode = conn.getResponseCode(); + + result = new String(StreamUtils.readStream(conn.getInputStream())); + conn.disconnect(); + assertEquals(200, resultCode); + assertTrue(result.indexOf("MOASessionID ist unbekannt") >= 0); + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + private String parseDataURL(String input) { + String ret = getSubString(input.substring(input.indexOf("DataURL"), input.length()), "value=\"", "\""); + return ret; + } + + private String getSubString(String input, String startsWith, String endsWith) { + return input.substring(input.indexOf(startsWith) + startsWith.length(), input.indexOf(endsWith, input.indexOf(startsWith) + startsWith.length())); + } + private String getURL(String authURL, String target, String oaURL) { + return authURL + "StartAuthentication?Target=" + target + "&OA=" + oaURL; + } + private String parseSessionIDFromForm(String htmlForm) { + String parName = "MOASessionID="; + assertTrue("HTML Form enthält keine SessionID", htmlForm.indexOf(parName) >= 0); + int i1 = htmlForm.indexOf(parName) + parName.length(); + int i2 = htmlForm.indexOf("\"", i1); + assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); + return htmlForm.substring(i1, i2); + } + + private class HostnameVerifierHack implements HostnameVerifier { + public boolean verify(String arg0, String arg1) { + return true; + } + } + private HttpsURLConnection giveConnection(String targetURL, String requestMethod) throws Exception { + URL url = new URL(targetURL); + HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); + conn.setRequestMethod(requestMethod); + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + conn.setAllowUserInteraction(false); + conn.setHostnameVerifier(new HostnameVerifierHack()); + return conn; + } + +} \ No newline at end of file diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java new file mode 100644 index 000000000..b44852346 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java @@ -0,0 +1,281 @@ +package test.abnahme.A; + +import java.io.OutputStream; +import java.net.URL; +import java.security.Security; +import java.util.Calendar; +import java.util.Vector; + +import javax.xml.namespace.QName; +import javax.xml.rpc.Call; +import javax.xml.rpc.Service; +import javax.xml.rpc.ServiceFactory; + +import org.apache.axis.message.SOAPBodyElement; +import org.w3c.dom.Element; + +import com.sun.net.ssl.HostnameVerifier; +import com.sun.net.ssl.HttpsURLConnection; + +import test.abnahme.AbnahmeTestCase; + +import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.DateTimeUtils; +import at.gv.egovernment.moa.util.StreamUtils; +import at.gv.egovernment.moa.util.URLDecoder; +import at.gv.egovernment.moa.util.URLEncoder; + +/** + * @author Stefan Knirsch + * @version $Id$ + */ + +public class Test600GetAuthenticationDataService extends AbnahmeTestCase { + + private String moaSessionID; + private String samlArtifact; + private static final QName SERVICE_QNAME = new QName("SignatureCreation"); + + public Test600GetAuthenticationDataService(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); + } + + public void testA601() throws Exception { + try { + + // Anmelden + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + String MOASessionID = parseSessionIDFromForm(result); + conn.disconnect(); + + URL = parseDataURL(result); + // Verify Identity Link + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + String redirectLoc = conn.getHeaderField("Location"); + conn.disconnect(); + //Verify Auth Block + conn = giveConnection(redirectLoc, "POST"); + String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + out = conn.getOutputStream(); + out.write(("MOASessionID=" + moaSessionID + "&XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); + out.flush(); + out.close(); + conn.connect(); + redirectLoc = conn.getHeaderField("Location"); + samlArtifact = parseSamlArtifact(redirectLoc); + System.out.println("SamlArtifact: " + samlArtifact); + conn.disconnect(); + + assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); + + conn = null; + + SAMLRequestBuilder srb = new SAMLRequestBuilder(); + + Element erg = doCall(srb.build(moaSessionID,URLDecoder.decode(samlArtifact, "UTF-8"))); + result = DOMUtils.serializeNode(erg); + result = killInclusive(result,"IssueInstant=\"","\"",""); + result = killInclusive(result,"AssertionID=\"","\"",""); + result = killInclusive(result,"ResponseID=\"","\"",""); + +// writeXmldata("GetAuthenticationDataWebServiceResponse.xml", result.getBytes("UTF-8")); + + assertEquals(result,readXmldata("GetAuthenticationDataWebServiceResponse.xml")); + + System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA651() throws Exception { + try { + + // Anmelden + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + String MOASessionID = parseSessionIDFromForm(result); + conn.disconnect(); + + URL = parseDataURL(result); + // Verify Identity Link + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + String redirectLoc = conn.getHeaderField("Location"); + conn.disconnect(); + //Verify Auth Block + conn = giveConnection(redirectLoc, "POST"); + String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + out = conn.getOutputStream(); + out.write(("MOASessionID=" + moaSessionID + "&XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); + out.flush(); + out.close(); + conn.connect(); + redirectLoc = conn.getHeaderField("Location"); + samlArtifact = "AAGu1JFbyGKqJ+3NAonwMu5bNyUc7kooeMK6bxeXBbnK6NL0DfuVJsGi"; + System.out.println("SamlArtifact: " + samlArtifact); + conn.disconnect(); + + assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); + + conn = null; + + SAMLRequestBuilder srb = new SAMLRequestBuilder(); + Element samlPRequest = srb.build(moaSessionID,samlArtifact); + + assertTrue(DOMUtils.serializeNode(doCall(samlPRequest)).indexOf("unbekanntes SAML-Artifakt")!=-1); + + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: Fehler beim Abholen der Anmeldedaten, unbekanntes SAML-Artifakt\n-----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testA652() throws Exception { + try { + + // Anmelden + String URL = getURL("https://localhost:8443/moa-id-auth/", "gb", "https://localhost:9443/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + String MOASessionID = parseSessionIDFromForm(result); + conn.disconnect(); + + URL = parseDataURL(result); + // Verify Identity Link + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + String redirectLoc = conn.getHeaderField("Location"); + conn.disconnect(); + //Verify Auth Block + conn = giveConnection(redirectLoc, "POST"); + String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + out = conn.getOutputStream(); + out.write(("MOASessionID=" + moaSessionID + "&XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); + out.flush(); + out.close(); + conn.connect(); + redirectLoc = conn.getHeaderField("Location"); + samlArtifact = parseSamlArtifact(redirectLoc); + System.out.println("SamlArtifact: " + samlArtifact); + conn.disconnect(); + + assertTrue(redirectLoc.startsWith("https://localhost:9443/?Target=gb&SAMLArtifact=")); + + conn = null; + String request = + "" + + ""; + + Element samlPRequest = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + + assertTrue(DOMUtils.serializeNode(doCall(samlPRequest)).indexOf("Fehlerhaftes Requestformat")!=-1); +// writeXmldata("GetAuthenticationDataWebServiceResponse.xml", result.getBytes("UTF-8")); + System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: Fehlerhaftes Requestformat\n-----------------------"); } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + protected Element doCall(Element request) + throws Exception { + QName serviceName = new QName("GetAuthenticationData"); + String endPoint = "http://localhost:8080/moa-id-auth/services/GetAuthenticationData"; + Service service = ServiceFactory.newInstance().createService(serviceName); + Call call = service.createCall(); + SOAPBodyElement body = + new SOAPBodyElement(request); + SOAPBodyElement[] params = new SOAPBodyElement[] {body}; + Vector responses; + SOAPBodyElement response; + + call.setTargetEndpointAddress(endPoint); + responses = (Vector) call.invoke(params); + response = (SOAPBodyElement) responses.get(0); + + return response.getAsDOM(); + } + + private String parseDataURL(String input) + { + return getSubString(input.substring(input.indexOf("DataURL"),input.length()),"value=\"","\""); + } + private String parseSamlArtifact(String input) + { + return getSubString(input+"@@@","SAMLArtifact=","@@@"); + } + private String getSubString(String input, String startsWith, String endsWith) + { + return input.substring(input.indexOf(startsWith)+startsWith.length(), input.indexOf(endsWith, input.indexOf(startsWith)+startsWith.length())); + } + private String getURL(String authURL, String target, String oaURL) + { + return authURL + "StartAuthentication?Target=" + target + "&OA=" + oaURL; + } + private String parseSessionIDFromForm(String htmlForm) { + String parName = "MOASessionID="; + assertTrue( + "HTML Form enthält keine SessionID", + htmlForm.indexOf(parName) >= 0); + int i1 = htmlForm.indexOf(parName) + parName.length(); + int i2 = htmlForm.indexOf("\"", i1); + assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); + return htmlForm.substring(i1, i2); + } + private HttpsURLConnection giveConnection(String targetURL, String requestMethod) throws Exception { + HttpsURLConnection conn = (HttpsURLConnection) new URL(targetURL).openConnection(); + conn.setRequestMethod(requestMethod); + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + conn.setAllowUserInteraction(false); + conn.setHostnameVerifier(new HostnameVerifierHack()); + return conn; + } + private class HostnameVerifierHack implements HostnameVerifier { + public boolean verify(String arg0, String arg1) { + return true; + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test700SelectBKU.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test700SelectBKU.java new file mode 100644 index 000000000..9cfa47033 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test700SelectBKU.java @@ -0,0 +1,63 @@ +package test.abnahme.A; + +import test.abnahme.AbnahmeTestCase; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class Test700SelectBKU extends AbnahmeTestCase { + + public Test700SelectBKU(String name) { + super(name); + } + + public void testA701() throws Exception { + try { + String form = server.selectBKU( + "https://localhost:8443/auth", + "gb", + "https://localhost:9443/", + "file:" + getTestCaseDirectory() + "BKUSelectionTemplate.html", + "file:" + getTestCaseDirectory() + "Template.html"); + //writeXmldata("SelectBKUForm_out.html", form.getBytes()); + assertEqualsIgnoreSessionID(readXmldata("SelectBKUForm.html"), form); + } + catch (Exception ex) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + ex.getLocalizedMessage()); + throw ex; + } + } + public void testA702() throws Exception { + try { + String form = server.selectBKU( + "https://localhost:8443/auth", + "gb", + "https://localhost:9443/", + null, + null); + //writeXmldata("SelectBKUForm_out.html", form.getBytes()); + assertEqualsIgnoreSessionID(readXmldata("SelectBKUForm.html"), form); + } + catch (Exception ex) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + ex.getLocalizedMessage()); + throw ex; + } + } + public void testA703() throws Exception { + try { + String form = server.selectBKU( + "https://localhost:8443/auth", + "gb", + "https://localhost:9443/", + null, + null); + //writeXmldata("SelectBKUForm_out.html", form.getBytes()); + assertEqualsIgnoreSessionID(readXmldata("SelectBKUForm.html"), form); + } + catch (Exception ex) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + ex.getLocalizedMessage()); + throw ex; + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java b/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java new file mode 100644 index 000000000..e0e6fc183 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java @@ -0,0 +1,163 @@ +package test.abnahme; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; + +import test.MOAIDTestCase; + +import at.gv.egovernment.moa.id.MOAIDException; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.data.AuthenticationData; + +/** + * Base class for MOA ID test cases. + * + * Provides some utility functions. + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class AbnahmeTestCase extends MOAIDTestCase { + + protected static final String TESTDATA_ROOT = "data/abnahme-test/"; + protected static final String TESTDATA_XMLDATA = "data/abnahme-test/xmldata/"; + protected static final String AUTH_ENDPOINT = "http://localhost:8080/moa-id-auth/"; + protected AuthenticationServer server; + + /** + * Constructor for MOATestCase. + * @param arg0 + */ + public AbnahmeTestCase(String name) { + super(name); + } + /** + * Set up a transaction context with a test configuration. + */ + protected void setUp() throws Exception { + + System.out.print("--------S-T-A-R-T----V-O-N----"); + System.out.print(getName().toUpperCase().substring(4,getName().length())); + System.out.print("-----------------------------\n"); + + // Set moa.spss.server.configuration property + System.setProperty("moa.spss.server.configuration",TESTDATA_ROOT + "conf/moa/ConfigurationTest.xml"); + + // Set moa.id.configuration property + String pathname = findXmldata("Configuration.xml"); + System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, pathname); + System.out.println("Konfiguration " + pathname); + AuthConfigurationProvider.reload(); + + server = AuthenticationServer.getInstance(); + } + /** Test case z.B. "A153" */ + protected String getID() { + return getName().toUpperCase().substring(4,getName().length()); + } + /** Test group z.B. "A100" */ + protected String getTestGroup() { + return getID().substring(0, 2) + "00"; + } + /** Test case data directory */ + protected String getTestCaseDirectory() { + return getTestGroupDirectory() + getID() + "/"; + } + /** Test group data directory */ + protected String getTestGroupDirectory() { + return TESTDATA_XMLDATA + getTestGroup() + "/"; + } + /** Finds a file in the xmldata directory */ + protected String findXmldata(String filename) { + String pathname = getTestCaseDirectory() + filename; + if (! new File(pathname).exists()) { + pathname = getTestGroupDirectory() + filename; + if (! new File(pathname).exists()) { + pathname = TESTDATA_XMLDATA + filename; + } + } + return pathname; + } + /** Finds and reads a file in the xmldata directory */ + protected String readXmldata(String filename) throws IOException { + String pathname = findXmldata(filename); + System.out.println("Read file " + pathname); + return readFile(pathname); + } + protected void writeXmldata(String filename, byte[] content) throws Exception { + String pathname = getTestCaseDirectory() + filename; + System.out.println("Write file " + pathname); + RandomAccessFile raf = new RandomAccessFile(pathname, "rw"); + byte[] data = content; + raf.write(data); + raf.setLength(data.length); + raf.close(); + } + + /** + * Creates a session using standard parameters, + * and returns the session ID. + */ + protected String startAuthentication() throws MOAIDException { + return startAuthentication("https://localhost:9443/"); + } + /** + * Creates a session using standard parameters, + * and returns the session ID. + */ + protected String startAuthentication(String oaURL) throws MOAIDException { + String htmlForm = AuthenticationServer.getInstance().startAuthentication( + "https://localhost:8443/auth", + "gb", + oaURL, + null, + null, + null); + String sessionID = parseSessionIDFromForm(htmlForm); + return sessionID; + } + private String parseSessionIDFromForm(String htmlForm) { + String parName = "MOASessionID="; + assertTrue( + "HTML Form enthält keine SessionID", + htmlForm.indexOf(parName) >= 0); + int i1 = htmlForm.indexOf(parName) + parName.length(); + int i2 = i1; + while(i2 < htmlForm.length() && + (htmlForm.charAt(i2) == '-' || (htmlForm.charAt(i2) >= '0' && htmlForm.charAt(i2) <= '9'))) + i2++; + assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); + return htmlForm.substring(i1, i2); + } + protected String clearSessionID(String htmlForm) { + String sessionID = parseSessionIDFromForm(htmlForm); + int i1 = htmlForm.indexOf(sessionID); + int i2 = i1 + sessionID.length(); + return htmlForm.substring(0, i1) + htmlForm.substring(i2); + } + protected void assertEqualsIgnoreSessionID(String s1, String s2) { + String ss1 = clearSessionID(s1); + String ss2 = clearSessionID(s2); + assertEquals(ss1, ss2); + } + protected void authDataWriter(AuthenticationData authData, String filename) throws Exception + { + writeXmldata("AuthenticationDataNEW.xml", clearSamlAssertion(authData.getSamlAssertion()).getBytes("UTF-8")); + } + + /** + * clearSamlAssertion löscht aus einer beliebiegen String-Repräsentation einer XML-Struktur + * AUSSLIESSLICH die Attribute 'IssueInstant' und 'AssertionID' heraus. + * @param samlAssertion + * @return String + */ + protected String clearSamlAssertion(String samlAssertion) + { + String result = killInclusive(samlAssertion,"IssueInstant='", "'",""); + result = killInclusive(result,"AssertionID='", "'",""); + return result; + } +} \ No newline at end of file diff --git a/id/server/idserverlib/src/test/java/test/abnahme/AllTests.java b/id/server/idserverlib/src/test/java/test/abnahme/AllTests.java new file mode 100644 index 000000000..56a38be28 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/AllTests.java @@ -0,0 +1,49 @@ +package test.abnahme; + +import junit.awtui.TestRunner; +import junit.framework.*; + +import test.abnahme.A.Test100StartAuthentication; +import test.abnahme.A.Test200VerifyIdentityLink; +import test.abnahme.A.Test300VerifyAuthBlock; +import test.abnahme.A.Test400GetAuthenticationData; +import test.abnahme.A.Test500StartAuthenticationServlet; +import test.abnahme.A.Test600GetAuthenticationDataService; +import test.abnahme.A.Test700SelectBKU; +import test.abnahme.C.Test100Konfiguration; +import test.abnahme.P.Test100LoginParameterResolver; + + + + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(Test100StartAuthentication.class); + suite.addTestSuite(Test200VerifyIdentityLink.class); + suite.addTestSuite(Test300VerifyAuthBlock.class); + suite.addTestSuite(Test400GetAuthenticationData.class); + suite.addTestSuite(Test500StartAuthenticationServlet.class); + suite.addTestSuite(Test600GetAuthenticationDataService.class); + suite.addTestSuite(Test700SelectBKU.class); + + suite.addTestSuite(Test100LoginParameterResolver.class); + + suite.addTestSuite(Test100Konfiguration.class); + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/C/Test100Konfiguration.java b/id/server/idserverlib/src/test/java/test/abnahme/C/Test100Konfiguration.java new file mode 100644 index 000000000..7da5a7449 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/C/Test100Konfiguration.java @@ -0,0 +1,60 @@ +package test.abnahme.C; + +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; + +import test.abnahme.AbnahmeTestCase; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ + +public class Test100Konfiguration extends AbnahmeTestCase { + + public Test100Konfiguration(String name) { + super(name); + } + + public void testC001() throws Exception { + try { + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testC002() throws Exception { + try { + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testC003() throws Exception { + try { + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + public void testC051() throws Exception { + try { + // Set moa.id.configuration property + String pathname = findXmldata("ConfigurationC051.xml"); + System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, pathname); + System.out.println("Konfiguration " + pathname); + AuthConfigurationProvider.reload(); + } + catch (Exception e) { + System.out.println("-----------------------Fehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "-----------------------"); + } + // AuthConfigurationProvider.getInstance().getBKUConnectionParameter().getAcceptedServerCertificates() + } +} diff --git a/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java b/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java new file mode 100644 index 000000000..21958a367 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java @@ -0,0 +1,146 @@ +package test.abnahme.P; +import java.util.Map; + +import sun.misc.BASE64Decoder; +import test.abnahme.AbnahmeTestCase; + +import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.proxy.LoginParameterResolver; +import at.gv.egovernment.moa.id.proxy.LoginParameterResolverFactory; +import at.gv.egovernment.moa.util.Base64Utils; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ + +public class Test100LoginParameterResolver extends AbnahmeTestCase { + + private static final String CLIENT_IP_ADDRESS = "56.246.75.11"; + private OAConfiguration oaConf; + private LoginParameterResolver lpr; + + public Test100LoginParameterResolver(String name) { + super(name); + } + + private void setUp(String publicURLPrefix) + throws Exception { + + // get configuration data + ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); + OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(publicURLPrefix); + oaConf = oaParam.getOaConfiguration(); + System.out.println("Parameterübergabe: " + oaConf.getAuthType()); + + // get login parameter resolver + LoginParameterResolverFactory.initialize(); + lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); + } + public void testP101() throws Exception { + try { + // read configuration and set up LoginParameterResolver + setUp("https://testP101:9443/"); + if (! oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) + fail(); + + // assemble authentication data + AuthenticationData authData = new AuthenticationData(); + authData.setFamilyName("Huber"); + authData.setGivenName("Hugo"); + + // resolve login headers + Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); + + // validate login headers + assertEquals(1, loginHeaders.keySet().size()); + System.out.println("Header Authorization: " + loginHeaders.get("Authorization")); + System.out.println("Decoded UserID:Password " + + new String(new BASE64Decoder().decodeBuffer(((String)loginHeaders.get("Authorization")).substring(6)))); + String userIDPassword = "Hugo:Huber"; + String credentials = Base64Utils.encode(userIDPassword.getBytes()); + assertEquals("Basic " + credentials, loginHeaders.get("Authorization")); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + + } + public void testP102() throws Exception { + try { + // read configuration and set up LoginParameterResolver + setUp("https://testP102:9443/"); + if (! oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) + fail(); + + // assemble authentication data + AuthenticationData authData = new AuthenticationData(); + String DATE_OF_BIRTH = "1963-12-29"; + String VPK = "kp6hOq6LRAkLtrqm6EvDm6bMwJw="; + authData.setDateOfBirth(DATE_OF_BIRTH); + authData.setBPK(VPK); + + // resolve login parameters + Map loginParameters = lpr.getAuthenticationParameters(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); + + // validate login headers + assertEquals(2, loginParameters.keySet().size()); + System.out.println("Param1: " + loginParameters.get("Param1")); + System.out.println("Param2: " + loginParameters.get("Param2")); + assertEquals(DATE_OF_BIRTH, loginParameters.get("Param1")); + assertEquals(VPK, loginParameters.get("Param2")); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } + + public void testP103() throws Exception { + try { + // read configuration and set up LoginParameterResolver + setUp("https://localhost:9443/"); + if (! oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) + fail(); + + // assemble authentication data + AuthenticationData authData = new AuthenticationData(); + boolean PUBLIC_AUTH = true; + String BKZ = "FinanzamtWien23Leitstelle"; + boolean QUAL_CERT = false; + String STAMMZAHL = "3456789012"; + authData.setPublicAuthority(PUBLIC_AUTH); + authData.setPublicAuthorityCode(BKZ); + authData.setQualifiedCertificate(QUAL_CERT); + authData.setIdentificationValue(STAMMZAHL); + + // resolve login headers + Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); + + // validate login headers + assertEquals(5, loginHeaders.keySet().size()); + System.out.println("Header Param1: " + loginHeaders.get("Param1")); + System.out.println("Header Param2: " + loginHeaders.get("Param2")); + System.out.println("Header Param3: " + loginHeaders.get("Param3")); + System.out.println("Header Param4: " + loginHeaders.get("Param4")); + System.out.println("Header Param5: " + loginHeaders.get("Param5")); + assertEquals(String.valueOf(PUBLIC_AUTH), loginHeaders.get("Param1")); + assertEquals(BKZ, loginHeaders.get("Param2")); + assertEquals(String.valueOf(QUAL_CERT), loginHeaders.get("Param3")); + assertEquals(STAMMZAHL, loginHeaders.get("Param4")); + assertEquals(CLIENT_IP_ADDRESS, loginHeaders.get("Param5")); + System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); + } + catch (Exception e) { + System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); + throw e; + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/AllTests.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/AllTests.java new file mode 100644 index 000000000..69ed3d12b --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/AllTests.java @@ -0,0 +1,41 @@ +package test.at.gv.egovernment.moa.id; + +import test.at.gv.egovernment.moa.id.auth.AuthenticationServerTest; +import test.at.gv.egovernment.moa.id.auth.servlet.GetAuthenticationDataServiceTest; +import test.at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationTest; +import test.at.gv.egovernment.moa.id.config.auth.MOAIDAuthConfigurationProviderTest; +import test.at.gv.egovernment.moa.id.config.proxy.MOAIDProxyConfigurationProviderTest; + +import junit.awtui.TestRunner; +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(AuthenticationServerTest.class); + suite.addTest(test.at.gv.egovernment.moa.id.auth.builder.AllTests.suite()); + suite.addTest(test.at.gv.egovernment.moa.id.auth.parser.AllTests.suite()); + suite.addTestSuite(GetAuthenticationDataServiceTest.class); + suite.addTestSuite(SignatureVerificationTest.class); + suite.addTestSuite(MOAIDAuthConfigurationProviderTest.class); + suite.addTestSuite(MOAIDProxyConfigurationProviderTest.class); + suite.addTest(test.at.gv.egovernment.moa.id.proxy.AllTests.suite()); + + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/UnitTestCase.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/UnitTestCase.java new file mode 100644 index 000000000..8309a4f7e --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/UnitTestCase.java @@ -0,0 +1,35 @@ +package test.at.gv.egovernment.moa.id; + +import test.MOAIDTestCase; + +import at.gv.egovernment.moa.id.config.ConfigurationProvider; + +/** + * Base class for MOA ID test cases. + * + * Provides some utility functions. + * + * @author Patrick Peck + * @version $Id$ + */ +public class UnitTestCase extends MOAIDTestCase { + + protected static final String TESTDATA_ROOT = "data/test/"; + + /** + * Constructor for MOATestCase. + * @param arg0 + */ + public UnitTestCase(String name) { + super(name); + } + /** + * Set up a transaction context with a test configuration. + */ + protected void setUp() throws Exception { + System.setProperty( + ConfigurationProvider.CONFIG_PROPERTY_NAME, + TESTDATA_ROOT + "conf/ConfigurationTest.xml"); + } + +} \ No newline at end of file diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java new file mode 100644 index 000000000..5acb23dc2 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java @@ -0,0 +1,56 @@ +package test.at.gv.egovernment.moa.id.auth; + +import java.util.HashMap; + +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.data.AuthenticationData; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationServerTest extends UnitTestCase { + + public AuthenticationServerTest(String name) { + super(name); + } + + public void testStandard() throws Exception { + doTest( + "standard", + "https://localhost:8443/auth", + "gb", + "https://localhost:9443/", + null, + null); + } + public void doTest(String testdataDirectory, String authURL, String target, String oaURL, String bkuURL, String templateURL) throws Exception { + String testdataRoot = TESTDATA_ROOT + "xmldata/" + testdataDirectory + "/"; + AuthenticationServer server = AuthenticationServer.getInstance(); + String htmlForm = server.startAuthentication(authURL, target, oaURL, templateURL, bkuURL, null); + String sessionID = parseSessionIDFromForm(htmlForm); + String infoboxReadResponse = readFile(TESTDATA_ROOT + "xmldata/testperson1/" + "InfoboxReadResponse.xml"); + HashMap parameters = new HashMap(1); + parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse); + + String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, parameters); + String createXMLSignatureRequestShould = readFile(testdataRoot + "CreateXMLSignatureRequest.xml"); + assertXmlEquals(createXMLSignatureRequestShould, createXMLSignatureRequest); + String createXMLSignatureResponse = readFile(testdataRoot + "CreateXMLSignatureResponse.xml"); + String samlArtifact = server.verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + AuthenticationData authData = server.getAuthenticationData(samlArtifact); + String authDataShould = readFile(testdataRoot + "AuthenticationDataAssertion.xml"); + assertXmlEquals(authDataShould, authData.getSamlAssertion()); + } + private String parseSessionIDFromForm(String htmlForm) { + String parName = "MOASessionID="; + assertTrue("HTML Form enthält keine SessionID", htmlForm.indexOf(parName) >= 0); + int i1 = htmlForm.indexOf(parName) + parName.length(); + int i2 = htmlForm.indexOf("\"", i1); + assertTrue("HTML Form enthält keine gültige SessionID", i2 > i1); + return htmlForm.substring(i1, i2); + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java new file mode 100644 index 000000000..81cdfb9f8 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/MOAIDAuthInitialiserTest.java @@ -0,0 +1,47 @@ +package test.at.gv.egovernment.moa.id.auth; + +import java.security.KeyStore; +import java.util.Enumeration; + +import test.at.gv.egovernment.moa.id.UnitTestCase; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.util.KeyStoreUtils; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class MOAIDAuthInitialiserTest extends UnitTestCase { + + public MOAIDAuthInitialiserTest(String name) { + super(name); + } + + public void testInit() throws Exception + { +// System.setProperty( +// ConfigurationProvider.CONFIG_PROPERTY_NAME,"C://Programme/ApacheGroup/abnahme/conf/moa-id/SampleMOAIDConfiguration.xml"); +// System.setProperty( +// ConfigurationProvider.CONFIG_PROPERTY_NAME,"D://Daten/_Projects/moa_id_maengel/SampleMOAIDConfiguration.xml"); + SSLUtils.initialize(); + + try { + KeyStore s = KeyStoreUtils.loadKeyStore("pkcs12","file:C:/Programme/ApacheGroup/abnahme/cert/keystore.p12","changeit"); + System.out.println(s.getProvider().getClass().getName()); + Enumeration aliases = s.aliases(); + while (aliases.hasMoreElements()) { + String element = (String) aliases.nextElement(); + System.out.print(element+":"); + System.out.println(s.getCertificate(element).getPublicKey().getAlgorithm()); + System.out.println(s.getCertificate(element).getType()); + } + + + System.out.println(s.getCertificate("pc41408").getPublicKey().getFormat()); + + } + catch (Exception e) {e.printStackTrace();}; + + } + + } diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java new file mode 100644 index 000000000..2940f0ec7 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AllTests.java @@ -0,0 +1,33 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import junit.awtui.TestRunner; +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author patrick + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + +// suite.addTestSuite(AuthenticationBlockAssertionBuilderTest.class); + suite.addTestSuite(CreateXMLSignatureBuilderTest.class); +// suite.addTestSuite(GetIdentityLinkFormBuilderTest.class); +// suite.addTestSuite(InfoboxReadRequestBuilderTest.class); +// suite.addTestSuite(PersonDataBuilderTest.class); +// suite.addTestSuite(SAMLArtifactBuilderTest.class); + + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java new file mode 100644 index 000000000..8cc8797ef --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilderTest.java @@ -0,0 +1,47 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class AuthenticationBlockAssertionBuilderTest extends UnitTestCase { + private static final String nl = "\n"; + private static final String ISSUER = "Hugo Mustermann"; + private static final String ISSUE_INSTANT = "2003-03-15T22:50:21+01:00"; + private static final String AUTH_URL = "https://auth.moa.gv.at/"; + private static final String TARGET = "Grundbuch"; + private static final String OA_URL = "https://grundbuch.gv.at/"; + private static final String GEB_DAT = "2004-01-02"; + + // wird auch von CreateXMLSignatureBuilderTest verwendet ! + public static final String ASSERTION_SHOULD = +"" + nl + +" " + nl + +" " + nl + +" " + AUTH_URL + "" + nl + +" " + nl + +" " + nl + +" " + TARGET + "" + nl + +" " + nl + +" " + nl + +" " + OA_URL + "" + nl + +" " + nl + +" " + nl + +""; + + public AuthenticationBlockAssertionBuilderTest(String name) { + super(name); + } + + public void testBuild() throws Exception { + AuthenticationBlockAssertionBuilder builder = new AuthenticationBlockAssertionBuilder(); + String assertionBuilt = builder.buildAuthBlock(ISSUER, ISSUE_INSTANT, AUTH_URL, TARGET, "", "", OA_URL, GEB_DAT, null, null); + assertionBuilt = XML_DECL + assertionBuilt; + String assertionShould = XML_DECL + ASSERTION_SHOULD; + assertXmlEquals(assertionShould, assertionBuilt); + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java new file mode 100644 index 000000000..1f4890dc9 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/CreateXMLSignatureBuilderTest.java @@ -0,0 +1,105 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.id.auth.builder.CreateXMLSignatureRequestBuilder; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class CreateXMLSignatureBuilderTest extends UnitTestCase { + private static final String nl = "\n"; + public static final String TRANSFORMS_INFO = + " " + nl + + " " + nl + + " " + nl + + " " + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + + " " + nl + + " " + nl + + " " + nl + + " text/html" + nl + + " " + nl + + " " + nl; + public static final String REQUEST_SHOULD = +"" + nl + +"" + nl + +" SecureSignatureKeypair" + nl + +" " + nl + +" " + nl + +TRANSFORMS_INFO + +" " + nl + +" " + nl + +" " + nl + +" " + AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD + "" + nl + +" " + nl + +" /saml:Assertion" + nl + +" " + nl + +""; + + + public static final String TRANSFORMS_INFO_SL12 = + " " + nl + + " " + nl + + " " + nl + + " " + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + +"" + nl + + " " + nl + + " " + nl + + " " + nl + + " text/html" + nl + + " " + nl + + " " + nl; + public static final String REQUEST_SHOULD_SL12 = +"" + nl + +"" + nl + +" SecureSignatureKeypair" + nl + +" " + nl + +" " + nl + +TRANSFORMS_INFO_SL12 + +" " + nl + +" " + nl + +" " + nl + +" " + AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD + "" + nl + +" " + nl + +" /saml:Assertion" + nl + +" " + nl + +""; + + + + + public CreateXMLSignatureBuilderTest(String name) { + super(name); + } + + public void testBuild() throws Exception { + // test build for Security Layer version 1.1 and 1.0 + String request = new CreateXMLSignatureRequestBuilder().build( + AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD, "SecureSignatureKeypair", + new String[] {TRANSFORMS_INFO}, + false); + assertXmlEquals(REQUEST_SHOULD, request); + // test build for Security Layer version 1.2 + String requestSL12 = new CreateXMLSignatureRequestBuilder().build( + AuthenticationBlockAssertionBuilderTest.ASSERTION_SHOULD, "SecureSignatureKeypair", + new String[] {TRANSFORMS_INFO}, + true); + assertXmlEquals(REQUEST_SHOULD_SL12, requestSL12); + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java new file mode 100644 index 000000000..c146984d0 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilderTest.java @@ -0,0 +1,73 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import java.text.MessageFormat; + +import junit.framework.TestCase; + +import at.gv.egovernment.moa.id.auth.builder.CertInfoVerifyXMLSignatureRequestBuilder; +import at.gv.egovernment.moa.id.auth.builder.GetIdentityLinkFormBuilder; +import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilder; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class GetIdentityLinkFormBuilderTest extends TestCase { + private static String nl = "\n"; + public static String FORM = + "" + nl + + "" + nl + + "" + nl + + "Auslesen der Personenbindung" + nl + + "" + nl + + "" + nl + + "

" + nl + + " " + nl + + " " + nl + + " " + nl + + "
" + nl + + "
" + nl + + " " + nl + + " " + nl + + " " + nl + + "
" + nl + + "" + nl + + ""; + public static String BKU = + "http://localhost:3495/http-security-layer-request"; + + public void testBuild() throws Exception { + String xmlRequest = new InfoboxReadRequestBuilder().build(false, false, null); + String dataURL = "https://1.2.3.4/auth/VerifyIdentityLink?MOASessionID=1234567"; + String infoRequest = new CertInfoVerifyXMLSignatureRequestBuilder().build(false); + String infoDataURL = "https://1.2.3.4/auth/StartAuthentication?Target=gb&OA=https://oa.gv.at/"; + String form = new GetIdentityLinkFormBuilder().build(null, null, xmlRequest, dataURL, infoRequest, infoDataURL, null); + String formShould = MessageFormat.format( + FORM, new Object[] { BKU, xmlRequest, dataURL, infoRequest, infoDataURL }); + assertEquals(formShould, form); + } + public void testBuildCustomBKU() throws Exception { + String xmlRequest = new InfoboxReadRequestBuilder().build(false, false, null); + String dataURL = "https://1.2.3.4/auth/AuthServlet/StartAuthentication?MOASessionID=1234567"; + String infoRequest = new CertInfoVerifyXMLSignatureRequestBuilder().build(false); + String infoDataURL = "https://1.2.3.4/auth/StartAuthentication?Target=gb&OA=https://oa.gv.at/"; + String bkuURL = "http://bku.at/"; + String form = new GetIdentityLinkFormBuilder().build(null, bkuURL, xmlRequest, dataURL, infoRequest, infoDataURL, null); + String formShould = MessageFormat.format( + FORM, new Object[] { bkuURL, xmlRequest, dataURL, infoRequest, infoDataURL }); + assertEquals(formShould, form); + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java new file mode 100644 index 000000000..24d01f96f --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/InfoboxReadRequestBuilderTest.java @@ -0,0 +1,29 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import org.w3c.dom.Document; +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilder; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class InfoboxReadRequestBuilderTest extends UnitTestCase implements Constants { + + public InfoboxReadRequestBuilderTest(String name) { + super(name); + } + + public void testBuild() throws Exception { + InfoboxReadRequestBuilder builder = new InfoboxReadRequestBuilder(); + String xmlBuilt = builder.build(false, false, null); + Document docBuilt = DOMUtils.parseDocument(xmlBuilt, false, ALL_SCHEMA_LOCATIONS, null); + String xmlBuiltSerialized = DOMUtils.serializeNode(docBuilt); + // xmlShould was generated by Hot:Sign Tester + String xmlShould = "IdentityLink"; + assertXmlEquals(xmlShould, xmlBuiltSerialized); + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java new file mode 100644 index 000000000..504679fd5 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/PersonDataBuilderTest.java @@ -0,0 +1,51 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; +import at.gv.egovernment.moa.util.Constants; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class PersonDataBuilderTest extends UnitTestCase implements Constants { + + /** + * Constructor for PersonDataBuilderTest. + */ + public PersonDataBuilderTest(String arg) { + super(arg); + } + public void testBuild() throws Exception { + String xmlInfoboxReadResponse = readFile("data/test/xmldata/testperson1/InfoboxReadResponse.xml"); + IdentityLink il = new InfoboxReadResponseParser(xmlInfoboxReadResponse).parseIdentityLink(); + String xmlPersonData = new PersonDataBuilder().build(il, true); + String xmlPersonDataShould = "123456789012http://reference.e-government.gv.at/names/persondata/20020228#zmr-zahlHermannMuster1968-10-22"; + assertPersonDataEquals(xmlPersonDataShould, xmlPersonData); + } + public void testBuildNoZMRZahl() throws Exception { + String xmlInfoboxReadResponse = readFile("data/test/xmldata/testperson1/InfoboxReadResponse.xml"); + IdentityLink il = new InfoboxReadResponseParser(xmlInfoboxReadResponse).parseIdentityLink(); + String xmlPersonData = new PersonDataBuilder().build(il, false); + String xmlPersonDataShould = XML_DECL + "HermannMuster1968-10-22"; + assertPersonDataEquals(xmlPersonDataShould, xmlPersonData); + } + private void assertPersonDataEquals(String s1, String s2) throws Exception { + String ss1 = insertPrNS(s1); + String ss2 = insertPrNS(s2); + assertXmlEquals(ss1, ss2); + } + private String insertPrNS(String xmlPersonData) { + int startNS = xmlPersonData.indexOf("Person") + "Person".length() + 1; + String s = + xmlPersonData.substring(0, startNS) + + "xmlns:pr=\"" + PD_NS_URI + "\" " + + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + + xmlPersonData.substring(startNS); + return s; + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java new file mode 100644 index 000000000..3ec73ee4c --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilderTest.java @@ -0,0 +1,52 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import at.gv.egovernment.moa.id.BuildException; +import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder; +import at.gv.egovernment.moa.util.Base64Utils; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLArtifactBuilderTest extends UnitTestCase { + + private static final String AUTH_URL = "https://moa.gv.at/auth/"; + private static final String SESSION_ID_1 = "123456"; + private static final String SESSION_ID_2 = "123457"; + private static final String SESSION_ID_3 = "1234567"; + + private SAMLArtifactBuilder builder; + private byte[] artifact1; + private byte[] artifact2; + private byte[] artifact3; + + public SAMLArtifactBuilderTest(String name) { + super(name); + } + protected void setUp() throws Exception { + builder = new SAMLArtifactBuilder(); + artifact1 = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_1), false); + artifact2 = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_2), false); + artifact3 = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_3), false); + } + + public void testBuildArtifactLength() throws BuildException { + assertEquals(42, artifact1.length); + assertEquals(42, artifact2.length); + assertEquals(42, artifact3.length); + } + public void testBuildSameArtifact() throws Exception { + byte[] artifact1Clone = Base64Utils.decode(builder.build(AUTH_URL, SESSION_ID_1), false); + assertEquals(new String(artifact1), new String(artifact1Clone)); + } + public void testBuildDifferentArtifacts() throws BuildException { + String msg = "SAML Artifacts should be different"; + assertFalse(msg, new String(artifact1).equals(new String(artifact2))); + assertFalse(msg, new String(artifact1).equals(new String(artifact3))); + assertFalse(msg, new String(artifact3).equals(new String(artifact2))); + } + + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java new file mode 100644 index 000000000..5b3bb5906 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java @@ -0,0 +1,93 @@ +package test.at.gv.egovernment.moa.id.auth.builder; + +import java.io.FileInputStream; +import java.io.RandomAccessFile; + +import org.w3c.dom.Element; +import test.at.gv.egovernment.moa.id.auth.invoke.MOASPSSTestCase; + +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +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.parser.CreateXMLSignatureResponseParser; +import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; +import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; + + + +/** + * Test case for the signature verification web service. + * + * This test requires a running SignatureVerification web service. + * + * @author Stefan Knirsch + * @version $Id$ + */ +public class VerifyXMLSignatureRequestBuilderTest extends MOASPSSTestCase { + + + private SignatureVerificationInvoker caller; + + public VerifyXMLSignatureRequestBuilderTest(String name) { + super(name); + } + + public void setUp() { + System.setProperty( + ConfigurationProvider.CONFIG_PROPERTY_NAME, + "data/test/conf/ConfigurationTest.xml"); + caller = new SignatureVerificationInvoker(); + } + + public void testVerifyXMLSignatureRequestBuilderIdentityLink() throws Exception { + + RandomAccessFile infoBox = new RandomAccessFile( + "data/test/xmldata/testperson1/InfoboxReadResponse.xml","r"); + byte[] b = new byte[(int) infoBox.length()]; + infoBox.read(b); + infoBox.close(); + String xmlInfoboxReadResponse = new String(b, "UTF-8"); + + + RandomAccessFile vr = new RandomAccessFile( + "data/test/xmldata/standard/VerifyXMLSignatureRequestIdentityLink.xml","r"); + b = new byte[(int) vr.length()]; + vr.read(b); + vr.close(); + String xmlResponse = new String(b, "UTF-8"); + + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + + Element requestBuild = vsrb.build(idl, authConf.getMoaSpIdentityLinkTrustProfileID()); + + assertXmlEquals(requestBuild, xmlResponse); + + } + + public void testVerifyXMLSignature2() throws Exception { + + RandomAccessFile s = new RandomAccessFile("data/test/xmldata/standard/CreateXMLSignatureResponse.xml","r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + s.close(); + String xmlCreateXMLSignatureResponse = new String(b, "UTF-8"); + + CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); + CreateXMLSignatureResponse csr = cXMLsrp.parseResponse(); + + VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); + + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + + Element request = vsrb.build(csr, authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(), authConf.getMoaSpIdentityLinkTrustProfileID()); + + // check the result + assertXmlEquals(request, new FileInputStream("data/test/xmldata/standard/VerifyXMLSignatureRequestCreateXML.xml")); + + } + } diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java new file mode 100644 index 000000000..7ae6f70ef --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/MOASPSSTestCase.java @@ -0,0 +1,38 @@ +package test.at.gv.egovernment.moa.id.auth.invoke; + +import java.security.Security; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/** + * Base class for end-to-end tests of MOA web-services. + * + * Initializes the test system and provides some properties. + * + * @author Patrick Peck + * @version $Id$ + */ +public class MOASPSSTestCase extends UnitTestCase { + + public MOASPSSTestCase(String name) { + super(name); + } + + + protected void setupSSL() { + System.setProperty("javax.net.debug", "all"); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty( + "java.protocol.handler.pkgs", + "com.sun.net.ssl.internal.www.protocol"); + System.setProperty( + "javax.net.ssl.keyStore", + "data/test/security/client.keystore"); + System.setProperty("javax.net.ssl.keyStorePassword", "changeit"); + System.setProperty( + "javax.net.ssl.trustStore", + "data/test/security/client.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java new file mode 100644 index 000000000..0648163d5 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java @@ -0,0 +1,166 @@ +package test.at.gv.egovernment.moa.id.auth.invoke; + +import java.io.RandomAccessFile; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +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.data.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; +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.invoke.SignatureVerificationInvoker; +import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.util.DOMUtils; + + + +/** + * Test case for the signature verification web service. + * + * This test requires a running SignatureVerification web service. + * + * @author Patrick Peck + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SignatureVerificationTest extends MOASPSSTestCase { + + + private SignatureVerificationInvoker caller; + + public SignatureVerificationTest(String name) { + super(name); + } + + public void setUp() { +System.setProperty( + ConfigurationProvider.CONFIG_PROPERTY_NAME, + "data/test/conf/ConfigurationTest.xml"); + caller = new SignatureVerificationInvoker(); + } + +/* public void testVerifyCMSSignature() throws Exception { + Element request = + parseXml("data/test/xml/VCSQ000.xml").getDocumentElement(); + Element result; + + // call the service + result = caller.verifyXMLSignature(request); + + // check the result + assertEquals("VerifyCMSSignatureResponse", result.getTagName()); + }*/ + + public void testVerifyXMLSignature1() throws Exception { + + //Momentan zeigt die Konfiguration als Endpunkt aus localhost:8081 zum + //Protokollieren per TCPMon... der ECHT Endpunkt ist 10.16.46.108:8080 + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/testperson1/InfoboxReadResponse.xml","r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlInfoboxReadResponse =new String(b,"UTF8"); + + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); + IdentityLink idl = irrp.parseIdentityLink(); + VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); + + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + + Element request = vsrb.build(idl, authConf.getMoaSpIdentityLinkTrustProfileID()); + s =new RandomAccessFile("D://PatricksVerifyXMLSignatureRequestWithInfoboxReadResponse.xml","rw"); + s.write(DOMUtils.serializeNode(request).getBytes("UTF-8")); + s.close(); +// Element request = DOMUtils.parseDocument(vsrb.build(xmlInfoboxReadResponse,"TrustProfile1"),false,null,null).getDocumentElement(); +// Element request = DOMUtils.parseDocument(xmlInfoboxReadResponse,false,null,null).getDocumentElement(); +// call the service + Element response = caller.verifyXMLSignature(request); + VerifyXMLSignatureResponseParser vParser = new VerifyXMLSignatureResponseParser(response); + VerifyXMLSignatureResponse vData = vParser.parseData(); + VerifyXMLSignatureResponseValidator vValidate = VerifyXMLSignatureResponseValidator.getInstance(); + vValidate.validate(vData, authConf.getIdentityLinkX509SubjectNames(), VerifyXMLSignatureResponseValidator.CHECK_IDENTITY_LINK, true); + vValidate.validateCertificate(vData,idl); + + // check the result + assertXmlEquals(response, request); + + } + + public void testVerifyXMLSignature2() throws Exception { + // Prüft den 2. Aufruf mit dem CreateXMLSIgnatureResponse als Parameter + //Momentan zeigt die Konfiguration als Endpunkt aus localhost:8081 zum + //Protokollieren per TCPMon... der ECHT Endpunkt ist 10.16.46.108:8080 + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/standard/CreateXMLSignatureResponse.xml","r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlCreateXMLSignatureResponse = new String(b, "UTF8"); + + CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); +// CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); + CreateXMLSignatureResponse csr = cXMLsrp.parseResponse(); + + VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); + + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + + Element request = vsrb.build(csr, authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(), authConf.getMoaSpIdentityLinkTrustProfileID()); + // Element request = DOMUtils.parseDocument(vsrb.build(xmlInfoboxReadResponse,"TrustProfile1"),false,null,null).getDocumentElement(); +// Element request = DOMUtils.parseDocument(xmlInfoboxReadResponse,false,null,null).getDocumentElement(); + Element result; +/*s =new RandomAccessFile("D://PatricksVerifyXMLSignatureRequestWithAuthBlock.xml","rw"); + s.write(DOMUtils.serializeNode(request).getBytes("UTF-8")); + s.close();*/ + // call the service + result = caller.verifyXMLSignature(request); + // check the result + assertEquals("VerifyXMLSignatureResponse", result.getTagName()); + + } + + + public void testParseCreateXMLSignatureResponse() throws Exception { + + //Später soll die Datei direkt vom Server geholt werden... + + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/standard/CreateXMLSignatureResponse.xml", + + "r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlCreateXMLSignatureResponse = new String(b, "UTF-8"); + + CreateXMLSignatureResponseParser cXMLsrp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureResponse); + CreateXMLSignatureResponse csr = cXMLsrp.parseResponse(); + + } + + public void testParseVerifyXMLSignatureResponse() throws Exception { + + //Später soll die Datei direkt vom Server geholt werden... + + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/standard/VerifyXMLSignaterResponse.xml", + + "r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlVerifyXMLSignatureResponse = new String(b, "UTF-8"); + + VerifyXMLSignatureResponseParser vXMLsrp = new VerifyXMLSignatureResponseParser(xmlVerifyXMLSignatureResponse); + VerifyXMLSignatureResponse vsr = vXMLsrp.parseData(); + + } + + + } diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java new file mode 100644 index 000000000..84f5110b0 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/AllTests.java @@ -0,0 +1,29 @@ +package test.at.gv.egovernment.moa.id.auth.parser; + +import junit.awtui.TestRunner; +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(IdentityLinkAssertionParserTest.class); + suite.addTestSuite(SAMLArtifactParserTest.class); + + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java new file mode 100644 index 000000000..c29c1eedf --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/IdentityLinkAssertionParserTest.java @@ -0,0 +1,137 @@ +package test.at.gv.egovernment.moa.id.auth.parser; + +import iaik.security.rsa.RSAPublicKey; + +import java.io.FileOutputStream; +import java.io.RandomAccessFile; +import java.security.PublicKey; + +import org.w3c.dom.Document; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.util.ECDSAKeyValueConverter; +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.validator.IdentityLinkValidator; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class IdentityLinkAssertionParserTest extends UnitTestCase { + + IdentityLinkAssertionParser ilap; + + public IdentityLinkAssertionParserTest(String name) { + super(name); + } + + public void setUp() { + try { + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/testperson1/InfoboxReadResponse.xml", + "r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlInfoboxReadResponse = new String(b, "UTF-8"); + + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); + ilap = new IdentityLinkAssertionParser(irrp.parseSAMLAssertion()); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public void testParseIdentityLink() throws Exception { + IdentityLink idl = ilap.parseIdentityLink(); + System.out.println(idl.getGivenName()); + System.out.println(idl.getFamilyName()); + System.out.println(idl.getDateOfBirth()); + System.out.println(idl.getIdentificationValue()); + + VerifyXMLSignatureRequestBuilder vx = new VerifyXMLSignatureRequestBuilder(); + + // Element zurück bekommen: vx.build(idl.getSamlAssertion()); + + IdentityLinkValidator idVali = IdentityLinkValidator.getInstance(); + idVali.validate(idl); + + } + +// public void testParseIdentityLinkECC() throws Exception { +// RandomAccessFile s = +// new RandomAccessFile( +// "data/test/xmldata/IL.ResponseToRequest.01.ECDSA.xml", +// "r"); +// byte[] b = new byte[(int) s.length()]; +// s.read(b); +// String xmlInfoboxReadResponse = new String(b); +// InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); +// String SAML = irrp.parseSAMLAssertion(); +// ilap = new IdentityLinkAssertionParser(SAML); +// IdentityLink idl = ilap.parseIdentityLink(); +// System.out.println(idl.getGivenName()); +// System.out.println(idl.getFamilyName()); +// System.out.println(idl.getDateOfBirth()); +// System.out.println(idl.getIdentificationValue()); +// +// VerifyXMLSignatureRequestBuilder vx = new VerifyXMLSignatureRequestBuilder(); +// +// // Element zurück bekommen: vx.build(idl.getSamlAssertion()); +// +// IdentityLinkValidator idVali = IdentityLinkValidator.getInstance(); +// idVali.validate(idl); +// +// } + + public void testRSAPublicKeys() throws Exception { + if (ilap.getPublicKeys()[0].getClass().getName().equals("iaik.security.rsa.RSAPublicKey")) + { + + for (int i = 0; i < ilap.getPublicKeys().length; i++) { + RSAPublicKey result = (RSAPublicKey)ilap.getPublicKeys()[i]; + System.out.println("RSA Public Key No" + i); + System.out.println("Modulus: " + result.getModulus()); + System.out.println("Exponent: " + result.getPublicExponent()); + } + + } + } + + public void testECDSAPublicKeys() throws Exception { + + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/ECDSAKeyExample.xml", + "r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String ecdsaKey = new String(b, "UTF-8"); + Document e = DOMUtils.parseDocument(ecdsaKey,true,Constants.ALL_SCHEMA_LOCATIONS, null); + PublicKey p = ECDSAKeyValueConverter.element2ECDSAPublicKey(e.getDocumentElement()); + + } + + + public void testDsigCertificates() throws Exception { + + String[] result = ilap.getCertificates(); + for (int i = 0; i < result.length; i++) { + + System.out.println("DSIG Certificate Length: " + result[i].length() + " No" + i + "\n" + result[i]); + FileOutputStream raf = new FileOutputStream("data/test/certs/cert" + i + ".cer"); + raf.write(result[i].getBytes()); + raf.flush(); + raf.close(); + } + + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java new file mode 100644 index 000000000..9a878be2c --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/InfoboxReadResponseParserTest.java @@ -0,0 +1,67 @@ +package test.at.gv.egovernment.moa.id.auth.parser; + +import java.io.RandomAccessFile; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; +import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class InfoboxReadResponseParserTest extends UnitTestCase { + + IdentityLinkAssertionParser ilap; + + public InfoboxReadResponseParserTest(String name) { + super(name); + } + + public void setUp() { + } + + public void testParseInfoboxReadResponse() throws Exception { + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/testperson1/InfoboxReadResponse.xml", + "r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlInfoboxReadResponse = new String(b, "UTF-8"); + + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); + ilap = new IdentityLinkAssertionParser(irrp.parseSAMLAssertion()); + + IdentityLink idl = ilap.parseIdentityLink(); + System.out.println(idl.getGivenName()); + System.out.println(idl.getFamilyName()); + System.out.println(idl.getDateOfBirth()); + System.out.println(idl.getIdentificationValue()); + + } + + public void testParseInfoboxReadResponseError() throws Exception { + RandomAccessFile s = + new RandomAccessFile( + "data/test/xmldata/ErrorResponse.xml", + "r"); + byte[] b = new byte[(int) s.length()]; + s.read(b); + String xmlInfoboxReadResponse = new String(b, "UTF-8"); + + InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); + ilap = new IdentityLinkAssertionParser(irrp.parseSAMLAssertion()); + + IdentityLink idl = ilap.parseIdentityLink(); + System.out.println(idl.getGivenName()); + System.out.println(idl.getFamilyName()); + System.out.println(idl.getDateOfBirth()); + System.out.println(idl.getIdentificationValue()); + + } + + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java new file mode 100644 index 000000000..992e799bd --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/parser/SAMLArtifactParserTest.java @@ -0,0 +1,55 @@ +package test.at.gv.egovernment.moa.id.auth.parser; + +import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder; +import at.gv.egovernment.moa.id.auth.parser.SAMLArtifactParser; +import at.gv.egovernment.moa.id.util.Random; +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLArtifactParserTest extends UnitTestCase { + + private static String URL1 = "http://moa.gv.at/auth"; + private static String URL2 = "https://moa.gv.at/auth"; + + public SAMLArtifactParserTest(String name) { + super(name); + } + + public void testParseTypeCode() throws Exception { + String sessionID = Random.nextRandom(); + String samlArtifact = new SAMLArtifactBuilder().build(URL1, sessionID); + byte[] typeCode = new SAMLArtifactParser(samlArtifact).parseTypeCode(); + assertEquals(typeCode[0], 0); + assertEquals(typeCode[1], 1); + } + public void testParseAssertionHandleSameSessionID() throws Exception { + // SAML artifacts for different authURL's but same sessionID MUST give same assertion handle + String sessionID = Random.nextRandom(); + String samlArtifact1 = new SAMLArtifactBuilder().build(URL1, sessionID); + String samlArtifact2 = new SAMLArtifactBuilder().build(URL2, sessionID); + String assertionHandle1 = new SAMLArtifactParser(samlArtifact1).parseAssertionHandle(); + String assertionHandle2 = new SAMLArtifactParser(samlArtifact2).parseAssertionHandle(); + assertEquals(assertionHandle1, assertionHandle2); + } + public void testParseAssertionHandleSameURL() throws Exception { + // SAML artifacts for same authURL but different sessionID's MUST give different assertion handles + String sessionID1 = Random.nextRandom(); + String sessionID2 = Random.nextRandom(); + String samlArtifact1 = new SAMLArtifactBuilder().build(URL1, sessionID1); + String samlArtifact2 = new SAMLArtifactBuilder().build(URL1, sessionID2); + String assertionHandle1 = new SAMLArtifactParser(samlArtifact1).parseAssertionHandle(); + String assertionHandle2 = new SAMLArtifactParser(samlArtifact2).parseAssertionHandle(); + assertFalse(assertionHandle1.equals(assertionHandle2)); + } + public void testParseAssertionHandleSameSAMLArtifact() throws Exception { + // SAML artifact parsed twice MUST give same assertion handle each time + String sessionID = Random.nextRandom(); + String samlArtifact = new SAMLArtifactBuilder().build(URL1, sessionID); + String assertionHandle1 = new SAMLArtifactParser(samlArtifact).parseAssertionHandle(); + String assertionHandle2 = new SAMLArtifactParser(samlArtifact).parseAssertionHandle(); + assertEquals(assertionHandle1, assertionHandle2); + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java new file mode 100644 index 000000000..c78651fdb --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataServiceTest.java @@ -0,0 +1,91 @@ +package test.at.gv.egovernment.moa.id.auth.servlet; + +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.auth.servlet.GetAuthenticationDataService; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * Test case instantiates GetAuthenticationDataService and calls the Request() method. + * It DOES NOT call the web service via Axis. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class GetAuthenticationDataServiceTest extends UnitTestCase implements Constants { + + private GetAuthenticationDataService service; + + public GetAuthenticationDataServiceTest(String arg0) { + super(arg0); + } + protected void setUp() throws Exception { + service = new GetAuthenticationDataService(); + } + + public void testService2Requests() throws Exception { + String requestString = + "" + + "" + + "123" + + ""; + Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + Element response = service.Request(new Element[] {request, request})[0]; + assertStatus(response, "samlp:Requester", "samlp:TooManyResponses"); + } + public void testServiceNoSAMLArtifact() throws Exception { + String requestString = + "" + + "" + + "123" + + ""; + Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + Element response = service.Request(new Element[] {request})[0]; + assertStatus(response, "samlp:Requester", null); + } + public void testService2SAMLArtifacts() throws Exception { + String requestString = + "" + + "" + + "123" + + "456" + + ""; + Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + Element response = service.Request(new Element[] {request})[0]; + assertStatus(response, "samlp:Requester", "samlp:TooManyResponses"); + } + public void testServiceWrongFormat() throws Exception { + String requestString = + "" + + "" + + ""; + Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + Element response = service.Request(new Element[] {request})[0]; + assertStatus(response, "samlp:Requester", null); + } + public void testServiceWrongSAMLArtifact() throws Exception { + String requestString = + "" + + "" + + "WRONGARTIFACT" + + ""; + Element request = DOMUtils.parseDocument(requestString, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + Element response = service.Request(new Element[] {request})[0]; + assertStatus(response, "samlp:Requester", "samlp:ResourceNotRecognized"); + } + private void assertStatus(Element response, String statusCodeShould, String subStatusCodeShould) throws Exception { + Element statusCodeNode = (Element)XPathUtils.selectSingleNode(response, "//samlp:StatusCode"); + String statusCode = statusCodeNode.getAttribute("Value"); + Element subStatusCodeNode = (Element)XPathUtils.selectSingleNode(statusCodeNode, "//samlp:StatusCode/samlp:StatusCode"); + String subStatusCode = subStatusCodeNode == null ? null : subStatusCodeNode.getAttribute("Value"); + System.out.println(statusCode + subStatusCode); + assertEquals(statusCodeShould, statusCode); + assertEquals(subStatusCodeShould, subStatusCode); + } + + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java new file mode 100644 index 000000000..655c33fd9 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/auth/MOAIDAuthConfigurationProviderTest.java @@ -0,0 +1,112 @@ +package test.at.gv.egovernment.moa.id.config.auth; + +import java.util.Map; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; + +/** + * @author Stefan Knirsch + * @version $Id$ + */ +public class MOAIDAuthConfigurationProviderTest extends UnitTestCase { + private AuthConfigurationProvider provider; + + /** + * Constructor for MOAAuthConfigTest. + * @param name + */ + public MOAIDAuthConfigurationProviderTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + + provider = + new AuthConfigurationProvider(TESTDATA_ROOT + "conf/ConfigurationTest.xml"); + + } + public void testGetTransformsInfoFileNames() { + String[] transformsInfoFileNames; + transformsInfoFileNames = provider.getTransformsInfoFileNames(); +// for (int i = 0; i < transformsInfoFileNames.length; i++) { +// System.out.println( +// "getTransformsInfoFileNames: " + transformsInfoFileNames[i]); + assertEquals(transformsInfoFileNames[0],"http://StringsecLayerTranformsInfo1"); + assertEquals(transformsInfoFileNames[1],"http://StringsecLayerTranformsInfo2"); +// } + + } + + public void testGetMOASPConnectionParameters() { + ConnectionParameter cp; + cp = provider.getMoaSpConnectionParameter(); + assertEquals(cp.getUrl(),"MOA-SP-URL"); + assertEquals(cp.getAcceptedServerCertificates(),"http://AcceptedServerCertificates"); + assertEquals(cp.getClientKeyStorePassword(),"Keystore Pass"); + assertEquals(cp.getClientKeyStore(),"URLtoClientKeystoreAUTH"); +/* System.out.println(); + System.out.println("getMoaSpConnectionParameter :" + cp.getUrl()); + System.out.println( + "getMoaSpConnectionParameter :" + cp.getAcceptedServerCertificates()); + System.out.println( + "getMoaSpConnectionParameter :" + cp.getClientKeyStorePassword()); + System.out.println( + "getMoaSpConnectionParameter :" + cp.getClientKeyStore());*/ + } + public void testGetMoaSpIdentityLinkTrustProfileID() { + + assertEquals(provider.getMoaSpIdentityLinkTrustProfileID(),"StringVerifyIdentiyLinkTrustID"); + + } + public void testGetMoaSpAuthBlockTrustProfileID() { + assertEquals(provider.getMoaSpAuthBlockTrustProfileID(),"StringVerifyAuthBlockTransformID"); + } + + public void testGetMoaSpAuthBlockVerifyTransformsInfoIDs() { + String[] result = provider.getMoaSpAuthBlockVerifyTransformsInfoIDs(); + assertEquals(result[0],"StringVerifyTransformsInfoID1"); + assertEquals(result[1],"StringVerifyTransformsInfoID2"); + + } + + public void testGetOnlineApplicationAuthParameter() { + OAAuthParameter[] result = provider.getOnlineApplicationParameters(); + + assertEquals(result[0].getPublicURLPrefix(),"StringOALoginURL"); + assertEquals(result[0].getProvideStammzahl(),false); + assertEquals(result[0].getProvideAuthBlock(),false); + assertEquals(result[0].getProvideIdentityLink(),false); + + assertEquals(result[1].getPublicURLPrefix(),"StringOALoginURL2"); + assertEquals(result[1].getProvideStammzahl(),true); + assertEquals(result[1].getProvideAuthBlock(),true); + assertEquals(result[1].getProvideIdentityLink(),true); + + +/* for (int i = 0; i < result.length; i++) { + System.out.println(); + System.out.println("getOnlineApplicationParameters Url: " + result[i].getUrl()); + System.out.println("getOnlineApplicationParameters ProvideStammzahl: " + result[i].getProvideStammzahl()); + System.out.println("getOnlineApplicationParameters ProvideAuthBlock: " + result[i].getProvideAuthBlock()); + System.out.println("getOnlineApplicationParameters ProvideIdentityLink: " + result[i].getProvideIdentityLink()); + }*/ + } + + public void testGetGenericConfiguration() { + Map result = provider.getGenericConfiguration(); + assertEquals(result.containsKey("Generic Name 1"),true); + assertEquals(result.containsKey("Generic Name 2"),true); + assertEquals(result.get("Generic Name 1"),"Value1"); + assertEquals(result.get("Generic Name 2"),"Value2"); + /* for (Iterator iter = result.keySet().iterator(); iter.hasNext();) { + String element = (String) iter.next(); + System.out.println("getGenericConfiguration Key:" + element); + System.out.println("getGenericConfiguration Value:" + result.get(element)); + }*/ + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java new file mode 100644 index 000000000..ec6a65581 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/config/proxy/MOAIDProxyConfigurationProviderTest.java @@ -0,0 +1,127 @@ +package test.at.gv.egovernment.moa.id.config.proxy; + +import java.util.Map; + +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + + + +/** + * @author Stefan Knirsch + * @version $Id$ + */ +public class MOAIDProxyConfigurationProviderTest extends UnitTestCase { + private ProxyConfigurationProvider provider; + + /** + * Constructor for MOAProxyConfigTest. + * @param name + */ + public MOAIDProxyConfigurationProviderTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + + provider = +// new ProxyConfigurationProvider(TESTDATA_ROOT + "conf/ConfigurationTest.xml"); + new ProxyConfigurationProvider("data/deploy/conf/moa-id/ConfigurationTest.xml"); + } + public void testGetAuthComponentConnectionParameter() + { + ConnectionParameter cp; + cp = provider.getAuthComponentConnectionParameter(); + assertEquals(cp.getUrl(),"AuthComponentURL"); + assertEquals( cp.getAcceptedServerCertificates(),"http://www.altova.com"); + assertEquals(cp.getClientKeyStorePassword(),"String"); + assertEquals(cp.getClientKeyStore(),"http://www.altova.com"); + /* System.out.println(); + System.out.println("getProxyComponentConnectionParameter :" + cp.getUrl()); + System.out.println( + "getProxyComponentConnectionParameter :" + cp.getAcceptedServerCertificates()); + System.out.println( + "getProxyComponentConnectionParameter :" + cp.getClientKeyStorePassword()); + System.out.println( + "getProxyComponentConnectionParameter :" + cp.getClientKeyStore());*/ +} + + public void testGetOAProxyParameter() { + OAProxyParameter[] result = provider.getOnlineApplicationParameters(); + + assertEquals("http://localhost:9080/", result[0].getPublicURLPrefix()); + assertEquals("file:data/test/conf/OAConfParamAuth.xml", result[0].getConfigFileURL()); + assertEquals(10, result[0].getSessionTimeOut()); + assertEquals("StringloginParameterResolverImpl1", result[0].getLoginParameterResolverImpl()); + assertEquals("StringconnectionBuilderImpl1", result[0].getConnectionBuilderImpl()); + + assertEquals("ProxyComponentURL", result[0].getConnectionParameter().getUrl()); + assertEquals("url:AcceptedServerCertificates", result[0].getConnectionParameter().getAcceptedServerCertificates()); + assertEquals("URL:toClientKeystoreOA", result[0].getConnectionParameter().getClientKeyStore()); + assertEquals("ClientKeystoreOAPAss", result[0].getConnectionParameter().getClientKeyStorePassword()); + + assertEquals("StringOALoginURL2", result[1].getPublicURLPrefix()); + assertEquals("file:data/test/conf/OAConfHeaderAuth.xml", result[1].getConfigFileURL()); + assertEquals(20, result[1].getSessionTimeOut()); + assertEquals("StringloginParameterResolverImpl2",result[1].getLoginParameterResolverImpl()); + assertEquals("StringconnectionBuilderImpl2", result[1].getConnectionBuilderImpl()); + + assertEquals("ProxyComponentURL2", result[1].getConnectionParameter().getUrl()); + assertEquals("url:AcceptedServerCertificates2", result[1].getConnectionParameter().getAcceptedServerCertificates()); + assertEquals("URL:toClientKeystoreOA2", result[1].getConnectionParameter().getClientKeyStore()); + assertEquals("ClientKeystoreOAPAss2", result[1].getConnectionParameter().getClientKeyStorePassword()); + + assertEquals("StringOALoginURL3", result[2].getPublicURLPrefix()); + assertEquals("file:data/test/conf/OAConfBasicAuth.xml", result[2].getConfigFileURL()); + assertEquals(20, result[2].getSessionTimeOut()); + assertEquals("StringloginParameterResolverImpl3",result[2].getLoginParameterResolverImpl()); + assertEquals("StringconnectionBuilderImpl3", result[2].getConnectionBuilderImpl()); + + assertEquals("ProxyComponentURL3", result[2].getConnectionParameter().getUrl()); + assertEquals("url:AcceptedServerCertificates3", result[2].getConnectionParameter().getAcceptedServerCertificates()); + assertEquals("URL:toClientKeystoreOA3", result[2].getConnectionParameter().getClientKeyStore()); + assertEquals("ClientKeystoreOAPAss3", result[2].getConnectionParameter().getClientKeyStorePassword()); + } + + public void testGetGenericConfiguration() { + Map result = provider.getGenericConfiguration(); + assertEquals(true, result.containsKey("authenticationSessionTimeOut")); + assertEquals(true, result.containsKey("authenticationDataTimeOut")); + assertEquals("600", result.get("authenticationSessionTimeOut")); + assertEquals("120", result.get("authenticationDataTimeOut")); + } + + public void testOAConfigurationProvider() throws Exception + { + OAProxyParameter[] result = provider.getOnlineApplicationParameters(); + // für jeden Parameter müsste theoretisch bereits ein Provider instanziiert worden sein, + // aus diesem Grund braucht man NICHT mehr die File-URL anzugeben, PublicURLPrefix reicht + + // sollte ParamAuth sein + OAConfiguration oac1 = result[0].getOaConfiguration(); + assertEquals(OAConfiguration.PARAM_AUTH, oac1.getAuthType()); + assertEquals("MOADateOfBirth", oac1.getParamAuthMapping().get("Param1")); + assertEquals("MOABPK", oac1.getParamAuthMapping().get("Param2")); + // sollte HeaderAuth sein + OAConfiguration oac2 = result[1].getOaConfiguration(); + assertEquals(OAConfiguration.HEADER_AUTH, oac2.getAuthType()); + assertEquals("MOAPublicAuthority", oac2.getHeaderAuthMapping().get("Param1")); + assertEquals("MOABKZ", oac2.getHeaderAuthMapping().get("Param2")); + assertEquals("MOAQualifiedCertificate", oac2.getHeaderAuthMapping().get("Param3")); + assertEquals("MOAStammzahl", oac2.getHeaderAuthMapping().get("Param4")); + assertEquals("MOAIPAddress", oac2.getHeaderAuthMapping().get("Param5")); + + // sollte BasicAuth sein + OAConfiguration oac3 = result[2].getOaConfiguration(); + assertEquals(OAConfiguration.BASIC_AUTH, oac3.getAuthType()); + assertEquals("MOAGivenName", oac3.getBasicAuthUserIDMapping()); + assertEquals("MOAFamilyName", oac3.getBasicAuthPasswordMapping()); + //Fehlerfall: + + + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/AllTests.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/AllTests.java new file mode 100644 index 000000000..2dd6cd35e --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/AllTests.java @@ -0,0 +1,31 @@ +package test.at.gv.egovernment.moa.id.proxy; + +import test.at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilderTest; +import test.at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParserTest; +import junit.awtui.TestRunner; +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Paul Ivancsics + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(SAMLRequestBuilderTest.class); + suite.addTestSuite(SAMLResponseParserTest.class); + + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java new file mode 100644 index 000000000..aec14ce1c --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/DOMTreeCompare.java @@ -0,0 +1,462 @@ +package test.at.gv.egovernment.moa.id.proxy.builder; + +import java.io.PrintStream; +import java.util.ArrayList; + +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; + +import at.gv.egovernment.moa.util.Base64Utils; + +/** + * @author Administrator + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + */ +public class DOMTreeCompare { + + boolean debug = true; + + private static PrintStream Log = null; + + static + { + Log = System.out; + } + + public boolean compareElements(Element root1, Element root2) + { + //Log.println("----- Compare Elements:"+root1.getNodeName()+" "+root2.getNodeName()); + filterTree(root1); + filterTree(root2); + return compareNodes(root1,root2,0,"root/",false); + } + + private boolean compareNodes(Node n1, Node n2, int level,String path,boolean attribute) + { + /*try { + Log.println(DOMUtils.serializeNode(n1)); + } + catch(Exception e) + { + e.printStackTrace(); + }*/ + boolean equal = false; + //Log.println("----- Compare Node "+level+":"+n1+" "+n2); + //Log.println("----- Compare Node "+level+":"+n1.getNodeName()+" "+n2.getNodeName()); + //Log.println("----- Checking:"+path+getPathString(n1)); + NodeList nl1 = n1.getChildNodes(); + NodeList nl2 = n2.getChildNodes(); + + int size1 = nl1.getLength(); + int size2 = nl2.getLength(); + + if(debug)display_one(n1); + if(debug)display_one(n2); + + + if(debug) + if(n1.getNodeName().equals("Base64Content") && n2.getNodeName().equals("Base64Content")) + { + try { + Log.println("CONT:"+new String(Base64Utils.decode(strip(n1.getChildNodes().item(0).getNodeValue()),false))); + Log.println("CONT:"+new String(Base64Utils.decode(strip(n2.getChildNodes().item(0).getNodeValue()),false))); + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + if(size1 != size2) + { + Log.println("----- Anzahl der Kinder nicht gleich:"+path+getPathString(n1)+":"+getPathString(n2)); + return false; + } + + equal = compareNodeExact(n1,n2,level,path+getPathString(n1)+"/"); + if(!equal) + { + Log.println("----- Knoten sind nicht identisch:"+path+getPathString(n1)); + return false; + } + + if(n1.hasAttributes() || n2.hasAttributes()) + { + equal = compareNodeAttriubtes(n1,n2,level+1,path+getPathString(n1)+"/(a)"); + if(!equal) + { + Log.println("----- Attribute stimmen nicht überein:"+path+getPathString(n1)); + return false; + } + } + if(size1==0) + { + return true; + } + + for(int counter=0;counter" + + "" + samlArtifact + "" + + ""; + Element request = new SAMLRequestBuilder().build(requestID, samlArtifact); + Element requestShould = DOMUtils.parseDocument(REQUEST_SHOULD, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + assertTrue(new SAMLRequestCompare().compareElements(requestShould, request)); + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java new file mode 100644 index 000000000..5685129a1 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestCompare.java @@ -0,0 +1,19 @@ +package test.at.gv.egovernment.moa.id.proxy.builder; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLRequestCompare extends test.at.gv.egovernment.moa.id.proxy.builder.DOMTreeCompare { + + + /* + * @see at.gv.egovernment.moa.util.SAMLRequestCompare#specialAttributes(java.lang.String, java.lang.String) + */ + public boolean specialAttributes(String path,String attr1_name,String value1,String attr2_name,String value2) { + if(attr1_name.equals("IssueInstant")) + return true; + return false; + } + +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java new file mode 100644 index 000000000..68b5d4ee3 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParserTest.java @@ -0,0 +1,180 @@ +package test.at.gv.egovernment.moa.id.proxy.parser; + +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.id.UnitTestCase; + +import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.data.SAMLStatus; +import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class SAMLResponseParserTest extends UnitTestCase { + + public SAMLResponseParserTest(String arg0) { + super(arg0); + } + + public void testParse() throws Exception { + String samlResponse = + "" + + "" + + "" + + "" + + "Ollas leiwand" + + "" + +"" + + "" + + "" + + "MTk2OC0xMC0yMmdi" + + "" + + "http://reference.e-government.gv.at/namespace/moa/20020822#cm" + + "" + + "" + + "" + + "" + + "http://localhost:8080/moa-id-auth/" + + "" + + "" + + "gb" + + "" + + "" + + "https://localhost:9443/" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "urn:oasis:names:tc:SAML:1.0:cm:sender-vouches" + + "" + + "" + + "" + + "123456789012" + + "http://reference.e-government.gv.at/names/persondata/20020228#zmr-zahl" + + "" + + "" + + "Hermann" + + "Muster" + + "" + + "1968-10-22" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "0v1Ftf7WXgoexx0Jo/GrlExHOHnQIEQ5FFSjptLRd5BN1mZYRg2S9KfOMbHSCsiPm8AwjAEwE5EM A6P18Z/YyTIuP7fNGzckbB5PYIgNMHL8/TYJhHA8CjamsBrEfYDXivE8iAvALg5I9RMLZADmzL7a f2daYYuO8dycQw3xg6U=" + + "AQAB" + + "" + + "" + + "" + + "" + + "" + + "" + + "i2qa56X4fpYeXqFLXAcQljGU3+DWnVgNrAxI9gn2bMeFWtLXE2SFa6qvl9EymUl0noBlFn0q9DWp AsyeLnRhzCAXJeSxiwsUEloOvcQCV0DfW2UVq0Y9bVlJ8KifJ2AS+5BxZ21mkc/VYx5Qz6EYjPrn pIpdAwR9sw5xnIvTySc=" + + "AQAB" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "not(ancestor-or-self::pr:Identification)" + + "" + + "" + + "" + + "" + + "s7TfoZrYo36OMdlxGxuIfAw/wr8=" + + "" + + "" + + "" + + "" + + "ancestor-or-self::dsig:Manifest" + + "" + + "" + + "" + + "dO+RSn4xLHT3cuq8uopFtZyUBqo=" + + "" + + "" + + "MFbZ5wA5cq0UezYFDXted5uqXubWFxxRwZawGh73XEAGxAbJsT/IEQmrTQThPRHNWW5RPGxVlPDz 5BmjberdaWlgJlbyKf3b/WpNNJYptQ7ijrXlsQoCzjfiQy37NEfvHEcxHQOA6sa42C+dFKsKIvmP 3mZkRYWJDxxsVzI7E+Y=" + + "" + + "" + + "MIIDaDCCAtWgAwIBAgIBADAJBgUrDgMCHQUAMIGOMQswCQYDVQQGEwJBVDE9MDsG A1UEChQ0QnVuZGVzbWluaXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5n IHVuZCBTcG9ydDEjMCEGA1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMx GzAZBgNVBAMTEk1PQSBUZXN0IENBIC0gUm9vdDAeFw0wMzAyMTExNTE5NDRaFw0w MzEyMzEyMjU5MzBaMIGOMQswCQYDVQQGEwJBVDE9MDsGA1UEChQ0QnVuZGVzbWlu aXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5nIHVuZCBTcG9ydDEjMCEG A1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMxGzAZBgNVBAMTEk1PQSBU ZXN0IENBIC0gUm9vdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAjHuFphE3 +UkTe2OcIFWUDLzhPl1j2dH4sMPAhDK09/0i+aWrdtQW9yHktu/7+LTiCiPeevT0 lGMGDcWMSoSm66tYmpxei6YojCFIaVdJFtXZ7x1o7e7jTDVRLMfdZ5lI1sQ7loIY hOE0OmlYOkn4AI6xMtJtsca45rV8wW7qm8kCAwEAAaOB2zCB2DAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjBdBgNVHSAEVjBUMFIGDCsGAQQBlRIBAnsB ATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0IGlzdCBudXIgZvxy IFRlc3R6d2Vja2UgZ2VlaWduZXQuMB0GA1UdDgQWBBRDC612dCgZetTmAKyV6DII NkOoYTAWBgcqKAAKAQEBBAsMCUJNT0xTLUlLVDAfBgNVHSMEGDAWgBRDC612dCgZ etTmAKyV6DIINkOoYTAJBgUrDgMCHQUAA4GBAHj0xBNWGYLijaocjOX1AkL+r+G2 fZsX4z3S/2eEvtUp+EUHaOPMLTS0MIP1nwj5f4ZluAIrDLXihqMdi4xRv0W6QYbN aDxICNz3/QbrzMlFPeC8odesdRlT+GGswX0ZGUtVIZm1HVhxRk5ZEW2pr2afo5c0 Btxup/kgjGMnnS7C" + + "MIIDiTCCAvagAwIBAgIBADAJBgUrDgMCHQUAMIGOMQswCQYDVQQGEwJBVDE9MDsG A1UEChQ0QnVuZGVzbWluaXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5n IHVuZCBTcG9ydDEjMCEGA1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMx GzAZBgNVBAMTEk1PQSBUZXN0IENBIC0gUm9vdDAeFw0wMzAyMTExNTI1MTRaFw0w MzEyMzEyMjU5MzBaMIGZMQswCQYDVQQGEwJBVDE9MDsGA1UEChQ0QnVuZGVzbWlu aXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5nIHVuZCBTcG9ydDEjMCEG A1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMxJjAkBgNVBAMTHU1PQSBU ZXN0IENBIC0gU2lnbmF0dXJkaWVuc3RlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB iQKBgQCw7ULOYSNji09Ein7Ar4j3Rjxjq05spBmZDmbSomEZMnGEtVTyIRzKc8ia 2kcXUMz5MEoFaVmvqRim31m20T21uvHFIs86gqzC/prOAz7V7HWok5F+9M/5gR1S BvpdqiEAXYeRXFPiOe8XSmpwhic7+n2jfuoBeYiRBEMGoP1DkwIDAQABo4HxMIHu MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgHGMBEGCWCGSAGG+EIB AQQEAwIBAjBdBgNVHSAEVjBUMFIGDCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwIC MDQaMkRpZXNlcyBaZXJ0aWZpa2F0IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2Vl aWduZXQuMB0GA1UdDgQWBBSeRWvUfxEjKZSfxImJr/fpBDtMmTAWBgcqKAAKAQEB BAsMCUJNT0xTLUlLVDAfBgNVHSMEGDAWgBRDC612dCgZetTmAKyV6DIINkOoYTAJ BgUrDgMCHQUAA4GBAIMa4C2z3SbkcjEiMNAsHKaKUCJkBbMtNaab6U/cwwYmG6nl ga7xyEmbfY2SKzOqkcIwuv83Tma3rcr1f+OLUeGUaGLHt2Pl1a/s8BZGQZHWvLXv 7hV4RceEUHzVGAfvDD8iBJqBmfq/z/fBPFsgSup4nO1YECkDYfQ+sqCIP4ik" + + "MIIDZzCCAtSgAwIBAgIBADAJBgUrDgMCHQUAMIGZMQswCQYDVQQGEwJBVDE9MDsG A1UEChQ0QnVuZGVzbWluaXN0ZXJpdW0gZvxyIPZmZmVudGxpY2hlIExlaXN0dW5n IHVuZCBTcG9ydDEjMCEGA1UECxMaSUtULVN0YWJzc3RlbGxlIGRlcyBCdW5kZXMx JjAkBgNVBAMTHU1PQSBUZXN0IENBIC0gU2lnbmF0dXJkaWVuc3RlMB4XDTAzMDIx MTE1MzI0NVoXDTAzMDgxMTE0MzI0NVowgYUxCzAJBgNVBAYTAkFUMSYwJAYDVQQK FB1CdW5kZXNtaW5pc3Rlcml1bSBm/HIgSW5uZXJlczEgMB4GA1UECxMXWmVudHJh bGVzIE1lbGRlcmVnaXN0ZXIxLDAqBgNVBAMTI1Rlc3QgU2lnbmF0dXJkaWVuc3Qg UGVyc29uZW5iaW5kdW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEzkpk QjbGjZwssN1+vMBE/ALMcA8LWFcILI3uxXaTSWGfTiLo9ECfzjuwYJG7FjEaeWrW nPEcp4VfMNocrm3T7Hw/ikpE5/+FsfTzD4MpIwwUPd/CUfA5vDNXK5CiP7qKKR1e vATO2s6lfDul+CS/eEbwzKmUQvZGrJggxg2m5wIDAQABo4HYMIHVMAwGA1UdEwEB /wQCMAAwDgYDVR0PAQH/BAQDAgbAMF0GA1UdIARWMFQwUgYMKwYBBAGVEgECAwEB MEIwQAYIKwYBBQUHAgIwNBoyRGllc2VzIFplcnRpZmlrYXQgaXN0IG51ciBm/HIg VGVzdHp3ZWNrZSBnZWVpZ25ldC4wHQYDVR0OBBYEFIpEyv43H3EtiGr4I7Z34bWj v2z6MBYGByooAAoBAQEECwwJQk1PTFMtSUtUMB8GA1UdIwQYMBaAFJ5Fa9R/ESMp lJ/EiYmv9+kEO0yZMAkGBSsOAwIdBQADgYEAfMBJRy/kp8HQa0lGIBfFrWNpxVPv RsIu+N4IiFrswrsoQoMAh6IqNyzSdq7rJC08xsDkXe5HOwkb+2zGKYoC3aQ/J/zr BGkg6ec4tOaS/VSdEQeTL1L30r2faTffWLUV3GrzL7pM7jN470hB1w8F6Hc3LCI7 kFfp23o/juVtJNw=" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "BqzfCB7dNg4G3u4YaxpD1tALdKI=" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "123456789012" + + "http://reference.e-government.gv.at/names/persondata/20020228#zmr-zahl" + + "" + + "" + + "Hermann" + + "Muster" + + "" + + "1968-10-22" + + "" + + "" + + "" + + "" + + "true" + + "" + + "" + +"" + + ""; + + Element samlResponseElem = + DOMUtils.parseDocument(samlResponse, true, Constants.ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + SAMLResponseParser parser = new SAMLResponseParser(samlResponseElem); + SAMLStatus status = parser.parseStatusCode(); + assertEquals("samlp:Success", status.getStatusCode()); + assertEquals("samlp:Success", status.getSubStatusCode()); + assertEquals("Ollas leiwand", status.getStatusMessage()); + AuthenticationData authData = parser.parseAuthenticationData(); + assertEquals(1, authData.getMajorVersion()); + assertEquals(0, authData.getMinorVersion()); + assertEquals("-4633313027464114584", authData.getAssertionID()); + assertEquals("http://localhost:8080/moa-id-auth/", authData.getIssuer()); + assertEquals("2003-04-02T14:55:42+02:00", authData.getIssueInstant()); + assertEquals("123456789012", authData.getIdentificationValue()); + assertEquals("MTk2OC0xMC0yMmdi", authData.getBPK()); + assertEquals("Hermann", authData.getGivenName()); + assertEquals("Muster", authData.getFamilyName()); + assertEquals("1968-10-22", authData.getDateOfBirth()); + assertTrue(authData.isQualifiedCertificate()); + assertFalse(authData.isPublicAuthority()); + } +} diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java new file mode 100644 index 000000000..351ca0bd5 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/util/SSLUtilsTest.java @@ -0,0 +1,92 @@ +package test.at.gv.egovernment.moa.id.util; + +import iaik.pki.jsse.IAIKX509TrustManager; + +import java.net.URL; +import java.security.Security; + +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSocketFactory; + +import com.sun.net.ssl.HttpsURLConnection; + +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; +import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; +import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; +import at.gv.egovernment.moa.id.util.SSLUtils; +import test.at.gv.egovernment.moa.id.UnitTestCase; + +/* + * @author Paul Ivancsics + * @version $Id$ + */ +public class SSLUtilsTest extends UnitTestCase { + + public SSLUtilsTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + //System.setProperty("javax.net.debug", "all"); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + IAIKX509TrustManager.initLog(new LoggerConfigImpl("file:" + TESTDATA_ROOT + "conf/log4j.properties")); + System.setProperty("https.cipherSuites", "SSL_DHE_DSS_WITH_DES_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,SSL_RSA_WITH_DES_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_EXPORT_WITH_RC4_40_MD5"); + } + + public void testVerisignOK() throws Exception { + doTestOA("conf/ConfigurationTest.xml", "http://verisign.moa.gv.at/", true, null); + } + public void testATrustOK() throws Exception { + doTestOA("conf/ConfigurationTest.xml", "http://a-trust.moa.gv.at/", true, null); + } + public void testBaltimoreOK() throws Exception { + doTestOA("conf/ConfigurationTest.xml", "http://baltimore.moa.gv.at/", true, null); + } + public void testCIOOK() throws Exception { + doTestOA("conf/ConfigurationTest.xml", "http://cio.moa.gv.at/", true, null); + } + public void testMOASPOK() throws Exception { + System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, + TESTDATA_ROOT + "conf/ConfigurationTest.xml"); + ConnectionParameter connParam = AuthConfigurationProvider.getInstance().getMoaSpConnectionParameter(); + doTest(connParam, true, null); + } + private void doTestOA(String configFile, String publicURLPrefix, boolean shouldOK, String exMessageFragment) throws Exception { + System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, + TESTDATA_ROOT + configFile); + ProxyConfigurationProvider proxyConf = + ProxyConfigurationProvider.getInstance(); + OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(publicURLPrefix); + ConnectionParameter connParam = oaParam.getConnectionParameter(); + doTest(connParam, shouldOK, exMessageFragment); + } + private void doTest(ConnectionParameter connParam, boolean shouldOK, String exMessageFragment) throws Exception { + SSLUtils.initialize(); + AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(authConf, connParam); + URL url = new URL(connParam.getUrl()); + HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); + conn.setRequestMethod("GET"); + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + conn.setAllowUserInteraction(false); + conn.setSSLSocketFactory(ssf); + try { + conn.connect(); + assertTrue(shouldOK); + assertEquals(200, conn.getResponseCode()); + conn.disconnect(); + } + catch (SSLException ex) { + ex.printStackTrace(); + assertFalse(shouldOK); + assertTrue(ex.getMessage().indexOf(exMessageFragment) >= 0); + } + } + +} diff --git a/id/server/idserverlib/src/test/java/test/lasttest/Dispatcher.java b/id/server/idserverlib/src/test/java/test/lasttest/Dispatcher.java new file mode 100644 index 000000000..ad8f10fb4 --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/lasttest/Dispatcher.java @@ -0,0 +1,64 @@ +package test.lasttest; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class Dispatcher extends Thread { + private LasttestClient parent = null; + private int max; + private int turns; + private int turn_counter; + private int turn; + private int time; + private long sum; + private int turnnum; + + public Dispatcher(LasttestClient parent, int max, int turns, int time, long sum) { + this.parent = parent; + this.max = max; + this.turns = turns; + this.time = time; + this.sum = sum; + turnnum=0; + } + + public void run() { + this.setPriority(Thread.NORM_PRIORITY + 1); + System.out.println("Dispatcher wird gestartet..."); + TestThread[] old_reqs = buildRequests(0); + for (turn_counter = 0; turns == 0 ? true : (turn_counter < turns); turn_counter++) { + try { +// LasttestClient.Log.write(("Starte Durchlauf " + turn_counter + "\n").getBytes()); + } + catch (Exception e) {} + +// System.out.println("Starte Durchlauf " + turn_counter); + turn = turn_counter; + if (turns == 0) + turn_counter--; + TestThread[] reqs = buildRequests(turn_counter); + for (int counter = 0; counter < max; counter++) { + old_reqs[counter].start(); + } + old_reqs = reqs; + try { + Thread.sleep(time); + } + catch (Exception e) { + e.printStackTrace(); + } + } + parent.stop = true; + } + + public TestThread[] buildRequests(int turnNo) { + TestThread[] ret = new TestThread[max]; + for (int counter = 0; counter < max; counter++) { +// turnnum ++; + ret[counter] = new TestThread(parent, turnNo); + } + return ret; + } +} diff --git a/id/server/idserverlib/src/test/java/test/lasttest/HostnameVerifierHack.java b/id/server/idserverlib/src/test/java/test/lasttest/HostnameVerifierHack.java new file mode 100644 index 000000000..cf34b621a --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/lasttest/HostnameVerifierHack.java @@ -0,0 +1,13 @@ +package test.lasttest; + +import com.sun.net.ssl.HostnameVerifier; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class HostnameVerifierHack implements HostnameVerifier{ + public boolean verify(String arg0, String arg1) { + return true; + }} diff --git a/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java b/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java new file mode 100644 index 000000000..bad5161ba --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java @@ -0,0 +1,218 @@ +package test.lasttest; + +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.io.PrintStream; +import java.security.Security; +import java.util.Date; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.StreamUtils; +import at.gv.egovernment.moa.util.URLDecoder; +import at.gv.egovernment.moa.util.URLEncoder; +import com.sun.net.ssl.HttpsURLConnection; + +/** + * @author Sven + * + * To change this generated comment edit the template variable "typecomment": + * Window>Preferences>Java>Templates. + * To enable and disable the creation of type comments go to + * Window>Preferences>Java>Code Generation. + * + * Aufruf: Requestdatei (==null), ServerURL, Anzahl der Requests pro Sekunde, Anzahl der Wiederholungen + * z.b. "data/CX0/TestGeneratorCX0.001.Req.xml" "http://127.0.0.1:8080/" 5 100 + * + * ==> GEÄNDERT: ersten 2 Parameter gekillt... nur noch 5 100 + */ +public class LasttestClient { + + protected static final String TESTDATA_ROOT = "data/abnahme-test/"; + protected static final String MOA_AUTH_SERVER = "https://localhost:8443/moa-id-auth/"; + protected AuthenticationServer server; + + public int max_thread_count = 300; + public int thread_counter = 0; + public int error_count = 0; + public int turns = 0; + public long sum = 0; + public long max = 0; + public long min = Long.MAX_VALUE; + + public static PrintStream Log = null; + + public boolean stop = false; + + public static final String trustStore = "javax.net.ssl.trustStore"; + public static final String trustStorePassword = "javax.net.ssl.trustStorePassword"; + public static final String handler = "java.protocol.handler.pkgs"; + + public void startTest(int req_per_second, int turns, int time) throws Exception { + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); + + System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, TESTDATA_ROOT + "xmldata/L000/Configuration.xml"); + + AuthConfigurationProvider.reload(); + + this.turns = turns; + + boolean result = new TestThread(this,0).doRequest(0);// doTestRequest(); + if (result) { + System.out.println("TestRequest OK. Lasttest wird gestartet."); + sum=0; + max=0; + Dispatcher dp = new Dispatcher(this, req_per_second, turns, time, sum); + dp.start(); + while (!stop) { + try { + Log.println(new String(("Checking Stop Condition ...(Running " + thread_counter + ", Min " + (min) + ", Max " + (max) + ", " + new Date(System.currentTimeMillis()) + ")"))); + Log.flush(); + } + catch (Exception e) {} + + System.out.println("Checking Stop Condition ...(Running " + thread_counter + ", Min " + (min) + ", Max " + (max) + ", " + new Date(System.currentTimeMillis()) + ")"); + Thread.sleep(10000); + } + System.out.println("Fehler:" + error_count + " (Running " + thread_counter + ", Min " + (min) + ", Max " + (max) + ", " + new Date(System.currentTimeMillis()) + ")"); + } + else { + System.out.println("TestRequest lieferte einen Fehler. Lasttest wird nicht gestartet."); + } + } + + + public boolean doTestRequest() throws Exception { + + try { + + TestThread tt = new TestThread(null,0); + + // Anmelden + String URL = tt.getURL(MOA_AUTH_SERVER, "gb", "http://10.16.126.28:9080/moa-id-proxy/"); + HttpsURLConnection conn = tt.giveConnection(URL, "GET"); + + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + String MOASessionID = tt.parseSessionIDFromForm(result); + conn.disconnect(); + + URL = tt.parseDataURL(result); + // Verify Identity Link + conn = tt.giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + String infoboxReadResponse = tt.readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + String redirectLoc = conn.getHeaderField("Location"); + conn.disconnect(); + //Verify Auth Block + conn = tt.giveConnection(redirectLoc, "POST"); + String createXMLSignatureResponse = URLEncoder.encode(tt.readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + out = conn.getOutputStream(); + out.write(("XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); + out.flush(); + out.close(); + conn.connect(); + redirectLoc = conn.getHeaderField("Location"); + String samlArtifact = tt.parseSamlArtifact(redirectLoc); + System.out.println("SamlArtifact: " + samlArtifact); + + conn.disconnect(); + + conn = null; + + SAMLRequestBuilder srb = new SAMLRequestBuilder(); + + Element erg = tt.doCall(srb.build(MOASessionID, URLDecoder.decode(samlArtifact, "UTF-8")),MOA_AUTH_SERVER); + result = DOMUtils.serializeNode(erg); + if (result.indexOf("saml:Assertion")<0) + { + System.err.println("Falsche Antwort vom Webservice:\n" + result); + throw new Exception("Falsche Antwort vom Webservice"); + + } + } + catch (Exception e) { + System.err.println("------ FEHLER IN LASTTEST :" + e.getLocalizedMessage()); + throw e; + } + + return true; + + } + + public String replaceString(String input, String oldPart, String newPart) throws Exception { + String erg = null; + + //First Part + erg = input.substring(0, input.indexOf(oldPart)); + //Insert new Part + erg += newPart; + + //insert REST + erg += input.substring(input.indexOf(oldPart) + oldPart.length(), input.length()); + + return erg; + } + + public static void main(String[] args) throws Exception { + Log = new PrintStream(new FileOutputStream("C:/Lasttest.log")); + int time = 0; + int sek = 0; + int turns = 0; + + if (args.length != 3) { + System.out.println("Parameteranzahl falsch. Bitte verwenden Sie die Syntax "); + return; + } + + try { + sek = Integer.parseInt(args[0]); + time = Integer.parseInt(args[2]); + if (args[1].equals("INF")) { + turns = 0; + } + else + turns = Integer.parseInt(args[1]); + } + catch (NumberFormatException e) { + System.out.println("Einer der Parameter (Requestanzahl oder Testanzahl) ist keine Zahl !"); + return; + } + + System.out.println("Starte Lastest mit folgenden Parametern ..."); + System.out.println("ServerURL: " + MOA_AUTH_SERVER); + double reqPerSek = sek*1000; + System.out.println("Requests pro Sekunde: " + reqPerSek/time); + System.out.println("Durchläufe: " + (turns == 0 ? "INF" : turns + "")); + + Log.println("Starte Lastest mit folgenden Parametern ..."); + Log.println("ServerURL: " + MOA_AUTH_SERVER); + Log.println("Requests pro Sekunde: " + reqPerSek / time); + Log.println("Durchläufe: " + (turns == 0 ? "INF" : turns + "")); + + + try { + LasttestClient lc = new LasttestClient(); + //lc.startTest("data/CX0/TestGeneratorCX0.001.Req.xml","http://161.106.2.255:8080/",10,1000); + lc.startTest(sek, turns, time); + } + catch (Exception e) { + e.printStackTrace(); + } + } +} + diff --git a/id/server/idserverlib/src/test/java/test/lasttest/TestThread.java b/id/server/idserverlib/src/test/java/test/lasttest/TestThread.java new file mode 100644 index 000000000..0d2973c7f --- /dev/null +++ b/id/server/idserverlib/src/test/java/test/lasttest/TestThread.java @@ -0,0 +1,251 @@ +package test.lasttest; + +import java.io.OutputStream; +import java.net.URL; +import java.util.Vector; + +import javax.xml.namespace.QName; +import javax.xml.rpc.Call; +import javax.xml.rpc.Service; +import javax.xml.rpc.ServiceFactory; + +import org.apache.axis.message.SOAPBodyElement; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; +import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; +import at.gv.egovernment.moa.util.FileUtils; +import at.gv.egovernment.moa.util.StreamUtils; +import at.gv.egovernment.moa.util.URLDecoder; +import at.gv.egovernment.moa.util.URLEncoder; +import com.sun.net.ssl.HttpsURLConnection; + +/** + * @author Stefan Knirsch + * @version $Id$ + * + */ +public class TestThread extends Thread { + private LasttestClient parent = null; + private int turn_no; + private Dispatcher disp = null; + + public TestThread( LasttestClient parent, int durchlauf_nr) { + turn_no = durchlauf_nr; + this.parent = parent; + + } + + protected Element doCall(Element request, String server) throws Exception { + + /* QName serviceName = new QName("GetAuthenticationData"); + + String endPoint = server + "services/GetAuthenticationData"; + Service service = ServiceFactory.newInstance().createService(serviceName); + Call call = service.createCall(); + SOAPBodyElement body = new SOAPBodyElement(request); + SOAPBodyElement[] params = new SOAPBodyElement[] { body }; + Vector responses; + SOAPBodyElement response; + + + System.out.println(DOMUtils.serializeNode(body.getAsDOM())); + call.setTargetEndpointAddress(endPoint); + System.out.println("Rufe WS auf: " + endPoint); + responses = (Vector) call.invoke(params); + System.out.println("WS aufgerufen."); + response = (SOAPBodyElement) responses.get(0); + System.out.println(DOMUtils.serializeNode(response.getAsDOM())); + return response.getAsDOM();*/ + + QName serviceName = new QName("GetAuthenticationData"); + String endPoint = server + "services/GetAuthenticationData"; + Service service = ServiceFactory.newInstance().createService(serviceName); + Call call = service.createCall(); + + System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); + System.setProperty("javax.net.ssl.trustStore", "C:/Programme/ApacheGroup/abnahme/server.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); + SOAPBodyElement body = new SOAPBodyElement(request); + SOAPBodyElement[] params = new SOAPBodyElement[] { body }; + Vector responses; + SOAPBodyElement response; + + call.setTargetEndpointAddress(endPoint); + responses = (Vector) call.invoke(params); + response = (SOAPBodyElement) responses.get(0); + return response.getAsDOM(); + } + + public boolean doRequest(int turnNo) throws Exception { + long start = System.currentTimeMillis(); + + try { + LasttestClient.Log.write(("Starte Durchlauf " + turnNo + "\n").getBytes()); + } + catch (Exception e) {} + + System.out.println("Starte Durchlauf " + turnNo); + // Anmelden + String URL = getURL(LasttestClient.MOA_AUTH_SERVER, "gb", "http://10.16.126.28:9080/moa-id-proxy/"); + HttpsURLConnection conn = giveConnection(URL, "GET"); + conn.connect(); + String result = new String(StreamUtils.readStream(conn.getInputStream())); + /* + * FOR DEBUG ONLY + */ + // System.out.println(URL); + // System.out.println(result); + //---------------- + + String MOASessionID = parseSessionIDFromForm(result); + conn.disconnect(); + + URL = parseDataURL(result); + // Verify Identity Link + conn = giveConnection(URL, "POST"); + conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded"); + String infoboxReadResponse = readXmldata("InfoboxReadResponse.xml"); + OutputStream out = conn.getOutputStream(); + out.write(new String("XMLResponse=" + URLEncoder.encode(infoboxReadResponse, "UTF-8")).getBytes()); + out.flush(); + out.close(); + conn.connect(); + + /* + * FOR DEBUG ONLY + */ + // System.out.println(URL); + // System.out.println(new String(StreamUtils.readStream(conn.getInputStream()))); + //---------------- + + String redirectLoc = conn.getHeaderField("Location"); + conn.disconnect(); + //Verify Auth Block + conn = giveConnection(redirectLoc, "POST"); + String createXMLSignatureResponse = URLEncoder.encode(readXmldata("CreateXMLSignatureResponse.xml"), "UTF-8"); + out = conn.getOutputStream(); + out.write(("XMLResponse=" + createXMLSignatureResponse).getBytes("UTF-8")); + out.flush(); + out.close(); + conn.connect(); + redirectLoc = conn.getHeaderField("Location"); + + /* + * FOR DEBUG ONLY + */ + // System.out.println(redirectLoc); + // System.out.println(new String(StreamUtils.readStream(conn.getInputStream()))); + //---------------- + String samlArtifact = parseSamlArtifact(redirectLoc); + + // System.out.println("SamlArtifact: " + samlArtifact); + + AxisSecureSocketFactory.initialize(conn.getSSLSocketFactory()); + conn.disconnect(); + + conn = null; + + SAMLRequestBuilder srb = new SAMLRequestBuilder(); + + doCall(srb.build(MOASessionID, URLDecoder.decode(samlArtifact, "UTF-8")), LasttestClient.MOA_AUTH_SERVER); + // writeXmldata("GetAuthenticationDataWebServiceResponse.xml", result.getBytes("UTF-8")); + + long end = System.currentTimeMillis(); + long diff = end - start; + parent.sum +=diff; + if (parent.max < diff) { + parent.max = diff; + } + if (parent.min > diff) { + parent.min = diff; + } + if (turnNo>0) { + long totalmem = Runtime.getRuntime().totalMemory(); + long freemem = Runtime.getRuntime().freeMemory(); + try { + LasttestClient.Log.write(new String("Ende Durchlauf: " + turnNo + " ==> Dauer:" + diff + " Schnitt: " + (parent.sum/turnNo/2) + " Total-Mem: " + totalmem + " Free-Mem: " + freemem + "\n").getBytes()); + LasttestClient.Log.flush(); + } + catch (Exception e) {} + System.out.println(new String("Ende Durchlauf: " + turnNo + " ==> Dauer:" + diff + " Schnitt: " + (parent.sum/turnNo/2) + " Total-Mem: " + totalmem + " Free-Mem: " + freemem)); + } + return true; + + } + + public String getSubString(String input, String startsWith, String endsWith) { + return input.substring(input.indexOf(startsWith) + startsWith.length(), input.indexOf(endsWith, input.indexOf(startsWith) + startsWith.length())); + } + + public String getURL(String authURL, String target, String oaURL) { + return authURL + "StartAuthentication?Target=" + target + "&OA=" + oaURL; + } + + public HttpsURLConnection giveConnection(String targetURL, String requestMethod) throws Exception { + HttpsURLConnection conn = (HttpsURLConnection) new URL(targetURL).openConnection(); + conn.setRequestMethod(requestMethod); + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setUseCaches(false); + conn.setAllowUserInteraction(false); + conn.setHostnameVerifier(new HostnameVerifierHack()); + return conn; + } + + public String killInclusive(String input, String startsWith, String endsWith, String newValue) { + int start = 0; + int ende; + String result; + result = input; + do { + start = result.indexOf(startsWith, start) + startsWith.length(); + ende = result.indexOf(endsWith, start); + result = result.substring(0, start - startsWith.length()) + newValue + result.substring(ende + endsWith.length(), result.length()); + start++; + } + while (result.indexOf(startsWith, ende + 1) > 0); + + return result; + } + + public String parseDataURL(String input) { + return getSubString(input.substring(input.indexOf("DataURL"), input.length()), "value=\"", "\""); + } + + public String parseSamlArtifact(String input) { +// System.out.println(input); + return getSubString(input + "@@@", "SAMLArtifact=", "@@@"); + } + + public String parseSessionIDFromForm(String htmlForm) { + String parName = "MOASessionID="; + int i1 = htmlForm.indexOf(parName) + parName.length(); + int i2 = htmlForm.indexOf("\"", i1); + return htmlForm.substring(i1, i2); + } + + public String readXmldata(String filename) throws Exception { + + return FileUtils.readFile(LasttestClient.TESTDATA_ROOT + "xmldata/L000/" + filename, "UTF-8"); + } + + /** + * @see java.lang.Runnable#run() + */ + public void run() { + parent.thread_counter++; + + try { + if (!doRequest(turn_no)) { + parent.error_count++; + } + } + catch (Exception e) { + e.printStackTrace(); + parent.error_count++; + } + parent.thread_counter--; + } + +} diff --git a/id/server/proxy/src/main/webapp/WEB-INF/web.xml b/id/server/proxy/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..b11606fe0 --- /dev/null +++ b/id/server/proxy/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,82 @@ + + + + MOA ID Proxy + MOA ID Proxy Service + + + ParameterInOrder Filter + at.gv.egovernment.moa.id.util.ParameterInOrderFilter + + + ParameterInOrder Filter + /* + + + + Proxy + Proxy + Forwards requests to the online application + at.gv.egovernment.moa.id.proxy.servlet.ProxyServlet + 0 + + + ConfigurationUpdate + ConfigurationUpdate + Update MOA-ID Proxy configuration from the configuration file + at.gv.egovernment.moa.id.proxy.servlet.ConfigurationServlet + + + + + jspservlet + org.apache.jasper.servlet.JspServlet + + + + + + jspservlet + /errorpage-proxy.jsp + + + + jspservlet + /message-proxy.jsp + + + + ConfigurationUpdate + /ConfigurationUpdate + + + Proxy + /* + + + 30 + + + 500 + /errorpage.jsp + + + + ConfigurationUpdate + /ConfigurationUpdate + + + moa-admin + + + + BASIC + UserDatabase + + + + The role that is required to log in to the moa Application + + moa-admin + + diff --git a/id/server/proxy/src/main/webapp/errorpage-proxy.jsp b/id/server/proxy/src/main/webapp/errorpage-proxy.jsp new file mode 100644 index 000000000..07f3e7f69 --- /dev/null +++ b/id/server/proxy/src/main/webapp/errorpage-proxy.jsp @@ -0,0 +1,50 @@ + +<%@ page contentType="text/html; charset=UTF-8" %> + + +Ein Fehler ist aufgetreten + +<% Throwable exceptionThrown = (Throwable)request.getAttribute("ExceptionThrown"); + String errorMessage = (String)request.getAttribute("ErrorMessage"); + String wrongParameters = (String)request.getAttribute("WrongParameters"); +%> + + +

Fehler bei der Anmeldung

+

Bei der Anmeldung ist ein Fehler aufgetreten.

+ +<% if (errorMessage != null) { %> +

+<%= errorMessage%>
+

+<% } %> +<% if (exceptionThrown != null) { %> +

+<%= exceptionThrown.getMessage()%> +

+<% } %> +<% if (wrongParameters != null) { %> +

Die Angabe der Parameter ist unvollständig.

+ <%= wrongParameters %>
+

+ Beispiele für korrekte Links zur MOA-ID Authentisierung sind: +

+

+<a href="https://<MOA-URL>/StartAuthentication?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>"> +

+

+<a href="https://<MOA-URL>/SelectBKU?Target=<Geschäftsbereich>&OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> +

+

+Im Falle einer Applikation aus dem privatwirtschaftlichen Bereich (type="businessService") entfällt die Angabe des Target Parameters: +

+

+<a href="https://<MOA-URL>/StartAuthentication?OA=<OA-URL>&Template=<Template-URL>"> +

+

+<a href="https://<MOA-URL>/SelectBKU?OA=<OA-URL>&Template=<Template-URL>&BKUSelectionTemplate=<BKU-Template-URL>"> +

+

Die Angabe der Parameter "Template" und "BKUSelectionTemplate" ist optional.

+<% } %> + + \ No newline at end of file diff --git a/id/server/proxy/src/main/webapp/message-proxy.jsp b/id/server/proxy/src/main/webapp/message-proxy.jsp new file mode 100644 index 000000000..0d970898a --- /dev/null +++ b/id/server/proxy/src/main/webapp/message-proxy.jsp @@ -0,0 +1,20 @@ + +<%@ page contentType="text/html; charset=UTF-8" %> + + +MOA-ID Proxy + +<% String message = (String)request.getAttribute("Message"); +%> + + +

MOA-ID Proxy

+ +<% if (message != null) { %> +

+<%= message%>
+

+<% } %> + + + \ No newline at end of file diff --git a/id/server/resources/properties/id_messages_de.properties b/id/server/resources/properties/id_messages_de.properties new file mode 100644 index 000000000..4dc2ac3ae --- /dev/null +++ b/id/server/resources/properties/id_messages_de.properties @@ -0,0 +1,158 @@ +# This file contains exception messages in the standard Java properties +# format. The messages may contain formatting patterns as definied in the +# java.text.MessageFormat class. + +# +# Error messages: the key corresponds to the error code +# + +# status messages included in of GetAuthenticationDataService +1200=Anfrage erfolgreich beantwortet +1201=Fehlerhaftes Requestformat: mehr als 1 Request übergeben +1202=Fehlerhaftes Requestformat: kein SAML-Artifakt übergeben +1203=Fehlerhaftes Requestformat: mehr als 1 SAML-Artifakt übergeben +1204=Fehlerhaftes Requestformat +1205=Fehler beim Abholen der Anmeldedaten, fehlerhaftes SAML-Artifakt Format (SAML-Artifakt={0}): {1} +1206=Fehler beim Abholen der Anmeldedaten, unbekanntes SAML-Artifakt (SAML-Artifakt={0}) +1207=Zeitüberschreitung beim Abholen der Anmeldedaten (SAML-Artifakt={0}) +1299=Interner Server-Fehler + +auth.00=Anmeldung an dieser Applikation wird nicht unterstützt (URL={0}) +auth.01=Die Anmeldung ist bereits im Gange (MOASessionID={0}) +auth.02=MOASessionID ist unbekannt (MOASessionID={0}) +auth.03=Fehler beim Abholen einer Datei von der URL "{0}": Interne Fehlermeldung: {1} +auth.04=Fehler beim Auslesen der Resource "{0}": {1} +auth.05=Fehlender Parameter "{1}" beim Aufruf von "{0}" +auth.06=Fehler beim Speichern der Anmeldedaten, fehlerhaftes SAML-Artifact Format (SAML-Artifact={0}) +auth.07=Aufruf von {0} muss mit Schema "https:" erfolgen.
Hinweis: Bitte Dokumentation zu GenericConfiguration: "FrontendServlets.EnableHTTPConnection" beachten. +auth.08=In der Bürgerkartenumgebung ist ein Fehler aufgetreten:
Fehlercode {0}: {1} +auth.09=Zur Auswahlseite der Bürgertenumgebung (URL={0}) konnte keine Verbindung hergestellt werden. :
HTTP-Statuscode {1} +auth.10=Fehler beim Aufruf von "{0}": Parameter "{1}" fehlt +auth.11=Die zentral gespeicherte Auswahlseite für Bürgerkartenumgebungen konnte nicht geladen werden. Bitte informieren Sie den Adminstrator des Servers und versuchen Sie die Anmeldung in einiger Zeit abermals.
URL "{0}" Interne Fehlermeldung: {1} + +init.00=MOA ID Authentisierung wurde erfolgreich gestartet +init.01=Fehler beim Aktivieren des IAIK-JCE/JSSE/JDK1.3 Workaround: SSL ist möglicherweise nicht verfügbar +init.02=Fehler beim Starten des Service MOA ID Authentisierung + +config.00=MOA ID Konfiguration erfolgreich geladen: {0} +config.01=Umgebungsvariable "moa.id.configuration" nicht gesetzt +config.02=Nicht klassifizierter Fehler in der Konfiguration (siehe Log-Datei für Details) +config.03=Fehler beim Einlesen der Konfiguration (siehe Log-Datei für Details) +config.04=Fehler beim Lesen der MOA ID Konfiguration; es wird weiterhin die ursprüngliche Konfiguration verwendet +config.05=Fehlerhafter Wert für "{0}" in der MOA ID Konfiguration +config.06=Doppelter Eintrag in der Konfiguration für die Online-Applikation gefunden: {0} +config.07=Klasse {0} kann nicht instanziert werden +config.08=Fehlender Wert für "{0}" in der MOA ID Konfiguration +config.09=Fehler beim Erstellen von X509IssuerSerial (IssuerName={0}, SerialNumber={1}) +config.10=Fehler in der MOA SPSS Konfiguration: {0} +config.11=LoginParameterResolver konnte nicht konfiguriert werden {0} +config.12=Standard DATA URL Prefix "{0}" wird anstatt des konfigurierten DATA URL Prefix verwendet +config.13=Konfiguriertes DATA URL Prefix "{0}" muss mit http:// bzw. https:// beginnen +config.14=LoginParameterResolver-Fehler: {0} +config.15=Das Personenbindungs-Trust-Profil (TrustProfileID = {0}) darf nicht für die Verifikation anderer Infoboxen verwendet werden. +config.16=MOA ID Proxy konnte nicht gestartet werden. Das Element ConnnectionParameter im allgemeinen Konfigurationsteil der MOA-ID-PROXY Konfigurationsdatei fehlt. + + +parser.00=Leichter Fehler beim Parsen: {0} +parser.01=Fehler beim Parsen: {0} +parser.02=Schwerer Fehler beim Parsen: {0} +parser.03=Fehler beim Parsen oder Konvertieren eines ECDSA-Schlüssels: {0} +parser.04=Fehler beim Serialisieren: {0} +parser.05=Fehler beim Serialisieren: SAML-Attribute {0} (Namespace: {1}) konnte nicht serialsiert werden. +parser.06=Fehler beim Parsen: {0}-InfoboxResponse nicht vollständig ({1} im {2} fehlt) +parser.07=Fehler beim Parsen: Assoziatives Array im {0}-InfoboxResponse enthält einen Schlüssel ohne zugehörigen Wert ("Key"-Element statt "Pair"-Element). + +builder.00=Fehler beim Aufbau der Struktur "{0}": {1} +builder.01=Fehlerhaftes Template: Kennung "{0}" fehlt + +service.00=Fehler beim Aufruf des Web Service: {0} +service.01=Fehler beim Aufruf des Web Service: kein Endpoint +service.02=Fehler beim Aufruf des Web Service, Status {0}: {1} +service.03=Fehler beim Aufruf des SPSS-API: {0} + +cleaner.00=AuthenticationSessionCleaner wurde gestartet +cleaner.01=Fehler im AuthenticationSessionCleaner +cleaner.02=MOASession {0} ist abgelaufen +cleaner.03=Anmeldedaten zu SAML-Artifakt {0} sind abgelaufen + +proxy.00=MOA ID Proxy wurde erfolgreich gestartet +proxy.01=Unbekannter URL {0}, erwarteter URL auf {1} +proxy.02=Unbekannter URL {0}.
Es wurde keine Übereinstimmung zum Attribut publicURLPrefix im Element 'OnlineApplication' der verwendeten MOA-ID Konfigurationsdatei gefunden. +proxy.04=URL {0} : {1} +proxy.05=Fehler beim Aufbauen der SSLSocketFactory für {0} : {1} +proxy.06=Fehler beim Starten des Service MOA ID Proxy +proxy.07=Sie sind nicht bzw. nicht mehr angemeldet. Melden Sie sich bitte erneut an. +proxy.08=Kein URL-Mapping in der HttpSession verfügbar (URL {0}) +proxy.09=Fehler beim Aufruf des MOA-ID Auth API: {0} +proxy.10=Fehler beim Weiterleiten (MOA-ID Proxy) +proxy.11=Beim Weiterleiten der Verbindung zur Anwendung ist ein Fehler aufgetreten. +proxy.12=Fehler bei der Anmeldung.
Eine Anmeldung an der Anwendung {0} war nicht möglich.
Prüfen Sie bitte ihre Berechtigung. +proxy.13=Fehler beim Aufruf des LoginParameterResolvers zu URL-Präfix: {0} +proxy.14=

Folgende Ursachen können zu dem Fehler geführt haben:

  1. Sie sind nicht mehr angemeldet (Verbindungen werden aus Sicherheitsgründen bei längerer Inaktivität beendet.)
    Melden Sie sich bitte erneut an.
  2. Die Kommunikation mit dem Server schlug fehl.
+proxy.15=Auf die gewünschte Seite kann nicht zugegriffen werden, Sie besitzen nicht die benötigte Berechtigung. +proxy.16=Fehler bei der Anmeldung.
Eine Anmeldung an der Anwendung {0} war nicht möglich. Die maximale Anzahl von {1} ungültigen Loginversuchen wurde überschritten.
Prüfen Sie bitte ihre Berechtigung. + +validator.00=Kein SAML:Assertion Objekt gefunden {0} +validator.01=Im Subject kommt mehr als ein Element des Typs PhysicalPersonType vor {0} +validator.02=Das verwendete Schlüsselformat eines öffentlichen Schlüssels ist unbekannt {0} +validator.03=Der Namespace eines öffentlichen Schlüssels ist ungültig {0} +validator.04=Es wurde ein SAML:Attribut ohne öffentlichen Schlüssel gefunden {0} +validator.05=Es wurde {0} keine DSIG:Signature gefunden + +validator.06=Die Signatur ist ungültig +validator.07=Das Zertifikat der Personenbindung ist ungültig.
{0} +validator.08=Das Manifest ist ungültig +validator.09=Die öffentlichen Schlüssel des Identitiy Link stimmen nicht mit dem retournierten Zertifikat überein + +validator.10=Anzahl der URLs zur Authentisierungskomponente ungültig {0} +validator.11="Geschäftsbereich" wurde nicht in den SAML-Attributen gefunden {0} +validator.12=Der Namespace des SAML-Attributs "Geschäftsbereich" ist ungültig {0} +validator.13=Das Target des 'Geschäftsbereichs' ist ungültig {0} +validator.14="OA" wurde nicht in den SAML-Attributen gefunden {0} +validator.15=Der Namespace des SAML-Attributs "OA" ist ungültig {0} +validator.16=Die vorkonfigurierte URL der OnlineApplikation ist fehlerhaft {0} + +validator.17= Der SubjectDN-Name des von MOA-SP retournierten Zertifikats ist ungültig {0} +#validator.18= Der SubjectDN-Name des von MOA-SP retournierten Zertifikats ist nicht als gültiger SubjectDN-Name für eine Personenbindung konfiguriert. {0} wurde NICHT in der Konfiguration gefunden +validator.18= Das Zertifikat mit dem die Personenbindung signiert wurde, ist nicht zum Signieren der Personenbindung zulässig. Es konnte weder der SubjectDN ({0}) einem berechtigten Namen zugeordnet werden, noch enthält das Zertifikat die Erweiterung "Eigenschaft zur Ausstellung von Personenbindungen". + +validator.19=Das verwendete Zertifikat zum Signieren ist ungültig.
{0} + +validator.21=Es konnte keine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konstruiert werden. +validator.22=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für zumindest ein Zertifikat dieser Kette fällt der Prüfzeitpunkt nicht in das Gültigkeitsintervall. +validator.23=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für alle Zertifikate dieser Kette fällt der Prüfzeitpunkt in das jeweilige Gültigkeitsintervall. Für zumindest ein Zertifikat konnte der Zertifikatstatus nicht festgestellt werden. +validator.24=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für alle Zertifikate dieser Kette fällt der Prüfzeitpunkt in das jeweilige Gültigkeitsintervall. Zumindest ein Zertifikat ist zum Prüfzeitpunkt widerrufen. +validator.25=Eine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konnte konstruiert werden. Für alle Zertifikate dieser Kette fällt der Prüfzeitpunkt in das jeweilige Gültigkeitsintervall. Kein Zertifikat dieser Kette ist zum Prüfzeitpunkt widerrufen. Zumindest ein Zertifikat ist zum Prüfzeitpunkt gesperrt. + +validator.26=OA Applikation ist eine Wirtschaftsapplikation, trotzdem ist ein SAML-Attribut "Geschäftsbereich" enthalten +validator.27=OA Applikation ist keine Wirtschaftsapplikation, trotzdem ist ein SAML-Attribut "wbPK" enthalten +validator.28=Fehlerhafter Wert im "wbPK" SAML-Attribut {0} +validator.29=Fehler beim Auslesen des "wbPK" SAML-Attributs {0} +validator.30=Der Namespace des SAML-Attributs "wbPK" ist ungültig {0} +validator.31="wbPK" wurde nicht in den SAML-Attributen gefunden {0} + + +validator.32="Issuer" im AUTH-Block nicht vorhanden. +validator.33="Issuer"-Attribut im AUTH-Block ("{0}") stimmt nicht mit dem Namen in der Personenbindung ("{1}") überein. +validator.34=Das Geburtsdatum ({0}) stimmt nicht mit dem in der Personenbindung ({1}) überein. +validator.35=Der Namespace des SAML-Attributs "Geburtsdatum" ist ungültig. +validator.36=Die Anzahl der SAML-Attribute im AUTH-Block wurde verändert: {0} statt der erwarteten {1} +validator.37=Die Reihenfolge der SAML-Attribute im AUTH-Block wurde verändert: Attribut "{0}" anstelle von Attribut "{1}" an der {2}. Position +validator.38=Der {0} des SAML-Attributs Nummer {1} ({2}) im AUTH-Block ist ungültig: "{3}" anstelle von "{4}" +validator.39=Der Austellungszeitpunkt (IssueInstant) im AUTH-Block wurde verändert: {0} anstelle von {1}. Möglicherweise wurde Ihre Bürgerkartenumgebung kompromittiert. Verwenden Sie Ihre Bürgerkarte bis auf weiteres nicht mehr, und setzen Sie sich umgehend mit dem Betreiber des Online-Dienstes, an dem Sie sich anmelden wollten, in Verbindung. + + +validator.40=Überprüfung der {0}-Infobox fehlgeschlagen: {1} +validator.41=Überprüfung der {0}-Infobox fehlgeschlagen: Keine Konfigurationsparameter zur Überprüfung der {0}-Infobox vorhanden. +validator.42=Überprüfung der {0}-Infobox fehlgeschlagen: Es konnte keine geeignete Applikation zur Verifikation der {0}-Infobox geladen werden. +validator.43=Überprüfung der {0}-Infobox fehlgeschlagen: Der InfoboxReadResponse für die {0}-Infobox konnte nicht erfolgreich geparst werden. +validator.44=Überprüfung der {0}-Infobox fehlgeschlagen: In der {0}-Infobox Prüfapplikation ist ein Fehler aufgetreten. +validator.45=Überprüfung der {0}-Infobox fehlgeschlagen: Der {1} des von der {0}-Infobox Prüfapplikation zurückgegebenen SAML-Attributes Nummer {2} ist {3}. +validator.46=Überprüfung der {0}-Infobox fehlgeschlagen: Der Wert des von der Prüfapplikation zurückgegebenen SAML-Attributes Nummer {1} ist ungültig. +validator.47=Überprüfung der {0}-Infobox fehlgeschlagen: Das von der Prüfapplikation zurückgegebene SAML-Attribut Nummer {1} kann nicht eindeutig zugeordnet werden. +validator.48={0}-Infobox wurde nicht von der BKU übermittelt: Für die Anmeldung an dieser Online-Applikation ist die {0}-Infobox erforderlich. Bitte melden Sie sich erneut an, und selektieren Sie in Ihrer BKU die {0}-Infobox. + +validator.49=Beim Ermitteln der Personenbindungs-OID im Zertifikat, mit dem die Personenbindung signiert wurde, ist ein Fehler aufgetreten. + + +ssl.01=Validierung des SSL-Server-Endzertifikates hat fehlgeschlagen diff --git a/id/server/resources/wsdl/MOA-ID-1.0.wsdl b/id/server/resources/wsdl/MOA-ID-1.0.wsdl new file mode 100644 index 000000000..5751b3e58 --- /dev/null +++ b/id/server/resources/wsdl/MOA-ID-1.0.wsdl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/resources/wsdl/MOA-ID-1.x.wsdl b/id/server/resources/wsdl/MOA-ID-1.x.wsdl new file mode 100644 index 000000000..45152cb38 --- /dev/null +++ b/id/server/resources/wsdl/MOA-ID-1.x.wsdl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/resources/wsdl/MOA-SPSS-1.2.xsd b/id/server/resources/wsdl/MOA-SPSS-1.2.xsd new file mode 100644 index 000000000..d7a06d6e7 --- /dev/null +++ b/id/server/resources/wsdl/MOA-SPSS-1.2.xsd @@ -0,0 +1,454 @@ + + + + + + + + + + + + + + + + + + + + Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements + + + + + + + + + + + + + + + + + + + Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil + + + + + + + + + + + + + + + + + + Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage + + + + Resultat, falls die Signaturerstellung erfolgreich war + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert + + + + + + + + + + + only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. + + + + + + + + + + mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert + + + + + + + + + + + only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resultat, falls die Signaturerstellung gescheitert ist + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. + + + + + Profilbezeichner für einen Transformationsweg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. + + + + Der Transformationsparameter explizit angegeben. + + + + + Der Hashwert des Transformationsparameters. + + + + + + + + + + + + + + + + + + + + + + Explizite Angabe des Transformationswegs + + + + + + + Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. + + + + + + + + + + + + + + + + diff --git a/id/server/resources/xmldata/CertInfoDsigSignature.xml b/id/server/resources/xmldata/CertInfoDsigSignature.xml new file mode 100644 index 000000000..bf35dc73f --- /dev/null +++ b/id/server/resources/xmldata/CertInfoDsigSignature.xml @@ -0,0 +1,139 @@ +id('signed-data')/node()C0hW5jQojphweuFzPb+CNkHwhe4=id('refetsi')/etsi:QualifyingProperties/etsi:SignedPropertiesBdsc7wAfyMyZ21ChcF+tRh3D7sU=lCz3hDQMbqRMmCieG3fQFax3f8JX86gDi7mf4h03J7vlJjSOJQ4Wh/3Kd81ntKuh +qFphj2cEhQYX08e6SeaU+7H7qdRa+xFRDRGav8L5x5xCUQT2SV+2/hx0C7UuJt+p +tewtbqVAcNxgKPlBuIzyXGOrBdiinp1KftEQoVCpPCI=MIIFJTCCBA2gAwIBAgICGTcwDQYJKoZIhvcNAQEFBQAwgaExCzAJBgNVBAYTAkFU +MUgwRgYDVQQKEz9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGlt +IGVsZWt0ci4gRGF0ZW52ZXJrZWhyIEdtYkgxIzAhBgNVBAsTGmEtc2lnbi1URVNU +LVByZW1pdW0tRW5jLTAxMSMwIQYDVQQDExphLXNpZ24tVEVTVC1QcmVtaXVtLUVu +Yy0wMTAeFw0wMzAyMTAxMzIwNThaFw0wNjAyMTAxMzIwNThaMGoxCzAJBgNVBAYT +AkFUMRwwGgYDVQQDExNUZXN0cGVyc29uIE1PQTQgQlJaMQwwCgYDVQQEEwNCUlox +GDAWBgNVBCoTD1Rlc3RwZXJzb24gTU9BNDEVMBMGA1UEBRMMNzkwMTg3NDYxNjMz +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDS/UW1/tZeCh7HHQmj8auUTEc4 +edAgRDkUVKOm0tF3kE3WZlhGDZL0p84xsdIKyI+bwDCMATATkQwDo/Xxn9jJMi4/ +t80bNyRsHk9giA0wcvz9NgmEcDwKNqawGsR9gNeK8TyIC8AuDkj1EwtkAObMvtp/ +Z1phi47x3JxDDfGDpQIDAQABo4ICHzCCAhswEwYDVR0jBAwwCoAIS7OAw3GTPNgw +JwYIKwYBBQUHAQMBAf8EGDAWMAgGBgQAjkYBATAKBggrBgEFBQcLATCBggYIKwYB +BQUHAQEEdjB0MCkGCCsGAQUFBzABhh1odHRwOi8vd3d3LmEtdHJ1c3QuYXQ6ODIv +b2NzcDBHBggrBgEFBQcwAoY7aHR0cDovL3d3dy5hLXRydXN0LmF0L2NlcnRzL2Et +c2lnbi1URVNULVByZW1pdW0tU2lnLTAxYS5jcnQwgZQGA1UdIASBjDCBiTB9BgYq +KAARAQQwczA1BggrBgEFBQcCARYpaHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3Mv +Y3AvYS1zaWduLVRFU1QwOgYIKwYBBQUHAgIwLhosRGllc2VzIFplcnRpZmlrYXQg +ZGllbnQgbnVyIHp1IFRlc3R6d2Vja2VuICEwCAYGBACLMAEBMG8GA1UdHwRoMGYw +ZKBioGCGXmxkYXA6Ly9sZGFwLmEtdHJ1c3QuYXQvb3U9YS1zaWduLVRFU1QtUHJl +bWl1bS1FbmMtMDEsbz1BLVRydXN0LGM9QVQ/Y2VydGlmaWNhdGVyZXZvY2F0aW9u +bGlzdD8wEQYDVR0OBAoECE4DxL9ky4M+MA4GA1UdDwEB/wQEAwIGwDAgBgNVHREE +GTAXgRV0ZXN0cGVyc29uNEBicnouZ3YuYXQwCQYDVR0TBAIwADANBgkqhkiG9w0B +AQUFAAOCAQEAioVvsZN+NnQxXMTGdjKveTBMRTYzHflkSC8lI9XXltP5+mjIuoB2 +Tn6voovA8dXz9jTsnQt8f8ye0CL2bSS9UVD1jv8So3bavquW+HlkZBAZvL39APNL +PjUUnWn0QOnrQAJ6W47UwGAUgEw3KcBcJaEa4Xb/8kUj618xGzWl6X0mKsVpxkrf ++5Cj+nmwDqChll08/90MmhSY4M5FrvmQ9GjAN5FHVsk0FPp02tKCRzoBJtzpB1DW +KHlgiDHUAXy5eD0XI7PXebPNZ4InvY/jC/IH8PRLdJT249YQmUxZ4neTtFDvb8C1 +Qh6k725fh3hVxqX8ZwwWj9+iGQVk53K3CA== + +Ãœberprüfung des Namen des Anmelde-Servers + + +

Prüfung der Identität des MOA-ID Servers

+ +Bevor Sie sich in den folgenden Schritten an eine Online-Applikation anmelden, +wird empfohlen den Namen des Anmelde-Servers zu überprüfen. +Zu diesem Zweck identifiziert Ihr Webbrowser den Anmelde-Server mit Hilfe eines Zertifikates. +Ihre Aufgabe ist es zu überprüfen, ob das Server-Zertifikat von einem Unternehmen ausgestellt +wurde, dem Sie vertrauen. +

+Die folgenden Absätze beschreiben, wie Sie diese Überprüfung durchführen können. +Führen Sie jene Arbeitsschritte durch, die für den von Ihnen verwendeten Webbrowser zutreffend sind. +

+

Microsoft Internet Explorer 6.0

+ +
    +
  1. Öffnen Sie (durch Doppel-Klicken) das Symbol mit dem gelben Vorhangschloß am unteren Rand des Browsers.
  2. +
  3. Selektieren Sie im nun geöffnetem Fenster "Zertifikat" den Karteireiter "Zertifizierungspfad".
  4. +
  5. Öffnen Sie (durch Doppel-Klicken) das an oberster Stelle gereihte Zertifikat.
  6. +
  7. Überprüfen Sie ob als Aussteller dieses Zertifikat (Karteireiter "Details", Eintrag "Aussteller") +ein Unternehmen aufscheint, dem Sie vertrauen den Namen des Anmelde-Servers zu überprüfen.
  8. +
  9. Überprüfen Sie, ob dieses Zertifikat authentisch vom angegebene Unternehmen stammt. Dazu können Sie den +Fingerabdruck (Karteireiter "Details", unterster Eintrag) des Zertifikats überprüfen. Am Ende dieses Dokuments ist +eine von der IKT-Stabsstelle überprüfte Liste von Zertifikaten und deren Fingerabdruck aufgelistet. +Überprüfen Sie ob das von Ihnen zu überprüfende Zertifikat +in dieser Liste enthalten ist und der Fingerabruck mit dem Wert in der Liste übereinstimmt. +
      +
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten und stimmt der Wert des Fingerabdrucks mit dem Wert +in der Liste überein, dann ist das Zertifikat authentisch und der Anmeldevorgang kann fortgesetzt werden.
    • +
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten aber stimmt der Wert des Fingerabdrucks nicht mit dem Wert +in der Liste überein, dann ist das Zertifikat nicht authentisch und der Anmeldevorgang muss abgebrochen werden.
    • +
    • Ist Ihr zu prüfendes Zertifikat nicht in der Liste enthalten müssen Sie eine andere verlässliche Quelle für den +Vergleich des Fingerabdrucks finden. Sofern das Zertifikat authentisch ist, kann der Anmeldevorgang fortgesetzt werden.
    • +
  10. +
  11. Ist das in Schritt 3. geöffnete Zertifikat nicht im Internet Explorer installiert erscheint das Zertifikat mit +einem roten Kreuz. Sie können das Zertifikat installieren, indem Sie die Schaltfläche "Zertifikat installieren ..." +(Karteireiter "Allgemein") aktivieren. In der Folge werden alle von dieser Zertifizierungsstelle ausgestellten Zertifikate +vom Internet Explorer als vertrauenswürdig erkannt.
  12. +
+

Netscape Navigator 7.0

+
    +
  1. Öffnen Sie (durch Klicken) das Symbol mit dem Vorhangschloss am rechten, unteren Rand des Browsers
  2. +
  3. Aktivieren Sie die Schaltfläche "Anzeigen"
  4. +
  5. Selektieren Sie im nun geöffnetem Fenster "Zertifikatsanzeige" den Karteireiter "Detail".
  6. +
  7. Aktivieren Sie (durch Klicken) das an oberster Stelle gereihte Zertifikat.
  8. +
  9. Überprüfen Sie ob als Aussteller dieses Zertifikat (Eintrag "Aussteller") +ein Unternehmen aufscheint, dem Sie vertrauen den Namen des Anmelde-Servers zu überprüfen.
  10. +
  11. Überprüfen Sie, ob dieses Zertifikat authentisch vom angegebene Unternehmen stammt. Dazu können Sie den +Fingerabdruck des Zertifikats überprüfen. Am Ende dieses Dokuments ist +eine von der IKT-Stabsstelle überprüfte Liste von Zertifikaten und deren Fingerabdruck aufgelistet. +Überprüfen Sie ob das von Ihnen zu überprüfende Zertifikat +in dieser Liste enthalten ist und der Fingerabruck mit dem Wert in der Liste übereinstimmt. +
      +
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten und stimmt der Wert des Fingerabdrucks mit dem Wert +in der Liste überein, dann ist das Zertifikat authentisch und der Anmeldevorgang kann fortgesetzt werden.
    • +
    • Ist Ihr zu prüfendes Zertifikat in der Liste enthalten aber stimmt der Wert des Fingerabdrucks nicht mit dem Wert +in der Liste überein, dann ist das Zertifikat nicht authentisch und der Anmeldevorgang muss abgebrochen werden.
    • +
    • Ist Ihr zu prüfendes Zertifikat nicht in der Liste enthalten müssen Sie eine andere verlässliche Quelle für den +Vergleich des Fingerabdrucks finden. Sofern das Zertifikat authentisch ist, kann der Anmeldevorgang fortgesetzt werden.
    • +
  12. +
  13. Ist das Aussteller-Zertifikat nicht im Netscape Navigator installiert können Sie das Zertifikat installieren, +indem Sie die "*.cer" Datei mit Netscape Navigator öffnen. In der Folge werden alle von dieser Zertifizierungsstelle +ausgestellten Zertifikate vom Internet Explorer als vertrauenswürdig erkannt.
  14. +
+ +

Zertifikate und ihr Fingerabdruck

+ + + + + + + + + + + +
AusstellerCN=A-Trust-nQual-01,OU=A-Trust-nQual-01,O=A-Trust,C=AT
Seriennummer111 (0x6f)
FingerabdruckSHA-1: e6 e6 fc 88 71 91 77 c9 b7 42 18 25 75 7c 5e 47 bc ac 85 f6
+ +

+ + + + + + + + + + +
AusstellerCN=A-Trust-nQual-01,OU=A-Trust-nQual-01,O=A-Trust,C=AT
Seriennummer531 (0x213)
FingerabdruckSHA-1: 9e 05 12 dd 61 da 59 49 d1 d8 63 1c 3f 19 d7 5f 49 6c 37 33
+ +

+ + + + + + + + + + +
AusstellerCN=A-Trust-nQual-01,OU=A-Trust-nQual-01,O=A-Trust,C=AT
Seriennummer536 (0x0218)
FingerabdruckSHA-1: 0f 5a 03 42 f5 cd 44 87 99 c3 c6 d1 78 60 7e 3f 2b 5b cb 8f
+ + +2003-05-06T07:09:50ZFrhu1o4mL4gQHdJcU0xSA/h4COE=CN=a-sign-TEST-Premium-Enc-01,OU=a-sign-TEST-Premium-Enc-01,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT6455text/html \ No newline at end of file diff --git a/id/server/services/org.apache.axis.components.net.SecureSocketFactory b/id/server/services/org.apache.axis.components.net.SecureSocketFactory new file mode 100644 index 000000000..c4547e804 --- /dev/null +++ b/id/server/services/org.apache.axis.components.net.SecureSocketFactory @@ -0,0 +1 @@ +at.gv.egovernment.moa.id.util.AxisSecureSocketFactory diff --git a/id/templates/src/main/webapp/SampleBKUSelectionTemplate.html b/id/templates/src/main/webapp/SampleBKUSelectionTemplate.html new file mode 100644 index 000000000..5536226a8 --- /dev/null +++ b/id/templates/src/main/webapp/SampleBKUSelectionTemplate.html @@ -0,0 +1,52 @@ + + + +MOA ID - Auswahl der B&uuuml;rgerkartenumgebung + + + + + + + + +Organisation XY +

Auswahl der Bürgerkartenumgebung

+

+

Sie haben sich für Anmeldung mit Ihrer Bürgerkarte entschieden. Da es verschiedene Formen der Bürgerkarte gibt, müssen Sie nun wählen, welche Sie bei der Anmeldung verwenden wollen.

+

Auswahl der Bürgerkarte

+
+ + + +
+

+ + + + +

Hinweise:

+
    +
  • +

    Wollen Sie eine A-Trust Bürgerkarte erwerben? Hier finden Sie Informationen + dazu: A-Trust + Bürgerkarte. Bei der Anmeldung mit der A-Trust Bürgerkarte + benötigen Sie eine funktionsfähige Bürgerkartensoftware sowie + einen passenden Kartenleser.

    +
  • +
  • +

    Wollen Sie ein A1-Signatur erwerben? Wenden Sie sich an 0800-664 680 um + Informationen zur A1-Signatur zu erhalten. + Hier finden Sie ebenfalls Informationen dazu: A1-Signatur. + Bei der Anmeldung mit der A1-Signatur wird keine Bürgerkartensoftware und + kein Kartenleser benötigt.

    +
  • +
+
Valid HTML 4.01!
+

 

+ + + + diff --git a/id/templates/src/main/webapp/SampleLogo.gif b/id/templates/src/main/webapp/SampleLogo.gif new file mode 100644 index 000000000..4b7c682b1 Binary files /dev/null and b/id/templates/src/main/webapp/SampleLogo.gif differ diff --git a/id/templates/src/main/webapp/SampleTemplate.html b/id/templates/src/main/webapp/SampleTemplate.html new file mode 100644 index 000000000..e9756a036 --- /dev/null +++ b/id/templates/src/main/webapp/SampleTemplate.html @@ -0,0 +1,62 @@ + + + +MOA ID - Identifizierter Zugang mit Bürgerkarte + + + + + + + + +Organisation XY +

Sicherer Zugang zur Online-Anwendung mit Bürgerkarte

+

+ +Der identifizierte Zugang erfolgt über die Module für Online Applikationen (MOA) unter Verwendung einer Bürgerkarte und deren Signaturfunktion. + +

+

Wenn Sie in Folge die Schaltfläche "Anmeldung mit Bürgerkarte" +aktivieren, so werden zur Signatur der Anmeldedaten aufgefordert. Wenn sie diese +signieren, so werden sie zur Online-Anwendung weitergeleitet und angemeldet.

+ + +
+
+ + + + +
+
+
+ + + + +
+

+ + +
+ +
Valid HTML 4.01!
+

 

+ + + diff --git a/id/templates/src/main/webapp/WEB-INF/web.xml b/id/templates/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..6954e9c87 --- /dev/null +++ b/id/templates/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + + + + Sample MOA-ID Templates + >Sample MOA-ID Templates + + diff --git a/id/templates/src/main/webapp/css/display.css b/id/templates/src/main/webapp/css/display.css new file mode 100644 index 000000000..fc6da85b0 --- /dev/null +++ b/id/templates/src/main/webapp/css/display.css @@ -0,0 +1,52 @@ +/* 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 new file mode 100644 index 000000000..bcad5589c --- /dev/null +++ b/id/templates/src/main/webapp/css/main.css @@ -0,0 +1,74 @@ +/* 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 new file mode 100644 index 000000000..1270561e1 Binary files /dev/null and b/id/templates/src/main/webapp/valid-html401.gif differ diff --git a/spss.handbook/clients/api/lib/commons-discovery-0.2/commons-discovery.jar b/spss.handbook/clients/api/lib/commons-discovery-0.2/commons-discovery.jar deleted file mode 100644 index b88554847..000000000 Binary files a/spss.handbook/clients/api/lib/commons-discovery-0.2/commons-discovery.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging-api.jar b/spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging-api.jar deleted file mode 100644 index ade9a13c7..000000000 Binary files a/spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging-api.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging.jar b/spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging.jar deleted file mode 100644 index b73a80fab..000000000 Binary files a/spss.handbook/clients/api/lib/commons-logging-1.0.4/commons-logging.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Provider.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Provider.jar deleted file mode 100644 index af39b42b1..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Provider.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Wrapper.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Wrapper.jar deleted file mode 100644 index 43342ef7c..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_Pkcs11Wrapper.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_cms.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_cms.jar deleted file mode 100644 index 7264a68f3..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_cms.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ecc.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ecc.jar deleted file mode 100644 index 4cd73391d..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ecc.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ixsil.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ixsil.jar deleted file mode 100644 index 5279f2247..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_ixsil.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_jce_full.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_jce_full.jar deleted file mode 100644 index fe14dbb2a..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_jce_full.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_moa_full.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_moa_full.jar deleted file mode 100644 index 539988fba..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/iaik_moa_full.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux/libpkcs11wrapper.so deleted file mode 100644 index 11852511b..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux_x64/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux_x64/libpkcs11wrapper.so deleted file mode 100644 index 393946053..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/linux_x64/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_Pkcs11Provider.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_Pkcs11Provider.jar deleted file mode 100644 index a348db04e..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_Pkcs11Provider.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_ecc.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_ecc.jar deleted file mode 100644 index b8a4f190b..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_ecc.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_jce_full.jar b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_jce_full.jar deleted file mode 100644 index 7288bc39d..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/signed/iaik_jce_full.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparc/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparc/libpkcs11wrapper.so deleted file mode 100644 index 0b19f10c1..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparc/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparcv9/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparcv9/libpkcs11wrapper.so deleted file mode 100644 index 11f928b0b..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/solaris_sparcv9/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/win32/pkcs11wrapper.dll b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/win32/pkcs11wrapper.dll deleted file mode 100644 index 3789b8d7a..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/win32/pkcs11wrapper.dll and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/wince30arm/pkcs11wrapper.dll b/spss.handbook/clients/api/lib/iaik-moa-20070503/full/wince30arm/pkcs11wrapper.dll deleted file mode 100644 index d98e48d80..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070503/full/wince30arm/pkcs11wrapper.dll and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_Pkcs11Wrapper.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_Pkcs11Wrapper.jar deleted file mode 100644 index 43342ef7c..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_Pkcs11Wrapper.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_cms.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_cms.jar deleted file mode 100644 index 7264a68f3..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_cms.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_ixsil.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_ixsil.jar deleted file mode 100644 index 003df0066..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_ixsil.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_moa_full.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_moa_full.jar deleted file mode 100644 index 35ffc2d06..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/iaik_moa_full.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux/libpkcs11wrapper.so deleted file mode 100644 index 11852511b..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux_x64/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux_x64/libpkcs11wrapper.so deleted file mode 100644 index 393946053..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/linux_x64/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_Pkcs11Provider.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_Pkcs11Provider.jar deleted file mode 100644 index a348db04e..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_Pkcs11Provider.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_ecc.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_ecc.jar deleted file mode 100644 index b8a4f190b..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_ecc.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_jce_full.jar b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_jce_full.jar deleted file mode 100644 index 7288bc39d..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/signed/iaik_jce_full.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparc/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparc/libpkcs11wrapper.so deleted file mode 100644 index 0b19f10c1..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparc/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparcv9/libpkcs11wrapper.so b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparcv9/libpkcs11wrapper.so deleted file mode 100644 index 11f928b0b..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/solaris_sparcv9/libpkcs11wrapper.so and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/win32/pkcs11wrapper.dll b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/win32/pkcs11wrapper.dll deleted file mode 100644 index 3789b8d7a..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/win32/pkcs11wrapper.dll and /dev/null differ diff --git a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/wince30arm/pkcs11wrapper.dll b/spss.handbook/clients/api/lib/iaik-moa-20070801/full/wince30arm/pkcs11wrapper.dll deleted file mode 100644 index d98e48d80..000000000 Binary files a/spss.handbook/clients/api/lib/iaik-moa-20070801/full/wince30arm/pkcs11wrapper.dll and /dev/null differ diff --git a/spss.handbook/clients/api/lib/jaxen-1.0/jaxen-core.jar b/spss.handbook/clients/api/lib/jaxen-1.0/jaxen-core.jar deleted file mode 100644 index e52bf679c..000000000 Binary files a/spss.handbook/clients/api/lib/jaxen-1.0/jaxen-core.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/jaxen-1.0/jaxen-dom.jar b/spss.handbook/clients/api/lib/jaxen-1.0/jaxen-dom.jar deleted file mode 100644 index 1a9926357..000000000 Binary files a/spss.handbook/clients/api/lib/jaxen-1.0/jaxen-dom.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/jaxen-1.0/saxpath.jar b/spss.handbook/clients/api/lib/jaxen-1.0/saxpath.jar deleted file mode 100644 index 2b43955ba..000000000 Binary files a/spss.handbook/clients/api/lib/jaxen-1.0/saxpath.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/jaxp-1.2_01/dom.jar b/spss.handbook/clients/api/lib/jaxp-1.2_01/dom.jar deleted file mode 100644 index f91f80a8b..000000000 Binary files a/spss.handbook/clients/api/lib/jaxp-1.2_01/dom.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/jaxp-1.2_01/jaxp-api.jar b/spss.handbook/clients/api/lib/jaxp-1.2_01/jaxp-api.jar deleted file mode 100644 index 7a3295ee6..000000000 Binary files a/spss.handbook/clients/api/lib/jaxp-1.2_01/jaxp-api.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/jaxp-1.2_01/sax.jar b/spss.handbook/clients/api/lib/jaxp-1.2_01/sax.jar deleted file mode 100644 index 9ffb844e5..000000000 Binary files a/spss.handbook/clients/api/lib/jaxp-1.2_01/sax.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/log4j-1.2.7/log4j-1.2.7.jar b/spss.handbook/clients/api/lib/log4j-1.2.7/log4j-1.2.7.jar deleted file mode 100644 index 1595a56ef..000000000 Binary files a/spss.handbook/clients/api/lib/log4j-1.2.7/log4j-1.2.7.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/postgres-jdbc2-7.3/pg73jdbc2.jar b/spss.handbook/clients/api/lib/postgres-jdbc2-7.3/pg73jdbc2.jar deleted file mode 100644 index 8bf46dd8e..000000000 Binary files a/spss.handbook/clients/api/lib/postgres-jdbc2-7.3/pg73jdbc2.jar and /dev/null differ diff --git a/spss.handbook/clients/api/lib/xalan-j-2.5.1/xalan.jar b/spss.handbook/clients/api/lib/xalan-j-2.5.1/xalan.jar deleted file mode 100644 index 44d4d094d..000000000 Binary files a/spss.handbook/clients/api/lib/xalan-j-2.5.1/xalan.jar and /dev/null differ diff --git a/spss.handbook/clients/api/signatures/SimpleSignature.xml b/spss.handbook/clients/api/signatures/SimpleSignature.xml deleted file mode 100644 index 9ecd215c1..000000000 --- a/spss.handbook/clients/api/signatures/SimpleSignature.xml +++ /dev/null @@ -1,23 +0,0 @@ - -tLODyeiWFbAkQKwhrR23jtcgu4k=VEjXB6+geUL16oTPDVx5lcQliGl/oyVobug3BVxVwhu8CU7WK65moTcTuo/CL2hQMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqDiese Daten werden signiert. \ No newline at end of file diff --git a/spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/CreateXMLSignature.java b/spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/CreateXMLSignature.java deleted file mode 100644 index 2534e4913..000000000 --- a/spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/CreateXMLSignature.java +++ /dev/null @@ -1,130 +0,0 @@ -package at.gv.egovernment.moa.spss.handbook.clients.api; - -import java.io.ByteArrayInputStream; -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.SignatureCreationService; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * Dieses einfache Beispiel demonstriert grundlegend den Gebrauch der API von MOA SP/SS. Es wird damit eine - * einfach aufgebaute XML-Signatur erzeugt. - */ -public class CreateXMLSignature -{ - /** - * Methode main. - * - * Enthält beispielhaften Code zum grundlegenden Gebrauch der API von MOA SP/SS. Es wird damit eine - * einfach aufgebaute XML-Signatur erzeugt. - * - * ACHTUNG: Stellen Sie bei Verwendung von J2SE 1.4.x bzw. 5.x sicher, dass Sie die System-Property - * java.endorsed.dirs auf jenes Verzeichnis gesetzt haben, in dem sich die XPath- - * und XSLT-Bibliothek Xalan-J befindet. - * - * @param args
    - *
  • - * args[0] enthält einen Verweis auf die Konfigurations-Datei von MOA SP/SS Der Verweis - * enthält entweder eine absolute oder eine relative Pfadangabe, wobei eine relative - * Angabe als relativ zum Arbeitsverzeichnis der Java VM interpretiert wird. - *
  • - *
  • - * args[1] enthält einen Verweis auf die Konfigurations-Datei von Log4J, dem Logging- - * Framework, das von MOA SP/SS verwendet wird. Der Verweis enthält entweder eine - * absolute oder eine relative Pfadangabe, wobei eine relative Angabe als relativ zum - * Arbeitsverzeichnis der Java VM interpretiert wird. - *
  • - *
- * - * @throws Exception Sollten Fehler auftreten werden die Fehler an die Java-VM weitergeleitet. - */ - public static void main(String[] args) throws Exception - { - // Setzen der System-Properties - init(args); - - // Serverfunktionshandler instanzieren - SPSSFactory spf = SPSSFactory.getInstance(); - - // Zu signierende Daten in ein Contentobjekt einbinden (die Daten werden hier explizit angegeben, - // sollen aber in der Signatur mittels URL "http://uri.data.org" referenziert werden - byte[] data = "Diese Daten werden signiert.".getBytes("UTF-8"); - ByteArrayInputStream bis = new ByteArrayInputStream(data); - Content cont = spf.createContent(bis, null); - - // Metainformationen zu den zu signierenden Daten erstellen - MetaInfo mi = spf.createMetaInfo("text/plain", null, null, null); - - // Transformationen erstellen (hier werden keine Transformationen angewandt) - CreateTransformsInfo cti = spf.createCreateTransformsInfo(null, mi); - CreateTransformsInfoProfile ct = spf.createCreateTransformsInfoProfile(cti, null); - - // Datenobjekt aufbauen - DataObjectInfo doi = spf.createDataObjectInfo(DataObjectInfo.STRUCTURE_ENVELOPING, false, cont, ct); - - // Erstellen eines SingleSignatureInfo-Containers - // Enthält alle Angaben zur Erstellung *einer* Signatur - List dataobjectinfolist = new ArrayList(); - dataobjectinfolist.add(doi); - SingleSignatureInfo ssi = spf.createSingleSignatureInfo(dataobjectinfolist, null, false); - - // Erstellen des Request-Objekts (Schlüsselbezeichner, Liste von SingleSignatureInfo-Containern) - List singlesignatureinfolist = new ArrayList(); - singlesignatureinfolist.add(ssi); - CreateXMLSignatureRequest cxsreq = spf.createCreateXMLSignatureRequest("KG_allgemein", - singlesignatureinfolist); - - // Signatureerstellungsservice instanzieren und aufrufen - SignatureCreationService scs = SignatureCreationService.getInstance(); - CreateXMLSignatureResponse cxsres = scs.createXMLSignature(cxsreq); - - // Response auswerten - List elements = cxsres.getResponseElements(); - SignatureEnvironmentResponse ser = (SignatureEnvironmentResponse) elements.get(0); - - // Auswertung des ersten (und einzigen) SignatureEnvironmentResponse-Containers - int response_type = ser.getResponseType(); - - if (response_type == SignatureEnvironmentResponse.ERROR_RESPONSE) - { - // Fehlerfall - System.out.println("Bei der Erstellung der Signatur ist ein Fehler aufgetreten."); - } - else - { - // Signaturerstellung erfolgreich - System.out.println("Signaturerstellung erfolgreich:"); - - Element se = ser.getSignatureEnvironment(); - System.out.println(DOMUtils.serializeNode(se)); - } - } - - /** - * Setzt die notwendigen System-Properties für die Konfiguration der MOA SP/SS API. - * - * @param args Siehe @link CreateXMLSignature#main(String[]). - */ - private static void init(String[] args) - { - if (args == null || args.length != 2) - { - System.out.println("Verwendung: CreateXMLSignature "); - } - System.setProperty("moa.spss.server.configuration", args[0]); - System.setProperty("log4j.configuration", "file:" + args[1]); - } -} \ No newline at end of file diff --git a/spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/VerifyXMLSignature.java b/spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/VerifyXMLSignature.java deleted file mode 100644 index fed8ba9f2..000000000 --- a/spss.handbook/clients/api/src/at/gv/egovernment/moa/spss/handbook/clients/api/VerifyXMLSignature.java +++ /dev/null @@ -1,147 +0,0 @@ -package at.gv.egovernment.moa.spss.handbook.clients.api; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.util.HashMap; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.SignatureVerificationService; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * Dieses einfache Beispiel demonstriert grundlegend den Gebrauch der API von MOA SP/SS. - * Es wird damit eine einfach aufgebaute XML-Signatur geprüft. - */ - -public class VerifyXMLSignature -{ - /** - * Methode main. - * - * Enthält beispielhaften Code zum grundlegenden Gebrauch der API von MOA SP/SS. - * Es wird damit eine einfach aufgebaute XML-Signatur geprüft. - * - * ACHTUNG: Stellen Sie bei Verwendung von J2SE 1.4.x bzw. 5.x sicher, dass Sie die System-Property - * java.endorsed.dirs auf jenes Verzeichnis gesetzt haben, in dem sich die XPath- - * und XSLT-Bibliothek Xalan-J befindet. - * - * @param args
    - *
  • - * args[0] enthält einen Verweis auf die Konfigurations-Datei von MOA SP/SS Der Verweis - * enthält entweder eine absolute oder eine relative Pfadangabe, wobei eine relative - * Angabe als relativ zum Arbeitsverzeichnis der Java VM interpretiert wird. - *
  • - *
  • - * args[1] enthält einen Verweis auf die Konfigurations-Datei von Log4J, dem Logging- - * Framework, das von MOA SP/SS verwendet wird. Der Verweis enthält entweder eine - * absolute oder eine relative Pfadangabe, wobei eine relative Angabe als relativ zum - * Arbeitsverzeichnis der Java VM interpretiert wird. - *
  • - *
  • - * args[2] enthält Pfad und Dateiname des XML-Dokuments mit der darin enthaltenen, zu - * prüfenden XML-Signatur. Verwenden Sie z.B. das mit diesem Handbuch mitgelieferte - * Beispiel clients/api/signatures/SimpleSignature.xml. - *
  • - *
- */ - public static void main(String[] args) - { - // Setzen der System-Properties - init(args); - - // Factory und Service instanzieren - SPSSFactory spssFac = SPSSFactory.getInstance(); - SignatureVerificationService sigVerifyService = SignatureVerificationService.getInstance(); - - // Content aus Dokument mit zu prüfender Signatur erstellen - FileInputStream sigDocFIS = null; - try - { - sigDocFIS = new FileInputStream(args[2]); - } - catch (FileNotFoundException e1) - { - System.err.println("XML-Dokument mit zu prüfender Signatur nicht gefunden: " + args[2]); - System.exit(-1); - } - Content sigDocContent = spssFac.createContent(sigDocFIS, null); - - // Position der zu prüfenden Signatur im Dokument angeben - // (Nachdem im XPath-Ausdruck ein NS-Präfix verwendet wird, muss in einer Lookup-Tabelle - // der damit bezeichnete Namenraum mitgegeben werden) - HashMap nSMap = new HashMap(); - nSMap.put("dsig", "http://www.w3.org/2000/09/xmldsig#"); - VerifySignatureLocation sigLocation = spssFac.createVerifySignatureLocation("//dsig:Signature", nSMap); - - // Zu prüfendes Dokument und Signaturposition zusammenfassen - VerifySignatureInfo sigInfo = spssFac.createVerifySignatureInfo(sigDocContent, sigLocation); - - // Prüfrequest zusammenstellen - VerifyXMLSignatureRequest verifyRequest = spssFac.createVerifyXMLSignatureRequest( - null, // Wird Prüfzeit nicht angegeben, wird aktuelle Zeit verwendet - sigInfo, - null, // Keine Ergänzungsobjekte notwendig - null, // Signaturmanifest-Prüfung soll nicht durchgeführt werden - false, // Hash-Inputdaten, d.h. tatsächlich signierte Daten werden nicht zurückgeliefert - "Test-Signaturdienste"); // ID des verwendeten Vertrauensprofils - - VerifyXMLSignatureResponse verifyResponse = null; - try - { - // Aufruf der Signaturprüfung - verifyResponse = sigVerifyService.verifyXMLSignature(verifyRequest); - } - catch (MOAException e) - { - // Service liefert Fehler - System.err.println("Die Signaturprüfung hat folgenden Fehler geliefert:"); - System.err.println("Fehlercode: " + e.getMessageId()); - System.err.println("Fehlernachricht: " + e.getMessage()); - System.exit(-1); - } - - // Auswertung der Response - System.out.println(); - System.out.println("Ergebnisse der Signaturprüfung:"); - System.out.println(); - - // Besondere Eigenschaften des Signatorzertifikats - SignerInfo signerInfo = verifyResponse.getSignerInfo(); - System.out.println("*** Ist Zertifikat des Signators qualifiziert? " + ((signerInfo.isQualifiedCertificate()) ? "ja" : "nein")); - System.out.println("*** Ist Zertifikat des Signators von einer Behörde? " + ((signerInfo.isPublicAuthority()) ? "ja" : "nein")); - - // Ergebnisse von Signatur- und Zertifikatsprüfung - System.out.println(); - System.out.println("Ergebniscode der Signaturprüfung: " + verifyResponse.getSignatureCheck().getCode()); - System.out.println("Ergebniscode der Zertifikatsprüfung: " + verifyResponse.getCertificateCheck().getCode()); - - // Signatorzertifikat - System.out.println(); - System.out.println("*** Zertifikat des Signators:"); - System.out.println("Aussteller: " + signerInfo.getSignerCertificate().getIssuerDN()); - System.out.println("Subject: " + signerInfo.getSignerCertificate().getSubjectDN()); - System.out.println("Seriennummer: " + signerInfo.getSignerCertificate().getSerialNumber()); - } - - /** - * Setzt die notwendigen System-Properties für die Konfiguration der MOA SP/SS API. - * - * @param args Siehe @link VerifyXMLSignature#main(String[]). - */ - private static void init(String[] args) - { - if (args == null || args.length != 3) - { - System.out.println("Verwendung: VerifyXMLSignature "); - System.exit(-1); - } - System.setProperty("moa.spss.server.configuration", args[0]); - System.setProperty("log4j.configuration", "file:" + args[1]); - } -} \ No newline at end of file diff --git a/spss.handbook/clients/common/referencedData/Text.b64 b/spss.handbook/clients/common/referencedData/Text.b64 deleted file mode 100644 index 0f4636b9a..000000000 --- a/spss.handbook/clients/common/referencedData/Text.b64 +++ /dev/null @@ -1 +0,0 @@ -RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu \ No newline at end of file diff --git a/spss.handbook/clients/common/referencedData/Text.txt b/spss.handbook/clients/common/referencedData/Text.txt deleted file mode 100644 index 3a75c06b3..000000000 --- a/spss.handbook/clients/common/referencedData/Text.txt +++ /dev/null @@ -1 +0,0 @@ -Diese Daten sind reiner Text. \ No newline at end of file diff --git a/spss.handbook/clients/common/referencedData/WEB-INF/web.xml b/spss.handbook/clients/common/referencedData/WEB-INF/web.xml deleted file mode 100644 index 002520ba5..000000000 --- a/spss.handbook/clients/common/referencedData/WEB-INF/web.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - MOA Webservice Client: Referenzierte Web-Daten - MOA Webservice Client: Referenzierte Web-Daten - diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.Para.xsl b/spss.handbook/clients/common/referencedData/XMLDocument.Para.xsl deleted file mode 100644 index 11d6dd6f9..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.Para.xsl +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - HTML-Dokument - - - - - - - -

- -

-
-
diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.signed.xml b/spss.handbook/clients/common/referencedData/XMLDocument.signed.xml deleted file mode 100644 index 897b3c896..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.signed.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen.2b83+NbXDFijHzz+sH0T7fM36sA=30zsZMPn1mR5G5oIGJvTRmCik3WuepfZF6AhLwxgJDMJlPQ8rheBWCaKihzXnHaSMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirq - \ No newline at end of file diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.withResolvableSchemaHint.xml b/spss.handbook/clients/common/referencedData/XMLDocument.withResolvableSchemaHint.xml deleted file mode 100644 index 4f1124637..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.withResolvableSchemaHint.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.withSchemaHint.xml b/spss.handbook/clients/common/referencedData/XMLDocument.withSchemaHint.xml deleted file mode 100644 index 82f65d99e..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.withSchemaHint.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.xml b/spss.handbook/clients/common/referencedData/XMLDocument.xml deleted file mode 100644 index 1c48dce36..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.xsd b/spss.handbook/clients/common/referencedData/XMLDocument.xsd deleted file mode 100644 index a2930f1da..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.xsd +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/spss.handbook/clients/common/referencedData/XMLDocument.xsl b/spss.handbook/clients/common/referencedData/XMLDocument.xsl deleted file mode 100644 index 85755c2e6..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocument.xsl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - HTML-Dokument - - - -

- -

-
- - -
-
diff --git a/spss.handbook/clients/common/referencedData/XMLDocumentRef.xsl b/spss.handbook/clients/common/referencedData/XMLDocumentRef.xsl deleted file mode 100644 index c385f9d1f..000000000 --- a/spss.handbook/clients/common/referencedData/XMLDocumentRef.xsl +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/spss.handbook/clients/common/referencedData/referencedData.war b/spss.handbook/clients/common/referencedData/referencedData.war deleted file mode 100644 index 6a05d6c7a..000000000 Binary files a/spss.handbook/clients/common/referencedData/referencedData.war and /dev/null differ diff --git a/spss.handbook/clients/webservice/conf/http.properties b/spss.handbook/clients/webservice/conf/http.properties deleted file mode 100644 index 1506169ed..000000000 --- a/spss.handbook/clients/webservice/conf/http.properties +++ /dev/null @@ -1,74 +0,0 @@ -### -# Properties für den HTTP(S) Client -### - -# -# Signieren -# - -# Name des Webservices, fix "SignatureCreation" -signServiceQName = SignatureCreation - -# Zugangspunkt des Webservices -signServiceEndPoint = http://localhost:8080/moa-spss/services/SignatureCreation -#signServiceEndPoint = https://localhost:8443/moa-spss/services/SignatureCreation - -# Name des zu sendenden Signaturerstellungsrequests (entweder absolute -# oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum -# Arbeitsverzeichnis der Java VM interpretiert) -signRequest = clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.xml -#signRequest=clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.xml -#signRequest=clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.xml -#signRequest=clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.xml - - -# -# Verifizieren -# - -# Name des Webservices, fix "SignatureVerification" -verifyServiceQName = SignatureVerification - -# Zugangspunkt des Webservices -verifyServiceEndPoint = http://localhost:8080/moa-spss/services/SignatureVerification -#verifyServiceEndPoint = https://localhost:8443/moa-spss/services/SignatureVerification - -# Name des zu sendenden Signaturprüfrequests (entweder absolute -# oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum -# Arbeitsverzeichnis der Java VM interpretiert) -verifyRequest=clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.xml -#verifyRequest=clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.xml -#verifyRequest=clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.xml -#verifyRequest=clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.xml -#verifyRequest=clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.xml -#verifyRequest=clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.xml -#verifyRequest=clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.xml - -# -# JSSE-Konfiguration -# - -# Typ des JSSE-Truststores (entweder "JKS" für einen Java Key Store oder -# "PKCS12" für eine PKCS#12-Datei). -ssl.truststore.type = JKS - -# Relativer oder absoluter Pfad zum JSSE-Truststore. Ein relativer Pfad -# wird relativ zum Arbeitsverzeichnis der Java VM interpretiert). -ssl.truststore.loc = clients/webservice/resources/sslKeys/customer1/trustedServers[pwd=servers].keystore -#ssl.truststore.loc = clients/webservice/resources/sslKeys/customer2/trustedServers[pwd=servers].keystore - -# Passwort für den JSSE-Truststore. -ssl.truststore.pwd = servers - -# Typ des JSSE-Keystores (entweder "JKS" für einen Java Key Store oder -# "PKCS12" für eine PKCS#12-Datei). -ssl.keystore.type = PKCS12 - -# Relativer oder absoluter Pfad zum JSSE-Keystore. Ein relativer Pfad -# wird relativ zum Arbeitsverzeichnis der Java VM interpretiert). -ssl.keystore.loc = clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1[pwd=kunde1].p12 -#ssl.keystore.loc = clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2[pwd=kunde2].p12 - -# Passwort für den JSSE-Keystore. -ssl.keystore.pwd = kunde1 -#ssl.keystore.pwd = kunde2 diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/axis-ant.jar b/spss.handbook/clients/webservice/lib/axis-1_1/axis-ant.jar deleted file mode 100644 index 9cb30a98a..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/axis-ant.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/axis.jar b/spss.handbook/clients/webservice/lib/axis-1_1/axis.jar deleted file mode 100644 index 869ee16f5..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/axis.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/commons-discovery.jar b/spss.handbook/clients/webservice/lib/axis-1_1/commons-discovery.jar deleted file mode 100644 index b88554847..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/commons-discovery.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/commons-logging-api.jar b/spss.handbook/clients/webservice/lib/axis-1_1/commons-logging-api.jar deleted file mode 100644 index ade9a13c7..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/commons-logging-api.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/commons-logging.jar b/spss.handbook/clients/webservice/lib/axis-1_1/commons-logging.jar deleted file mode 100644 index b73a80fab..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/commons-logging.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/jaxrpc.jar b/spss.handbook/clients/webservice/lib/axis-1_1/jaxrpc.jar deleted file mode 100644 index 5f6a56f02..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/jaxrpc.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/log4j-1.2.8.jar b/spss.handbook/clients/webservice/lib/axis-1_1/log4j-1.2.8.jar deleted file mode 100644 index 493a3ccc1..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/log4j-1.2.8.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/saaj.jar b/spss.handbook/clients/webservice/lib/axis-1_1/saaj.jar deleted file mode 100644 index f2242abe5..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/saaj.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/axis-1_1/wsdl4j.jar b/spss.handbook/clients/webservice/lib/axis-1_1/wsdl4j.jar deleted file mode 100644 index 820abd082..000000000 Binary files a/spss.handbook/clients/webservice/lib/axis-1_1/wsdl4j.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jcert.jar b/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jcert.jar deleted file mode 100644 index d33134214..000000000 Binary files a/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jcert.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jnet.jar b/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jnet.jar deleted file mode 100644 index e1d340093..000000000 Binary files a/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jnet.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jsse.jar b/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jsse.jar deleted file mode 100644 index 123188c5e..000000000 Binary files a/spss.handbook/clients/webservice/lib/jsse-1_0_3/jsse-1_0_3.jsse.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xercesImpl.jar b/spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xercesImpl.jar deleted file mode 100644 index bff9af0c4..000000000 Binary files a/spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xercesImpl.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xmlParserAPIs.jar b/spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xmlParserAPIs.jar deleted file mode 100644 index 6ba4ff805..000000000 Binary files a/spss.handbook/clients/webservice/lib/xerces-j-2.4.0/xmlParserAPIs.jar and /dev/null differ diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.resp.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.resp.xml deleted file mode 100644 index bad31d170..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.resp.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen.A8ml6/aZKCmj1hONwvLItIwGHoc=0P878Dsmtxv5goj+6KgNmj6S/EE=0P878Dsmtxv5goj+6KgNmj6S/EE=2b83+NbXDFijHzz+sH0T7fM36sA=0P878Dsmtxv5goj+6KgNmj6S/EE=0P878Dsmtxv5goj+6KgNmj6S/EE=2b83+NbXDFijHzz+sH0T7fM36sA=mNsxUkFoF46XZVBivBo4aasFCTQ=kaAiAZgnUMYb3/IV5mmJinrH3et5M+o4OWMhgA3C9SZSPsE+ptWUAPU1VKl1G2AFMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirq - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. -RGllc2UgRGF0ZW4gc2luZCByZWluZXIgVGV4dC4=RGllc2UgRGF0ZW4gc2luZCByZWluZXIgVGV4dC4=RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQua53jOsL7KbyltpByAK87FoMZphI=a53jOsL7KbyltpByAK87FoMZphI= - \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.xml deleted file mode 100644 index f4dd2dbb6..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Refs.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - KG_allgemein - - - - - RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu - - - - - text/plain - - - - - - - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - - - - - - application/xml - - - - - - - - - - - text/plain - - - - - - - - http://localhost:8080/referencedData/Text.txt - - - - - text/plain - - - - - - - - RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu - - - - - text/plain - - - - - - - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - - - - - - application/xml - - - - - - - - - - - - text/plain - - - - - - - - http://localhost:8080/referencedData/Text.txt - - - - - text/plain - - - - - - - - - - - - - - application/xml - - - - - - - http://localhost:8080/referencedData/XMLDocument.xml - - - /doc:XMLDocument - - - - \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.resp.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.resp.xml deleted file mode 100644 index edcb03c09..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.resp.xml +++ /dev/null @@ -1,23 +0,0 @@ - -tLODyeiWFbAkQKwhrR23jtcgu4k=VEjXB6+geUL16oTPDVx5lcQliGl/oyVobug3BVxVwhu8CU7WK65moTcTuo/CL2hQMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqDiese Daten werden signiert. \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.xml deleted file mode 100644 index 3344b4709..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Simple.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - KG_allgemein - - - - Diese Daten werden signiert. - - - - - text/plain - - - - - - - diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.resp.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.resp.xml deleted file mode 100644 index def0daf25..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.resp.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - -luM3wUmedTvkMHVedQkA/8otXUE=vGVimRmUHwrDR8feQCK1DZ2kyDw0CCrXimJi/yCrIoqSkUKFlKrtAyP2RUBXXjyeMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirq - \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.xml deleted file mode 100644 index 9144e83f8..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Supplements.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - KG_allgemein - - - - - - - - - - - - - - - application/xhtml+xml - - - - - http://localhost:8080/referencedData/XMLDocument.Para.xsl - - - - - - - - /doc:XMLDocument - - - http://localhost:8080/referencedData/XMLDocument.xsd - - - - - - diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.resp.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.resp.xml deleted file mode 100644 index 1d5bd65ea..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.resp.xml +++ /dev/null @@ -1,39 +0,0 @@ - -a53jOsL7KbyltpByAK87FoMZphI=/doc:XMLDocument/doc:Paragraph[2] - - - - - HTML-Dokument - - - -

- -

-
- - -
-
fIPwneCpjVqTXwHMN9DFfx6tJIU=
kWm9iFL5UngH8uDG6094K99J/WB/PdlqzfI6WtGpJ3jiCTV7mn/mzYWMv09b3veeMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirq
\ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.xml b/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.xml deleted file mode 100644 index 6375365b2..000000000 --- a/spss.handbook/clients/webservice/resources/requests/CreateXMLSignatureRequest.Transforms.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - KG_allgemein - - - - - - - - - - text/plain - - - - - - - - - - - /doc:XMLDocument/doc:Paragraph[2] - - - - - - - HTML-Dokument - - - -

- -

-
- - -
-
- -
- - application/xhtml+xml - -
-
-
-
-
diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.resp.xml deleted file mode 100644 index daa22bdb3..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.resp.xml +++ /dev/null @@ -1,29 +0,0 @@ - -serialNumber=615536615920,givenName=Gregor,SN=Karlinger,CN=Gregor Karlinger,C=ATCN=TrustSignTest-Sig-01,OU=TrustSignTest-Sig-01,O=A-Trust Ges. für Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT2892MIIFLjCCBBagAwIBAgICC0wwDQYJKoZIhvcNAQEFBQAwgdkxCzAJBgNVBAYTAkFU -MYGLMIGIBgNVBAoegYAAQQAtAFQAcgB1AHMAdAAgAEcAZQBzAC4AIABmAPwAcgAg -AFMAaQBjAGgAZQByAGgAZQBpAHQAcwBzAHkAcwB0AGUAbQBlACAAaQBtACAAZQBs -AGUAawB0AHIALgAgAEQAYQB0AGUAbgB2AGUAcgBrAGUAaAByACAARwBtAGIASDEd -MBsGA1UECxMUVHJ1c3RTaWduVGVzdC1TaWctMDExHTAbBgNVBAMTFFRydXN0U2ln -blRlc3QtU2lnLTAxMB4XDTAzMDgyNzEyMDEyNFoXDTA2MDgyNzEyMDEyNFowZDEL -MAkGA1UEBhMCQVQxGTAXBgNVBAMTEEdyZWdvciBLYXJsaW5nZXIxEjAQBgNVBAQT -CUthcmxpbmdlcjEPMA0GA1UEKhMGR3JlZ29yMRUwEwYDVQQFEww2MTU1MzY2MTU5 -MjAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKDSK1XaYK0Ydbk6V58g7QzQ -Ysk0A6C2JyhiZy3078DJ1EkwzBMVejTNq1e9wp+BmeZ2YpiftNyRFfu/Gg8ksOUQ -2oCn9A9pZLUGvtajA3aL8f182GQODRqQmelvYSUL/u9vAChOlcT+UEqj5jW4xjd4 -XsCotX4Kz+ofkD+SAlf1AgMBAAGjggH2MIIB8jATBgNVHSMEDDAKgAhKfsjmnWR0 -6TA+BggrBgEFBQcBAwEB/wQvMC0wCAYGBACORgEBMBUGBgQAjkYBAjALEwNFVVIC -AQACAQAwCgYIKwYBBQUHCwEwgYIGCCsGAQUFBwEBBHYwdDAvBggrBgEFBQcwAYYj -aHR0cDovL29jc3AtdGVzdC5hLXRydXN0LmF0OjgyL29jc3AwQQYIKwYBBQUHMAKG -NWh0dHA6Ly93d3cuYS10cnVzdC5hdC9jZXJ0cy9UcnVzdFNpZ25UZXN0LVNpZy0w -MWMuY3J0MFEGA1UdIARKMEgwPAYGKigAEQEDMDIwMAYIKwYBBQUHAgEWJGh0dHA6 -Ly93d3cuYS10cnVzdC5hdC9kb2NzL1RydXN0VGVzdDAIBgYEAIswAQEwbgYDVR0f -BGcwZTBjoGGgX4ZdbGRhcDovL2xkYXAtdGVzdC5hLXRydXN0LmF0L291PVRydXN0 -U2lnblRlc3QtU2lnLTAxLG89QS1UcnVzdCxjPUFUP2NlcnRpZmljYXRlcmV2b2Nh -dGlvbmxpc3Q/MBEGA1UdDgQKBAhNa9QR1H4T3zAOBgNVHQ8BAf8EBAMCBsAwJQYD -VR0RBB4wHIEaZ3JlZ29yLmthcmxpbmdlckBjaW8uZ3YuYXQwCQYDVR0TBAIwADAN -BgkqhkiG9w0BAQUFAAOCAQEALi2DEl6whJsiQF+bsNVR8CQhXg6ZuzTGlPhyCBum -765Y5gMRLEfAx2D8Wv4XXPHasAxZ/NKZRwbfLWN7IxPeVHF+vCShlXmYGWVj75fE -EGStIKyULqZB7jOJdsFHNdvp8yQaexR9olO3neXjrFmcXFVhpZFJomBH6JEL0uRa -LsPlN97OTa1NKkdj92SX8IkcV2k9yQ3Nl2KgicZDlxdYtSDGh9P0KddJZZJTRAdm -ixWb4Y2cGkRDhXoHzvHcZQ7eqJYHPapm3NTZ428I7LCKma8859rMwRSNTN14yIVL -KkgBtxvmstGVa33Ki53LBkSSuBMH3Pa+4xbnYSkJA4phaA==01 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.xml b/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.xml deleted file mode 100644 index 16e961b96..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Extended.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 2004-08-17T08:00:00+02:00 - MIIHiwYJKoZIhvcNAQcCoIIHfDCCB3gCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCCBTIw -ggUuMIIEFqADAgECAgILTDANBgkqhkiG9w0BAQUFADCB2TELMAkGA1UEBhMCQVQxgYswgYgGA1UE -Ch6BgABBAC0AVAByAHUAcwB0ACAARwBlAHMALgAgAGYA/AByACAAUwBpAGMAaABlAHIAaABlAGkA -dABzAHMAeQBzAHQAZQBtAGUAIABpAG0AIABlAGwAZQBrAHQAcgAuACAARABhAHQAZQBuAHYAZQBy -AGsAZQBoAHIAIABHAG0AYgBIMR0wGwYDVQQLExRUcnVzdFNpZ25UZXN0LVNpZy0wMTEdMBsGA1UE -AxMUVHJ1c3RTaWduVGVzdC1TaWctMDEwHhcNMDMwODI3MTIwMTI0WhcNMDYwODI3MTIwMTI0WjBk -MQswCQYDVQQGEwJBVDEZMBcGA1UEAxMQR3JlZ29yIEthcmxpbmdlcjESMBAGA1UEBBMJS2FybGlu -Z2VyMQ8wDQYDVQQqEwZHcmVnb3IxFTATBgNVBAUTDDYxNTUzNjYxNTkyMDCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAoNIrVdpgrRh1uTpXnyDtDNBiyTQDoLYnKGJnLfTvwMnUSTDMExV6NM2r -V73Cn4GZ5nZimJ+03JEV+78aDySw5RDagKf0D2lktQa+1qMDdovx/XzYZA4NGpCZ6W9hJQv+728A -KE6VxP5QSqPmNbjGN3hewKi1fgrP6h+QP5ICV/UCAwEAAaOCAfYwggHyMBMGA1UdIwQMMAqACEp+ -yOadZHTpMD4GCCsGAQUFBwEDAQH/BC8wLTAIBgYEAI5GAQEwFQYGBACORgECMAsTA0VVUgIBAAIB -ADAKBggrBgEFBQcLATCBggYIKwYBBQUHAQEEdjB0MC8GCCsGAQUFBzABhiNodHRwOi8vb2NzcC10 -ZXN0LmEtdHJ1c3QuYXQ6ODIvb2NzcDBBBggrBgEFBQcwAoY1aHR0cDovL3d3dy5hLXRydXN0LmF0 -L2NlcnRzL1RydXN0U2lnblRlc3QtU2lnLTAxYy5jcnQwUQYDVR0gBEowSDA8BgYqKAARAQMwMjAw -BggrBgEFBQcCARYkaHR0cDovL3d3dy5hLXRydXN0LmF0L2RvY3MvVHJ1c3RUZXN0MAgGBgQAizAB -ATBuBgNVHR8EZzBlMGOgYaBfhl1sZGFwOi8vbGRhcC10ZXN0LmEtdHJ1c3QuYXQvb3U9VHJ1c3RT -aWduVGVzdC1TaWctMDEsbz1BLVRydXN0LGM9QVQ/Y2VydGlmaWNhdGVyZXZvY2F0aW9ubGlzdD8w -EQYDVR0OBAoECE1r1BHUfhPfMA4GA1UdDwEB/wQEAwIGwDAlBgNVHREEHjAcgRpncmVnb3Iua2Fy -bGluZ2VyQGNpby5ndi5hdDAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBBQUAA4IBAQAuLYMSXrCEmyJA -X5uw1VHwJCFeDpm7NMaU+HIIG6bvrljmAxEsR8DHYPxa/hdc8dqwDFn80plHBt8tY3sjE95UcX68 -JKGVeZgZZWPvl8QQZK0grJQupkHuM4l2wUc12+nzJBp7FH2iU7ed5eOsWZxcVWGlkUmiYEfokQvS -5Fouw+U33s5NrU0qR2P3ZJfwiRxXaT3JDc2XYqCJxkOXF1i1IMaH0/Qp10llklNEB2aLFZvhjZwa -REOFegfO8dxlDt6olgc9qmbc1NnjbwjssIqZrzzn2szBFI1M3XjIhUsqSAG3G+ay0ZVrfcqLncsG -RJK4Ewfc9r7jFudhKQkDimFoMYICITCCAh0CAQEwgeAwgdkxCzAJBgNVBAYTAkFUMYGLMIGIBgNV -BAoegYAAQQAtAFQAcgB1AHMAdAAgAEcAZQBzAC4AIABmAPwAcgAgAFMAaQBjAGgAZQByAGgAZQBp -AHQAcwBzAHkAcwB0AGUAbQBlACAAaQBtACAAZQBsAGUAawB0AHIALgAgAEQAYQB0AGUAbgB2AGUA -cgBrAGUAaAByACAARwBtAGIASDEdMBsGA1UECxMUVHJ1c3RTaWduVGVzdC1TaWctMDExHTAbBgNV -BAMTFFRydXN0U2lnblRlc3QtU2lnLTAxAgILTDAJBgUrDgMCGgUAoIGXMCMGCSqGSIb3DQEJBDEW -BBRrneM6wvspvKW2kHIArzsWgxmmEjAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMCkGCyqGSIb3 -DQEJEAIEMRowGAwLdGV4dC9wbGFpbhsGCSqGSIb3DQEHATArBgsqhkiG9w0BCRACEzEcMBowGDAW -BBQdhdZ+dQSz53K2vT9KOGCxp6+qIDANBgkqhkiG9w0BAQEFAASBgFTEY4mMXQx2fNk9zo64MRxI -mS38vuD7W7LjBoUQ/w6mPi60kiqA/Pnf5I7fvM2epuo4xHpft1diuTY0fa9VqSv+q13Lr1x+l3ON -oxX27oCPLcJq6sFipZj50Bx5BHhgTX+59cNIT3eTRLenBzrJ/ccNd5OLqgkfiwsvqSk48lou - - - RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu - - - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.resp.xml deleted file mode 100644 index daa22bdb3..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.resp.xml +++ /dev/null @@ -1,29 +0,0 @@ - -serialNumber=615536615920,givenName=Gregor,SN=Karlinger,CN=Gregor Karlinger,C=ATCN=TrustSignTest-Sig-01,OU=TrustSignTest-Sig-01,O=A-Trust Ges. für Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT2892MIIFLjCCBBagAwIBAgICC0wwDQYJKoZIhvcNAQEFBQAwgdkxCzAJBgNVBAYTAkFU -MYGLMIGIBgNVBAoegYAAQQAtAFQAcgB1AHMAdAAgAEcAZQBzAC4AIABmAPwAcgAg -AFMAaQBjAGgAZQByAGgAZQBpAHQAcwBzAHkAcwB0AGUAbQBlACAAaQBtACAAZQBs -AGUAawB0AHIALgAgAEQAYQB0AGUAbgB2AGUAcgBrAGUAaAByACAARwBtAGIASDEd -MBsGA1UECxMUVHJ1c3RTaWduVGVzdC1TaWctMDExHTAbBgNVBAMTFFRydXN0U2ln -blRlc3QtU2lnLTAxMB4XDTAzMDgyNzEyMDEyNFoXDTA2MDgyNzEyMDEyNFowZDEL -MAkGA1UEBhMCQVQxGTAXBgNVBAMTEEdyZWdvciBLYXJsaW5nZXIxEjAQBgNVBAQT -CUthcmxpbmdlcjEPMA0GA1UEKhMGR3JlZ29yMRUwEwYDVQQFEww2MTU1MzY2MTU5 -MjAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKDSK1XaYK0Ydbk6V58g7QzQ -Ysk0A6C2JyhiZy3078DJ1EkwzBMVejTNq1e9wp+BmeZ2YpiftNyRFfu/Gg8ksOUQ -2oCn9A9pZLUGvtajA3aL8f182GQODRqQmelvYSUL/u9vAChOlcT+UEqj5jW4xjd4 -XsCotX4Kz+ofkD+SAlf1AgMBAAGjggH2MIIB8jATBgNVHSMEDDAKgAhKfsjmnWR0 -6TA+BggrBgEFBQcBAwEB/wQvMC0wCAYGBACORgEBMBUGBgQAjkYBAjALEwNFVVIC -AQACAQAwCgYIKwYBBQUHCwEwgYIGCCsGAQUFBwEBBHYwdDAvBggrBgEFBQcwAYYj -aHR0cDovL29jc3AtdGVzdC5hLXRydXN0LmF0OjgyL29jc3AwQQYIKwYBBQUHMAKG -NWh0dHA6Ly93d3cuYS10cnVzdC5hdC9jZXJ0cy9UcnVzdFNpZ25UZXN0LVNpZy0w -MWMuY3J0MFEGA1UdIARKMEgwPAYGKigAEQEDMDIwMAYIKwYBBQUHAgEWJGh0dHA6 -Ly93d3cuYS10cnVzdC5hdC9kb2NzL1RydXN0VGVzdDAIBgYEAIswAQEwbgYDVR0f -BGcwZTBjoGGgX4ZdbGRhcDovL2xkYXAtdGVzdC5hLXRydXN0LmF0L291PVRydXN0 -U2lnblRlc3QtU2lnLTAxLG89QS1UcnVzdCxjPUFUP2NlcnRpZmljYXRlcmV2b2Nh -dGlvbmxpc3Q/MBEGA1UdDgQKBAhNa9QR1H4T3zAOBgNVHQ8BAf8EBAMCBsAwJQYD -VR0RBB4wHIEaZ3JlZ29yLmthcmxpbmdlckBjaW8uZ3YuYXQwCQYDVR0TBAIwADAN -BgkqhkiG9w0BAQUFAAOCAQEALi2DEl6whJsiQF+bsNVR8CQhXg6ZuzTGlPhyCBum -765Y5gMRLEfAx2D8Wv4XXPHasAxZ/NKZRwbfLWN7IxPeVHF+vCShlXmYGWVj75fE -EGStIKyULqZB7jOJdsFHNdvp8yQaexR9olO3neXjrFmcXFVhpZFJomBH6JEL0uRa -LsPlN97OTa1NKkdj92SX8IkcV2k9yQ3Nl2KgicZDlxdYtSDGh9P0KddJZZJTRAdm -ixWb4Y2cGkRDhXoHzvHcZQ7eqJYHPapm3NTZ428I7LCKma8859rMwRSNTN14yIVL -KkgBtxvmstGVa33Ki53LBkSSuBMH3Pa+4xbnYSkJA4phaA==01 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.xml b/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.xml deleted file mode 100644 index d41b0e278..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyCMSSignatureRequest.Simple.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - MIIHsAYJKoZIhvcNAQcCoIIHoTCCB50CAQExCzAJBgUrDgMCGgUAMDAGCSqGSIb3DQEHAaAjBCFE -aWVzZSBEYXRlbiB3YXJlbiBiYXNlNjQga29kaWVydC6gggUyMIIFLjCCBBagAwIBAgICC0wwDQYJ -KoZIhvcNAQEFBQAwgdkxCzAJBgNVBAYTAkFUMYGLMIGIBgNVBAoegYAAQQAtAFQAcgB1AHMAdAAg -AEcAZQBzAC4AIABmAPwAcgAgAFMAaQBjAGgAZQByAGgAZQBpAHQAcwBzAHkAcwB0AGUAbQBlACAA -aQBtACAAZQBsAGUAawB0AHIALgAgAEQAYQB0AGUAbgB2AGUAcgBrAGUAaAByACAARwBtAGIASDEd -MBsGA1UECxMUVHJ1c3RTaWduVGVzdC1TaWctMDExHTAbBgNVBAMTFFRydXN0U2lnblRlc3QtU2ln -LTAxMB4XDTAzMDgyNzEyMDEyNFoXDTA2MDgyNzEyMDEyNFowZDELMAkGA1UEBhMCQVQxGTAXBgNV -BAMTEEdyZWdvciBLYXJsaW5nZXIxEjAQBgNVBAQTCUthcmxpbmdlcjEPMA0GA1UEKhMGR3JlZ29y -MRUwEwYDVQQFEww2MTU1MzY2MTU5MjAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKDSK1Xa -YK0Ydbk6V58g7QzQYsk0A6C2JyhiZy3078DJ1EkwzBMVejTNq1e9wp+BmeZ2YpiftNyRFfu/Gg8k -sOUQ2oCn9A9pZLUGvtajA3aL8f182GQODRqQmelvYSUL/u9vAChOlcT+UEqj5jW4xjd4XsCotX4K -z+ofkD+SAlf1AgMBAAGjggH2MIIB8jATBgNVHSMEDDAKgAhKfsjmnWR06TA+BggrBgEFBQcBAwEB -/wQvMC0wCAYGBACORgEBMBUGBgQAjkYBAjALEwNFVVICAQACAQAwCgYIKwYBBQUHCwEwgYIGCCsG -AQUFBwEBBHYwdDAvBggrBgEFBQcwAYYjaHR0cDovL29jc3AtdGVzdC5hLXRydXN0LmF0OjgyL29j -c3AwQQYIKwYBBQUHMAKGNWh0dHA6Ly93d3cuYS10cnVzdC5hdC9jZXJ0cy9UcnVzdFNpZ25UZXN0 -LVNpZy0wMWMuY3J0MFEGA1UdIARKMEgwPAYGKigAEQEDMDIwMAYIKwYBBQUHAgEWJGh0dHA6Ly93 -d3cuYS10cnVzdC5hdC9kb2NzL1RydXN0VGVzdDAIBgYEAIswAQEwbgYDVR0fBGcwZTBjoGGgX4Zd -bGRhcDovL2xkYXAtdGVzdC5hLXRydXN0LmF0L291PVRydXN0U2lnblRlc3QtU2lnLTAxLG89QS1U -cnVzdCxjPUFUP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3Q/MBEGA1UdDgQKBAhNa9QR1H4T3zAO -BgNVHQ8BAf8EBAMCBsAwJQYDVR0RBB4wHIEaZ3JlZ29yLmthcmxpbmdlckBjaW8uZ3YuYXQwCQYD -VR0TBAIwADANBgkqhkiG9w0BAQUFAAOCAQEALi2DEl6whJsiQF+bsNVR8CQhXg6ZuzTGlPhyCBum -765Y5gMRLEfAx2D8Wv4XXPHasAxZ/NKZRwbfLWN7IxPeVHF+vCShlXmYGWVj75fEEGStIKyULqZB -7jOJdsFHNdvp8yQaexR9olO3neXjrFmcXFVhpZFJomBH6JEL0uRaLsPlN97OTa1NKkdj92SX8Ikc -V2k9yQ3Nl2KgicZDlxdYtSDGh9P0KddJZZJTRAdmixWb4Y2cGkRDhXoHzvHcZQ7eqJYHPapm3NTZ -428I7LCKma8859rMwRSNTN14yIVLKkgBtxvmstGVa33Ki53LBkSSuBMH3Pa+4xbnYSkJA4phaDGC -AiEwggIdAgEBMIHgMIHZMQswCQYDVQQGEwJBVDGBizCBiAYDVQQKHoGAAEEALQBUAHIAdQBzAHQA -IABHAGUAcwAuACAAZgD8AHIAIABTAGkAYwBoAGUAcgBoAGUAaQB0AHMAcwB5AHMAdABlAG0AZQAg -AGkAbQAgAGUAbABlAGsAdAByAC4AIABEAGEAdABlAG4AdgBlAHIAawBlAGgAcgAgAEcAbQBiAEgx -HTAbBgNVBAsTFFRydXN0U2lnblRlc3QtU2lnLTAxMR0wGwYDVQQDExRUcnVzdFNpZ25UZXN0LVNp -Zy0wMQICC0wwCQYFKw4DAhoFAKCBlzAjBgkqhkiG9w0BCQQxFgQUa53jOsL7KbyltpByAK87FoMZ -phIwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATApBgsqhkiG9w0BCRACBDEaMBgMC3RleHQvcGxh -aW4bBgkqhkiG9w0BBwEwKwYLKoZIhvcNAQkQAhMxHDAaMBgwFgQUHYXWfnUEs+dytr0/Sjhgsaev -qiAwDQYJKoZIhvcNAQEBBQAEgYBUxGOJjF0MdnzZPc6OuDEcSJkt/L7g+1uy4waFEP8Opj4utJIq -gPz53+SO37zNnqbqOMR6X7dXYrk2NH2vVakr/qtdy69cfpdzjaMV9u6Ajy3CaurBYqWY+dAceQR4 -YE1/ufXDSE93k0S3pwc6yf3HDXeTi6oJH4sLL6kpOPJaLg== - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.resp.xml deleted file mode 100644 index f4db026fe..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.resp.xml +++ /dev/null @@ -1,28 +0,0 @@ - -CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=ATCN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqBKA-IKTPGRvYzpYTUxEb2N1bWVudCB4bWxuczpkb2M9InVybjpkb2N1bWVudCI+CiAgPGRv -YzpQYXJhZ3JhcGg+SWNoIGJpbiBkZXIgZXJzdGUgQWJzYXR6IGluIGRpZXNlbSBE -b2t1bWVudC48L2RvYzpQYXJhZ3JhcGg+CiAgPGRvYzpQYXJhZ3JhcGggUGFyYUlk -PSJQYXJhMiI+VW5kIGljaCBiaW4gZGVyIHp3ZWl0ZSBBYnNhdHogaW4gZGllc2Vt -IERva3VtZW50LgpJY2ggaGFiZSB3ZWl0ZXJzIGVpbiBlaWdlbmVucyBJRC1BdHRy -aWJ1dCBiZWtvbW1lbi48L2RvYzpQYXJhZ3JhcGg+CjwvZG9jOlhNTERvY3VtZW50Pg==00 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.xml deleted file mode 100644 index d97e76f78..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Enveloped.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - 2004-08-18T17:00:00+02:00 - - - /doc:XMLDocument/dsig:Signature - - - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.resp.xml deleted file mode 100644 index 3798b2706..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.resp.xml +++ /dev/null @@ -1,24 +0,0 @@ - -CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=ATCN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqBKA-IKTUnd ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen.B9nRChTbct68n9h5+Cb2mfNkASI=2004-08-20T12:42:21FOWcAqaHew69LEIDiGuiWVnB0mc=CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9application/xhtml+xml000 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.xml deleted file mode 100644 index 657beca77..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.SigManifest.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - -luM3wUmedTvkMHVedQkA/8otXUE=1aSV+vFkwG6NZCk5ZUzZV3J4eSo=Dy1xXsV2LgSFJlGwYiunav1KC7A=f1v/vi1S7xiL+7ofWOUqBfoqOy42EnlXYFoTYcaUZaBiAecDvyX9StPRWTUls/j2MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqB9nRChTbct68n9h5+Cb2mfNkASI=2005-03-29T09:55:29FOWcAqaHew69LEIDiGuiWVnB0mc=CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9application/xhtml+xml - - - /doc:XMLDocument/dsig:Signature - - - - - - - - - - - - - - - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.resp.xml deleted file mode 100644 index 2fab33b20..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.resp.xml +++ /dev/null @@ -1,23 +0,0 @@ - -CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=ATCN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqBKA-IKT00 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.xml deleted file mode 100644 index 5565601d8..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Simple.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - tLODyeiWFbAkQKwhrR23jtcgu4k=VEjXB6+geUL16oTPDVx5lcQliGl/oyVobug3BVxVwhu8CU7WK65moTcTuo/CL2hQMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqDiese Daten werden signiert. - /dsig:Signature - - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.resp.xml deleted file mode 100644 index 2fab33b20..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.resp.xml +++ /dev/null @@ -1,23 +0,0 @@ - -CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=ATCN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqBKA-IKT00 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.response.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.response.xml deleted file mode 100644 index 2fab33b20..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.response.xml +++ /dev/null @@ -1,23 +0,0 @@ - -CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=ATCN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqBKA-IKT00 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.xml deleted file mode 100644 index 50ddbc1da..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.Supplements.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - -luM3wUmedTvkMHVedQkA/8otXUE=vGVimRmUHwrDR8feQCK1DZ2kyDw0CCrXimJi/yCrIoqSkUKFlKrtAyP2RUBXXjyeMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirq - - - /doc:XMLDocument/dsig:Signature - - - - http://localhost:8080/referencedData/XMLDocument.Para.xsl - - - - - - - - - - - - - - - - - - - - - - - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.resp.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.resp.xml deleted file mode 100644 index 9d3b6dea7..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.resp.xml +++ /dev/null @@ -1,23 +0,0 @@ - -CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=ATCN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqBKA-IKT0010 \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.xml b/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.xml deleted file mode 100644 index a57fbb934..000000000 --- a/spss.handbook/clients/webservice/resources/requests/VerifyXMLSignatureRequest.XMLDSigManifest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - nUUaW6OtcsNvV/QhqmkU2QXT1Mw=pzI1j60BNsnS+zjXYtXlh109HjJGEMrMzTzkUB54rReOpI1ynNkG2RE7AiOlvpPhMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqDiese Daten sind signiert.EYxznGxNRAIcHQeUsj+zsK+uaHA= - - //dsig:Signature - - Test-Signaturdienste - diff --git a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.response.xml b/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.response.xml deleted file mode 100644 index be2eb37ad..000000000 --- a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.response.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen.2b83+NbXDFijHzz+sH0T7fM36sA=30zsZMPn1mR5G5oIGJvTRmCik3WuepfZF6AhLwxgJDMJlPQ8rheBWCaKihzXnHaSMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirq - \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.xml b/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.xml deleted file mode 100644 index 7f89028c6..000000000 --- a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.Enveloped.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - KG_allgemein - - - - - - - - - - text/xml - - - - - - - - /doc:XMLDocument - - - - diff --git a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.response.xml b/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.response.xml deleted file mode 100644 index fb4204a09..000000000 --- a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.response.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - Ich bin der erste Absatz in diesem Dokument. - Und ich bin der zweite Absatz in diesem Dokument. -Ich habe weiters ein eigenens ID-Attribut bekommen. - -luM3wUmedTvkMHVedQkA/8otXUE=1aSV+vFkwG6NZCk5ZUzZV3J4eSo=Dy1xXsV2LgSFJlGwYiunav1KC7A=f1v/vi1S7xiL+7ofWOUqBfoqOy42EnlXYFoTYcaUZaBiAecDvyX9StPRWTUls/j2MIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqB9nRChTbct68n9h5+Cb2mfNkASI=2005-03-29T09:55:29FOWcAqaHew69LEIDiGuiWVnB0mc=CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT9application/xhtml+xml - \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.xml b/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.xml deleted file mode 100644 index b19f66b61..000000000 --- a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.SigManifest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - KG_allgemein - - - - - - - - - - - - - - - application/xhtml+xml - - - - - - - - /doc:XMLDocument - - - - diff --git a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.response.xml b/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.response.xml deleted file mode 100644 index a465e2126..000000000 --- a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.response.xml +++ /dev/null @@ -1,23 +0,0 @@ - -nUUaW6OtcsNvV/QhqmkU2QXT1Mw=pzI1j60BNsnS+zjXYtXlh109HjJGEMrMzTzkUB54rReOpI1ynNkG2RE7AiOlvpPhMIID+DCCA2WgAwIBAgIBCTAJBgUrDgMCHQUAMH8xCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMSIwIAYDVQQDExlUZXN0IENBIC0gU2ln -bmF0dXJkaWVuc3RlMB4XDTA0MDgwNDA4MjM0OFoXDTA3MDgwNDA4MjM0OFowgZgx -CzAJBgNVBAYTAkFUMS0wKwYDVQQKEyRTdGFic3N0ZWxsZSBJS1QtU3RyYXRlZ2ll -IGRlcyBCdW5kZXMxHjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczE6MDgG -A1UEAxMxVGVzdDogU2lnbmF0dXJkaWVuc3QgYWxsZXIgS3VuZGVuOiBFQ0RTQSAo -UDE5MnYxKTCB8zCBvAYHKoZIzj0CATCBsAIBATAkBgcqhkjOPQEBAhkA//////// -/////////////v//////////MDQEGP////////////////////7//////////AQY -ZCEFGeWcgOcPp+mrciQwSf643uzBRrmxBDEEGI2oDrAwkPZ8vyDrQ6GIAPT/Cv2C -/xASBxkrlf/I2nhjEBHtayTN1XP5d6EeeUgRAhkA////////////////md74NhRr -ybG00igxAgEBAzIABNHWY9lQOE1zgmpcpjTg2WIg6qgEsGhpXELPinJoMPDVheTv -2BZPG42YJsNfvWgC06OCARwwggEYMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8E -AjAAMB0GA1UdDgQWBBRHH5EXnrWosCmIa+JyEM5seMxFVzBdBgNVHSAEVjBUMFIG -DCsGAQQBlRIBAgMBATBCMEAGCCsGAQUFBwICMDQaMkRpZXNlcyBaZXJ0aWZpa2F0 -IGlzdCBudXIgZvxyIFRlc3R6d2Vja2UgZ2VlaWduZXQuMEMGA1UdHwQ8MDowOKA2 -oDSGMmh0dHA6Ly9sYWJzLmNpby5ndi5hdC90ZW1wL2NybHMvc2lnbmF0dXJkaWVu -c3QuY3JsMBQGByooAAoBAQEECQwHQktBLUlLVDAfBgNVHSMEGDAWgBRAl0P5fWaw -vf59+uxGcYY9wffZPTAJBgUrDgMCHQUAA4GBAIMKUsnajgfBtpHeDdMdQMLA8fdt -lluezDOM78WYYSFURP04QZk5iHkShzptgZCF5Y/T4an3dC3SnytL67LJvEoKUyja -iTMLo7650xRTvAjTaMJ+nly/wTRYJKplOLXKWj3WwfObMHXdsDE8NJmpJSRE7Sw7 -+tj+UiTiNNSaXirqDiese Daten sind signiert.EYxznGxNRAIcHQeUsj+zsK+uaHA= \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.xml b/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.xml deleted file mode 100644 index da7e82025..000000000 --- a/spss.handbook/clients/webservice/resources/requests/signatures2bverified/CreateXMLSignatureRequest.VerifyXML.XMLDSigManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - KG_allgemein - - - - Diese Daten sind signiert. - - - - - text/plain - - - - - - \ No newline at end of file diff --git a/spss.handbook/clients/webservice/resources/requests/transformResults/CreateXMLSignatureRequest.Transforms.hashinput.ref2.txt b/spss.handbook/clients/webservice/resources/requests/transformResults/CreateXMLSignatureRequest.Transforms.hashinput.ref2.txt deleted file mode 100644 index f8527bb6d..000000000 --- a/spss.handbook/clients/webservice/resources/requests/transformResults/CreateXMLSignatureRequest.Transforms.hashinput.ref2.txt +++ /dev/null @@ -1,8 +0,0 @@ - - -HTML-Dokument - - -

Ich bin der erste Absatz in diesem Dokument.

- - diff --git a/spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1.der b/spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1.der deleted file mode 100644 index b6091332c..000000000 Binary files a/spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1.der and /dev/null differ diff --git a/spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1[pwd=kunde1].p12 b/spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1[pwd=kunde1].p12 deleted file mode 100644 index 33f76bf9c..000000000 Binary files a/spss.handbook/clients/webservice/resources/sslKeys/customer1/moa-ssl-kunde1[pwd=kunde1].p12 and /dev/null differ diff --git a/spss.handbook/clients/webservice/resources/sslKeys/customer1/trustedServers[pwd=servers].keystore b/spss.handbook/clients/webservice/resources/sslKeys/customer1/trustedServers[pwd=servers].keystore deleted file mode 100644 index 9c6c55359..000000000 Binary files a/spss.handbook/clients/webservice/resources/sslKeys/customer1/trustedServers[pwd=servers].keystore and /dev/null differ diff --git a/spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2.der b/spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2.der deleted file mode 100644 index 20bc38e14..000000000 Binary files a/spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2.der and /dev/null differ diff --git a/spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2[pwd=kunde2].p12 b/spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2[pwd=kunde2].p12 deleted file mode 100644 index ec7bf8e48..000000000 Binary files a/spss.handbook/clients/webservice/resources/sslKeys/customer2/moa-ssl-kunde2[pwd=kunde2].p12 and /dev/null differ diff --git a/spss.handbook/clients/webservice/resources/sslKeys/customer2/trustedServers[pwd=servers].keystore b/spss.handbook/clients/webservice/resources/sslKeys/customer2/trustedServers[pwd=servers].keystore deleted file mode 100644 index d32a22f0f..000000000 Binary files a/spss.handbook/clients/webservice/resources/sslKeys/customer2/trustedServers[pwd=servers].keystore and /dev/null differ diff --git a/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTP.java b/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTP.java deleted file mode 100644 index 00ae94c11..000000000 --- a/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTP.java +++ /dev/null @@ -1,204 +0,0 @@ -package at.gv.egovernment.moa.spss.handbook.clients.webservice; - -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.util.Properties; -import java.util.Vector; - -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.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; -import org.w3c.dom.Document; - -/** - * Diese Klasse implementiert einen einfachen Client für das MOA SP/SS Webservice mittels Apache Axis. Die - * Verbindung erfolgt ungesichert über HTTP. - */ -public class HTTP -{ - protected Properties props_; - - /** - * Methode main. - * - * Enthält den Beispielcode der nötig ist um von Java aus auf MOA-SPSS zugreifen zu können. Der Zugriff - * passiert über das AXIS-Framework. Die Verbindung erfolgt ungesichert über HTTP. - * - * @param args
    - *
  • - * args[0] enthält entweder die Bezeichnung "sign" oder "verify" zur Kennzeichnung, - * ob ein Signaturerstellungsrequest, oder ein Signaturprüfrequest gesendet werden soll. - *
  • - *
  • - * args[1] enthält einen Verweis auf eine Property-Datei, die die nähere Konfiguration - * für dieses Beispiel enthält. Der Verweis enthält entweder eine absolute oder eine - * relative Pfadangabe, wobei eine relative Angabe als relativ zum Arbeitsverzeichnis der - * Java VM interpretiert wird. Folgende Properties müssen in der Property-Datei vorhanden - * sein: - *
      - *
    • - * signServiceQName: Name des Webservices, fix "SignatureCreation" - *
    • - *
    • - * signServiceEndPoint: Zugangspunkt des Webservices (URL) - *
    • - *
    • - * signRequest: Name des zu sendenden Signaturerstellungsrequests (entweder - * absolute oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum - * Arbeitsverzeichnis der Java VM interpretiert) - *
    • - *
    • - * verifyServiceQName: Name des Webservices, fix "SignatureVerification" - *
    • - *
    • - * verifyServiceEndPoint: Zugangspunkt des Webservices (URL) - *
    • - *
    • - * verifyRequest: Name des zu sendenden Signaturprüfrequests (entweder - * absolute oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum - * Arbeitsverzeichnis der Java VM interpretiert) - *
    • - *
    - *
  • - *
- */ - public static void main(String[] args) - { - try - { - // Prüfen, ob Beispiel korrekt verwendet wird - checkArgs(args, "HTTP"); - - // Initialisieren des Clients - HTTP httpClient = new HTTP(args); - - // Ausführen der Serviceabfrage - httpClient.execute(args[0]); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - /** - * Prüft, ob das Beispiel korrekt verwendet wird. - * - * @param args Die Aufrufparameter für das Beispiel. Siehe {@link HTTP#main(String[])}. - * - * @param exampleName Der Name dieses Beispiels, der im Hilfetext gedruckt wird. - */ - protected static void checkArgs(String[] args, String exampleName) - { - if (args == null || args.length != 2 || (!"sign".equals(args[0]) && !"verify".equals(args[0]))) - { - System.out.println("Verwendung: " + exampleName + " \"sign\"|\"verify\" Properties-Datei"); - } - } - - /** - * Erzeugt den MOA Client. Es erfolgt die Auswertung der übergebenen Aufrufparameter. - * - * @param args Die Aufrufparameter für das Beispiel. Siehe {@link HTTP#main(String[])}. - * - * @throws Exception wenn der MOA Client mit den übergebenen Aufrufparametern nicht korrekt erzeugt - * werden konnte. - */ - protected HTTP(String[] args) throws Exception - { - props_ = new Properties(); - props_.load(new FileInputStream(args[1])); - } - - /** - * Führt die Abfrage beim MOA-Service aus. - * - * @param mode Steuert, ob eine Signatur erstellt ("sign") oder geprüft ("verify") werden soll. - * - * @throws Exception wenn dabei etwas schiegeht. - */ - protected void execute(String mode) throws Exception - { - // Datei mit Request einlesen - FileInputStream inputStream = new FileInputStream(getProperty(mode + "Request")); - - // Parser/DOMBuilder instanzieren - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - DocumentBuilder builder = factory.newDocumentBuilder(); - - // XML Datei in einen DOM-Baum umwandeln - Document xmlRequest = builder.parse(inputStream); - - // AXIS-Server instanzieren - Service service = ServiceFactory.newInstance().createService(new QName(getProperty(mode + "ServiceQName"))); - - // Call öffnen - Call call = service.createCall(); - - // Neues BodyElement anlegen und mit dem DOM-Baum füllen - SOAPBodyElement body = new SOAPBodyElement(xmlRequest.getDocumentElement()); - SOAPBodyElement[] params = new SOAPBodyElement[] - { - body - }; - - // Call mit Endpoint verknüpfen - call.setTargetEndpointAddress(getProperty(mode + "ServiceEndPoint")); - - // Call auslösen und die Antworten speichern - System.out.println("Calling ..."); - Vector responses = (Vector) call.invoke(params); - - // Erstes Body Element auslesen - SOAPBodyElement response = (SOAPBodyElement) responses.get(0); - - // Aus der Response den DOM-Baum lesen - Document root_response = response.getAsDocument(); - System.out.println("Return ..."); - - // XML-Formatierung konfiguieren - OutputFormat format = new OutputFormat((Document) root_response); - format.setLineSeparator("\n"); - format.setIndenting(false); - format.setPreserveSpace(true); - format.setOmitXMLDeclaration(false); - format.setEncoding("UTF-8"); - - // Ausgabe der Webservice-Antwort auf die Konsole - XMLSerializer conSerializer = new XMLSerializer(System.out, format); - conSerializer.serialize(root_response); - - // Ausgabe der Webservice-Antwort in Datei - String responseFile = getProperty(mode + "Request").substring(0, getProperty(mode + "Request").lastIndexOf('.')) - + ".response.xml"; - XMLSerializer fileSerializer = new XMLSerializer(new FileOutputStream(responseFile), format); - fileSerializer.serialize(root_response); - } - - /** - * Prüft ob die Property mit dem angegebenen Namen in den Konfigurations-Properties enthalten ist. - * - * @param propName Name der zu untersuchenden Property. - * - * @return den Wert der gesuchten Property. - * - * @throws Exception wenn die gesuchte Property nicht vorhanden ist. - */ - protected String getProperty(String propName) throws Exception - { - String propValue = props_.getProperty(propName); - if ((propValue == null) || "".equals(propValue.trim())) - { - throw new Exception("Property named \"" + propName + "\" does not exist."); - } - return propValue; - } -} \ No newline at end of file diff --git a/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSClientAuth.java b/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSClientAuth.java deleted file mode 100644 index ef509088a..000000000 --- a/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSClientAuth.java +++ /dev/null @@ -1,122 +0,0 @@ -package at.gv.egovernment.moa.spss.handbook.clients.webservice; - - -/** - * Diese Klasse implementiert einen einfachen Client für das MOA SP/SS Webservice mittels Apache Axis. Die - * Verbindung erfolgt gesichert über SSL, und zwar sowohl mit Server- und Clientauthentisierung. - */ -public class HTTPSClientAuth extends HTTPSServerAuth -{ - // JSSE Konstanten - public static final String KEYSTORE = "javax.net.ssl.keyStore"; - public static final String KEYSTOREPASSWORD = "javax.net.ssl.keyStorePassword"; - public static final String KEYSTORETYPE = "javax.net.ssl.keyStoreType"; - - /** - * Methode main. - * - * Enthält den Beispielcode der nötig ist um von Java aus auf MOA-SPSS zugreifen zu können. Der Zugriff - * passiert über das AXIS-Framework. Die Verbindung erfolgt gesichert über SSL, und zwar sowohl mit - * Server- und Clientauthentisierung. - * - * @param args
    - *
  • - * args[0] enthält entweder die Bezeichnung "sign" oder "verify" zur Kennzeichnung, - * ob ein Signaturerstellungsrequest, oder ein Signaturprüfrequest gesendet werden soll. - *
  • - *
  • - * args[1] enthält einen Verweis auf eine Property-Datei, die die nähere Konfiguration - * für dieses Beispiel enthält. Der Verweis enthält entweder eine absolute oder eine - * relative Pfadangabe, wobei eine relative Angabe als relativ zum Arbeitsverzeichnis der - * Java VM interpretiert wird. Folgende Properties müssen in der Properties-Datei vorhanden - * sein: - *
      - *
    • - * signServiceQName: Name des Webservices, fix "SignatureCreation" - *
    • - *
    • - * signServiceEndPoint: Zugangspunkt des Webservices (URL) - *
    • - *
    • - * signRequest: Name des zu sendenden Signaturerstellungsrequests (entweder - * absolute oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum - * Arbeitsverzeichnis der Java VM interpretiert) - *
    • - *
    • - * verifyServiceQName: Name des Webservices, fix "SignatureVerification" - *
    • - *
    • - * verifyServiceEndPoint: Zugangspunkt des Webservices (URL) - *
    • - *
    • - * verifyRequest: Name des zu sendenden Signaturprüfrequests (entweder - * absolute oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum - * Arbeitsverzeichnis der Java VM interpretiert) - *
    • - *
    • - * ssl.truststore.type: Typ des JSSE-Truststores (entweder "JKS" für einen - * Java Key Store oder "PKCS12" für eine PKCS#12-Datei). - *
    • - *
    • ssl.truststore.type: Relativer oder absoluter Pfad zum JSSE-Truststore. - * Ein relativer Pfad wird relativ zum Arbeitsverzeichnis der Java VM interpretiert). - *
    • - *
    • ssl.truststore.pwd: Passwort für den JSSE-Truststore. - *
    • - *
    • - * ssl.keystore.type: Typ des JSSE-Keystores (entweder "JKS" für einen - * Java Key Store oder "PKCS12" für eine PKCS#12-Datei). - *
    • - *
    • ssl.keystore.type: Relativer oder absoluter Pfad zum JSSE-Keystore. - * Ein relativer Pfad wird relativ zum Arbeitsverzeichnis der Java VM interpretiert). - *
    • - *
    • ssl.keystore.pwd: Passwort für den JSSE-Keystore. - *
    • - *
    - *
  • - *
- */ - public static void main(String[] args) - { - try - { - // Prüfen, ob Beispiel korrekt verwendet wird - checkArgs(args, "HTTP"); - - // Initialisieren des Clients - HTTPSClientAuth httpClient = new HTTPSClientAuth(args); - - // Ausführen der Serviceabfrage - httpClient.execute(args[0]); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - /** - * Erzeugt den MOA Client. Es erfolgt die Auswertung der übergebenen Aufrufparameter. - * - * @param args Die Aufrufparameter für das Beispiel. Siehe {@link HTTPSClientAuth#main(String[])}. - * - * @throws Exception wenn der MOA Client mit den übergebenen Aufrufparametern nicht korrekt erzeugt - * werden konnte. - */ - protected HTTPSClientAuth(String[] args) throws Exception - { - super(args); - } - - /** - * Konfiguriert JSSE für eine SSL-Verbindung mit Client- und Serverauthentisierung. - */ - protected void configureSSL() throws Exception - { - super.configureSSL(); - - // Konfiguriere Key-Store (enthält privaten Schlüssel und Zertifikat des Clients) - System.setProperty(KEYSTORETYPE, getProperty("ssl.keystore.type")); - System.setProperty(KEYSTORE, getProperty("ssl.keystore.loc")); - System.setProperty(KEYSTOREPASSWORD, getProperty("ssl.keystore.pwd")); - } -} \ No newline at end of file diff --git a/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSServerAuth.java b/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSServerAuth.java deleted file mode 100644 index 712c9dbe7..000000000 --- a/spss.handbook/clients/webservice/src/at/gv/egovernment/moa/spss/handbook/clients/webservice/HTTPSServerAuth.java +++ /dev/null @@ -1,125 +0,0 @@ -package at.gv.egovernment.moa.spss.handbook.clients.webservice; - -import java.security.Security; - -import com.sun.net.ssl.internal.ssl.Provider; - -/** - * Diese Klasse implementiert einen einfachen Client für das MOA SP/SS Webservice mittels Apache Axis. Die - * Verbindung erfolgt gesichert über SSL, und zwar nur mit Serverauthentisierung. - */ -public class HTTPSServerAuth extends HTTP -{ - // JSSE Konstanten - public static final String HANDLER = "java.protocol.handler.pkgs"; - public static final String TRUSTSTORE = "javax.net.ssl.trustStore"; - public static final String TRUSTSTOREPASSWORD = "javax.net.ssl.trustStorePassword"; - public static final String TRUSTSTORETYPE = "javax.net.ssl.trustStoreType"; - - /** - * Methode main. - * - * Enthält den Beispielcode der nötig ist um von Java aus auf MOA-SPSS zugreifen zu können. Der Zugriff - * passiert über das AXIS-Framework. Die Verbindung erfolgt gesichert über SSL, und zwar nur mit - * Serverauthentisierung. - * - * @param args
    - *
  • - * args[0] enthält entweder die Bezeichnung "sign" oder "verify" zur Kennzeichnung, - * ob ein Signaturerstellungsrequest, oder ein Signaturprüfrequest gesendet werden soll. - *
  • - *
  • - * args[1] enthält einen Verweis auf eine Property-Datei, die die nähere Konfiguration - * für dieses Beispiel enthält. Der Verweis enthält entweder eine absolute oder eine - * relative Pfadangabe, wobei eine relative Angabe als relativ zum Arbeitsverzeichnis der - * Java VM interpretiert wird. Folgende Properties müssen in der Properties-Datei vorhanden - * sein: - *
      - *
    • - * signServiceQName: Name des Webservices, fix "SignatureCreation" - *
    • - *
    • - * signServiceEndPoint: Zugangspunkt des Webservices (URL) - *
    • - *
    • - * signRequest: Name des zu sendenden Signaturerstellungsrequests (entweder - * absolute oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum - * Arbeitsverzeichnis der Java VM interpretiert) - *
    • - *
    • - * verifyServiceQName: Name des Webservices, fix "SignatureVerification" - *
    • - *
    • - * verifyServiceEndPoint: Zugangspunkt des Webservices (URL) - *
    • - *
    • - * verifyRequest: Name des zu sendenden Signaturprüfrequests (entweder - * absolute oder relative Pfadangabe; eine relative Pfadangabe wird relativ zum - * Arbeitsverzeichnis der Java VM interpretiert) - *
    • - *
    • - * ssl.truststore.type: Typ des JSSE-Truststores (entweder "JKS" für einen - * Java Key Store oder "PKCS12" für eine PKCS#12-Datei). - *
    • - *
    • ssl.truststore.type: Relativer oder absoluter Pfad zum JSSE-Truststore. - * Ein relativer Pfad wird relativ zum Arbeitsverzeichnis der Java VM interpretiert). - *
    • - *
    • ssl.truststore.pwd: Passwort für den JSSE-Truststore. - *
    • - *
    - *
  • - *
- */ - public static void main(String[] args) - { - try - { - // Prüfen, ob Beispiel korrekt verwendet wird - checkArgs(args, "HTTP"); - - // Initialisieren des Clients - HTTPSServerAuth httpClient = new HTTPSServerAuth(args); - - // Ausführen der Serviceabfrage - httpClient.execute(args[0]); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - /** - * Erzeugt den MOA Client. Es erfolgt die Auswertung der übergebenen Aufrufparameter. - * - * @param args Die Aufrufparameter für das Beispiel. Siehe {@link HTTPSServerAuth#main(String[])}. - * - * @throws Exception wenn der MOA Client mit den übergebenen Aufrufparametern nicht korrekt erzeugt - * werden konnte. - */ - protected HTTPSServerAuth(String[] args) throws Exception - { - super(args); - configureSSL(); - } - - /** - * Konfiguriert JSSE für eine SSL-Verbindung mit Serverauthentisierung. - * - * @throws Exception wenn die Konfiguration von JSSE fehlschlägt. - */ - protected void configureSSL() throws Exception - { - // Aktivieren Sie die nächste Zeile für detailliertes Logging des SSL-Verbindungsaufbaus - // System.setProperty("javax.net.debug", "all"); - - // Setzen des korrekten Protokoll-Handlers für https - Security.addProvider(new Provider()); - System.setProperty(HANDLER, "com.sun.net.ssl.internal.www.protocol"); - - // Konfiguriere Trust-Store (enthält SSL-Zertifikat des MOA Services, dem vertraut wird) - System.setProperty(TRUSTSTORETYPE, getProperty("ssl.truststore.type")); - System.setProperty(TRUSTSTORE, getProperty("ssl.truststore.loc")); - System.setProperty(TRUSTSTOREPASSWORD, getProperty("ssl.truststore.pwd")); - } -} \ No newline at end of file diff --git a/spss.handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 b/spss.handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 deleted file mode 100644 index 592c96230..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 b/spss.handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 deleted file mode 100644 index a7948e488..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 b/spss.handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 deleted file mode 100644 index 73434134e..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 b/spss.handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 deleted file mode 100644 index 8c434777e..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 b/spss.handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 deleted file mode 100644 index 3af27c013..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 b/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 deleted file mode 100644 index 29d93550e..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F b/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F deleted file mode 100644 index 2a88295a7..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 b/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 deleted file mode 100644 index 84a1690d2..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A b/spss.handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A deleted file mode 100644 index 04c6ea363..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 b/spss.handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 deleted file mode 100644 index fd23a38d6..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D b/spss.handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D deleted file mode 100644 index 1a3106742..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 b/spss.handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 deleted file mode 100644 index 28cb48bb0..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 b/spss.handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 deleted file mode 100644 index bdfcb7ab1..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 b/spss.handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 deleted file mode 100644 index eaac3518b..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C b/spss.handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C deleted file mode 100644 index 4dd2c49bf..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 b/spss.handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 deleted file mode 100644 index 13abede5c..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 b/spss.handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 deleted file mode 100644 index 33e776369..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 b/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 deleted file mode 100644 index d2e7db667..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 b/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 deleted file mode 100644 index f2f1c6562..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 b/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 deleted file mode 100644 index 476a3efb2..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 b/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 deleted file mode 100644 index 5c88b668a..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F b/spss.handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F deleted file mode 100644 index 4d1852203..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 b/spss.handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 deleted file mode 100644 index 69a8e4872..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D b/spss.handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D deleted file mode 100644 index 807fa786c..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 b/spss.handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 deleted file mode 100644 index 376d0753f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 b/spss.handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 deleted file mode 100644 index 5171276f4..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 b/spss.handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 deleted file mode 100644 index f8a8957ac..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA b/spss.handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA deleted file mode 100644 index 836ba3767..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F b/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F deleted file mode 100644 index 69de75609..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE b/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE deleted file mode 100644 index efa28178e..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 b/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 deleted file mode 100644 index 289fc2198..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 b/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 deleted file mode 100644 index b7d4b08a6..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E b/spss.handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E deleted file mode 100644 index b2beddaa5..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 b/spss.handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 deleted file mode 100644 index 54893c9d6..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C b/spss.handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C deleted file mode 100644 index 8588ce58a..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 b/spss.handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 deleted file mode 100644 index 6e17b9db5..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 b/spss.handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 deleted file mode 100644 index 55707d69f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E b/spss.handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA b/spss.handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA deleted file mode 100644 index 4e18de8d7..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 b/spss.handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 deleted file mode 100644 index 9b2ee0fc6..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F b/spss.handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F deleted file mode 100644 index 5dd9558d0..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 b/spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 deleted file mode 100644 index da38ce028..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 b/spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B b/spss.handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B deleted file mode 100644 index b15880c29..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 b/spss.handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 deleted file mode 100644 index 6da18c620..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD b/spss.handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD deleted file mode 100644 index c19647ad8..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 b/spss.handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 deleted file mode 100644 index 39f88d881..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B b/spss.handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B deleted file mode 100644 index d361d919f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 b/spss.handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 deleted file mode 100644 index 89cfe44fd..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C b/spss.handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C deleted file mode 100644 index cc8b505ec..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E b/spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E deleted file mode 100644 index c9da41583..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 b/spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 deleted file mode 100644 index 28fbdf42f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 b/spss.handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 deleted file mode 100644 index 424f849a1..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C b/spss.handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C deleted file mode 100644 index 4989f3e73..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B b/spss.handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B deleted file mode 100644 index 06b40aa67..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB b/spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB deleted file mode 100644 index 6f97837a2..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B b/spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B deleted file mode 100644 index 508f7f076..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE b/spss.handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE deleted file mode 100644 index a0e3fdda1..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 b/spss.handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 deleted file mode 100644 index 36a442b89..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 b/spss.handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 deleted file mode 100644 index 6c0216239..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 b/spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 deleted file mode 100644 index f3cf5e676..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC b/spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC deleted file mode 100644 index fc5bd433b..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F b/spss.handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F deleted file mode 100644 index 3beb4529a..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 b/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 deleted file mode 100644 index 781d1e4f2..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B b/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B deleted file mode 100644 index 8286cabbc..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B b/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B deleted file mode 100644 index a0148f63b..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C b/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C deleted file mode 100644 index 61d346a8f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 b/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 deleted file mode 100644 index 9ae7ffa0c..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 b/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 deleted file mode 100644 index a68ae2db7..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B b/spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B deleted file mode 100644 index f1d7b6a28..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD b/spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD deleted file mode 100644 index c1b90c0f4..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B b/spss.handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B deleted file mode 100644 index e27a87038..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE b/spss.handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE deleted file mode 100644 index cc35ba691..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F b/spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F deleted file mode 100644 index b596d82e3..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D b/spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D deleted file mode 100644 index 4adc3b7ec..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A b/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A deleted file mode 100644 index b6f39e354..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 b/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 deleted file mode 100644 index f9fef65fc..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 b/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 deleted file mode 100644 index f9f27442b..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 b/spss.handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 deleted file mode 100644 index 10a1f7141..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 b/spss.handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 deleted file mode 100644 index 61a7ccb15..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 b/spss.handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 deleted file mode 100644 index ea3512e3d..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 b/spss.handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 deleted file mode 100644 index 46dd968f0..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 b/spss.handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 deleted file mode 100644 index 63ba5cce5..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D b/spss.handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D deleted file mode 100644 index 0bab77032..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 b/spss.handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 deleted file mode 100644 index 0a8de4bb9..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE b/spss.handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE deleted file mode 100644 index 6428b8256..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 b/spss.handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 deleted file mode 100644 index f11bd6247..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C b/spss.handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C deleted file mode 100644 index 348257122..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED b/spss.handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED deleted file mode 100644 index a3f8a7409..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA b/spss.handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA deleted file mode 100644 index 3c1f2f8a2..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 b/spss.handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 deleted file mode 100644 index 5026d395f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F b/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F deleted file mode 100644 index c34d0f380..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 b/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 deleted file mode 100644 index d894e92ca..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D b/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D deleted file mode 100644 index 380486f65..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 b/spss.handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 deleted file mode 100644 index 22d64fb5f..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C b/spss.handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C deleted file mode 100644 index 42a64da07..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 b/spss.handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 deleted file mode 100644 index 010c5d5b6..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE b/spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE deleted file mode 100644 index 5375c57c3..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 b/spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 deleted file mode 100644 index 7085c5ac9..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 b/spss.handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 deleted file mode 100644 index 6225c0ca7..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C b/spss.handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C deleted file mode 100644 index a3aa0000d..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 b/spss.handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 deleted file mode 100644 index 332aa817a..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 b/spss.handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 deleted file mode 100644 index 069640ffc..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE b/spss.handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE deleted file mode 100644 index c3fc91352..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 b/spss.handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 deleted file mode 100644 index 83aeb1fce..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 b/spss.handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 deleted file mode 100644 index 5631441a9..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C b/spss.handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C deleted file mode 100644 index 585047fa2..000000000 Binary files a/spss.handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der b/spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der deleted file mode 100644 index 332aa817a..000000000 Binary files a/spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 b/spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 deleted file mode 100644 index 8827ed99c..000000000 Binary files a/spss.handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der b/spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der deleted file mode 100644 index 63ba5cce5..000000000 Binary files a/spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 b/spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 deleted file mode 100644 index 4499ab52b..000000000 Binary files a/spss.handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der b/spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der deleted file mode 100644 index 4f87134e7..000000000 Binary files a/spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 b/spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 deleted file mode 100644 index 5b7631133..000000000 Binary files a/spss.handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/log4j.properties b/spss.handbook/conf/moa-spss/log4j.properties deleted file mode 100644 index f6abfd495..000000000 --- a/spss.handbook/conf/moa-spss/log4j.properties +++ /dev/null @@ -1,37 +0,0 @@ -# -# Sample log4j configuration for the MOA-SPSS web service -# - -# commons-logging setup -org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory - -# 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 - -# Configure the 'stdout' appender to write logging output to the console -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n - -# Configure the 'moaspss' appender to write moa-spss related logging output -# to the file '${catalina.home}/logs/moa-spss.log'. The file is rolled over every 1000KB, -# and a maximum history of 10 log files is being kept. -log4j.appender.moaspss=org.apache.log4j.RollingFileAppender -log4j.appender.moaspss.File=${catalina.home}/logs/moa-spss.log -log4j.appender.moaspss.MaxFileSize=1000KB -log4j.appender.moaspss.MaxBackupIndex=10 -log4j.appender.moaspss.layout=org.apache.log4j.PatternLayout -log4j.appender.moaspss.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n - -# Configure the jdbc appender 'JDBC' to write logging output -# to the given PostgreSQL database -# a suitable table called 'spss_log' must have been created in the -# database using the command: -# create table spss_log (log_time timestamp, log_level char(5), log_msg text) -#log4j.appender.JDBC=org.apache.log4j.jdbc.JDBCAppender -#log4j.appender.JDBC.driver=org.postgresql.Driver -#log4j.appender.JDBC.URL=jdbc:postgresql://10.16.46.108/moa?user=moa&password=moatest -#log4j.appender.JDBC.layout=org.apache.log4j.PatternLayout -#log4j.appender.JDBC.sql=INSERT INTO spss_log (log_time, log_level, log_msg) VALUES ('%d{ yyyy-MM-dd HH:mm:ss.SSS}', '%5p', '%m') diff --git a/spss.handbook/conf/moa-spss/sp.minimum.config.xml b/spss.handbook/conf/moa-spss/sp.minimum.config.xml deleted file mode 100644 index e2a556677..000000000 --- a/spss.handbook/conf/moa-spss/sp.minimum.config.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - -true -true - - -certstore - - - - - -pkix - - -Test-Signaturdienste -trustProfiles/test - - - -true -0 - -CRL -OCSP - - -false -365 - - -jdbc:url -fully.qualified.classname - - - - - - - diff --git a/spss.handbook/conf/moa-spss/spss.config.xml b/spss.handbook/conf/moa-spss/spss.config.xml deleted file mode 100644 index d792f9478..000000000 --- a/spss.handbook/conf/moa-spss/spss.config.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - SKM_Kunde1 - keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 - kunde1 - - - SKM_Kunde2 - keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 - kunde2 - - - SKM_allgemein - keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 - allekunden - - - - KG_Kunde1 - - SKM_Kunde1 - - CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT - 7 - - - - - KG_Kunde2 - - SKM_Kunde2 - - CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT - 8 - - - - - KG_allgemein - - SKM_allgemein - - CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT - 9 - - - - - KG_allgemein - - - - CN=Test CA - Verschl\C3\BCsselung B\C3\BCrger,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT - 0 - - KG_Kunde1 - - - - CN=Test CA - Verschl\C3\BCsselung B\C3\BCrger,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT - 1 - - KG_Kunde2 - - - http://www.w3.org/TR/2001/REC-xml-c14n-20010315 - http://www.w3.org/2000/09/xmldsig#sha1 - - - - - - true - true - - - certstore - - - - - - pkix - - - CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT - 536 - - chaining - - - - Test-Signaturdienste - trustProfiles/test - - - CertifiedSignature - trustProfiles/certifiedSignature - - - CertifiedSignature+Test - trustProfiles/certifiedSignature+Test - - - SecureSignature - trustProfiles/secureSignature - - - SecureSignature-Qual-Only - trustProfiles/secureSignature-qual-only - - - SecureSignature+Test - trustProfiles/secureSignature+Test - - - IdentityLink - trustProfiles/identityLink - - - IdentityLink+Test - trustProfiles/identityLink+Test - - - - true - 0 - - CRL - OCSP - - - false - 365 - - - jdbc:url - fully.qualified.classname - - - - - - - diff --git a/spss.handbook/conf/moa-spss/ss.minimum.config.xml b/spss.handbook/conf/moa-spss/ss.minimum.config.xml deleted file mode 100644 index 8ab10a994..000000000 --- a/spss.handbook/conf/moa-spss/ss.minimum.config.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - -SKM_Kunde1 -keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 -kunde1 - - - -KG_Kunde1 - -SKM_Kunde1 - -CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT -7 - - - - - -CN=Test CA - Verschl\C3\BCsselung B\C3\BCrger,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT -0 - -KG_Kunde1 - - -http://www.w3.org/TR/2001/REC-xml-c14n-20010315 -http://www.w3.org/2000/09/xmldsig#sha1 - - - diff --git a/spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der b/spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der deleted file mode 100644 index c3b3003d9..000000000 Binary files a/spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 b/spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 deleted file mode 100644 index af524d060..000000000 Binary files a/spss.handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore b/spss.handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore deleted file mode 100644 index 780e58934..000000000 Binary files a/spss.handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore b/spss.handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore deleted file mode 100644 index b3673b45d..000000000 Binary files a/spss.handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer deleted file mode 100644 index 8c434777e..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer deleted file mode 100644 index efa28178e..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer deleted file mode 100644 index 33e776369..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer deleted file mode 100644 index b7d4b08a6..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer deleted file mode 100644 index 289fc2198..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer deleted file mode 100644 index 69de75609..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer deleted file mode 100644 index 836ba3767..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer deleted file mode 100644 index fc5bd433b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer deleted file mode 100644 index f3cf5e676..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der deleted file mode 100644 index d3c213711..000000000 --- a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDljCCAwOgAwIBAgIBBDAJBgUrDgMCHQUAMHQxCzAJBgNVBAYTAkFUMSwwKgYD -VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE -CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMRcwFQYDVQQDEw5UZXN0IENBIC0gUm9v -dDAeFw0wNDA1MTgxMzQ1NTdaFw0wOTEyMzEyMjU5MzBaMIGGMQswCQYDVQQGEwJB -VDEsMCoGA1UEChMjU3RhYnN0ZWxsZSBJS1QtU3RyYXRlZ2llIGRlcyBCdW5kZXMx -HjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczEpMCcGA1UEAxQgVGVzdCBD -QSAtIFZlcnNjaGz8c3NlbHVuZyBC/HJnZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0A -MIGJAoGBALmykoSgYUpJiaK5NlC5jTcMQikEIB6kOdS7e82DBbT5G13zQeuiNBA2 -KzLMPMBK62Go+ZV8w94N5cSm2auuempVAHNF80ao9G3wYgK0xOVZXvf/145o8TIw -StPPckmVPL2OPa8/DIB8tqNjblFxy+XcBnTQMLKaxYSzwA/zULoNAgMBAAGjggEr -MIIBJzAOBgNVHQ8BAf8EBAMCAcYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4E -FgQUjRMKvtgH3PngerFS/Rt+vuEDbLMwXQYDVR0gBFYwVDBSBgwrBgEEAZUSAQID -AQEwQjBABggrBgEFBQcCAjA0GjJEaWVzZXMgWmVydGlmaWthdCBpc3QgbnVyIGb8 -ciBUZXN0endlY2tlIGdlZWlnbmV0LjA5BgNVHR8EMjAwMC6gLKAqhihodHRwOi8v -bGFicy5jaW8uZ3YuYXQvdGVtcC9jcmxzL3Jvb3QuY3JsMBQGByooAAoBAQEECQwH -QktBLUlLVDARBglghkgBhvhCAQEEBAMCAQIwHwYDVR0jBBgwFoAUZWxSwiqQLpxu -4vk3Op4dYHG46XswCQYFKw4DAh0FAAOBgQAnuY7RPFXLpO2hb3h1B0cy5p861j6E -eD+c/ZKAGqIh4kh3A65D8Zl90GSv9vV4L03dnN5hc7rm/bwKzDI57/PI2dL0H/S4 -OOl4tt4fZmjN8Xrv3oJxNEa+6AJ8TGCcouc/Eqxnpc0SxkP6UQrA8J8RM/8fk05U -DAyTZbTQ5wPIhA== ------END CERTIFICATE----- diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer deleted file mode 100644 index 06b40aa67..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer deleted file mode 100644 index da38ce028..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer deleted file mode 100644 index 8c434777e..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer deleted file mode 100644 index efa28178e..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer deleted file mode 100644 index 33e776369..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer deleted file mode 100644 index b7d4b08a6..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer deleted file mode 100644 index 289fc2198..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer deleted file mode 100644 index 69de75609..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer deleted file mode 100644 index 06b40aa67..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer deleted file mode 100644 index da38ce028..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer b/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer deleted file mode 100644 index 592c96230..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer deleted file mode 100644 index 376d0753f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer b/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer deleted file mode 100644 index 424f849a1..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer deleted file mode 100644 index 376d0753f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der b/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der deleted file mode 100644 index 5171276f4..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der b/spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der deleted file mode 100644 index 592c96230..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer deleted file mode 100644 index 376d0753f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der b/spss.handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der deleted file mode 100644 index 376d0753f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der b/spss.handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der deleted file mode 100644 index 5171276f4..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer deleted file mode 100644 index f9fef65fc..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer deleted file mode 100644 index 36a442b89..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer deleted file mode 100644 index d361d919f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer deleted file mode 100644 index ad13d7b28..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer deleted file mode 100644 index f9f27442b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer deleted file mode 100644 index b6f39e354..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer deleted file mode 100644 index 28cb48bb0..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer deleted file mode 100644 index 28fbdf42f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer deleted file mode 100644 index c9da41583..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der deleted file mode 100644 index 807fa786c..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer deleted file mode 100644 index 06b40aa67..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer deleted file mode 100644 index da38ce028..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer deleted file mode 100644 index f9fef65fc..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer deleted file mode 100644 index 36a442b89..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer deleted file mode 100644 index d361d919f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer deleted file mode 100644 index ad13d7b28..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer deleted file mode 100644 index f9f27442b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer deleted file mode 100644 index b6f39e354..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer deleted file mode 100644 index f9fef65fc..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer deleted file mode 100644 index 36a442b89..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer deleted file mode 100644 index d361d919f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer deleted file mode 100644 index ad13d7b28..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer deleted file mode 100644 index f9f27442b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer deleted file mode 100644 index b6f39e354..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der deleted file mode 100644 index 3be7b6a06..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer deleted file mode 100644 index 06b40aa67..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer deleted file mode 100644 index 7e9fd5b0b..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer deleted file mode 100644 index da38ce028..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer and /dev/null differ diff --git a/spss.handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der b/spss.handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der deleted file mode 100644 index 55707d69f..000000000 Binary files a/spss.handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der and /dev/null differ diff --git a/spss.handbook/handbook.html b/spss.handbook/handbook.html deleted file mode 100644 index 2497d7f70..000000000 --- a/spss.handbook/handbook.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - -

Zum Handbuch ...

- \ No newline at end of file diff --git a/spss.handbook/handbook/common/LogoBKA.png b/spss.handbook/handbook/common/LogoBKA.png deleted file mode 100644 index 6a92647fd..000000000 Binary files a/spss.handbook/handbook/common/LogoBKA.png and /dev/null differ diff --git a/spss.handbook/handbook/common/LogoMoa4c.3148x3545.jpg b/spss.handbook/handbook/common/LogoMoa4c.3148x3545.jpg deleted file mode 100644 index a5ba135ef..000000000 Binary files a/spss.handbook/handbook/common/LogoMoa4c.3148x3545.jpg and /dev/null differ diff --git a/spss.handbook/handbook/common/LogoMoa4c.jpg b/spss.handbook/handbook/common/LogoMoa4c.jpg deleted file mode 100644 index a1102090b..000000000 Binary files a/spss.handbook/handbook/common/LogoMoa4c.jpg and /dev/null differ diff --git a/spss.handbook/handbook/common/LogoMoaBw.jpg b/spss.handbook/handbook/common/LogoMoaBw.jpg deleted file mode 100644 index 5a31e3e15..000000000 Binary files a/spss.handbook/handbook/common/LogoMoaBw.jpg and /dev/null differ diff --git a/spss.handbook/handbook/common/MOA.css b/spss.handbook/handbook/common/MOA.css deleted file mode 100644 index 81e0a3f8d..000000000 --- a/spss.handbook/handbook/common/MOA.css +++ /dev/null @@ -1,300 +0,0 @@ -body -{ - font-family: "Times New Roman", Times, serif; - font-size: medium; - font-weight: normal; - margin-left: 2.5em; - margin-right: 2.5em; -} - -p -{ - margin-top: 0pt; - margin-bottom: 0.5em; - text-align: justify -} - -pre -{ - font-family: "Courier New", monospace; - font-size: 90%; - background-color: #cccccc; - color: #000000; - margin-left:1.5%; - margin-right:1.5%; - margin-top: 1em; - margin-bottom: 1em; - border: #008000 none; -} - -hr -{ - color: #000080; - background-color: #000080; - margin-top: 0.5em; - margin-bottom: 0.5em; -} - -table.fixedWidth -{ - width: 97%; - margin-left:1.5%; - margin-right:1.5%; - margin-top: 1em; - margin-bottom: 1em; -} - - -table.varWidth -{ - margin-left:1.5%; - margin-top: 1em; - margin-bottom: 1em; -} - -th -{ - text-align: left; -} - -h1 -{ - color: #000080; - text-align: left; - font-size: 167%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal -} - -h2 -{ - color: #000080; - font-size: 150%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal -} - -h3 -{ - color: #000080; - font-size: 133%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal -} - -h4 -{ - color: #000080; - font-size: 116%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal -} - -h5 -{ - color: #000080; - font-size: 100%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal -} - -h6 -{ - color: #000080; - font-size: 83%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal -} - -code -{ - font-family: "Courier New", Courier, monospace; - font-size: 90%; - color: #000000 -} - -dd -{ - margin-top: 0.8em; - margin-bottom: 0.8em; - text-align: justify - -} - -dt -{ - margin-top: 0.8em; - font-family: Arial, Helvetica, sans-serif; - color: #000080 -} - -ol -{ - margin-top: 0.5em; - margin-bottom: 0.5em -} - -ol.alpha -{ - list-style-type: lower-alpha -} - -li -{ - margin-top: 0.25em; - margin-bottom: 0.25em; - text-align: justify -} - -a:hover -{ - color: #990000 -} - - -.title -{ - text-align: left; - font-size: 167%; - color: #000080; - font-family: Arial, Helvetica, sans-serif; - margin-top: 0.4em; - margin-bottom: 0.4em -} - -.subtitle -{ - text-align: left; - font-size: 133%; - color: #000080; - font-family: Arial, Helvetica, sans-serif; - margin-top: 0.4em; - margin-bottom: 0.4em -} - -.glossaryTerm -{ - font-style: italic; - color: #006699 -} - -.example -{ - font-family: "Courier New", monospace; - background-color: #CCFFFF; - color: #000000; - margin: 0pt 0pt; - border: #008000 none -} - -.schema -{ - font-family: "Courier New", monospace; - background-color: #FFFFCC; - color: #000000; - margin: 0pt 0pt; - border: #008000 none -} - -.documentinfo -{ - font-family: Arial, Helvetica, sans-serif; - font-size: 100%; -} - -.ol-contents -{ - font-size: 100%; - margin-top: 0.0em; - margin-bottom: 0.0em; -} - -.li-contents -{ - font-size: 100%; - margin-top: 0.0em; - margin-bottom: 0.0em; -} - -.logoTitle -{ - text-align: center; - font-size: 133%; - color: #000080; - font-family: Arial, Helvetica, sans-serif; -} - -.logoTable -{ - margin-bottom: 0px; - margin-left: 0px -} - -.superscript -{ - vertical-align: super; - font-size: 66%; -} - -.term -{ - font-style: italic; -} - -.comment -{ - color: #000000; - background: #ffff00; - font-style: italic -} - -.addedErrata12 -{ - color: #FF0000; - background-color: #FFEEEE; - text-decoration: underline -} - -.deletedErrata12 -{ - color: #999999; - background-color: #EEEEEE; - text-decoration: line-through -} - -.added12 -{ - color: #FF0000; - text-decoration: underline -; background-color: #F8F0FF -} - -.deleted12 -{ - color: #999999; - text-decoration: line-through -; background-color: #f8f0ff -} - -.rfc2119Keyword -{ - font-variant: small-caps; - font-style: normal; -} - -.remark { font-style: italic} - -li.faq -{ - margin-top: 1.5em; - margin-bottom: 1.5em; -} - -.faq-question -{ - color: #000080; - font-size: 100%; - font-family: Arial, Helvetica, sans-serif; - font-weight: normal; - margin-bottom: 0.4em; -} diff --git a/spss.handbook/handbook/config/MOA-SPSS-config-1.3.xsd b/spss.handbook/handbook/config/MOA-SPSS-config-1.3.xsd deleted file mode 100644 index 1521b4f1b..000000000 --- a/spss.handbook/handbook/config/MOA-SPSS-config-1.3.xsd +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spss.handbook/handbook/config/config.html b/spss.handbook/handbook/config/config.html deleted file mode 100644 index f1097e55a..000000000 --- a/spss.handbook/handbook/config/config.html +++ /dev/null @@ -1,1014 +0,0 @@ - - - - - MOA SS und SP - Konfiguration - - - - - - - - - -
Logo BKAOpen Source
- für das E-Government
Logo MOA
-
-

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

-

Konfiguration

-
-

Inhalt

-
    -
  1. -

    Übersicht

    -
      -
    1. Allgemeines -
        -
      1. Namenskonventionen
      2. -
      -
    2. -
    3. Zentrale Konfigurationsdatei -
        -
      1. Aktualisierung auf das Format von MOA SP/SS 1.3
      2. -
      -
    4. -
    5. Bekanntmachung der Konfigurationsdatei - -
        -
      1. Aktualisierung der Konfiguration im laufenden Betrieb
      2. -
      -
    6. -
    7. Konfiguration des Loggings
    8. -
    -
  2. -
  3. Konfigurationsparameter -
      -
    1. Allgemeines Parameter
        -
      1. Hardwarebasiertes Kryptographiemodul
      2. -
      -
    2. -
    3. Parameter für MOA SS
        -
      1. Schlüsselspeicher
          -
        1. Hardware-Schlüsselspeicher
        2. -
        3. Software-Schlüsselspeicher
        4. -
        -
      2. -
      3. Schlüsselgruppe
      4. -
      5. Zuordnung von Schlüsselgruppen zu einem - Kunden
      6. -
      7. Parameter für XML-Signaturen
      8. -
      9. Profil für Transformationen
      10. -
      11. Profil für Signaturumgebung
      12. -
      -
    4. -
    5. Parameter für MOA SP
        -
      1. Zertifikatsvalidierung
          -
        1. Konstruktion des Zertifikatspfads -
            -
          1. Cachen von Zertifikaten
          2. -
          3. Auswertung der Zertifikatserweiterung Authority Information Access
          4. -
          5. Lokalisierung des Zertifikatsspeichers
          6. -
          -
        2. -
        3. Valdierung des Zertifikatspfads -
            -
          1. Gültigkeitsmodell für die Zertifikatskettenprüfung
          2. -
          3. Vertrauensprofile
          4. -
          -
        4. -
        5. Widerrufsprüfung -
            -
          1. Aktivieren - der Widerrufsprüfung
          2. -
          3. Maximales Alter der Widerrufsinformation
          4. -
          5. Reihenfolge der Widerrufsdienste
          6. -
          7. Archivierung von Widerrufsinformationen
          8. -
          9. Manuelle - Konfiguration von Verteilungspunkten für Widerrufsinformationen
          10. -
          -
        6. -
        -
      2. -
      3. Profil für Transformationen
      4. -
      5. Profil für Ergänzungsobjekte
      6. -
      -
    6. -
    -
  4. -
  5. Beispielkonfigurationen -
      -
    1. Minimale Konfiguration für MOA SS
    2. -
    3. Minimale Konfiguration für MOA SP
    4. -
    5. Typische Konfiguration für MOA SP/SS
    6. -
    -
  6. -
-
-

1 Übersicht

-

Dieses Handbuch beschreibt detailliert die Konfigurationsmöglichkeiten für MOA SP/SS. Wenn nicht anders angegeben, beziehen sich die Erläuterungen sowohl auf die Konfiguration des Webservices als auch auf die Konfiguration von MOA SP/SS für den Einsatz als Klassenbibliothek.

-

1.1 Allgemeines

-

1.1.1 Namenskonventionen

-

Folgende Namenraum-Präfixe werden in diesem Handbuch zur Kennzeichnung der Namenräume - von XML-Elementen verwendet:

- - - - - - - - - - - - - - - - - - - - - -
PräfixNamenraum
cfghttp://reference.e-government.gv.at/namespace/moaconfig/20021122#
dsighttp://www.w3.org/2000/09/xmldsig#
moahttp://reference.e-government.gv.at/namespace/moa/20020822#
xshttp://www.w3.org/2001/XMLSchema
-

1.2 Zentrale Konfigurationsdatei

-

Die Konfiguration von MOA SP/SS erfolgt zentral über eine einzige Konfigurationsdatei. Das Format der Konfigurationsdatei ist XML und muss dem Schema MOA-SPSS-config-1.3.xsd entsprechen. Abschnitt 2 erläutert die Konfigurationsmöglichkeiten im Einzelnen.

-

1.2.1 - Aktualisierung auf das Format von MOA SP/SS 1.3

-

Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues, übersichtlicheres Format für die - XML-Konfigurationsdatei.

-

Wenn Sie von einer ä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ügung, mit dem - Sie Ihre Konfigurationsdatei vom bisherigen auf das neue Format migrieren können.

-

Dieses Werkzeug können Sie durch Ausführen des Scripts configtool aus dem Verzeichnis - tools im MOA-Installationsverzeichnis verwenden:

-
configtool c:\pfad\zur\konfiguration\config.alt.xml c:\pfad\zur\konfiguration\config.neu.xml
-

Der erste Parameter für das Script gibt also Pfad und Dateiname der bestehenden, alten Konfigurationsdatei - an, der zweite Parameter Pfad und Dateiname für die zu erzeugende Konfigurationsdatei im neuen Format (Hinweis: - Die Beispielpfade beziehen sich auf Windows-Betriebssysteme; für Unix-Betriebssysteme wählen Sie bitte sinngemäße - Pfade.).

-

1.3 Bekanntmachung der Konfigurationsdatei

-

Die zentrale Konfigurationsdatei von MOA SP/SS wird der Java Virtual Machine, in der MOA SP/SS läuft, durch eine System Property mitgeteilt (wird beim Starten der Java Virtual Machine in der Form -D<name>=<wert> gemacht). Der Name der System Property lautet moa.spss.server.configuration; als Wert der System Property ist der Pfad sowie der Name der Konfigurationsdatei im Dateisystem anzugeben, z.B.

-
moa.spss.server.configuration=C:/Programme/apache/tomcat-4.1.30/conf/moa-spss/moa-spss.config.xml 
-
-

Weitere Informationen zum Bekanntmachen der zentralen Konfigurationsdatei für MOA SP/SS erhalten Sie in Abschnitt 2.1.2.3 des Installationshandbuchs.

-

1.3.1 - Aktualisierung der Konfiguration im laufenden Betrieb

-

Wird MOA SP/SS als Webservice eingesetzt, kann durch Aufrufen einer speziellen URL des Webservice ein erneutes Einlesen der Konfigurationsdatei erzwungen werden. Damit ist es möglich, Änderungen an der Konfigurationsdatei vorzunehmen, und diese Änderungen ohne Neustart des zu Grunde liegenden Servlet Containers in den Betrieb zu übernehmen.

-

Weitere Informationen zum erneuten Einlesen der Konfigurationsdatei im Webservice-Betrieb erhalten Sie in Abschnitt 2.1.2.5 des Installationshandbuchs.

-

1.4 Konfiguration des Loggings

-

MOA SP/SS verwendet als Framework für Logging-Information die Open Source Software log4j. Die Konfiguration der Logging-Information erfolgt nicht direkt durch MOA SP/SS, sondern über eine eigene Konfigurationsdatei, die der Java Virtual Machine durch eine System Property mitgeteilt wird. Der Name der System Property lautet log4j.configuration; als Wert der System Property ist eine URL anzugeben, die auf die log4j-Konfigurationsdatei verweist, z.B.

-

-

log4j.configuration=file:/C:/Programme/apache/tomcat-4.1.30/conf/moa-spss/log4j.properties
- Weitere Informationen zur Konfiguration des Loggings erhalten Sie in Abschnitt 2.1.3 des Installationshandbuchs. -

-

2 Konfigurationsparameter

-

Nachfolgend werden die verfügbaren Konfigurationsparameter der zentralen Konfigurationsdatei im Detail erläutert. Die Reihenfolge der Abhandlung entspricht der Reihenfolge des vorgeschriebenen Auftretens in der Konfigurationsdatei. Für beispielhafte Konfigurationsdateien siehe Abschnitt 3.

-

Muss der Wert eines Konfigurationsparameters eine URL oder eine Pfadangabe sein, und wird als konkreter Wert eine relative URL bzw. ein relativer Pfad angegeben, so wird diese Angabe relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist.

-

2.1 - Allgemeine Parameter

-

2.1.1 Hardwarebasiertes Kryptographiemodul

- - - - - - - - - - - - - -
Namecfg:Common/cfg:HardwareCryptoModule
GebrauchNull mal bis unbeschränkt oft
Erläuterung

Mit diesem Element wird MOA SP bzw. SS die Verfügbarkeit eines Hardware-Kryptographiemoduls - mitgeteilt. Wird ein solches Hardware-Kryptographiemodul konfiguriert, versucht MOA SP/SS das - Hardware-Kryptographiemodul für die Verifikation des Signaturwerts (MOA SP) bzw. für die Berechnung - von Hashwerten (MOA SP und MOA SS) anstatt des standardmäßig konfigurierten Software-Kryptographiemoduls - zu verwenden.

-

Werden mehrere Hardware-Kryptographiemodule konfiguriert, prüft MOA SP/SS entsprechend - der Konfigurationsreihenfolge der Hardware-Kryptographiemodule, ob eines der Module die benötigte - Funktion (Hashwertberechnung, Siganturprüfung) zur Verfügung stellt. Verwendet wird das erste Hardware-Kryptographiemodul, - das ide benötigte Funktion zur Verfügung stellen kann.

-

Das Element weist bis zu drei Kindelemente auf:

-
    -
  • Element cfg:Name: Dieses obligatorische Element vom Typ xs:string enthält - den Dateinamen der DLL (Windows) oder der Shared-Library (Unix), welche die PKCS#11-Schnittstelle - zum Hardware-Kryptographiemodul implementiert; der Wert enthält entweder einen Dateinamen - mit absoluter Pfadangabe oder einen Dateinamen ohne Pfadangabe. Im letzteren Fall wird der Dateiname - relativ zum Suchpfad des Betriebssystems interpretiert.
  • -
  • Element cfg:SlotId: Dieses optionale Element vom Typ xs:string gibt - des Slot der PKCS#11-Schnittstelle an, über den das Hardware-Kryptographiemodul von MOA - SP/SS angesprochen werden soll. Fehlt dieses Attribut, wählt MOA SP/SS selbst einen Slot - aus der Liste der verfügbaren Slots aus.
  • -
  • Element cfg:UserPIN: Dieses obligatorische Element vom Typ xs:string enthält - den PIN-Code zur Freischaltung der Kryptographiefunktionen über die PKCS#11-Schnittstelle - des Hardware-Kryptographiemoduls.
  • -
-

2.2 Parameter für MOA SS

-

2.2.1 Schlüsselspeicher

-

2.2.1.1 Hardware-Schlüsselspeicher

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule
GebrauchNull mal bis unbeschränkt oft; zumindest ein Hardware- (cfg:HardwareKeyModule) oder - Software-Schlüsselspeicher (cfg:SoftwareKeyModule) muss - jedoch vorhanden sein
Erläuterung

Mit diesem Element wird MOA SS die Verfügbarkeit eines Hardware-Schlüsselspeichers mitgeteilt.

-

Das Element weist bis zu vier Kindelemente auf:

-
    -
  • Element cfg:Id: Dieses obligatorische Element vom Typ xs:token enthält - einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der - XML-Konfigurationsdatei eindeutig sein muss. Mit Hilfe dieses Identifikators wird im Konfigurationselement cfg:SignatureCreation/cfg:KeyGroup auf - dieses Konfigurationselement referenziert.
  • -
  • Element cfg:Name: Dieses obligatorische Element vom Typ xs:string enthält - den Dateinamen der DLL (Windows) oder der Shared-Library (Unix), welche die PKCS#11-Schnittstelle - zum Hardware-Schlüsselspeicher implementiert; der Wert enthält entweder einen Dateinamen - mit absoluter Pfadangabe oder einen Dateinamen ohne Pfadangabe. Im letzteren Fall wird der Dateiname - relativ zum Suchpfad des Betriebssystems interpretiert.
  • -
  • Element cfg:SlotId: Dieses optionale Element vom Typ xs:string gibt des - Slot der PKCS#11-Schnittstelle an, über den der Hardware-Schlüsselspeicher von MOA SS - angesprochen werden soll. Fehlt dieses Attribut, wählt MOA SS selbst einen Slot aus der Liste - der verfügbaren Slots aus.
  • -
  • Element cfg:UserPIN: Dieses obligatorische Element vom Typ xs:string enthält - den PIN-Code zur Freischaltung der Schlüsselverwendung über die PKCS#11-Schnittstelle - des Hardware-Schlüsselspeichers.
  • -
-

2.2.1.2 - Software-Schlüsselspeicher

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule
GebrauchNull mal bis unbeschränkt oft; zumindest ein Hardware- (cfg:HardwareKeyModule) oder - Software-Schlüsselspeicher (cfg:SoftwareKeyModule) muss jedoch vorhanden sein
Erläuterung

Mit diesem Element wird MOA SS die Verfügbarkeit eines Software-Schlüsselspeichers in - Form einer PKCS#12-Datei mitgeteilt.

-

Das Element weist drei obligatorische Kindelemente auf:

-
    -
  • Element cfg:Id: Dieses Element vom Typ xs:token enthält einen - frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der XML-Konfigurationsdatei - eindeutig sein muss. Mit Hilfe dieses Identifikators wird im Konfigurationselement cfg:SignatureCreation/cfg:KeyGroup auf - dieses Konfigurationselement referenziert.
  • -
  • Element cfg:Filename: Dieses Element vom Typ xs:string enthält - den Dateinamen der PKCS#12-Datei, die den Software-Schlüsselspeicher repräsentiert. Der - Wert enthält einen Dateinamen mit absoluter oder relativer Pfadangabe. Eine relative Pfadangabe - wird von MOA SS relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale Konfigurationsdatei - gespeichert ist.
  • -
  • Element cfg:Password: Dieses Element vom Typ xs:string enthält - das Passwort zum Entschlüsseln der Inhalte der PKCS#12-Datei.
  • -
-

2.2.2 Schlüsselgruppe

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:KeyGroup
Gebraucheinmal bis unbeschränkt oft
Erläuterung

Mit diesem Element wird in MOA SS eine Schlüsselgruppe definiert. Eine Schlüsselgruppe - ist eine Zusammenfassung von einem oder mehreren privaten Schlüsseln, die in Hardware- bzw. Softwareschlüsselspeichern - (vergleiche Abschnitte 2.2.1.1 bzw. 2.2.1.2) - verwaltet werden. Die Schlüsselgruppe wird vom Kunden von MOA SS über einen eindeutigen Bezeichner - im Request zur Signaturerstellung angesprochen.

-

Sinn der Zusammenfassung von mehreren privaten Schlüsseln zu einer Schlüsselgruppe ist - es, dass MOA SS selbst entscheidet, welcher konkrete Schlüssel aus der Schlüsselgruppe - zur Erstellung der Signatur verwendet wird. Durch die somit mögliche Parallelisierung (mehrere - private Schlüssel werden parallel für Anfragen, die auf die gleiche Schlüsselgruppe - referenzieren) lässt sich der Durchsatz der erstellten Signaturen verbessern.

-

Das Element cfg:SignatureCreation/cfg:KeyGroup hat folgenden Element-Inhalt:

-
    -
  • Element cfg:Id: Dieses obligatorische Element vom Typ xs:token enthält - einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der - XML-Konfigurationsdatei eindeutig sein muss. Mit Hilfe dieses Identifikators wird im Konfigurationselement cfg:SignatureCreation/cfg:KeyGroupMapping auf - dieses Konfigurationselement referenziert. Weiters wird dieser Identifikator im Request zur Erstellung - der Signatur verwendet, um die zu verwendende Schlüsselgruppe anzugeben.
  • -
  • Element cfg:Key: Dieses Element muss zumindest einmal vorkommen. Jedes Element beschreibt - einen der privaten Schlüssel, aus denen sich die Schlüsselgruppe zusammensetzt. Das Element - hat folgenden Element-Inhalt: -
      -
    • Element cfg:KeyModuleId: Dieses Element kommt genau einmal vor. Mit ihm wird - auf einen der konfigurierten Hardware- oder Software-Schlüsselspeicher referenziert. - Sein Textinhalt vom Typ xs:token enthält den Identifikator des Hardware- - oder Software-Schlüsselspeichers, so wie er in cfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule/cfg:Id bzw. cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule/cfg:Id festgelegt - wurde.
    • -
    • Element cfg:KeyCertIssuerSerial: Dieses Element kommt ebenfalls genau einmal - vor. Mit ihm wird ein privater Schlüssel innerhalb des mit cfg:KeyModuleId ausgewählten - Schlüsselspeichers ausgewählt (sowohl Hardware- als auch Softwareschlüsselspeicher - können ja prinzipiell mehr als nur einen einzigen privaten Schlüssel verwalten). - Das Element hat folgenden Element-Inhalt: -
        -
      • Element dsig:X509IssuerName: Dieses Element kommt genau einmal vor. - Sein Textinhalt vom Typ xs:string enthält den Namen des Ausstellers - des Zertifikats für den ausgewählten privaten Schlüssel.
      • -
      • Element dsig:X509SerialNumber: Dieses Element kommt genau einmal vor. - Sein Textinhalt vom Typ xs:integer enthält die Seriennummer des Zertifikats - für den ausgewählten privaten Schlüssel.
      • -
      -
    • -
    -
  • -
-

Um auf einfache Weise für alle in Ihren Schlüsselspeichern enthaltenen privaten Schlüssel - die jeweiligen Werte für dsig:X509IssuerName und dsig:X509SerialNumber zu - erhalten, gehen Sie am besten wie folgt vor:

-
    -
  1. Erfassen Sie in der zentralen Konfigurationsdatei alle Ihre Schlüsselspeicher mit Hilfe - der Konfigurationselemente cfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule bzw. cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule.
  2. -
  3. Starten Sie nun - mit bewusst fehlenden cfg:SignatureCreation/cfg:KeyGroup Elementen - den MOA SP/SS Server. - Stellen Sie dabei sicher, dass das Log-Level für den Logger moa.spss.server zumindest - auf das Niveau info eingestellt ist (Informationen zur Konfiguration des Loggings - von MOA SP/SS finden Sie in Abschnitt - 2.1.3 des Installationshandbuchs). Im Log-File werden dann alle verfügbaren privaten Schlüssel - an Hand der Werte dsig:X509IssuerName und dsig:X509SerialNumber aufgelistet. - Vergleichen Sie den folgenden beispielhaften Auszug:
    -
    INFO | 15 15:10:14,737 | moa.spss.server | TID=startup NID=node1 MSG=Key 
    ID=SKM_Kunde1;CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT;7 -INFO | 15 15:10:14,737 | moa.spss.server | TID=startup NID=node1 MSG=Key - ID=SKM_allgemein;CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT;9
    INFO | 15 15:10:14,737 | moa.spss.server | TID=startup NID=node1 MSG=Key
    ID=SKM_Kunde2;CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT;8
    - Der Wert der Eigenschaft ID des Logging-Eintrags gliedert sich in drei Teile: -
      -
    1. Der erste Teil enthält den Identifikator des Hardware- bzw. Softwareschlüsselspeichers, - so wie er im entsprechenden Konfigurationselement cfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule bzw. cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule erfasst - wurde.
    2. -
    3. Der zweite Teil enthält nach dem ersten Semikolon den Namen des Ausstellers des Zertifikats - für den privaten Schlüssel, so wie er in dsig:X509IssuerName benötigt - wird.
    4. -
    5. Der dritte Teil enthält nach dem zweiten Semikolon die Seriennummer des Zertifikats für - den privaten Schlüssel, so wie er in dsig:X509SerialNumber benötigt wird.
    6. -
    -
  4. -
  5. Erfassen Sie nun mit Hilfe der neu gewonnenen Informationen die Schlüsselgruppen, die in - MOA SS zur Verfügung stehen sollen.
  6. -
-

Wenn Ihnen für einen privaten Schlüssel, den Sie in eine Schlüsselgruppe aufnehmen - wollen, das Zertifikat bekannt ist und es in Form einer DER-kodierten Datei vorliegt, können - Sie alternativ das Script certtool aus dem Verzeichnis tools im MOA-Installationsverzeichnis - verwenden, um zu den Werten für dsig:X509IssuerName und dsig:X509SerialNumber zu - kommen:

-
certtool -info <certfilename>

<certfilename> enthält den Namen der DER-kodierten Zertifikatsdatei, für - die die beiden Werte dsig:X509IssuerName und dsig:X509SerialNumber geliefert - werden sollen. Eine beispielhafte Ausgabe des Scripts sieht wie folgt aus:

-
SubjectDN (RFC2253): 
-  CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=AT
-IssuerDN (RFC2253) : 
-  CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT
Serial Number : - 9

Die Werte für IssuerDN (RFC2253) sowie Serial Number entsprechen - den Werten für dsig:X509IssuerName und dsig:X509SerialNumber.

-

2.2.3 - Zuordnung von Schlüsselgruppen zu Kunden

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:KeyGroupMapping
Gebraucheinmal bis unbeschränkt oft
Erläuterung

Das Element cfg:SignatureCreation/cfg:KeyGroupMapping ordnet einem Kunden von MOA SS die ihm zur Verfügung - stehenden Schlüsselgruppen zu, indem das den Kunden repräsentierende SSL-Clientzertifikat - mit einer oder mehreren Schlüsselgruppen assoziiert wird.

-

Das Element hat folgenden Element-Inhalt:

-
    -
  • Element cfg:CustomerId: Dieses Element bezeichnet auf eindeutige - Weise das den Kunden repräsentierende SSL-Clientzertifikat. Der Aufbau des Elements enspricht - dem Aufbau des Elements cfg:KeyCertIssuerSerial in Abschnitt 2.2.2. - Um zu den Werten für Ausstellername und Seriennummer des SSL-Clientzertifikats zu kommen, - können Sie auch hier das Script certtool (vergleiche Abschnitt 2.2.2) - verwenden.
  • -
  • Element cfg:KeyGroupId: Dieses Element vom Typ xs:token kommt so oft - vor, wie Schlüsselgruppen - einem bestimmten SSL-Clientzertifikat zugeordnet werden sollen, mindestens jedoch einmal. Sein - Wert repräsentiert dem Identifikator der Schlüsselgruppe, so wie er in cfg:SignatureCreation/cfg:KeyGroup/cfg:Id festgelegt - wurde.
  • -
-

Bitte beachten Sie: Für maximal ein Konfigurationselement cfg:SignatureCreation/cfg:KeyGroupMapping kann cfg:CustomerId auch - weggelassen werden. Die darin enthaltenen Schlüsselgruppen stehen dann allen Kunden von MOA - SS gleichermaßen zur Verfügung.

-

2.2.4 Parameter - für XML-Signaturen

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:XMLDSig/cfg:CanonicalizationAlgorithm
GebrauchNull mal oder einmal
Erläuterung

Als Inhalt des Elements kann der Kanonisierungs-Algorithmus, der für das Erstellen von XML-Signaturen verwendet werden soll und in der Signatur als Inhalt von dsig:Signature/dsig:SignedInfo/dsig:CanonicalizationMethod aufscheint, spezifiziert werden. Folgende Werte dürfen verwendet werden:

-

-

http://www.w3.org/TR/2001/REC-xml-c14n-20010315 
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
http://www.w3.org/2001/10/xml-exc-c14n#
http://www.w3.org/2001/10/xml-exc-c14n#WithComments
-

Wird das Element nicht angegeben, wird folgender Wert als Default-Wert verwendet:

-
http://www.w3.org/TR/2001/REC-xml-c14n-20010315  

Für die genaue Bedeutung der Werte siehe die Spezifikation für XML-Signaturen.

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:XMLDSig/cfg:DigestMethodAlgorithm
GebrauchNull mal oder einmal
Erläuterung

Als Inhalt des Elements kann der Digest-Algorithmus, der für das Erstellen von XML-Signaturen verwendet werden soll und in der Signatur als Inhalt von dsig:Signature/dsig:SignedInfo/dsig:Reference/dsig:DigestMethod aufscheint, spezifiziert werden. Folgende Werte dürfen verwendet werden:

-

-

http://www.w3.org/2000/09/xmldsig#sha1
-
-

-

Wird das Element nicht angegeben, wird folgender Wert als Default-Wert verwendet:

-
http://www.w3.org/2000/09/xmldsig#sha1

Für die genaue Bedeutung der Werte siehe die Spezifikation für XML-Signaturen.

-

2.2.5 Profil für Transformationen

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:CreateTransformsInfoProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SS erlaubt die Hinterlegung von vordefinierten Profilen für Transformationen, die im Rahmen - einer XML-Signaturerstellung zur Anwendung kommen sollen. Im Request zur XML-Signaturerstellung - reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die gesamten Transformationen explizit - anzugeben.

-

cfg:CreateTransformsInfoProfile enthält für ein bestimmtes Datenobjekt - für eine zu erstellende XML-Signatur die auf dieses Datenobjekt anzuwendenden Transformationen, - sowie allenfalls für die Durchführung der Transformationen notwendige Ergänzungsobjekte - (z.B. einen zu importierenden Stylesheet für eine XSL-Transformation).

-

cfg:CreateTransformsInfoProfile weist folgende obligatorische Kindelemene auf:

-
    -
  • Element Id: Dieses Element vom Typ xs:token enthält einen frei - wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der XML-Konfigurationsdatei - eindeutig sein muss. Dieser Identifikator wird im Request zur Erstellung der XML-Signatur verwendet, - um das hinterlegte Profil zu referenzieren (vergleiche Element moa:CreateTransformsInfoProfileID).
  • -
  • Element Location: Dieses Element vom Typ xs:anyURI enthält - den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative - oder absolute URI. Eine relative URI - wird von MOA SS als File-URI relativ zum Lage jenes Verzeichnisses interpretiert, in dem die zentrale - Konfigurationsdatei gespeichert ist. Die XML-Datei muss als Wurzelelement das Element moa:CreateTransformsInfoProfile - enthalten.
  • -
-

2.2.6 Profil für Signaturumgebung

- - - - - - - - - - - - - -
Namecfg:SignatureCreation/cfg:CreateSignatureEnvironmentProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SS erlaubt die Hinterlegung von vordefinierten Profilen für die Signaturumgebung, - die im Rahmen einer XML-Signaturerstellung zur Anwendung kommen soll. Im Request zur XML-Signaturerstellung - reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die Informationen zur Signaturumgebung - explizit anzugeben.

-

cfg:CreateSignatureEnvironmentProfile enthält für eine zu erstellende XML-Signatur, - die in ein bereits bestehendes XML-Dokument integriert werden soll, die Stelle, an der die XML-Signatur - eingefügt werden soll, sowie allenfalls für die Verarbeitung des bestehenden XML-Dokuments - notwendige Ergänzungsobjekte (z.B. ein XML-Schema für das validierende Parsen des bestehenden - XML-Dokuments).

-

cfg:CreateSignatureEnvironmentProfile weist folgende obligatorische Kindelemene - auf:

-
    -
  • Element Id: Dieses Element vom Typ xs:token enthält - einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der - XML-Konfigurationsdatei eindeutig sein muss. Dieser Identifikator wird im Request zur Erstellung - der XML-Signatur verwendet, um das hinterlegte Profil zu referenzieren (vergleiche Element moa:CreateSignatureEnvironmentProfileID).
  • -
  • Element Location: Dieses Element vom Typ xs:anyURI enthält - den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative - oder absolute URI. Eine relative URI wird von MOA SS als File-URI relativ zum Lage jenes Verzeichnisses - interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist. Die XML-Datei muss als - Wurzelelement das Element moa:CreateSignatureEnvironmentProfile enthalten.
  • -
-

2.3 - Parameter für MOA SP

-

2.3.1 - Zertifikatsvalidierung

-

2.3.1.1 - Konstruktion des Zertifikatspfads

-
2.3.1.1.1 Cachen von Zertifikaten
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction/cfg:AutoAddCertificates
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob Zertifikate, die in einer - zu prüfenden - Signatur enthalten sind bzw. bei der Zertifikatspfaderstellung durch Auswertung der Zertifikatserweiterung Authority - Information Access (siehe - auch Parameter cfg:UseAuthorityInfoAccess) aus dem Internet geladen werden, automatisch - in den lokalen Zertifikatsspeicher (siehe Abschnitt x.y.z) hinzugefügt werden sollen.

-

Zulässige Werte für diesen Parameter sind true oder false.

-
-
2.3.1.1.2 Auswertung - der Zertifikatserweiterung Authority Information Access -
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction/cfg:UseAuthorityInfoAccess
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob die Zertifikatserweiterung Authority - Information Access für die Zertifikatspfaderstellung verwendet werden soll. Wird der - Wert auf true gesetzt, dann setzt MOA auch den Parameter cfg:AutoAddCertificate automatisch - auf true und ignoriert den gegebenenfalls in der Konfigurationsdatei dafür gesetzten - Wert.

-

Zulässige Werte für diesen Parameter sind true oder false.

-
2.3.1.1.3 Lokalisierung - des Zertifikatsspeichers
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction/cfg:CertificateStore/cfg:DirectoryStore/cfg:Location
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:token gibt ein Verzeichnis im lokalen Dateisystem - an, das von MOA als lokaler Zertifikatsspeicher verwendet werden soll. -Zulässige Werte für diesen Parameter sind absolute oder relative Pfadangaben, wobei relative Pfadangaben -als relativ zum Pfad jenes Verzeichnisses interpretiert werden, in dem die zentrale - Konfigurationsdatei gespeichert ist. Beispiele für zulässige Werte lauten:

-
C:/Programme/apache/tomcat-4.1.30/conf/moa-spss/certstore
-
certstore
-

2.3.1.2 - Valdierung des Zertifikatspfads

-
2.3.1.2.1 Gültigkeitsmodell - für die Zertifikatskettenprüfung
- - - - - - - - - - - - - -
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:PathValidation/cfg:ChainingMode
Gebrauchgenau einmal
Erläuterung

Dieses Element legt fest, ob MOA SP für die Prüfung der Gültigkeit - einer konstruierten Zertifikatskette das Kettenmodell aus ISIS-MTT oder das Schalenmodell aus dem PKIX - RFC 3280 verwenden soll. Es hat folgende Kindelemente:

-
    -
  • cfg:DefaultMode: Dieses obligatorische Element gibt das Default-Modell für die Prüfung - der Gültigkeit einer konstruierten Zertifikatskette an. Gültige Werte sind chaining (Kettenmodell) - oder pkix (Schalenmodell).
  • -
  • cfg:TrustAnchor: Dieses Element kann beliebig oft (auch gar nicht) verwendet - werden, um für bestimmte Vertrauensanker (vergleiche nächsten Parameter cfg:TrustProfile) - Ausnahmen vom Default-Modell vorzugeben. - Das Element weist folgende Kindelemente auf: -
      -
    • cfg:Identification: Dieses obligatorische Element identifiziert den Vertrauensanker, - für den ein bestimmtes Modell konfiguriert werden soll. Es entspricht vom Aufbau jenem - von cfg:KeyCertIssuerSerial in - Abschnitt 2.2.2. Um zu den Werten für - Ausstellername und Seriennummer des Vertrauensankers zu kommen, können Sie auch hier - das Script certtool (vergleiche Abschnitt 2.2.2) - verwenden.
    • -
    • cfg:Mode: Dieses obligatorische Element vom Typ xs:string gibt - jenes Modell an, das von MOA SP für die - Prüfung von konstruierten Zertifikatsketten zu verwenden ist, die im mittels cfg:Identification/dsig:X509IssuerName und cfg:Identification/dsig:X509SerialNumber angegebenen - Vertrauensanker münden. Gültige Werte sind chaining (Kettenmodell) - oder pkix (Schalenmodell).
    • -
    -
  • -
-
2.3.1.2.2 Vertrauensprofile
- - - - - - - - - - - - - -
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:PathValidation/cfg:TrustProfile
Gebraucheinmal bis unbeschränkt oft (zumindest ein Vertrauensprofil muss vorhanden sein)
Erläuterung

Das Element cfg:TrustProfile wird dazu verwendet, um in MOA SP ein Vertrauensprofil - für die Signaturprüfung einzurichten. Ein Vertrauensprofil besteht aus einer Menge von Vertrauensankern - und einer optionalen Menge von explizit erlaubten Signatorzertifikaten.

-

Ein Vertrauensanker ist ein CA-Zertifikat, das explizit als vertrauenswürdig eingestuft wird. - MOA SP versucht bei der Konstruktion einer Zertifikatskette, einen Pfad vom Signatorzertifikat bis - hin zu einem der konfigurierten Vertrauensanker zu finden. Gelingt dies, wird auch das Signatorzertifikat - als vertrauenswürdig betrachtet, ansonsten nicht.

-

Wird neben der Menge von Vertrauensankern auch noch eine Menge von explizit erlaubten Signatorzertifikaten - angegeben, prüft MOA SP nicht nur, ob sich ein Pfad vom Signatorzertifikat zu einem konfigurierten - Vertrauensanker konstruieren lässt, sondern darüber hinaus auch noch, ob das Signatorzertifikat - aus der zu prüfenden Signatur in der Menge der explizit erlaubten Signatorzertifikate vorkommt. - Explizit erlaubte Signatorzertifikate sollten Sie dann konfigurieren, wenn nicht allen von einer - als Vertrauensanker konfigurierten CA ausgestellten Zertifikaten vertraut werden soll, sondern nur - ganz bestimmten Zertifikaten dieser CA.

-

In MOA SP können beliebig viele solcher Vertrauensprofile konfiguriert werden. Der Kunde von - MOA SP gibt im Request zur Signaturprüfung an, gegen welches Vertrauensprofil MOA SP die Zertifikatsprüfung - vornehmen soll.

-

Das Element cfg:TrustProfile weist folgende Kindelemente - auf:

-
    -
  • Id: Dieses obligatorische Element vom Typ xs:token enthält einen - frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der XML-Konfigurationsdatei - eindeutig sein muss. Dieser Identifikator wird im Request zur Signaturprüfung verwendet, um - das zu verwendende Vertrauensprofil auszuwählen.
  • -
  • Element TrustAnchorsLocation: Dieses obligatorische Element vom Typ xs:anyURI enthält - eine relative oder absolute URL, die ein Verzeichnis im lokalen Dateisystem referenziert. - Eine relative URL wird relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale - Konfigurationsdatei gespeichert ist. Eine absolute URL muss als Protokoll-Teil file verwenden. - Das referenzierte Verzeichnis muss eine oder mehrere DER-kodierte Zertifikatsdateien beinhalten. - Jede Zertifikatsdatei repräsentiert einen Vertrauensanker.
  • -
  • Element SignerCertsLocation: Dieses optionale Element vom Typ xs:anyURI enthält - eine relative oder absolute URL, die ein Verzeichnis im lokalen Dateisystem referenziert. Eine - relative URL wird relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale Konfigurationsdatei - gespeichert ist. Eine absolute URL muss als Protokoll-Teil file verwenden. Das referenzierte - Verzeichnis muss eine oder mehrere DER-kodierte Zertifikatsdateien beinhalten. Jede Zertifikatsdatei - repräsentiert ein explizit erlaubtes Signatorzertifikat.
  • -
-

2.3.1.3 - Widerrufsprüfung

-
2.3.1.3.1 Aktivieren - der Widerrufsprüfung
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:EnableChecking
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob bei der Zertifikatsüberprüfung im Zuge einer Signaturprüfung auch der - Zertifikatsstatus jedes einzelnen Zertifikats des gebildeten Zertifikatspfads überprüft werden - soll.

-

Bitte beachten Sie: Die Widerrufsprüfung ist ein sehr wichtiger Schritt der - Zertifikatsüberprüfung und somit der Signaturprüfung. Eine Deaktivierung sollte nur - in begründeten Ausnahmefällen in Erwägung gezogen werden, z.B. für Testsituationen.

-

Zulässige Werte für diesen Parameter sind true oder false.

-
2.3.1.3.2 - Maximales Alter der Widerrufsinformation
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:MaxRevocationAge
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:integer gibt an, wie aktuell eine ggf. lokal - gespeicherte Widerrufsinformation sein muss, damit sie von MOA SP als gültig angesehen wird. Ist - die lokal gespeicherte Widerrufsinformation nicht aktuell genug, wird sie von MOA SP erneut aus dem - Internet geladen.

-

Dieser Parameter wird nur ausgewertet, wenn die Widerrufsprüfung aktiviert ist (siehe Parameter cfg:EnableChecking).

-

Zulässige Werte für diesen Parameter sind ganze Zahlen:

-
    -
  • Ein beliebiger negativer Wert bedeutet, dass eine Widerrufsinformation jedes Mal, wenn sie benötigt - wird, neu aus dem Internet geladen wird.
  • -
  • Der Wert 0 bedeutet, dass eine Widerrufsinformation dann neu geladen wird, wenn - das Datum im Feld nextUpdate der entsprechenden Widerrufsliste bereits überschritten - ist.
  • -
  • Ein positiver Wert gibt gibt die Zeitspanne in Millisekunden an, nach der eine ggf. vorhandene - lokale Widerrufsinformation spätestens durch erneutes Laden aus dem Internet aktualisiert - wird.
  • -
-
2.3.1.3.3 - Reihenfolge der Widerrufsdienste
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:ServiceOrder
GebrauchNull mal oder einmal
Erläuterung

Dieses Element gibt an, in welcher Reihenfolge MOA SP die Widerrufsdienste für die Prüfung des - Widerrufs für ein Zertifikat kontaktieren soll, wenn für das Zertifikat mehrere unterschiedliche Widerrufsdienste - (CRL, OCSP) verfügbar sind. Das Element weist folgendes Kindelement auf:

-
    -
  • cfg:Service: Dieses Element vom Typ xs:token muss genau zwei mal vorkommen. Gütlige Werte für den - Textinhalt des Elements sind OCSP und CRL. Damit kann entweder die Reihenfolge (CRL, OCSP) oder (OCSP, - CRL) festgelegt werden.
  • -

Wird das Element nicht angegeben, so lautet die von MOA SP dann verwendete Default-Reihenfolge (CRL, - OCSP).

-
2.3.1.3.4 - Archivierung von Widerrufsinformationen
- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving/cfg:EnableArchiving
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob mittlerweile ungültig - gewordene (i.e. historische) CRL-Widerrufsinformationen von MOA SP archiviert werden soll.

-

Wird dieser - Parameter auf den Wert true gesetzt, muss auch der Parameter cfg:Archive (siehe - unten) angegeben werden. Zulässige Werte für diesen Parameter sind true oder false.

- - - - - - - - - - - - - - -
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving/cfg:ArchiveDuration
GebrauchNull mal oder einmal
Erläuterung

Dieses Element vom Typ xs:nonNegativeInteger gibt (in Tagen) an, wie lange Widerrufsinformationen - von MOA SP archiviert werden müssen. Das Element wird von MOA SP nur dann ausgewertet, wenn der - Konfigurationsparameter cfg:EnableArchiving auf - true gesetzt ist.

-

Wird das Element nicht angegeben, so verwendet MOA SP den Default-Wert von 365 Tagen.

- - - - - - - - - - - - - -
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving/cfg:Archive
GebrauchNull mal oder einmal
Erläuterung

Dieses Element gibt an, welches Archiv MOA SP zur Archivierung von mittlerweile ungültig - gewordene (i.e. historische) CRL-Widerrufsinformationen verwenden soll, falls der Konfigurationsparameter cfg:EnableArchiving auf - true gesetzt ist. Es muss angegeben werden, wenn der - Konfigurationsparameter cfg:EnableArchiving auf true gesetzt ist. Das Element weist folgendes - Kindelement auf:

-
    -
  • cfg:DatabaseArchive: Dieses obligatorische Element dient zur Angabe der notwendigen - Informationen für die Benutzung eines datenbankbasierten CRL-Archivs durch MOA SP. Das Datenbankarchiv - ist die einzige derzeit unterstützte Archivform. Das Element weist folgende Kindelemente auf: -
      -
    • cfg:JDBCURL: Dieses obligatorische Element vom Typ xs:anyURI gibt - die JDBC-URL zu jener Datenbank an, in der MOA historische Widerrufsinformationen archivieren - soll. Der genaue Aufbau der JDBC-URL ist abhängig von der verwendeten Datenbank. Im Fall von - PostgreSQL kann folgende URL verwendet werden: -
      jdbc:postgresql://<host>/<moadb>?user=<moauser>&amp;password=<moapassword>
      -

      Die Platzhalter <host>, <moadb>, <moauser> und <moapassword> müssen - dabei an die tatsächlich verwendete Datenbank angepasst werden.

      -

      Bitte beachten Sie: Die Kodierung des Zeichens "&" als "&amp;" ist - erforderlich, da es andernfalls zu einem Validierungsfehler beim Parsen der XML-Konfigurationsdatei - durch MOA kommen würde.

      -

      Bitte beachten Sie: MOA SP legt eigenständig eine passende Tabelle in der angegebenen - Datenbank an und befüllt diese dann in weiterer Folge. Der in der JDBC-URL angegebene Benutzer - muss mit den dazu passenden Rechten ausgestattet sein.

      -
    • -
    • cfg:JDBCDriverClassName: Dieses obligatorische Element vom Typ xs:token gibt den - vollständig - qualifizierten Java-Klassennamen des JDBC-Treibers an, der von MOA SP zur Ansprache der für - die CRL-Archivierung zu verwendenden Datenbank benützt werden soll.

      -

      Bitte beachten Sie: Informationen zum Anlegen einer Datenbank in postgreSQL finden Sie in Abschnitt - 2.2.2.1 des Installationshandbuchs.

      -
    • -
    -
  • -
-
2.3.1.3.5 - Manuelle Konfiguration von Verteilungspunkten für Widerrufsinformationen
- - - - - - - - - - - - - -
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:DistributionPoint
GebrauchNull mal bis unbeschränkt oft
Erläuterung

Das Element cfg:CRLDistributionPoint kann dazu verwendet werden, manuelle - Verteilungspunkte für Widerrufsinformationen einer bestimmten CA zu konfigurieren.

-

Dies macht für veraltete Zertifikate Sinn, die nicht den aktuellen Vorgaben aus dem PKIX RFC 3280 entsprechen und im Zertifikat selbst keine Zertifikatserweiterung mit einem solchen Verteilungspunkt enthalten.

-

Weiters kann diese manuelle Konfiguration verwendet werden, wenn die in einem Zertifikat enthaltenen Verteilungspunkte für eine bestimmte CA durch einen manuellen Eintrag überschrieben werden soll (etwa weil die im Zertifikat enthaltenen Verteilungspunkte in Form von ldap-URLs angegeben sind, MOA SP aber der Zugriff auf ldap-URLs per Firewall-Einstellungen untersagt ist; dann könnte man stattdessen manuell eine (lokale) http-URL als Verteilungspunkt angeben, die von MOA SP dann aufgelöst werden kann).

-

Das Element weist folgende Kind-Elemente auf:

-
    -
  • Element cfg:CAIssuerDN: Dieses Element enthält als Textinhalt vom Typ xs:string den - Namen jener CA, die das Zertifikat ausgestellt hat, dessen Widerruf mit Hilfe des zu konfigurierenden - Verteilungspunktes geprüft werden soll. Um zu diesem Wert zu kommen, können Sie auch - hier das Script certtool (vergleiche Abschnitt 2.2.2) - verwenden, in dem Sie es für das Zertifikat anwenden, dessen Widerruf mit Hilfe des zu konfigurierenden - Verteilungspunktes geprüft werden soll.
  • -
  • Element cfg:CRLDP: Dieses Element verweist auf einen Verteilungspunkt, an dem eine - Widerrufsliste abgeholt werden kann. Es weist folgende Kind-Elemente auf: -
      -
    • Element cfg:Location: Der Wert dieses obligatorischen Elements vom Typ xs:anyURI enthält - die URL für den zu konfigurierenden Verteilungspunkt. Es werden die Protokolle HTTP, HTTPS - und LDAP unterstützt.
    • -
    • Element cfg:ReasonCode: Dieses Element vom Typ xs:token kann - null mal bis unbeschränkt - oft vorkommen und enthält - jeweils einen laut PKIX RFC 3280 möglichen Grund eines Widerrufs, - für - welche die über den zu konfigurierenden Verteilungspunkt zu beziehende Widerrufsliste - ausgestellt ist. Gültige Gründe sind unused, keyCompromise, cACompromise, affiliationChanged, superseded, cessationOfOperation, certificateHold, privilegeWithdrawn und aACompromise. - Wird eine Widerrufsliste für mehrere Gründe ausgestellt, muss also das Element cfg:ReasonCode mehrmals - angegeben werden. Wird das Element null mal angegeben, gilt der Verteilungspunkt für alle möglichen - Widerrufsgründe.
    • -
    -
  • -
  • Element cfg:OCSPDP: Dieses Element verweist auf einen Verteilungspunkt, an dem die - Widerrufsinformation von einem OCSP-Responder bezogen werden kann. Es weist folgendes Kind-Element - auf: -
      -
    • -
    - Element cfg:Location: Der Wert dieses obligatorischen Elements vom Typ xs:anyURI enthält - die URL für den zu konfigurierenden Verteilungspunkt. Es werden die Protokolle HTTP, HTTPS und - LDAP unterstützt.
  • -
-

Hinweis: Die Elemente cfg:CRLDP bzw. cfg:OSCPDP können beliebig oft als Kinder von cfg:CRLDistributionPoint angegeben - werden. Die Reihenfolge spielt dabei keine Rolle. Jedenfalls muss aber eines dieser beiden Elemente - angegeben werden.

- -

2.3.2 Profil für Transformationen

- - - - - - - - - - - - - -
Namecfg:SignatureVerification/cfg:VerifyTransformsInfoProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SP erlaubt die Hinterlegung eines vordefinierten Profils für eine erlaubte Transformationsfolge, - deren Einhaltung im Rahmen einer XML-Signaturprüfung kontrolliert wird. Im Request - zur XML-Signaturprüfung reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die - gesamten Transformationen explizit anzugeben.

-

cfg:VerifyTransformsInfoProfile enthält für ein bestimmtes Datenobjekt für - eine zu prüfende XML-Signatur eine - für dieses Datenobjekt erlaubte Transformationsfolge, bestehend aus den anzuwendenden Transformationen, - sowie allenfalls für die Durchführung der Transformationen erlaubte implizite Transformationsparameter - (z.B. einen zu importierenden Stylesheet für eine XSL-Transformation).

-

cfg:VerifyTransformsInfoProfile weist folgende obligatorische Kindelemene - auf:

-
    -
  • Element Id: Dieses Element vom Typ xs:token enthält - einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der - XML-Konfigurationsdatei eindeutig sein muss. Dieser Identifikator wird im Request zur Prüfung - der XML-Signatur verwendet, um das hinterlegte Profil zu referenzieren (vergleiche Element moa:VerifyTransformsInfoProfileID).
  • -
  • Element Location: Dieses Element vom Typ xs:anyURI enthält - den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative - oder absolute URI. Eine relative URI wird von MOA SP als File-URI relativ zum Lage jenes Verzeichnisses - interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist. Die XML-Datei muss als - Wurzelelement das Element moa:VerifyTransformsInfoProfile enthalten.
  • -
-

2.3.3 Profil für Ergänzungsobjekte

- - - - - - - - - - - - - -
Namecfg:SignatureVerification/cfg:SupplementProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SS erlaubt die Hinterlegung eines vordefinierten Profils für ein Ergänzungsobjekt, - das im Rahmen einer XML-Signaturprüfung verwendet werden soll. Im Request zur XML-Signaturprüfung reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die Informationen zur Signaturumgebung - explizit anzugeben.

-

cfg:SupplementProfile enthält für ein Datenobjekt in der zu prüfenden - XML-Signatur ein allenfalls für die Durchführung der vorgegebenen Transformationen notwendiges - Ergänzungsobjekt (z.B. einen zu importierenden Stylesheet für eine XSL-Transformation).

-

cfg:SupplementProfile weist folgende obligatorische Kindelemene auf:

-
    -
  • Element Id: Dieses Element vom Typ xs:token enthält - einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der - XML-Konfigurationsdatei eindeutig sein muss. Dieser Identifikator wird im Request zur Prüfung - der XML-Signatur verwendet, um das hinterlegte Profil zu referenzieren (vergleiche Element moa:SupplementProfileID).
  • -
  • Element Location: Dieses Element vom Typ xs:anyURI enthält - den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative - oder absolute URI. Eine relative URI wird von MOA SP als File-URI relativ zum Lage jenes Verzeichnisses - interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist. Die XML-Datei muss als - Wurzelelement das Element moa:SupplementProfile enthalten.
  • -
-

3 Beispielkonfigurationen

-

3.1 Minimale Konfiguration für MOA SS

-

Nachfolgend finden Sie eine zentrale Konfigurationsdatei mit den minimal notwendigen Einträgen für - den alleinigen Betrieb von MOA SS. Darin sind als Kinder des Wurzelelements cfg:MOAConfiguration folgende - Konfigurationselemente enthalten:

-
    -
  • Ein Software-Schlüsselspeicher (cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule);
  • -
  • Eine Schlüsselgruppe (cfg:SignatureCreation/cfg:KeyGroup);
  • -
  • Eine Zuordnung dieser Schlüsselgruppe für einen bestimmten Kunden (cfg:SignatureCreation/cfg:KeyGroupMapping).
  • -
-

Minimale Konfiguration für MOA SS

-

3.2 Minimale Konfiguration für MOA SP

-

Nachfolgend finden Sie eine zentrale Konfigurationsdatei mit den minimal notwendigen Einträgen für - den alleinigen Betrieb von MOA SP. Darin sind als Kinder des Wurzelelements cfg:MOAConfiguration folgende - Konfigurationselemente enthalten:

-
    -
  • Einstellungen betreffend die Konstruktion des Zertifikatspfades (cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction);
  • -
  • Einstellungen betreffend die Validierung des Zertifikatspfades (cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathValidation), - unter anderem ein Vertrauensprofil (cfg:TrustProfile);
  • -
  • Einstellungen betreffend die Widerrufsprüfung von Zertifikaten des Zertifikatspfades (cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking) .
  • -
-

Minimale Konfiguration für MOA SP

-

3.3 Typische Konfiguration für MOA SP/SS

-

Nachfolgend finden Sie eine typische zentrale Konfigurationsdatei mit Einträgen für den kombinierten Betrieb von MOA SP und SS. Diese Datei wird auch als Konfiguration von MOA SP und SS verwendet, die für das Ausführen der Beispiele des Anwenderhandbuchs notwendig ist.

-

Typische Konfiguration für MOA SP/SS

-

 

- - diff --git a/spss.handbook/handbook/faq/faq.html b/spss.handbook/handbook/faq/faq.html deleted file mode 100644 index 74f26e70a..000000000 --- a/spss.handbook/handbook/faq/faq.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - MOA SS und SP - FAQ - - - - - - - - - -
Logo BKAOpen Source
- für das E-Government
Logo MOA
-
-

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

-

FAQ

-
-

Inhalt

-
    -
  1. -

    Allgemeines

    -
  2. -
  3. -

    Übersicht der Fragen

    -
  4. -
  5. -

    Antworten

    -
  6. -
-
-

1 Allgemeines

-

Dieses Dokument enthält eine Reihe von häufig gestellten Fragen zu Installation, Konfiguration und Verwendung von MOA Serversignatur (SS) und Signaturprüfung (SP).

-

2 Übersicht der Fragen

-

Installation

-
    -
  1. Beim Starten von MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: iaik.asn1.structures.Name. Was kann der Fehler sein? [Zur Antwort]
  2. -
  3. Ich möchte MOA SS/SP in einer Umgebung betreiben, die einen Internet-Zugang nur über einen Proxy erlaubt. Funktioniert das? [Zur Antwort]
  4. -
-

Konfiguration

-
    -
  1. Ich möchte gerne die CRL-Archivierung von MOA verwenden, möchte aber eine andere als die in der Konfiguration erwähnte postgreSQL-Datenbank verwenden. Geht das? [Zur Antwort]
  2. -
  3. Ich möchte ein Zertifikat (z.B. einer Zwischen-Zertifizierungsstelle) manuell in den internen Zertifikatsspeicher von MOA SP importieren. Wie funktioniert das? [Zur Antwort]
  4. -
  5. Meine bestehende Konfigurationsdatei funktioniert mit MOA SP/SS 1.3 oder höher nicht mehr. Was ist passiert? - [Zur Antwort]
  6. -
-

Verwendung

-
    -
  1. Bei der Prüfung einer Signatur liefert die Prüfung des Zertifikatsstatus den Code 1. Was kann der Fehler sein? [Zur Antwort]
  2. -
-

3 Antworten

-

Installation

-
    -
  1. Beim Starten von MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: iaik.asn1.structures.Name. Was kann der Fehler sein?
    -

    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ü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ützt, wird PKCS7.getCertificate() verwendet, und es kommt zu einer ClassCastException.

    -

    Wird MOA ü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ö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üssen die Einträge

    -
     security.provider.1=sun.security.provider.Sun
    -   security.provider.2=com.sun.rsajca.Provider 
    -

    durch folgenden Eintrag ergänzt werden:

    -
    security.provider.3=iaik.security.provider.IAIK
    -
  2. -
  3. -
    Ich möchte MOA SS/SP in einer Umgebung betreiben, die einen Internet-Zugang nur über einen Proxy erlaubt. Funktioniert das?
    -

    Ja, zumindest für Zugriffe über HTTP. Sie müssen dazu die nachfolgenden JAVA System-Properties setzen:

    -
    http.proxyHost=<proxyhost>
    -http.proxyPort=<proxyport>
    -http.nonProxyHosts="<exceptionhosts>"
    -

    <proxyhost> gibt den Namen oder die IP-Adresse des Proxies an.

    -

    <proxyport> gibt den Port des Proxies an.

    -

    <exceptionhosts> enthält eine Liste von Rechnernamen, die nicht über den Proxy laufen sollen. Jedenfalls müssen sie hier localhost angeben. Einzelne Namen sind durch eine Pipe (|) zu trennen. Bitte beachten Sie, dass IP-Addressen nicht angegeben werden dürfen, sowie die verpflichtend zu verwendenen Anführungszeichen.
    -

    -
  4. -
-

Konfiguration

-
    -
  1. Ich möchte gerne die CRL-Archivierung von MOA verwenden, möchte aber eine andere als die in der Konfiguration erwähnte postgreSQL-Datenbank verwenden. Geht das?
    -

    Ja, das ist möglich. Wenn Sie eine mySQL-Datenbank verwenden möchten, sind folgende Maßnahmen zu treffen:

    -
      -
    • Laden Sie den mySQL-JDBC-Connector herunter und fügen Sie das im Download enthaltene jar-File mysql-connector-java-3.x.x-stable-bin.jar zum Klassenpfad für MOA SPSS hinzu.
    • -
    • Geben Sie im MOA-Konfigurationsfile mit Hilfe des generischen Konfigurationsparameters DataBaseArchiveParameter.JDBCUrl eine gültige JDBC-URL zu Ihrer mySQL-Datenbank angeben. Hinweise zum Format dieser URL für mySQL finden Sie hier.
    • -
    -

    Wenn Sie eine andere Datenbank verwenden möchten, beispielsweise Oracle, gehen Sie sinngemäß wie oben vor und setzen zusätzlich noch folgenden Schritt:

    -
      -
    • Geben Sie im MOA-Konfigurationsfile mit Hilfe des generischen Konfigurationsparameters DataBaseArchiveParameter.JDBCDriverClass den vollständig qualifizierten Klassennamen des JDBC-Treibers an, der die Verbindung zu Ihrer Datenbank herstellt.
    • -
    -
  2. -
  3. -
    Ich möchte ein Zertifikat (z.B. einer Zwischen-Zertifizierungsstelle) manuell in den internen Zertifikatsspeicher von MOA SP importieren. Wie funktioniert das?
    -

    Sie können für diesen Zweck ein mit MOA SP/SS mitgeliefertes Kommandozeilen-Tool verwenden, das Sie im Verzeichnis $MOA_SPSS_INST/tools finden. Wechseln Sie zu diesem Verzeichnis und rufen Sie die Script-Datei certtools.bat bzw. certtools.sh (je nach Betriebssystem) auf. Achten Sie darauf, dass die Umgebungsvariable $JAVA_HOME korrekt gesetzt ist. Die Syntax für dieses Tool lautet:

    -
    certtool -add <cert> <store>
    -

    <cert> bezeichnet dabei Pfad und Dateiname des zu importierenden X509-Zertifikats. Das Zertifikat muss DER-kodiert vorliegen.

    -

    <store> bezeichnet den Pfad des internen Zertifikatsspeichers von MOA SP. Wenn Sie nach der Installationsanleitung vorgegangen sind, lautet dieser Pfad $CATALINA_HOME/conf/moa-spss/certstore.

    -
  4. -
  5. -
    - Meine bestehende Konfigurationsdatei - funktioniert mit MOA SP/SS 1.3 oder höher nicht mehr. Was ist passiert?
    -

    Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues, übersichtlicheres Format für die - XML-Konfigurationsdatei.

    -

    Wenn Sie von einer ä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ügung, mit - dem Sie Ihre Konfigurationsdatei vom bisherigen auf das neue Format migrieren können.

    -

    Informationen zur Verwendung des Werkzeugs finden Sie in Abschnitt 1.2.1 des Konfigurationshandbuchs.

    -
  6. -
-

Verwendung

-
    -
  1. Bei der Prüfung einer Signatur liefert die Prüfung des Zertifikatsstatus den Code 1. Was kann der Fehler sein?
    -

    Dieser Fehlercode bedeutet: Es konnte keine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konstruiert werden. Das kann grundsätzlich eine der beiden folgenden Ursachen haben:

    -
      -
    • Keines der Zertifikate in der Kette vom Signatorzertifikat bis zu einem selbstsignierten Wurzelzertifikat ist im anzuwendenden TrustProfile enthalten.
    • -
    • Die Zertifikatskette konnte nicht bis zu einem im anzuwendenden TrustProfile enthaltenen vertrauenswürdigen Zertifikat gebildet werden.
    • -
    -

    Prüfen Sie also zunächst, ob sie im anzuwendenden TrustProfile ein passendes vertrauenswü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.

    -

    Wenn diese Prüfung das Problem nicht behebt, gelingt des MOA SP vermutlich nicht, ein für die Bildung der Zertifikatskette notwendiges Zertifikat zu lokalisieren. Mögliche Gründe sowie Lösungsmöglichkeiten dafür sind:

    -
      -
    • Das aktuell letzte Zertifikat in der bereits gebildeten Zertifikatskette besitzt zwar die Zertifikatserweiterung AuthorityInformationAccess mit einem Hinweis auf das nächste Zertifikat der zu bildenden Kette, das darin per URL referenzierte Zertifikat kann jedoch nicht geladen werden. Prüfen Sie daher zunächst, ob MOA SP/SS per HTTP oder LDAP Zugriffe nach außen tätigen darf.
    • -
    • Das aktuell letzte Zertifikat in der bereits gebildeten Zertifikatskette besitzt keine Zertifikatserweiterung AuthorityInformationAccess mit einem Hinweis auf das nächste Zertifikat der zu bildenden Kette, und auch im internen Zertifikatsspeicher von MOA SP ist das nächste Zertifikat nicht enthalten. Ist Ihnen das nächste Zertifikat bekannt (z.B. durch manuellen Download von der Webseite des Zertifizierungsdiensteanbieters), können Sie es manuell in den internen Zertifikatsspeicher importieren. Eine Anleitung dazu finden Sie hier.
      -
    • -
    -
  2. -
- - diff --git a/spss.handbook/handbook/index.html b/spss.handbook/handbook/index.html deleted file mode 100644 index 4fa5728f6..000000000 --- a/spss.handbook/handbook/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - MOA SS und SP - Übersicht - - - - - - - - - -
Logo BKAOpen Source
- für das E-Government
Logo MOA
-
-

MOA: Serversignatur (SS) und Signaturprüfung (SP)

-

Übersicht zur Dokumentation der Version 1.2

-
-
-
Einführung
-
Übersicht über die beiden Module.
-
Installation
-
Detaillierte Anleitung für die Installation.
-
Konfiguration
-
Erläuterung aller Konfigurationsoptionen sowie Leitfaden für häufige Konfigurationsaufgaben.
-
Anwendung
-
Beispiele zur Verwendung der beiden Module.
-
FAQ
-
Häufig gestellte Fragen zu Installation, Konfiguration und Anwendung.
-
- - diff --git a/spss.handbook/handbook/install/install.html b/spss.handbook/handbook/install/install.html deleted file mode 100644 index eb287ee8a..000000000 --- a/spss.handbook/handbook/install/install.html +++ /dev/null @@ -1,486 +0,0 @@ - - - - - MOA SS und SP - Installation - - - - - - - - - -
Logo BKAOpen Source
- für das E-Government
Logo MOA
-
-

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

-

Installation

-
-

Inhalt

-
    -
  1. -

    Übersicht

    -
  2. -
  3. -

    Webservice

    -
      -
    1. Basisinstallation -
        -
      1. Einführung
      2. -
      3. Installation -
          -
        1. Vorbereitung
        2. -
        3. Konfiguration von Apache Tomcat -
            -
          1. Konfiguration des HTTP Connectors
          2. -
          3. Konfiguration des HTTPS Connectors
          4. -
          5. Einrichten des MOA SP/SS Administrators
          6. -
          -
        4. -
        5. Einsatz des MOA SP/SS Webservices in Tomcat
        6. -
        7. Starten und Stoppen von Tomcat -
            -
          1. Unter Windows
          2. -
          3. Unter Unix
          4. -
          5. Prüfen des erfolgreichen Starts
          6. -
          -
        8. -
        9. Änderung der Konfiguration im laufenden Betrieb
        10. -
        -
      4. -
      5. Logging -
          -
        1. Format der Log-Meldungen
        2. -
        3. Wichtige Log-Meldungen
        4. -
        -
      6. -
      -
    2. -
    3. Erweiterungsmöglichkeiten
        -
      1. Vorgeschalteter Webserver
          -
        1. Microsoft Internet Information Server (MS IIS)
            -
          1. Konfiguration von Jakarta mod_jk im MS IIS
          2. -
          3. Konfiguration von Tomcat
          4. -
          5. Konfiguration von SSL
          6. -
          -
        2. -
        3. Apache
            -
          1. Konfiguration von Jakarta mod_jk im Apache
          2. -
          3. Konfiguration von Tomcat
          4. -
          5. Konfiguration von SSL mit mod_SSL
          6. -
          -
        4. -
        -
      2. -
      3. Datenbank
          -
        1. PostgreSQL
            -
          1. Anlegen eines Benutzers und einer Datenbank für MOA SP/SS
          2. -
          3. Archivierung von CRLs
          4. -
          5. Logging
          6. -
          -
        2. -
        3. Andere Datenbanken
        4. -
        -
      4. -
      -
    4. -
    -
  4. Klassenbibliothek -
      -
    1. Basisinstallation -
        -
      1. Einführung
      2. -
      3. Vorbereitung
      4. -
      5. Verwendung
      6. -
      7. Logging
      8. -
      -
    2. -
    3. Erweiterungsmöglichkeiten
    4. -
    -
  5. -
-
    -
  1. Referenzierte Software
  2. -
-
-

1 Übersicht

-

Die Module Signaturprüfung (SP) und Serversignatur (SS) sind als plattformunabhängige Module ausgelegt, die entweder als Webservice über HTTP bzw. HTTPS oder als Klassenbibliothek über ein API angesprochen werden können. Dieses Handbuch beschreibt die Installation der beiden Module als Webservice oder als Klassenbibliothek, sowie die Einrichtung der Systemumgebung.

-

2 Webservice

-

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öglichkeiten auf.

-

2.1 Basisinstallation

-

2.1.1 Einführung

-

Die Basisinstallation des Webservices stellt einerseits die minimalen Anforderungen für den Betrieb von MOA SP/SS als Webservices dar, andererseits dient sie als Ausgangspunkt für optionale Erweiterungsmöglichkeiten.

-

Folgende Software ist Voraussetzung für die Basisinstallation des Webservices:

- -

In diesem Betriebs-Szenario wird das MOA SP/SS Webservice in Tomcat zum Einsatz gebracht. Tomcat fungiert gleichzeitig als HTTP- und HTTPS-Endpunkt für das MOA SP/SS Webservice. Beide Protokolle werden direkt in Tomcat konfiguriert. Das MOA SP/SS Webservice verwendet Log4j als Logging Toolkit.

-

2.1.2 Installation

-

2.1.2.1 Vorbereitung

-

Die folgenden Schritte dienen der Vorbereitung der Installation.

-
-
Installation von J2SE SDK
-
Installieren Sie J2SE 1.3.1 SDK oder J2SE 1.4.2 SDK oder J2SE 5.0 SDK in ein beliebiges Verzeichnis. Wir empfehlen die Installation von J2SE 5.0 SDK. Das Wurzelverzeichnis der J2SE SDK Installation wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
-
Installation von Apache Tomcat 4.1
-
Installieren Sie Apache Tomcat 4.1.18 oder höher in ein Verzeichnis, das keine Leerzeichen im Pfadnamen enthält. Wir empfehlen die Installation von Apache Tomcat 4.1.31. Verwenden Sie bitte die zu Ihrem J2SE SDK passende Distribution von Tomcat. Das Wurzelverzeichnis der Tomcat-Installation wird im weiteren Verlauf als $CATALINA_HOME bezeichnet.
-
Entpacken der MOA SP/SS Webservice Distribution
-
Entpacken Sie die Datei moa-spss-1.2.x.zip in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als $MOA_SPSS_INST bezeichnet.
-
Installation der Krypographiebibliotheken von SIC/IAIK
-
-

Die Installation der Kryptographiebibliotheken von SIC/IAIK ist abhängig vom eingesetzten J2SE SDK:

-
-
J2SE 1.3.1 SDK
-
Kopieren Sie alle Dateien aus dem Verzeichnis - - - $MOA_SPSS_INST/ext13 in das Verzeichnis $JAVA_HOME/jre/lib/ext.
-
J2SE 1.4.2 SDK oder JSE 5.0 SDK
-
Kopieren Sie alle Dateien aus dem Verzeichnis $MOA_SPSS_INST/ext14 in das Verzeichnis $JAVA_HOME/jre/lib/ext. Zusätzlich müssen Sie die Rechtedateien Ihres J2SE 1.4.2 SDK bzw. J2SE 5.0 SDK austauschen. Laden Sie dazu die Unlimited Strength - - - Jurisdiction Policy Files von der J2SE 1.4.2 SDK Downloadseite bzw. J2SE 5.0 SDK Downloadseite und folgen Sie der darin enthaltenen Installationsanweisung.
-
-
-
-

2.1.2.2 Konfiguration von Apache Tomcat

-

Die zentrale Konfigurations-Datei von Tomcat ist $CATALINA_HOME/conf/server.xml. Tomcat wird grundsätzlich mit einer funktionierenden Default-Konfiguration ausgeliefert, die jedoch einiges an Ballast enthält und viele Ports offen lässt.

-
2.1.2.2.1 Konfiguration des HTTP Connectors
-

Die Datei $MOA_SPSS_INST/tomcat/server.xml enthält eine minimale Tomcat-Konfiguration, die ausschließlich den Connector für HTTP auf Port 8080 freischaltet. Durch kopieren dieser Datei nach $CATALINA_HOME/conf/server.xml kann Tomcat mit dieser Konfiguration gestartet werden. Wir empfehlen diese Konfiguration nur für Fälle, in denen das MOA SP/SS Webservice in einer abgeschlossenen Netzwerkumgebung betrieben wird.

-
2.1.2.2.2 Konfiguration des HTTPS Connectors
-

Wird das MOA SP/SS Webservice in einer nicht abgeschlossenen Umgebung (z.B. Erreichbarkeit über das Internet) betrieben, ist die gegenseitige Identitätsfeststellung von Kunde und Webservice essentiell:

-
    -
  • Nutzt ein Kunde MOA SP, ist es für ihn wichtig, die Identität des Webservice eindeutig feststellen zu können, denn er vertraut dem Webservice ja die Prüfung einer elektronischen Signatur an.
  • -
  • Nutzt ein Kunde MOA SS, ist es für ihn wesentlich, dass nur er Zugriff auf die für ihn vom Webservice verwalteten privaten Schlüssel hat, um elektronische Signaturen zu erstellen. Das Webservice muss also die Identität des Kunden prüfen.
  • -
-

Beide Identitätsprüfungen können mit hoher Qualität vorgenommen werden, wenn die Erreichbarkeit des Webservice auf SSL mit Server- (für MOA SP) bzw. Client- und Serverauthentisierung (für MOA SS) eingeschränkt wird.

-

Für die dazu notwendige Konfiguration kann die im vorigen Abschnitt besprochene minimale Tomcat-Konfiguration als Ausgangspunkt verwendet werden: Zunächst ist der HTTP Connector abzuschalten (auszukommentieren). Anschließend ist der HTTPS Connector zu konfigurieren. Das Dokument Tomcat SSL Configuration HOW-TO gibt einen guten Überblick dazu. Grob zusammengefasst sind folgende Schritte durchzuführen:

-
    -
  • Erstellung eines Server-Keystores, der den privaten Schlüssel sowie das zugehörige Zertifikat des Webservices enthält, mit dem es sich bei Aufbau einer SSL-Verbindung gegenüber dem Kunden ausweist.sowie das dazugehörige ZertiServer-Zertifikat enthält. Sie können diesen Keystore z.B. mit keytool erstellen, einem Programm, das Ihrem J2SE SDK beiliegt.
  • -
  • Erstellung eines Client-Keystores, der die Zertifikate aller Kunden des Webservices enthält. Nur Kunden des Webservices, die sich beim Aufbau einer SSL-Verbindung gegenüber dem Webservice mit einem im Client-Keystore enthaltenen Zertifikat ausweisen, erhalten grundsätzlich Zugriff zu den Diensten des Webservices (für die Konfiguration, welcher Kunde welche Schlüssel von MOA SS verwenden darf, siehe Abschnitt 2.2.3 des Konfigurationshandbuchs). Auch dieser Keystore kann z.B. mit keytool erstellt werden. Dieser Keystore ist optional und braucht nur erstellt zu werden, wenn sich die Kunden gegenüber dem Webservice authentisieren müssen.
  • -
  • Konfiguration des HTTPS Connectors in $CATALINA_HOME/conf/server.xml.
  • -
-

Die Konfiguration des HTTPS Connectors kann entfallen, wenn Tomcat ein Webserver vorgeschaltet ist, und dieser die SSL-Kommunikation mit dem Kunden übernimmt (siehe Abschnitt 2.2.1).

-
2.1.2.2.3 Einrichten des MOA SP/SS Administrators
-

Das MOA SP/SS Webservice kann remote durch den Aufruf einer speziellen URL des Webservices dazu veranlasst werden, seine Konfiguration neu einzulesen (vergleiche Abschnitt 2.1.2.5). Der Zugriff auf diese URL ist durch eine Passwort-Abfrage geschützt, und kann nur von Tomcat-Benutzern aufgerufen werden, denen die Tomcat-Benutzer-Rolle moa-admin zugeordnet wurde.

-

Um diese Benutzer-Rolle und einen oder mehrere Benutzer einzurichten, müssen in der Datei $CATALINA_HOME/conf/tomcat-users.xml unter dem Element <tomcat-users> sinngemäß folgende Einträge hinzugefügt werden:

-

-

<role rolename="moa-admin"/> 
-<user username="moa-chief" password="openSesam" roles="moa-admin"/> 
-

Soll der Aufruf dieser URL niemandem ermöglicht werden, sind die oben beschriebenen Einträge einfach nicht vorzunehmen.

- -

2.1.2.3 Einsatz des MOA SP/SS Webservices in Tomcat

-

Um das MOA SP/SS Webservice in Tomcat für den Einsatz vorzubereiten, sind folgende Schritte notwendig:

-
    -
  • Die Datei $MOA_SPSS_INST/moa-spss.war enthält das einsatzfertige MOA SP/SS Webarchiv und muss ins Verzeichnis $CATALINA_HOME/webapps kopiert werden. Dort wird sie beim ersten Start von Tomcat automatisch ins Verzeichnis $CATALINA_HOME/webapps/ moa-spss entpackt.
  • -
  • Die zentrale Konfigurationsdatei für MOA SP/SS und die zugehörigen Profil-Verzeichnisse müssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. $CATALINA_HOME/conf/moa-spss). Eine funktionsfähige Konfiguration, die als Ausgangspunkt für die Konfiguration des MOA SP/SS Webservices dienen kann, finden Sie hier.
  • -
  • Wird Tomcat unter J2SE 1.4.x SDK oder höher betrieben, müssen die Dateien xalan.jar, xercesImpl.jar und xmlParserAPIs.jar aus dem Verzeichnis $MOA_SPSS_INST/endorsed14 in das Tomcat-Verzeichnis $CATALINA_HOME/common/endorsed kopiert werden. Sind gleichnamige Dateien dort bereits vorhanden, müssen sie überschrieben werden. Die ggf. in diesem Verzeichnis vorhandene Datei xml-apis.jar muss gelöscht werden.
  • -
  • Folgende System Properties können gesetzt werden (wird beim Starten von Tomcat der Java Virtual Machine in der Umgebungsvariablen CATALINA_OPTS in der Form -D<name>=<wert> übergeben): -
      -
    • moa.spss.server.configuration: Pfad und Name der zentralen Konfigurationsdatei für MOA SP/SS. Eine beispielhafte Konfigurationsdatei finden Sie hier. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der Java Virtual Machine interpretiert. Ist diese System Property nicht gesetzt, wird automatisch eine im Webarchiv unter WEB-INF/conf enthaltene Default-Konfiguration herangezogen.
    • -
    • log4j.configuration: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie hier. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der Java Virtual Machine interpretiert. Ist diese System Property nicht gesetzt, wird automatisch eine im Webarchiv unter WEB-INF/classes enthaltene Default-Konfiguration herangezogen.
    • -
    • moa.node.id: Frei wählbarer Name des Rechner-Knotens, auf dem MOA SP/SS läuft. Der Name des Knotens wird bei Log-Ausgaben von MOA SP/SS angeführt und dient zur Unterscheidung mehrerer gleichzeitig betriebener MOA SP/SS Webservice-Instanzen.
    • -
    • javax.net.ssl.trustStore: Pfad und Dateiname des Truststores für vertrauenswürdige SSL Client-Zertifikate (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll). Ein relativer Pfad werden relativ zum Startverzeichnis der Java Virtual Machine interpretiert.
    • -
    • javax.net.ssl.trustStorePassword: Passwort für den Truststore (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll).
    • -
    • javax.net.ssl.trustStoreType: Truststore-Typ (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll). Je nach verwendetem Keystore-Typ muss jks (Java Key Store) oder pkcs12 (PKCS#12-Datei) angegeben werden.
    • -
    -
  • -
-

2.1.2.4 Starten und Stoppen von Tomcat

-
2.1.2.4.1 Unter Windows
-
-

Das Verzeichnis $MOA_SPSS_INST/tomcat/win32 enthält Script-Dateien zum Starten und Stoppen von Tomcat. Vor der erstmaligen Verwendung der Scripts müssen in den ersten Zeilen die Umgebungsvariablen JAVA_HOME (Basisverzeichnis des eingesetzten J2SE SDK) und CATALINA_HOME (Basisverzeichnis der eingesetzten Tomcat-Installation) angepasst werden. Evtl. müssen Sie auch noch die in den Script-Dateien gesetzten, in Abschnitt 2.1.2.3 besprochenen System Properties anpassen.

-
-
2.1.2.4.2 Unter Unix
-

Zunächst müssen die in Abschnitt 2.1.2.3 besprochenen System Properties mit Hilfe der Umgebungsvariablen CATALINA_OPTS gesetzt sein. Die Datei $MOA_SPSS_INST/tomcat/unix/moa-env.sh enthält ein Beispiel dafür. Weiters müssen noch die Umgebungsvariablen JAVA_HOME (Basisverzeichnis des eingesetzten J2SE SDK) und CATALINA_HOME (Basisverzeichnis der eingesetzten Tomcat-Installation) angepasst werden.

-

Nun kann Tomcat aus seinem Basisverzeichnis mit

-
bin/catalina.sh start
-gestartet werden. Das Stoppen von Tomcat erfolgt analog mit -
bin/catalina.sh stop
-
2.1.2.4.3 Prüfen des erfolgreichen Starts
-
-

Ein erfolgreicher Start des MOA SP/SS Webservices ist an folgender Log-Meldung ersichtlich:
-

-
-
INFO | 18 10:09:45,155 | main | TID=startup NID=<null> MSG=MOA Konfiguration erfolgreich geladen
-
-

Bei leichten Fehlern in der Konfiguration geben WARN Log-Meldungen unmittelbar davor Aufschluss über fehlerhafte Konfigurations-Einträge. - Nach dem Starten von Tomcat steht das MOA SP/SS Webservice für die Server-Signatur und Signatur-Prüfung unter den Endpunkten

-
http://<host>:<port>/moa-spss/services/SignatureCreation
-
-

bzw. -

-
http://<host>:<port>/moa-spss/services/SignatureVerification
-
-

zur Verfügung. Die Verfügbarkeit des Services können Sie einfach überprüfen, indem Sie die Endpunkte mit einem Web-Browser aufgerufen; dies sollte nach erfolgreichem Start zur Anzeige einer Informationsseite führen.

-

Konnte das MOA SP/SS Webservice nicht ordnungsgemäß gestartet werden, führt das zu folgender Log-Meldung:

-
FATAL | 18 10:17:03,475 | main | TID=startup NID=<null> 
MSG=Fehler beim Lesen der MOA Konfiguration: das Service steht nicht zur Verfügung -
-In diesem Fall geben die WARN bzw. ERROR Log-Meldungen unmittelbar davor Aufschluss über den genaueren Grund. -

2.1.2.5 Änderung der Konfiguration im laufenden Betrieb

-

Sie können die Konfiguration für MOA SP/SS im laufenden Betrieb aktualisieren, in dem Sie mittels eines Web-Browsers folgende URL aufrufen:

-
 http://<host>:<port>/moa-spss/ConfigurationUpdate 
-

Damit dies funktioniert, muss in der Konfiguration von Tomcat ein spezieller Benutzer sowie eine spezielle Benutzerrolle eingerichtet werden (vergleiche Abschnitt 2.1.2.2.3).

-

2.1.3 Logging

-

Das MOA SP/SS Webservice verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Log4j bietet zahlreiche Konfigurationsmöglichkeiten, die ausführlich im Jakarta Log4j Handbuch beschrieben sind. Unter anderem gibt es die Möglichkeit, folgende Einstellungen vorzunehmen: -

    -
  • -

    Das verwendete Log-Level (DEBUG, INFO, WARN, ERROR, FATAL);

    -
  • -
  • -

    Name und maximale Größe der Log-Datei(en);

    -
  • -
  • -

    Das Aussehen der Log-Einträge.

    -
  • -
-

Das MOA SP/SS Webservice verwendet folgende Log-Hierarchien:

-
    -
  • -

    moa.spss.server für alle Log-Meldungen aus dem MOA/SPSS Webservice;

    -
  • -
  • -

    iaik.server für alle Log-Meldungen aus den SIC/IAIK Kryptographie-Modulen.

    -
  • -
-

Eine für MOA SP/SS passende Konfigurationsdatei für Log4j finden Sie hier. Wird diese Datei als Logging-Konfiguration verwendet, so werden alle Log-Meldungen sowohl in die Konsole, als auch in die Datei moa-spss.log geschrieben.

-

2.1.3.1 Format der Log-Meldungen

-

Anhand einer konkreten Log-Meldung wird das Format der MOA SP/SS Log-Meldungen erläutert:

-
INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=node1 
-  MSG=Starte neue Transaktion: TID=1049225059594-100, Service=SignatureVerification
-
-

Der Wert INFO besagt, dass die Log-Meldung im Log-Level INFO entstanden ist. Folgende Log-Levels existieren:

-
    -
  • -

    DEBUG: Log-Meldungen im Log-Level DEBUG geben Auskunft über die innere Arbeitsweise des Systems. Sie sind hauptsächlich für Entwickler interessant.

    -
  • -
  • -

    INFO: Diese Log-Meldungen geben Status-Informationen über den Ablauf des Webservices, wie z.B. über das Einlangen einer neuen Anfrage.

    -
  • -
  • -

    WARN: Bei der Ausführung einer Anfrage sind leichte Fehler aufgetreten. Der Ablauf des Webservices ist nicht weiter beeinträchtigt.

    -
  • -
  • -

    ERROR: Die Ausführung einer Anfrage musste abgebrochen werden. Das Webservice ist davon nicht beeinträchtigt.

    -
  • -
  • -

    FATAL: Es ist ein Fehler aufgetreten, der den weiteren Betrieb des Webservices nicht mehr erlaubt.

    -
  • -
-

Der nächste Wert 01 21:25:26,540 gibt den Zeitpunkt an, zu dem die Log-Meldung generiert wurde (in diesem Fall den 1. Tag im aktuellen Monat, sowie die genaue Uhrzeit).

-

Der Wert Thread-3 bezeichnet den Thread, von dem die Anfrage bearbeitet wird.

-

Der Wert von TID gibt die für jede Anfrage eindeutige Transaktions-ID an. Log-Meldungen, die bei der Abarbeitung dieser Anfrage geschrieben werden, enthalten alle einen Hinweis auf die entsprechende Transaktions-ID.

-

Der Wert von NID gibt den Rechner-Knoten an, auf dem das MOA SP/SS Webservice läuft (bei NID=<null> ist dieser Wert nicht konfiguriert, vergleiche Abschnitt 2.1.2.3).

-

Der Rest der Zeile einer Log-Meldung ist der eigentliche Text, mit dem das System bestimmte Informationen anzeigt. Im Fehlerfall ist häufig ein Java Stack-Trace angefügt, der eine genauere Ursachen-Forschung ermöglicht.

-

2.1.3.2 Wichtige Log-Meldungen

-

Neben den im Abschnitt 2.1.2.4.3 beschriebenen Log-Meldungen, die anzeigen, ob das Service ordnungsgemäß gestartet wurde, geben nachfolgenden Log-Meldungen Aufschluss über die Abarbeitung von Anfragen.

-

Die Entgegennahme einer Anfrage wird angezeigt durch: - -

-
INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=<null> 
-  MSG=Starte neue Transaktion: TID=1049225059594-100, Service=SignatureVerification
-INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=<null> 
-  MSG=Aufruf von Adresse=127.0.0.1
-INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=<null> 
-  MSG=Client-Zertifikat nicht verfügbar
-

Die dritte Log-Meldung besagt, dass für die Abarbeitung dieser Anfrage kein Client-Zertifikat verfügbar ist (entweder, weil die Anfrage über HTTP eingelangt ist, oder weil die SSL Client-Authentisierung nicht eingeschaltet ist). Bei erfolgreicher SSL Client-Authentisierung, gibt beispielsweise folgende Log-Meldung Informationen über das Client-Zertifikat aus: -

INFO | 12 13:58:08,772 | Thread-10 | TID=1045054687159-2 NID=<null> 
-  MSG=Client-Zertifikat: Subject=CN=Testuser, OU=MOA, O=BRZ, L=Vienna, ST=Vienna, C=AT, 
-  Serial=1.039.104.204, Issuer=CN=TestCA, OU=MOA, O=BRZ, L=Vienna, ST=Vienna, C=AT
-

Eine erfolgreich abgearbeitete Anfrage wird angezeigt durch: -

-
INFO | 01 21:25:53,168 | Thread-3 | TID=1049225059594-106 NID=<null> 
-  MSG=Anfrage erfolgreich abgearbeitet
-

Ein Fehler beim Abarbeiten der Anfrage wird angezeigt durch:

-
INFO | 01 21:25:27,642 | Thread-3 | TID=1049225059594-100 NID=<null> 
-  MSG=Fehler beim Abarbeiten der Anfrage
-
-

In diesem Fall gibt der mitgeloggte Stacktrace Auskunft über die Art des Fehlers. Der Aufrufer des MOA SP/SS Webservices bekommt einen Fehlercode sowie eine kurze Beschreibung des Fehlers als Antwort zurück.

-

Die Tatsächlich übertragenen Anfragen bzw. Antworten werden aus Effizienzgründen nur im Log-Level DEBUG angezeigt.

-
-

2.2 Erweiterungsmöglichkeiten

-

Ausgehend von der Basisinstallation können die optionalen Erweiterungen, die in den nachfolgenden Abschnitten beschrieben werden, unabhängig und in beliebiger Kombination aufgesetzt werden.

-

2.2.1 Vorgeschalteter Webserver

-

2.2.1.1 Microsoft Internet Information Server (MS IIS)

-

Den MOA SP/SS Webservices kann optional ein MS IIS vorgeschaltet sein. In diesem Fall übernimmt der MS IIS die HTTP- bzw. HTTPS-Kommunikation mit dem Aufrufer des Webservices. Die Kommunikation zwischen MS IIS und dem in Tomcat eingerichteten MOA SP/SS Webservice wird durch Jakarta mod_jk durchgeführt. Die angeführten Konfigurationsschritte gehen von einer MS IIS Standard-Installation aus.

-
2.2.1.1.1 Konfiguration von Jakarta mod_jk im MS IIS
-

Für die Kommunikation des MS IIS mit dem im Tomcat eingerichteten MOA SP/SS Webservice wird das ISAPI-Modul von Jakarta mod_jk im MS IIS installiert und konfiguriert. Eine detaillierte Installations- und Konfigurationsanleitung gibt das mod_jk IIS HowTo. Beispiele für workers.properties und uriworkermap.properties Dateien liegen im Verzeichnis $MOA_SPSS_INST/tomcat bei.

-
2.2.1.1.2 Konfiguration von Tomcat
-

Damit Tomcat die Aufrufe entgegennehmen kann, die von MS IIS mittels Jakarta mod_jk weiterleitet werden, muss in $CATALINA_HOME/conf/server.xml der AJP 1.3 Connector aktiviert werden. Im Gegenzug können die Konnektoren für HTTP und HTTPS deaktiviert werden. Das geschieht am einfachsten durch Ein- bzw. Auskommentieren der entsprechenden Connector Konfigurations-Elemente in dieser Datei. Die Datei $MOA_SPSS_INST/tomcat/server.mod_jk.xml enthält eine Konfiguration, die ausschließlich den Port für den AJP 1.3 Connector offen lässt.

-
2.2.1.1.3 Konfiguration von SSL
-

Die Dokumentation zum Einrichten von SSL auf dem MS IIS steht nach Installation des IIS unter http://localhost/iisHelp/ oder aber auch auf den Websiten vo Mircrosoft zur Verfügung.

-

2.2.1.2 Apache

-

Den MOA SP/SS Webservices kann ein Apache Webserver vorgeschaltet sein. Das Prinzip funktioniert wie bei MS IIS, auch hier wird Jakarta mod_jk für die Kommunikation zwischen Webserver und Tomcat eingesetzt. Die angeführten Konfigurationsschritte gehen von einer Standard-Installation des Apache Webservers aus und sind ident für die Versionen 1.3.x und 2.0.x.

-
2.2.1.2.1 Konfiguration von Jakarta mod_jk im Apache
-

Um das MOA-SPSS Webservice hinter einem Apache Webserver zu betreiben, ist die Konfiguration des Apache-Moduls mod_jk erforderlich. Eine detaillierte Installations- und Konfigurationsanleitung gibt das mod_jk Apache HowTo. Ein Beispiel für eine workers.properties Datei liegt im Verzeichnis $MOA_SPSS_INST/tomcat bei.

-

Um das MOA SP/SS Webservice dem Apache Webserver bekannt zu machen, sind zumindest folgende Einträge im globalen Kontext der Apache-Konfigurationsdatei notwendig:

-
LoadModule jk_module /usr/lib/apache/mod_jk.so
AddModule jk_module
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkWorkersFile conf/workers.properties
JkMount /moa-spss/* moaworker
-

Die Pfad- und Dateinamen können je nach existierender Apache Installation geringfügig variieren.

-
2.2.1.2.2 Konfiguration von Tomcat
-

Die Konfiguration von Tomcat ist analog zu Abschnitt 2.2.1.1.2 durchzuführen.

-
2.2.1.2.2 Konfiguration von SSL mit mod_SSL
-

Apache kann in Verbindung mit mod_SSL als SSL-Endpunkt für das MOA SP/SS Webservice fungieren. In diesem Fall entfä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 enthält die Online-Dokumentation von mod_SSL.

-

Bei der Verwendung von Client-Authentisierung muss darauf geachtet werden, dass mod_ssl die HTTP-Header mit den Informationen über das Client-Zertifikat exportiert. Dies wird durch Angabe der folgenden Option in der Apache-Konfiguration erreicht:

-
SSLOptions +ExportCertData +StdEnvVars
-

Je nach vorhandener SSL-Konfiguration des Apache Webservers kann diese Option im globalen Kontext, im Kontext des Virtual Hosts oder im Kontexts eines Verzeichnisses spezifiziert werden.

-

2.2.2 Datenbank

-

Die MOA SP/SS Module können eine Datenbank zum Archivieren von Certificate Revocation Lists (CRLs), sowie zum Abspeichern von Log-Meldungen verwenden. In beiden Fällen wird eine installierte und konfigurierte Datenbank vorausgesetzt.

-

2.2.2.1 PostgreSQL

-

Eine detaillierte Übersicht über die Installation und Konfiguration von PostgreSQL gibt die Online-Dokumentation.

-

Bitte beachten Sie: Eine Möglichkeit, PostgreSQL unter MS Windows zu installieren, besteht darin, Cygwin mit dem PostgreSQL-Package zu installieren. Alternative Installationsvarianten werden auf dieser Seite angeführt.

-
2.2.2.1.1 Anlegen eines Benutzers und einer Datenbank für MOA SP/SS
-

Damit die MOA SP/SS Module eine Verbindung zu PostgreSQL aufbauen kann, müssen der Name eines PostgreSQL-Benutzers und einer PostgreSQL-Datenbank bekannt sein. Sollten diese nicht vorhanden sein, kann mit folgenden Kommandos ein Benutzer namens moa und eine Datenbank namens moadb angelegt werden:

-
createuser -U postgres -d -A -P moa
createdb -U moa moadb
-

Da die MOA SP/SS Module über JDBC mit der Datenbank kommunizieren, ist in der Folge die Angabe einer JDBC-URL notwendig, welche die Verbindungsparameter enthält. Wurden der Benutzer und die Datenbank wie im obigen Beispiel angelegt, ist folgende JDBC-URL anzugeben (Annahme: als Passwort für den Benutzer moa wurde moapass gewählt):

-
 jdbc:postgresql://host/moadb?user=moa&password=moapass
-

Die Zeichen jdbc:postgresql:// sind unveränderliche Bestandteile einer PostgreSQL JDBC-URL. host gibt den Rechner an, auf dem PostgreSQL läuft. moadb identifiziert den Namen der Datenbank. Über die Parameter user= und pass= werden Benutzername und Passwort für den DB-User bekanntgegeben.

-
2.2.2.1.2 Archivierung von CRLs
-

Zum Archivieren von CRLs müssen in der MOA SP/SS Konfigurationsdatei die Kinder des Elements cfg:MOAConfiguration/cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving entsprechend - konfiguriert werden:

-
    -
  • cfg:EnableArchiving muss auf den Wert true gesetzt sein;
  • -
  • cfg:ArchiveDuration muss als nichtnegative Ganzzahl die maximale Archivierungsdauer in Tagen enthalten;
  • -
  • cfg:Archive muss genau ein Element cfg:DatabaseArchive enthalten, das wiederum aus zwei Elementen - bestehen muss: -
      -
    • cfg:JDBCURL muss eine gültige JDBC-URL enthalten, mit der auf die Datenbank zur Archivierung - zugegriffen werden kann (Hinweis: da es sich hierbei um einen Eintrag - in eine XML-Datei handelt, muss das Zeichen & in der in Abschnitt 2.2.2.1.1 gezeigten - JDBC-URL - durch die Zeichenfolge &amp; ersetzt werden.);
    • -
    • cfg:JDBCDriverClassName muss den vollständig qualifizierten Java-Klassennamen des JDBC-Treibers - enthalten.
    • -
    -
  • -
-

Vergleiche auch Abschnitt 2.3.1.3.4 im - Konfigurationshandbuch.

-
2.2.2.1.3 Logging
-

Für das Logging in eine PostgreSQL Datenbank mittels Jakarta Log4j muss zunächst eine Tabelle für die Log-Meldungen angelegt werden. Dies kann mit folgendem SQL-Statement erreicht werden:

-
 create table spss_log (log_time timestamp, log_level varchar(5), log_msg text);
-

Damit Log4j die Log-Meldungen in diese Datenbanktabelle schreibt, muss die Log4j-Konfiguration adaptiert werden. Die mit MOA SP/SS mitgelieferte, beispielhafte Log4j-Konfiguration enthält bereits die notwendigen Einträge für das Logging in eine PostgreSQL Datenbank, die jedoch standardmäßig ausgeschaltet sind.

-

Wie beim Caching von CRLs ist auch hier die Angabe einer JDBC-URL notwendig, damit die MOA SP/SS Module eine Verbindung zur Datenbank aufnehmen können.

-

Bitte beachten Sie: Bei Tests hat sich das Logging in eine Datenbank mit Jakarta Log4j als Performance-Engpass herausgestellt. Es wird deshalb empfohlen, dieses Feature mit Bedacht einzusetzen.

-

2.2.2.2 Andere Datenbanken

-

Über die generische Anbindung JDBC können auch andere Datenbanken für die Archivierung von CRLs bzw. für die Speicherung der Log-Meldungen eingesetzt werden. Hinweise zu bestimmten Datenbanken finden Sie in den FAQ.

-

Die in Abschnitt 2.2.2.1 gemachten Angaben zu Archivierung von CRLs bzw. zur Speicherung von Log-Meldungen gelten sinngemäß.

-

2.2.3 Hardware Security Module (HSM)

-

MOA SS kann für die Erstellung von Signaturen auf die Dienste eines HSM zurückgreifen. Voraussetzung dafür ist, dass für das HSM eine Implementierung der Schnittstelle PCKS#11 (PKCS#11-Bibliothek) angeboten wird.

-

Für die Einbindung des HSM in MOA SS müssen zunächst die Bibliotheken aus $MOA_SPSS_INST/pkcs11 in ein beliebiges Verzeichnis kopiert werden, welches dann in den Libray-Pfad des jeweiligen Betriebssystems aufgenommen werden muss (Windows: Umgebungsvariable PATH; Linux: Umgebungsvariable LD_LIBRARY_PATH).

-

Der Name der für das HSM spezifischen PKCS#11-Bibliothek muss in der Konfigurationsdatei eingetragen werden (vergleiche Abschnitt 2.2.1.1 des Konfigurationshandbuchs).

-

3 Klassenbibliothek

-

Dieser Abschnitt beschreibt die Verwendung von MOA SP/SS als Klassenbibliothek. Im ersten Unterkapitel wird eine minimale Basisinstallation beschrieben. Das zweite Unterkapitel zeigt eine Reihe von optionalen Erweiterungsmöglichkeiten auf.

-

3.1 Basisinstallation

-

3.1.1 Einführung

-

Die Basisinstallation der Klassenbibliothek stellt einerseits die minimalen Anforderungen für den Einsatz von MOA SP/SS als Klassenbibliothek dar, andererseits dient sie als Ausgangspunkt für optionale Erweiterungsmöglichkeiten.

-

Folgende Software ist Voraussetzung für die Basisinstallation der Klassenbibliothek:

- -

3.1.2 Vorbereitung

-

Die folgenden Schritte dienen der Vorbereitung der Installation.

-
-
Installation von J2SE SDK
-
Installieren Sie J2SE 1.3.1 SDK oder J2SE 1.4.2 SDK oder J2SE 5.0 SDK in ein beliebiges Verzeichnis. Wir empfehlen die Installation von J2SE 5.0 SDK. Das Wurzelverzeichnis der J2SE SDK Installation wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
-
Entpacken der MOA SP/SS Klassenbibliotheks-Distribution
-
Entpacken Sie die Datei moa-spss-1.2.x-lib.zip in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als $MOA_SPSS_INST bezeichnet.
-
Installation der Krypographiebibliotheken von SIC/IAIK
-
-

Die Installation der Kryptographiebibliotheken von SIC/IAIK ist abhängig vom eingesetzten J2SE SDK:

-
-
J2SE 1.3.1 SDK
-
Kopieren Sie alle Dateien aus dem Verzeichnis $MOA_SPSS_INST/ext13 in das Verzeichnis $JAVA_HOME/jre/lib/ext.
-
J2SE 1.4.2 SDK oder JSE 5.0 SDK
-
Kopieren Sie alle Dateien aus dem Verzeichnis $MOA_SPSS_INST/ext14 in das Verzeichnis $JAVA_HOME/jre/lib/ext. Zusätzlich müssen Sie die Rechtedateien Ihres J2SE 1.4.2 SDK bzw. J2SE 5.0 SDK austauschen. Laden Sie dazu die Unlimited Strength Jurisdiction Policy Files von der J2SE 1.4.2 SDK Downloadseite bzw. J2SE 5.0 SDK Downloadseite und folgen Sie der darin enthaltenen Installationsanweisung.
-
-
-
-

3.1.3 Verwendung

-

Um die MOA SP/SS Klassenbibliothek in einer Applikation verwenden zu können, müssen die mit MOA SP/SS ausgelieferten Bibliotheken in den Java Klassenpfad der Applikation eingebunden werden.

-

Die nachfolgende Tabelle listet diese Klassenbibliotheken auf; die Einträge in der Spalte Dateien sind relativ zum Verzeichnis $MOA_SPSS_INST zu interpretieren.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KlassenbibliothekVersionDateien
MOA SP/SS1.2.x  moa-spss.jar, moa-common.jar
MOA IAIK1.0.7 

lib/iaik_moa_full.jar, lib/iaik_Pkcs11Wrapper.jar, - lib/iaik_cms.jar, lib/iaik_ixsil.jar

-
JAXP1.2_01  lib/jaxp-api.jar, lib/sax.jar, lib/dom.jar
Xerces-J2.4.0  lib/xercesImpl.jar, lib/xmlParserAPIs.jar
Xalan-J2.5.1 

lib/xalan.jar

-

Bitte beachten Sie: Wenn Sie J2SE 1.4.2 JRE oder J2SE 5.0 JRE verwenden, müssen Sie diese Bibliothek der Java VM als endorsed bekanntgeben. Sie können dies tun, indem Sie entweder

-
    -
  • die Bibliothek in das (ggf. vorher anzulegende) Verzeichnis $JAVA_HOME/jre/lib/endorsed/ kopieren; oder
  • -
  • die System Property java.endorsed.dirs verwenden, und als Wert den Pfad zu jenem Verzeichnis angeben, in dem Sie die Bibliothek vorhalten (also z.B. java.endorsed.dirs=c:/mylibdir).
  • -
Jaxen1.0  lib/jaxen-core.jar, lib/jaxen-dom.jar, lib/saxpath.jar
Commons-Logging1.0.4  lib/commons-logging-api.jar, lib/commons-logging.jar
Log4j1.2.7  lib/log4j-1.2.7.jar
Commons-Discovery0.2  lib/commons-discovery.jar
JSSE1.0.3_01 

Diese Bibliotheken benötigen Sie nur, wenn Sie J2SE 1.3.1 verwenden:

-

lib/ext13/jsse.jar, lib/ext13/jcert.jar, lib/ext13/jnet.jar

-

Bitte beachten Sie: Diese Bibliotheken benötigen Sie nur, wenn Sie J2SE 1.3.1 verwenden.

Postgres JDBC27.3 

lib/pg73jdbc2.jar

-

Bitte beachten Sie: Wenn Sie keine Datenbank für MOA SP/SS verwenden (vergleiche 2.2.2), benötigen Sie diese Bibliothek nicht.

- -

3.1.4 Logging

-

Die MOA SP/SS Klassenbibliothek verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Die im Abschnitt 2.1.3 gemachten Aussagen lassen sich großteils auf den Einsatz der MOA SP/SS Klassenbibliothek übertragen.

-

3.2 Erweiterungsmöglichkeiten

-

Die im Abschnitt 2.2 angeführten Erweiterungsmöglichkeiten für die MOA SP/SS Webservices gelten in analoger Weise auch für die Klassenbibliothek.

-

A Referenzierte Software

-

Auf folgende Software-Pakete wird in diesem Handbuch verwiesen:

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameBeschreibung
Apache Tomcat 4.1.x Servlet-Container des Apache Jakarta Projekts in der Version 4.1.x
J2SE 1.3.1 SDK/JRE Java 2 Standard Edition in der Version 1.3.1 (Software Development Kit bzw. Java Runtime Environment)
J2SE 1.4.2 SDK/JREJava 2 Standard Edition in der Version 1.4.2 (Software Development Kit bzw. Java Runtime Environment)
J2SE 5.0 SDK/JRE Java 2 Standard Edition in der Version 5.0 (Software Development Kit bzw. Java Runtime Environment)
Jakarta Log4J Logging Framework des Apache Jakarta Projekts
- - diff --git a/spss.handbook/handbook/intro/intro.html b/spss.handbook/handbook/intro/intro.html deleted file mode 100644 index 8b1bc381f..000000000 --- a/spss.handbook/handbook/intro/intro.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - MOA SS und SP - Einführung - - - - - - - - - -
Logo BKAOpen Source
- für das E-Government
Logo MOA
-
-

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

-

Einführung

-
-

Inhalt

-
    -
  1. -

    Allgemeines

    -
  2. -
  3. -

    Modul Serversignatur (SS)

    -
  4. -
  5. Modul Signaturprüfung (SP)
  6. -
-
-

1 Allgemeines

-

Die Module Serversignatur (SS) und Signaturprüfung (SP) können von Anwendungen verwendet werden, um elektronische Signaturen zu erstellen bzw. vorliegende elektronische Signaturen zu überprüfen.

-

Die Funktionalität und der Aufbau der Schnittstelle zu den beiden Modulen ist in der Spezifikation MOA SP/SS (V1.2) detailliert beschrieben. Da diese Spezifikation auf der Schnittstellenspezifikation des Security-Layers (V 1.1) aufbaut, ist deren Kenntnis zum Verstehen der Schnittstellen zu SS und SP erforderlich.

-

2 Modul Serversignatur (SS)

-

Das Modul Serversignatur (SS) dient zum Erstellen von XML-Signaturen in Anlehnung an die Schnittstellenspezifikation des Security-Layers (V 1.1). Eine Signatur kann entweder rein in Software erstellt werden, oder aber unter Zuhilfenahme eines Hardware Security Modules (HSM), das den privaten Schlüssel geschützt enthält und die Signatur berechnet.

-

Der Zugriff auf einzelne Signaturschlüssel in MOA SS kann basierend auf dem für TLS-Client-Authentisierung verwendeten Zertifikat eingeschränkt werden.

-

Anwendungen können das Modul entweder als Web-Service oder über ein Java-API ansprechen.

-

3 Modul Signaturprüfung (SP)

-

Das Modul Signaturprüfung (SP) dient zum Überprüfen von XML-Signaturen und CMS-Signaturen.

-

Im Zuge der Verifikation einer XML-Signatur werden die Signatur, gegebenenfalls vorhandene XMLDSIG-Manifeste, als auch die Gültigkeit und Anwendbarkeit des Zertifikats überprüft. Bei XML-Signaturen kann zusätzlich überprüft werden, ob sie den speziellen Anforderungen Schnittstellenspezifikation des Security-Layers (V 1.1) entsprechen (vgl. Signaturmanifest).

-

Anwendungen können das Modul entweder als Web-Service oder über ein Java-API ansprechen.

- - diff --git a/spss.handbook/handbook/spec/MOA-SPSS-1.3.pdf b/spss.handbook/handbook/spec/MOA-SPSS-1.3.pdf deleted file mode 100644 index 6709a4081..000000000 Binary files a/spss.handbook/handbook/spec/MOA-SPSS-1.3.pdf and /dev/null differ diff --git a/spss.handbook/handbook/spec/MOA-SPSS-1.3.wsdl b/spss.handbook/handbook/spec/MOA-SPSS-1.3.wsdl deleted file mode 100644 index cc7aec4dc..000000000 --- a/spss.handbook/handbook/spec/MOA-SPSS-1.3.wsdl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spss.handbook/handbook/spec/MOA-SPSS-1.3.xsd b/spss.handbook/handbook/spec/MOA-SPSS-1.3.xsd deleted file mode 100644 index 9c40d8153..000000000 --- a/spss.handbook/handbook/spec/MOA-SPSS-1.3.xsd +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage - - - - Resultat, falls die Signaturerstellung erfolgreich war - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resultat, falls die Signaturerstellung gescheitert ist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. - - - - - Profilbezeichner für einen Transformationsweg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. - - - - Der Transformationsparameter explizit angegeben. - - - - - Der Hashwert des Transformationsparameters. - - - - - - - - - - - - - - - - - - - - - - Explizite Angabe des Transformationswegs - - - - - - - Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. - - - - - - - - - - - - - - - - diff --git a/spss.handbook/handbook/usage/usage.html b/spss.handbook/handbook/usage/usage.html deleted file mode 100644 index 69e21d5f0..000000000 --- a/spss.handbook/handbook/usage/usage.html +++ /dev/null @@ -1,1236 +0,0 @@ - - - - - MOA SS und SP - Anwendung - - - - - - - - - -
Logo BKAOpen Source
- für das E-Government
Logo MOA
-
-

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

-

Anwendung

-
-

Inhalt

-
    -
  1. -

    Übersicht

    -
  2. -
  3. -

    Verwendung des Webservices

    -
      -
    1. XML-Requests
        -
      1. Erstellung einer XML-Signatur
          -
        1. Einfaches Beispiel
        2. -
        3. Angabe der zu signierenden Daten
        4. -
        5. Transformationen
        6. -
        7. Ergänzungsobjekte
        8. -
        -
      2. -
      3. Prüfung einer CMS-Signatur
          -
        1. Einfaches Beispiel
        2. -
        3. Erweitertes Beispiel
        4. -
        -
      4. -
      5. Prüfung einer XML-Signatur
          -
        1. Einfaches Beispiel
        2. -
        3. Erweitertes Beispiel
        4. -
        5. Prüfung eines XMLDSIG-Manifests
        6. -
        7. Ergänzungsobjekte
        8. -
        9. Signatur-Manifest des Security-Layers
        10. -
        -
      6. -
      -
    2. -
    3. Webservice-Clients -
        -
      1. Übersicht
      2. -
      3. Gemeinsamkeiten
      4. -
      5. Besonderheiten von HTTPSServerAuth.java
      6. -
      7. Besonderheiten von HTTPSClientAuth.java
      8. -
      -
    4. -
    -
  4. -
  5. Verwendung der Klassenbibliothek -
      -
    1. Vorbereitung
    2. -
    3. Allgemeines
    4. -
    5. Beispiele
    6. -
    7. API-Dokumentation
    8. -
    -
  6. -
-
    -
  1. Referenzierte Software
  2. -
-
-

1 Übersicht

-

Die Module Signaturprüfung (SP) und Serversignatur (SS) sind als plattformunabhängige Module ausgelegt, die entweder als Webservice über HTTP bzw. HTTPS oder als Klassenbibliothek über ein API angesprochen werden können. Dieses Handbuch beschreibt die Anwendung der beiden Module auf jede dieser beiden Arten.

-

2 Verwendung des Webservices

-

Dieser Abschnitt beschreibt die Verwendung der Module SP und SS über die Webservice-Schnittstelle. Im ersten Unterabschnitt werden typische XML-Requests zur Signaturerstellung mittels SS bzw. zur Signaturprüfung mittels SP vorgestellt, wie sie an das Webservice gesendet werden können. Der zweite Unterabschnitt stellt beispielhafte Implementierungen eines Webservice-Clients in Java vor, mit dem die Requests aus dem ersten Unterabschnitt an das Webservice gesendet werden können.

-

2.1 XML-Requests

-

Dieser Abschnitt stellt typische XML-Requests für die Erstellung einer XML-Signatur mittels SS bzw. zur Prüfung einer CMS- bzw. XML-Signatur mittels SP vor. Zu jedem Request wird jeweils auch eine typische Response des Services besprochen.

-

Bitte beachten Sie: Einige der vorgestellten Requests referenzieren beispielhafte Daten auf localhost, z.B. http://localhost:8080/referencedData/Text.txt. Wenn Sie diese Beispiele ausprobieren möchten, müssen Sie dafür sorgen, dass MOA SS bzw. SP diese Daten auch tatsächlich auflösen kann. Wenn Sie Ihre Tomcat-Installation auf localhost:8080 betreiben, ist es ausreichend, wenn sie die diesem Handbuch beiliegende Webapplikation referencedData.war in das Verzeichnis webapps Ihrer Tomcat-Installation kopieren. Ansonsten müssen Sie zusätzlich die URLs in den Requests anpassen.

-

2.1.1 Erstellung einer XML-Signatur

-

2.1.1.1 Einfaches Beispiel

-
Request
-

CreateXMLSignatureRequest.Simple.xml ist ein einfacher XML-Request zur Erzeugung einer XML-Signatur. Sein Aufbau wird nachfolgend analysiert:

-
  <KeyIdentifier>KG_allgemein</KeyIdentifier> 
-

KG_allgemein bezeichnet eine Schlüsselgruppe, aus der SS einen Signaturschlüssel selektieren soll und muss einer in der SP/SS-Konfigurationsdatei definierten Schlüsselgruppe entsprechen.

-
  <SingleSignatureInfo SecurityLayerConformity="false">
-

Für jedes SingleSignatureInfoElement wird eine eigene XML-Signatur erzeugt. Wird das Attribut SecurityLayerConformity auf true gesetzt, dann wird eine XML-Signatur gemäß Security-Layer Spezifikation V1.1 erzeugt; d.h. es werden signierte Properties (Zeitpunkt der Signaturerstellung, das für die Signaturüberprüfung zu verwendende Zertifikat, Metainformationen zu den signierten Datenobjekten) und ein Manifest, das alle implizite Transformationsparameter enthält, zur Signatur hinzugefügt.

-
    <DataObjectInfo Structure="enveloping">
-      <DataObject>
-        <XMLContent>Diese Daten werden signiert.<XMLContent>
-      </DataObject>
-

-

Für jedes Daten-Objekt, das in die XML-Signatur als dsig:Reference aufgenommen werden soll, muss ein DataObjectInfo Element spezifiziert werden. Das Attribut Structure gibt an, ob die Daten in die Signatur in ein dsig:Object Element integriert werden sollen (Structure="enveloping"), oder über einen URL referenziert werden sollen (Structure="detached").

-

Im Fall von Structure="enveloping" muss im nachfolgenden DataObject Element entweder das Attribut Reference (enthält eine URL, von der SS die Daten beziehen soll) gesetzt sein, oder aber die zu signierenden Daten werden explizit in einem der Elemente Base64Content (enthält Daten in Base64 kodierter Form) oder XMLContent (enthält Daten als beliebiges XML-Fragment) oder LocRefContent (enthält eine URL, von der SS die Daten beziehen soll; in diesem Fall also gleichwertig wie ein gesetztes Attribut Reference) spezifiziert sein. Die Angabe der zu signierenden Daten über das Attribut Reference und gleichzeitig einem der Elemente Base64Content oder XMLContent oder LocRefContent ist nicht erlaubt.

-

Im Fall von Structure="detached" muss das Attribut Reference im nachfolgenden DataObject Element gesetzt sein. Es enthält jene URL, die zur Referenzierung der Daten als Wert von dsig:Reference/@URI in die XML-Signatur aufgenommen wird. Die Angabe eines der Element Base64Content oder XMLContent oder LocRefContent ist optional. Unterbleibt die Angabe, bezieht SS die Daten von der URL im Attribut Reference. Wird eines der Elemente verwendet, bezieht SS die Daten durch Analyse des angegebenen Elements (siehe obiger Absatz).

-

Im konkreten Beispiel sollen die Daten in ein dsig:Object Element integriert werden (Structure="enveloping"). Die Daten werden mittels XMLContent als XML-Fragment (ein einfacher Textknoten) angegeben.

-

-

    <CreateTransformsInfoProfile>
<CreateTransformsInfo> - <FinalDataMetaInfo> - <MimeType>text/plain<MimeType> - </FinalDataMetaInfo> - </CreateTransformsInfo> - </CreateTransformsInfoProfile>
- Zu jedem Daten-Objekt können optional Transformationen (z.B. XPath, XSLT, Base64-Decodierung, etc.) angegeben werden. Werden - wie hier im Beispiel - keine Transformationen angegeben, so muss zumindest der MIME-Type der zu signierenden Daten spezifiziert werden.

-
Response
-

CreateXMLSignatureRequest.Simple.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

-

-

<CreateXMLSignatureResponse
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<SignatureEnvironment>
<dsig:Signature Id="signature-1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<dsig:SignedInfo> - ... - <dsig:Reference Id="reference-1-1" URI="#xpointer(id(&apos;signed-data-1-1-1&apos;)/node())"> - ... - </dsig:Reference> - ... - </dsig:SignedInfo> - ... - <dsig:Object Id="signed-data-1-1-1">Diese Daten werden signiert.</dsig:Object> - </dsig:Signature>
</SignatureEnvironment>
</CreateXMLSignatureResponse>
-

-

CreateXMLSignatureResponse enthält je erzeugter Signatur ein Element SignatureEnvironment (in diesem Fall genau ein Element). SignatureEnvironment enthält die von SS erzeugte XML-Signatur, die im obigen Request spezifiziert wurde. Man erkennt, dass die XML-Signatur genau ein Daten-Objekt unterzeichnet (ein dsig:Reference Element ist enthalten). Das unterzeichnete Datenobjekt ist in der Signaturstruktur selbst enthalten (enveloping), und zwar in einem dsig:Object Element.

-

2.1.1.2 Angabe der zu signierenden Daten

-
Request
-

Dieses Beispiel stellt die vielfältigen Möglichkeiten vor, wie MOA SS mitgeteilt werden kann, welche Daten signiert (wenn keine Transformationen angegeben werden) bzw. als Eingangsdaten für die Berechnung der Transformationen verwendet werden sollen (wenn Transformationen angegeben werden).

-

Mit CreateXMLSignatureRequest.Refs.xml sollen insgesamt neun Datenobjekte signiert werden:

-
<CreateXMLSignatureRequest 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<KeyIdentifier>KG_allgemein</KeyIdentifier>
<SingleSignatureInfo SecurityLayerConformity="false">
-

Die Signatur soll mit dem Schlüssel KG_allgemein erstellt werden; jene Elemente, die speziell für eine Security-Layer V1.1 konforme Signatur notwendig sind (vergleiche Einfaches Beispiel), brauchen nicht erstellt zu werden (SecurityLayerConformity="false").

-
    <DataObjectInfo Structure="enveloping" ChildOfManifest="true">
-      <DataObject>
-        <Base64Content>RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</Base64Content>
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-

Die Daten sollen in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Weiters sollen die Daten nicht über über eine dsig:Reference in dsig:SignedInfo, sondern über eine dsig:Reference in einem eigenen dsig:Manifest aufgenommen werden (ChildOfManifest="true").

-

Die Daten selbst werden explizit in base64 kodierter Form als Inhalt des Elements Base64Content angegeben. Das Attribut DataObject/@Reference darf nicht angegeben werden, da die Daten in der Enveloping Form integriert werden sollen, und Base64Content verwendet wird.

-

Es werden - wie in allen übrigen Fällen dieses Beispiels - keine Transformationen angegeben. Der Mime-Type der zu signierenden Daten wird als text/plain angegeben, da der Inhalt von Base64Content die base64-Kodierung des Texts Diese Daten waren base64 kodiert. ist.

-
-    <DataObjectInfo Structure="enveloping" ChildOfManifest="false">
-      <DataObject>
-        <XMLContent><doc:XMLDocument xmlns:doc="urn:document">
-  <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
-  <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
-Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
-</doc:XMLDocument></XMLContent>
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>application/xml</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Die Daten sollen in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Diesmal sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

-

Die Daten selbst werden explizit als XML-Fragment als Inhalt des Elements XMLContent angegeben. Das Attribut DataObject/@Reference darf nicht angegeben werden, da die Daten in der Enveloping Form integriert werden sollen, und XMLContent verwendet wird.

-

Der Mime-Type der zu signierenden Daten wird als application/xml angegeben.

-
-    <DataObjectInfo Structure="enveloping" ChildOfManifest="false">
-      <DataObject Reference="http://localhost:8080/referencedData/Text.txt"/>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Die Daten sollen in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Wiederum sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false"). -

-

Die Daten werden diesmal nicht explizit angegeben, sondern mittels der URL in DataObject/@Reference referenziert. MOA SS versucht diese URL aufzulösen, um zu den zu signierenden Daten zu gelangen. Base64Content oder XMLContent oder LocRefContent dürfen nicht verwendet werden, da die Daten in der Enveloping Form integriert werden sollen, und bereits DataObject/@Reference eingesetzt wird.

-

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

-
-    <DataObjectInfo Structure="enveloping" ChildOfManifest="false">
-      <DataObject>
-        <LocRefContent>http://localhost:8080/referencedData/Text.txt</LocRefContent>
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Die Daten sollen wiederum in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Wiederum sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

-

Die Daten werden wie im vorhergehenden Fall nicht explizit angegeben, sondern referenziert. Diesmal wird die URL jedoch nicht DataObject/@Reference verwendet, sondern als Textinhalt des Elements LocRefContent (LocRef steht für Location Reference). DataObject/@Reference darf in diesem Fall nicht verwendet werden. Diese Methode ist semantisch völlig ident mit dem vorhergehenden Fall.

-

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

-
-    <DataObjectInfo Structure="detached" ChildOfManifest="true">
-      <DataObject Reference="http://localhost:8080/referencedData/Text.b64">
-        <Base64Content>RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</Base64Content>
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Die Daten sollen diesmal in der Detached Form in die Signatur aufgenommen werden, d. h. die Daten werden nicht direkt in die Signaturstruktur integriert, sondern lediglich mittels URI im Attribut URI der anzufertigenden dsig:Reference referenziert (Structure="detached"). Die Daten sollen indirekt über eine dsig:Reference eines dsig:Manifests aufgenommen werden (ChildOfManifest="true").

-

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Die Daten selbst hingegen werden im diesem Beispiel explizit in base64 kodierter Form als Inhalt des Elements Base64Content angegeben. MOA SS löst also keine URL zur Erlangung der Daten auf, sondern verwendet den Inhalt von Base64Content.

-

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

-
-    <DataObjectInfo Structure="detached" ChildOfManifest="false">
-      <DataObject Reference="NichtAufloesbareReferenz1">
-        <XMLContent><doc:XMLDocument xmlns:doc="urn:document">
-  <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
-  <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument. 
-Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
-</doc:XMLDocument></XMLContent>
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>application/xml</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Die Daten sollen auch diesmal in der Detached Form in die Signatur aufgenommen werden, d. h. die Daten werden nicht direkt in die Signaturstruktur integriert, sondern lediglich mittels URI im Attribut URI der anzufertigenden dsig:Reference referenziert (Structure="detached"). Diesmal sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false"). -

-

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Die Daten selbst hingegen werden im diesem Beispiel explizit als XML-Fragment in XMLContent angegeben. MOA SS löst auch hier keine URL zur Erlangung der Daten auf, sondern verwendet den Inhalt von XMLContent. Zur Verdeutlichung dieses Umstandes wurde die URI in DataObject/@Reference auf einen Wert gesetzt, der von MOA SS ganz sicher nicht aufgelöst werden kann (NichtAufloesbareReferenz1).

-

Der Mime-Type der zu signierenden Daten wird als application/xml angegeben.

-
-    <DataObjectInfo Structure="detached" ChildOfManifest="false">
-      <DataObject Reference="http://localhost:8080/referencedData/Text.txt">
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Wiederum sollen die Daten in der Detached Form in die Signatur aufgenommen werden (Structure="detached"). Wie zuvor sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

-

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Nachdem eine explizite Angabe der Daten mittels Base64Content, XMLContent oder LocRefContent unterbleibt, wird MOA SS versuchen, die URI in dsig:Reference/@URI als URL aufzulösen, um so zu den zu signierenden Daten zu gelangen.

-

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

-
-    <DataObjectInfo Structure="detached" ChildOfManifest="false">
-      <DataObject Reference="NichtAufloesbareReferenz2">
-        <LocRefContent>http://localhost:8080/referencedData/Text.txt</LocRefContent>
-      </DataObject>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Wiederum sollen die Daten in der Detached Form in die Signatur aufgenommen werden (Structure="detached"). Wie zuvor sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

-

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Den Hinweis, wie MOA SS zu den zu signierenden Daten gelangen soll, ist jedoch in LocRefContent enthalten. MOA SS wird also versuchen, die dort enthaltene URL aufzulösen, um zu den zu signierenden Daten zu gelangen. Zur Verdeutlichung dieses Umstandes wurde die URI in DataObject/@Reference auf einen Wert gesetzt, der von MOA SS ganz sicher nicht aufgelöst werden kann (NichtAufloesbareReferenz2). Diese Art der Datenangabe kann eingesetzt werden, wenn die Daten zum Zeitpunkt der Signaturerstellung von einem anderen Ort bezogen werden müssen, als später dann bei der Signaturprüfung.

-

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

-
-    <DataObjectInfo Structure="detached" ChildOfManifest="false">
-      <DataObject Reference=""/>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <dsig:Transforms>
-            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
-          </dsig:Transforms>
-          <FinalDataMetaInfo>
-            <MimeType>application/xml</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Im letzten Fall schließlich sollen wiederum Daten in der Detached Form in die Signatur aufgenommen werden (Structure="detached"). Wie zuvor sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

-

Die Referenz auf die zu signierenden Daten ist wiederum in DataObject/@Reference enthalten; sie verweist diesmal jedoch nicht auf ein externes Dokument, sondern auf das gesamte (XML-)Dokument, in das die zu erstellende Signatur integriert werden soll, und zwar, indem DataObject/@Reference den leeren String ("") enthält. Nachdem dadurch zwangsläufig auch die Signatur in den zu signierenden Daten enthalten wäre, wird die Signatur durch die Angabe einer Enveloped Signature Transform aus den zu signierenden Daten herausgenommen, bevor darüber der Hashwert berechnet wird (dsig:Transform).

-

Offen bleibt die Frage, wie MOA SS nun weiß, in welches (XML-)Dokument es die die Signatur integrieren soll. Siehe dazu die Erläuterungen zum nächsten Ausschnitts des Requests.

-

Der Mime-Type der zu signierenden Daten wird als application/xml angegeben.

-
-    <CreateSignatureInfo>
-      <CreateSignatureEnvironment>
-        <LocRefContent>http://localhost:8080/referencedData/XMLDocument.xml</LocRefContent>
-      </CreateSignatureEnvironment>
-      <CreateSignatureEnvironmentProfile>
-        <CreateSignatureLocation Index="4" xmlns:doc="urn:document">/doc:XMLDocument</CreateSignatureLocation>
-      </CreateSignatureEnvironmentProfile>
-    </CreateSignatureInfo>
-
-

Das Element CreateSignatureInfo ist grundsätzlich optional, und muss nur angegeben werden, wenn die zu erstellende Signatur von MOA SS in ein bestehendes XML-Dokument integriert werden soll (was in diesem Beispiel ja der Fall ist).

-

CreateSignatureEnvironment enthält das XML-Dokument, in das die zu erstellende Signatur integriert werden soll. In diesem Beispiel wird dieses Dokument mit Hilfe von LocRefContent referenziert, d. h. MOA SS wird versuchen, die darin enthaltene URL aufzulösen, um das XML-Dokument zu erhalten. Alternativ könnte auch Base64Content (explizite Angabe des XML-Dokuments in base64 kodierter Form) oder XMLContent (direkte Angabe des XML-Dokuments im Request) verwendet werden.

-

CreateSignatureLocation enthält die Angabe jener Stelle, an der die Signatur in das XML-Dokument eingesetzt werden soll. Der Inhalt dieses Elements bezeichnet mittels XPath-Ausdruck das Parent-Element der Signatur, der Wert des Attributs CreateSignatureLocation/@Index enthält den Offset innerhalb dieses Parent-Elements. Betrachten Sie zur Verdeutlichung das XML-Dokument XMLDocument.xml, in das die Signatur integriert werden soll: Die Signatur soll unmittelbar nach dem zweiten doc:Paragraph Element in das XML-Dokument eingefügt werden. Der Inhalt von CreateSignatureLocation (/doc:XMLDocument) selektiert das zukünftige Parent-Element der Signatur, also doc:XMLDocument. Das Attribut Index enthält deshalb den Wert 4 (und nicht etwa 2 oder 3), da erstens bei 0 zu zählen begonnen wird, und zweitens auch die Text-Knoten, die lediglich Whitespace enthalten, für diesen Offset zählen (um diese Textknoten erkennen zu können, müssen Sie das XML-Dokument in einem Text-Editor öffnen). Beachten Sie weiters, dass das im XPath-Ausdruck verwendete Namespace-Prefix doc im Kontext des Elements CreateSignatureLocation bekannt sein muss. Deshalb enthält dieses Element auch die entsprechende Namespace-Deklaration (xmlns:doc="urn:document").

-
Response
-

CreateXMLSignatureRequest.Refs.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

-
-<CreateXMLSignatureResponse 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <SignatureEnvironment>
-    <doc:XMLDocument xmlns:doc="urn:document">
-      <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
-      <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
-Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph><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-sha1"/>
-
-

Die Antwort enthält in SignatureEnvironment das Ergebnis der Signaturerstellung. Nachdem die Signatur in ein bestehendes XML-Dokument integriert werden sollte, enthält SignatureEnvironment das Dokument-Element dieses XML-Dokuments (doc:XMLDocument). Man erkennt auch gut, dass die XML-Signatur als fünfter Kindknoten (Offset 4) von doc:XMLDocument eingefügt wurde.

-
-          <dsig:Reference Id="reference-1-2" URI="#xpointer(id('signed-data-1-2-1')/node())">
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>A8ml6/aZKCmj1hONwvLItIwGHoc=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des zweiten DataObjectInfo Elements im Request erstellt. Man erkennt gut den Verweis in dsig:Reference/@URI auf das dsig:Object, das die signierten Daten enthält (der XPointer verweist auf sämtliche Kindknoten jenes Elements, das ein ID-Attribut mit dem Wert signed-data-1-2-1 aufweist, des ersten vorkommenden dsig:Objects der Signatur).

-
-          <dsig:Reference Id="reference-1-3" URI="#xpointer(id('signed-data-1-3-1')/node())">
-            <dsig:Transforms>
-              <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
-            </dsig:Transforms>
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des dritten DataObjectInfo Elements im Request erstellt. Die Text-Daten wurden von der angegebenen URL (http://localhost:8080/referencedData/Text.txt) aufgelöst und in das dsig:Object mit dem ID-Attribut signed-data-1-3-1 gesteckt. Um Probleme mit nicht in XML darstellbare Zeichen zu vermeiden, wurde der Text nicht direkt signiert, sondern in base64 kodierter Form in das dsig:Object integriert, und eine Transformation zur base64 Dekodierung spezifiziert.

-
-          <dsig:Reference Id="reference-1-4" URI="#xpointer(id('signed-data-1-4-1')/node())">
-            <dsig:Transforms>
-              <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
-            </dsig:Transforms>
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des vierten DataObjectInfo Elements im Request erstellt. Wie schon bei der Beschreibung des Requests angeführt, ist die erstellte dsig:Reference semantisch genau gleich wie die vorhergehende.

-
-          <dsig:Reference Id="reference-1-6" URI="NichtAufloesbareReferenz1">
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>2b83+NbXDFijHzz+sH0T7fM36sA=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des sechsten DataObjectInfo Elements im Request erstellt. Die zu signierenden Daten wurden aus dem XMLContent des Requests entnommen, als Wert von dsig:Reference/@URI wurde der Wert von DataObjectInfo/@Reference übernommen.

-
-          <dsig:Reference Id="reference-1-7" URI="http://localhost:8080/referencedData/Text.txt">
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des siebenten DataObjectInfo Elements im Request erstellt. Um zu den zu signierenden Daten zu gelangen, wurde von MOA SS die URL in DataObjectInfo/@Reference aufgelöst. Gleichermaßen wurde die URL in dsig:Reference/@URI übernommen.

-
-          <dsig:Reference Id="reference-1-8" URI="NichtAufloesbareReferenz2">
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des achten DataObjectInfo Elements im Request erstellt. Um zu den zu signierenden Daten zu gelangen, wurde von MOA SS die URL in LocRefContent aufgelöst. In dsig:Reference/@URI wurde der Wert aus DataObjectInfo/@Reference übernommen.

-
-          <dsig:Reference Id="reference-1-9" URI="">
-            <dsig:Transforms>
-              <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
-            </dsig:Transforms>
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>2b83+NbXDFijHzz+sH0T7fM36sA=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference wurde auf Grund des neunten DataObjectInfo Elements im Request erstellt. Als zu signierende Daten wurde das XML-Dokument ausgewählt, in das die XML-Signatur integriert werden solle. Vor der Berechnung des Hashwerts wurde eine Enveloped Signature Transformation zwischengeschaltet, welche die XML-Struktur der Signatur selbst aus den Hash-Eingangsdaten herausschneidet.

-
-          <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#dsig-manifest-1-1">
-            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-            <dsig:DigestValue>mNsxUkFoF46XZVBivBo4aasFCTQ=</dsig:DigestValue>
-          </dsig:Reference>
-
-

Diese dsig:Reference verweist auf das dsig:Manifest weiter unten in der XML-Struktur der Signatur. Das dsig:Manifest wurde angelegt, weil bei zwei DataObjectInfos im Request das Attribut ChildOfManifest auf den Wert true gesetzt wurde.

-
-        </dsig:SignedInfo>
-        <dsig:SignatureValue>...</dsig:SignatureValue>
-        <dsig:KeyInfo>...</dsig:KeyInfo>
-        <dsig:Object Id="signed-data-1-2-1">
-          <doc:XMLDocument xmlns:doc="urn:document">
-            <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
-            <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
-Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
-          </doc:XMLDocument>
-        </dsig:Object>
-        <dsig:Object Id="signed-data-1-3-1">RGllc2UgRGF0ZW4gc2luZCByZWluZXIgVGV4dC4=</dsig:Object>
-        <dsig:Object Id="signed-data-1-4-1">RGllc2UgRGF0ZW4gc2luZCByZWluZXIgVGV4dC4=</dsig:Object>
-        <dsig:Object Id="signed-data-1-1-1">RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</dsig:Object>
-
-

SignatureValue und KeyInfo werden an dieser Stelle nicht näher betrachtet.

-

Das erste dsig:Object enthält die Daten aus dem zweiten DataObjectInfo; das zweite dsig:Object jene aus dem dritten DataObjectInfo; das dritte dsig:Object jene aus dem vierten DataObjectInfo; das vierte dsig:Object schließlich jene aus dem ersten DataObjectInfo.

-
-        <dsig:Object>
-          <dsig:Manifest Id="dsig-manifest-1-1">
-            <dsig:Reference Id="reference-1-1" URI="#xpointer(id('signed-data-1-1-1')/node())">
-              <dsig:Transforms>
-                <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
-              </dsig:Transforms>
-              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-              <dsig:DigestValue>a53jOsL7KbyltpByAK87FoMZphI=</dsig:DigestValue>
-            </dsig:Reference>
-            <dsig:Reference Id="reference-1-5" URI="http://localhost:8080/referencedData/Text.b64">
-              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-              <dsig:DigestValue>a53jOsL7KbyltpByAK87FoMZphI=</dsig:DigestValue>
-            </dsig:Reference>
-          </dsig:Manifest>
-        </dsig:Object>
-
-

Das fünfte dsig:Object enthält das dsig:Manifest, das von MOA SS auf Grund des ersten bzw. fünften DataObjectInfo des Requests erstellt wurde. Darin enthalten sind die zum ersten und fünten DataObjectInfo korrespondierenden dsig:Reference Elemente. Die Daten für die erste im dsig:Manifest enthaltene dsig:Reference wurden aus dem Base64Content Element des ersten DataObjectInfo entnommen, jene für die zweite dsig:Reference aus dem Base64Content Element des fünften DataObjectInfo. Der Wert des URI Attributs der zweiten dsig:Reference wurde aus dem DataObject/@Reference des fünften DataObjectInfo übernommen.

-

2.1.1.3 Transformationen

-
Request
-

Dieses Beispiel (CreateXMLSignatureRequest.Transforms.xml) stellt die wichtigsten Transformationen vor, die von MOA SS bei der Erstellung einer Signatur verwendet werden können. Eine Transformation bzw. eine Kette mehrerer hintereinandergeschalteter Transformationen werden auf die Referenz-Eingangsdaten (also jene Daten, die in DataObjectInfo/DataObject angegeben werden) angewendet; das Ergebnis fließt dann in die Hashwert-Berechnung ein.

-
<CreateXMLSignatureRequest 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<KeyIdentifier>KG_allgemein</KeyIdentifier>
<SingleSignatureInfo SecurityLayerConformity="false">
-

Die Signatur soll mit dem Schlüssel KG_allgemein erstellt werden; jene Elemente, die speziell für eine Security-Layer V1.1 konforme Signatur notwendig sind (vergleiche Einfaches Beispiel), brauchen nicht erstellt zu werden (SecurityLayerConformity="false").

-
-    <DataObjectInfo Structure="detached">
-      <DataObject Reference="http://localhost:8080/referencedData/Text.b64"/>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <dsig:Transforms>
-            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
-          </dsig:Transforms>
-          <FinalDataMetaInfo>
-            <MimeType>text/plain</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Für das erste zu signierende Datenobjekt werden die Referenz-Eingangsdaten mittels DataObject/@Reference referenziert, d. h. MOA SS löst die darin enthaltene URL auf, um zu den Daten zu gelangen. Es handelt sich dabei um einen base64 kodierten Text.

-

Unterschrieben werden soll nun aber nicht dieser base64 kodierte Text, sondern der entsprechend dekodierte Text. Dies lässt sich elegant durch die Angabe einer Base64 Decoding Transformation bewerkstelligen. Dazu wird als erstes Kindelement von CreateTransformsInfo ein dsig:Transforms Element im Request angegeben. Dieses dsig:Transforms Element nimmt ein oderer mehrere dsig:Transform Elemente auf, wobei jedes dsig:Transform Element für eine Transformation steht. In unserem Fall wird nur eine einzige Transformation benötigt; die Angabe, um welche Transformation es sich handelt, wird durch das Attribut dsig:Transform/@Algorithm angegeben. Für die Base64 Decoding Transformation muss der Wert auf http://www.w3.org/2000/09/xmldsig#base64 gesetzt werden. Sie ist eine parameterlose Transformation, d. h. dsig:Transform hat keine Kindelemente.

-

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben, da ja tatsächlich nach der durchgeführten Transformation dekodierter Text vorliegt, über den dann der Hashwert berechnet wird.

-
-    <DataObjectInfo Structure="detached">
-      <DataObject Reference="http://localhost:8080/referencedData/XMLDocument.xml"/>
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <dsig:Transforms>
-            <dsig:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2">
-              <xp2:XPath 
-                xmlns:xp2="http://www.w3.org/2002/06/xmldsig-filter2" 
-                xmlns:doc="urn:document" 
-                Filter="subtract">/doc:XMLDocument/doc:Paragraph[2]</xp2:XPath>
-            </dsig:Transform>
-            <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:doc="urn:document">
-  <xsl:output encoding="UTF-8" method="xml" indent="yes"/>
-  <xsl:template match="/doc:XMLDocument">
-    <html xmlns="http://www.w3.org/1999/xhtml">
-      <head>
-        <title>HTML-Dokument</title>
-      </head>
-      <body>
-        <xsl:for-each select="doc:Paragraph">
-          <p>
-            <xsl:value-of select="child::text()"/>
-          </p>
-        </xsl:for-each>
-      </body>
-    </html>
-  </xsl:template>
-</xsl:stylesheet></dsig:Transform>
-            <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
-          </dsig:Transforms>
-          <FinalDataMetaInfo>
-            <MimeType>application/xhtml+xml</MimeType>
-          </FinalDataMetaInfo>
-        </CreateTransformsInfo>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Für das zweite zu signierende Datenobjekt werden die Referenz-Eingangsdaten wiederum mittels DataObject/@Reference referenziert, d. h. MOA SS löst die darin enthaltene URL auf, um zu den Daten zu gelangen. Es handelt sich dabei um ein XML-Dokument.

-

Zunächst soll von diesem XML-Dokument jedoch ein Teil weggeschnitten werden, da er nicht mitsigniert werden soll. Für diesen Zweck bietet sich die XPath Filter 2 Transformation an. Das Attribut dsig:Transform/@Algorithm ist dazu auf den Wert http://www.w3.org/2002/06/xmldsig-filter2 zu setzen. Diese Transformation benötigt weiters Transformationsparameter. Diese werden als Kindelement xp2:XPath in dsig:Transform angegeben. Das Attribut Filter selektiert den Filtermodus; für das Bespiel wird den Modus subtract benötigt, da ein Teil weggefiltert werden soll. Der Textinhalt von xp2:XPath ist ein XPath-Ausdruck, der den Wurzelknoten jenes Teilbaums selektiert, der weggefiltert werden soll. Für das Beispiel soll das zweite doc:Paragraph Element des XML-Dokuments weggefiltert werden. Beachten Sie, dass das im XPath-Ausdruck verwendete Namespace-Prefix doc im Kontext des xp2:XPath Elements deklariert sein muss.

-

Als nächstes soll nun das XML-Dokument mit Hilfe eines Stylesheets in ein XHTML-Dokument übergeführt werden. Dazu kann die XSLT Transformation verwendet werden. Das Attribut dsig:Transform/@Algorithm ist dazu auf den Wert http://www.w3.org/TR/1999/REC-xslt-19991116 zu setzen. Auch diese Transformation benötigt Transformationsparameter: Als Kindelement von dsig:Transform wird jener Stylesheet angegeben, mit dem die Stylesheet-Transformation ausgeführt werden soll.

-

Abschließend soll, wie in der Spezifikation der XSLT-Transformation empfohlen, eine Kanonisierungstransformation angewendet werden. Damit können Unterschiede im Output unterschiedlicher XSLT-Engines, wie sie in der Praxis vorkommen, abgefangen werden. Beachten Sie, dass als Voraussetzung dazu die Output-Methode im Stylesheet auf xml festgelegt werden muss (<xsl:output method="xml">), denn nur XML-Output kann anschließend kanonisiert werden. Das Attribut dsig:Transform/@Algorithm ist für die Canonical XML Transformation auf den Wert http://www.w3.org/TR/2001/REC-xml-c14n-20010315 zu setzen. Die Transformation benötigt keine Transformationsparameter.

-

Das Ergebnis der drei hintereinandergeschalteten Transformationen, welches der Hashwert-Berechnung zufließt, finden Sie hier.

-
Response
-

CreateXMLSignatureRequest.Transforms.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

-
-<CreateXMLSignatureResponse 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <SignatureEnvironment>
-    <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-sha1"/>
-
-

Die Antwort enthält in SignatureEnvironment das Ergebnis der Signaturerstellung. Nachdem die Signatur in kein bestehendes Dokument eingefügt werden sollte, enhält SignatureEnvironment direkt die erzeugte XML-Signatur (dsig:Signature).

-
-        <dsig:Reference Id="reference-1-1" URI="http://localhost:8080/referencedData/Text.b64">
-          <dsig:Transforms>
-            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
-          </dsig:Transforms>
-          <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-          <dsig:DigestValue>a53jOsL7KbyltpByAK87FoMZphI=</dsig:DigestValue>
-        </dsig:Reference>
-
-

Die erste dsig:Reference wurde auf Grund des ersten DataObjectInfo im Request erstellt. Man erkennt dass die URL auf die Referenz-Eingangsdaten (Wert des Attributs dsig:Reference/@URI) aus DataObject/@Reference übernommen und eine Base64 Decoding Transformation eingefügt würde. Die im Request spezifizierten Transformationen werden also eins zu eins in die XML-Signatur übernommen.

-
-        <dsig:Reference Id="reference-1-2" URI="http://localhost:8080/referencedData/XMLDocument.xml">
-          <dsig:Transforms>
-            <dsig:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2">
-              <xp2:XPath Filter="subtract" xmlns:doc="urn:document" 
-                xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" 
-                xmlns:xf2="http://www.w3.org/2002/06/xmldsig-filter2" 
-                xmlns:xp2="http://www.w3.org/2002/06/xmldsig-filter2">/doc:XMLDocument/doc:Paragraph[2]</xp2:XPath>
-            </dsig:Transform>
-            <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
-              <xsl:stylesheet version="1.0" 
-                xmlns:doc="urn:document" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-                <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
-                <xsl:template match="/doc:XMLDocument">...</xsl:template>
-              </xsl:stylesheet>
-            </dsig:Transform>
-            <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
-          </dsig:Transforms>
-          <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-          <dsig:DigestValue>fIPwneCpjVqTXwHMN9DFfx6tJIU=</dsig:DigestValue>
-        </dsig:Reference>
-
-

Die zweite dsig:Reference wurde auf Grund des zweiten DataObjectInfo im Request erstellt. Man erkennt auch hier gut, dass die URL auf die Referenz-Eingangsdaten (Wert des Attributs dsig:Reference/@URI) aus DataObject/@Reference übernommen und die drei Transformationen wie im Request angegeben eingefügt wurden.

-

2.1.1.4 Ergänzungsobjekte

-
Request
-

Dieses Beispiel (CreateXMLSignatureRequest.Supplements.xml) stellt die Verwendung von Ergänzungsobjekten vor. Ein Ergänzungsobjekt betrifft entweder ein zu signierendes Datum (Zusammenhang mit einem DataObject) oder jenes Dokument, in das eine zu erzeugende Signatur eingefügt werden soll (Zusammenhang mit CreateSignatureEnvironment). Es muss dann angegeben werden, wenn in einem zu signierenden Datum bzw. im Einfügedokument auf Daten per Referenz verwiesen wird, diese referenzierten Daten aber von MOA SS nicht aufgelöst werden können. Das Ergänzungsobjekt enthält dann genau diese Daten, die nicht von MOA SS aufgelöst werden können.

-
-<CreateXMLSignatureRequest 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <KeyIdentifier>KG_allgemein</KeyIdentifier>
-  <SingleSignatureInfo SecurityLayerConformity="false">
-
-

Die Signatur soll mit dem Schlüssel KG_allgemein erstellt werden; jene Elemente, die speziell für eine Security-Layer V1.1 konforme Signatur notwendig sind (vergleiche Einfaches Beispiel), brauchen nicht erstellt zu werden (SecurityLayerConformity="false").

-
-    <DataObjectInfo Structure="detached">
-      <DataObject Reference="#Para2"/>
-
-

Das zu signierende Datum in diesem Beispiel ist ein Teil des Dokuments, in das die zu erstellende Signatur eingefügt werden soll. Der Wert des Reference Attributs ist #Para2, das bedeutet, dass jenes Element des Einfügedokuments signiert werden soll, das ein ID-Attribut mit dem Wert #Para2 aufweist. Damit MOA SS diesen Hinweis auswerten kann, muss es das Einfügedokument validierend parsen, denn sonst wüsste es ja nicht, welche Attribute überhaupt ID-Attribute sind. Das zum validierenden Parsen notwendige XML-Schema wird MOA SS in diesem Beispiel über ein Ergänzungsobjekt zum Einfügedokument mitgeteilt (siehe weiter unten).

-
-      <CreateTransformsInfoProfile>
-        <CreateTransformsInfo>
-          <dsig:Transforms>
-            <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">
-  <xsl:include href="XMLDocument.Para.xsl"/>
-</xsl:stylesheet>              
-            </dsig:Transform>
-            <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
-          </dsig:Transforms>
-          <FinalDataMetaInfo>
-            <MimeType>application/xhtml+xml</MimeType>
-          </FinalDataMetaInfo>
-
-

Das Beispiel enthält als erste Transformation eine XSLT-Transformation. Der als Kindelement von dsig:Transform angegebene Stylesheet verweist dabei mittels xsl:include auf einen weiteren Stylesheet. Dieser weitere Stylesheet kann jedoch von MOA nicht direkt aufgelöst werden, da er als relative Referenz angegeben wird. Deshalb ist es notwendig, diesen weiteren Stylesheet als Ergänzungsobjekt zu den signierenden Daten anzugeben:

-
-        </CreateTransformsInfo>
-        <Supplement>
-          <Content Reference="XMLDocument.Para.xsl">
-            <LocRefContent>http://localhost:8080/referencedData/XMLDocument.Para.xsl</LocRefContent>
-          </Content>
-        </Supplement>
-      </CreateTransformsInfoProfile>
-    </DataObjectInfo>
-
-

Ein Ergänzungsobjekt für zu signierende Daten wird im entsprechenden DataObjectInfo Element angegeben, und zwar als Inhalt des Elements CreateTransformsInfoProfile/Supplement. Das verpflichtend zu verwendende Attribut Content/@Reference enthält dabei die Referenz auf das Ergänzungsobjekt in exakt jener Schreibweise, wie sie in der xsl:include Direktive vorkommt, hier also XMLDocument.Para.xsl. Das Element Content beinhaltet das Ergänzungsobjekt so, wie es MOA SS verwenden soll (Elemente Base64Content oder XMLContent, vergleiche Einfaches Beispiel), bzw. enthält eine von MOA SS auflösbare Referenz auf das Ergänzungsobjekt (Element LocRefContent, vergleiche Einfaches Beispiel). Im konkreten Beispiel wird LocRefContent verwendet.

-
-    <CreateSignatureInfo>
-      <CreateSignatureEnvironment 
-        Reference="http://localhost:8080/referencedData/XMLDocument.withSchemaHint.xml"/>
-      <CreateSignatureEnvironmentProfile>
-        <CreateSignatureLocation 
-          Index="4" xmlns:doc="urn:document">/doc:XMLDocument</CreateSignatureLocation>
-
-

Eingefügt werden soll die zu erzeugende Signatur in ein bestehendes Dokument, das MOA SS durch Auflösen der in CreateSignatureEnvironment/@Reference angegebenen URL erhält. Eingefügt werden soll die Signatur als fünfter Kindknoten des Wurzelelements doc:XMLDocument. Beachten Sie wiederum die Hinweise zur Zählweise für das Attribut Index bzw. zur Deklaration der im XPath-Ausdruck verwendeten Namespace-Deklarationen (hier doc).

-
-        <Supplement>
-          <Content Reference="urn:XMLDocument.xsd">
-            <LocRefContent>http://localhost:8080/referencedData/XMLDocument.xsd</LocRefContent>
-          </Content>
-        </Supplement>
-      </CreateSignatureEnvironmentProfile>
-    </CreateSignatureInfo>
-
-

Wie oben bereits angemerkt, muss MOA SS zur Auflösung der ID-Referenz #Para2 das Einfügedokument validierend parsen. Im Einfügedokument ist zwar nun ein Hinweis auf die dazu notwendige Grammatikinformation in Form eines XML-Schemas enthalten (Attribut xsi:schemaLocation enthält den Wert "urn:document urn:XMLDocument.xsd"). Nachdem die darin angegebene URI urn:XMLDocument.xsd jedoch von MOA nicht direkt aufgelöst werden kann, wird im Request ein Ergänzungsobjekt zum Einfügedokument angegeben (CreateSignatureEnvironmentProfile/Supplement). Das Attribut Content/@Reference enthält die Referenz auf das Ergänzungsobjekt in exakt jener Schreibweise, wie sie im Attribut xsi:schemaLocation angegeben wurde (urn:XMLDocument.xsd). Das Element Content beinhaltet das Ergänzungsobjekt so, wie es MOA SS verwenden soll (Elemente Base64Content oder XMLContent, vergleiche Einfaches Beispiel), bzw. enthält eine von MOA SS auflösbare Referenz auf das Ergänzungsobjekt (Element LocRefContent, vergleiche Einfaches Beispiel). Im konkreten Beispiel wird LocRefContent verwendet.

-

Beachten Sie bitte, dass die Verwendung von Ergänzungsobjekten für die Mitteilung von XML-Schemata nur dann funktioniert, wenn die Referenz auf das XML-Schema in der xsi:schemaLocation eine absolute URI ist (also z.B. wie hier urn:XMLDocument.xsd oder auch http://example.org/XMLDocument.xsd, nicht aber z.B. XMLDocument.xsd oder ../schemas/XMLDocument.xsd).

-

Auch für das Auflösen eines Verweises in einer DTD kann in analoger Weise von Ergänzungsobjekten Gebrauch gemacht werden.

-
Response
-

CreateXMLSignatureRequest.Supplements.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Er wird an dieser Stelle nicht näher analysiert, da er keine für das Thema des Beispiels relevanten Besonderheiten aufweist.

-

2.1.2 Prüfung einer CMS-Signatur

-

2.1.2.1 Einfaches Beispiel

-
Request
-

Dieses Beispiel (VerifyCMSSignatureRequest.Simple.xml) ist ein einfacher Request zur Prüfung einer CMS-Signatur. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass der nachfolgende Ausschnitt aus dem Request aus Gründen der Übersichtlichkeit gekürzt wurde.

-
-<VerifyCMSSignatureRequest 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
-  <CMSSignature>MIIHsAYJKo...4sLL6kpOPJaLg==</CMSSignature>
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyCMSSignatureRequest>
-
-

Der Request enthält zunächst in CMSSignature die zu prüfende CMS-Signatur, und zwar in base64 kodierter Form. In diesem Beispiel wird davon ausgegangen, dass es sich dabei um eine Enveloping Signature handelt, d. h. dass die signierten Daten als Teil der CMS-Struktur vorhanden sind. Für die Behandlung einer Detached Signature sei auf das nächste Beispiel verwiesen.

-

Abschließend enthält der Request in TrustProfileID die Angabe des Vertrauensprofils, gegen das die Vertrauensprüfung des Zertifikats durchgeführt werden soll. Ein Vertrauensprofil mit dem angegebenen Namen muss in der für die Signaturprüfung verwendeten Instanz von MOA SP eingerichtet sein.

-
Response
-

VerifyCMSSignatureRequest.Simple.resp.xml 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ückt und gekürzt wurde.

-
-<VerifyCMSSignatureResponse 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <SignerInfo>
-    <dsig:X509Data>
-      <dsig:X509SubjectName>serialNumber=615536615920,givenName=Gregor,SN=Karlinger,
-CN=Gregor Karlinger,C=AT</dsig:X509SubjectName>
-      <dsig:X509IssuerSerial>
-        <dsig:X509IssuerName>CN=TrustSignTest-Sig-01,OU=TrustSignTest-Sig-01,
-O=A-Trust Ges. für Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName>
-        <dsig:X509SerialNumber>2892</dsig:X509SerialNumber>
-      </dsig:X509IssuerSerial>
-      <dsig:X509Certificate>...</dsig:X509Certificate>
-      <QualifiedCertificate/>
-    </dsig:X509Data>
-  </SignerInfo>
-
-

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der CMS-Signatur enthaltenen Signatorzertifikat entnommen sind.

-

dsig:X509SubjectName ist immer vorhanden und enthält den Namen des Signators. dsig:X509IssuerSerial ist ebenfalls immer vorhanden und enthält den Namen des Austellers des Signatorzertifikats (dsig:X509IssuerName) sowie die Seriennummer des Zertifikats (dsig:X509SerialNumber). Auch dsig:X509Certificate ist immer vorhanden und enthält das Signatorzertifikat in base64 kodierter Form.

-

Optional vorhanden ist das inhaltslose Element QualifiedCertificate, und zwar dann, wenn es sich beim Signatorzertifikat um ein qualifiziertes Zertifikat handelt. Ebenfalls optional vorhanden ist schließlich - in diesem Beispiel nicht ersichtlich - das Element PublicAuthority, und zwar dann, wenn das Signatorzertifikat die österreichspezifische Zertifikatserweiterung Verwaltungseigenschaft aufweist. Ist in dieser Zertifikatserweiterung das Verwaltungskennzeichen mitkodiert, wird dieses Kennzeichen als Textinhalt des optionalen Elements PublicAuthority/Code geliefert.

-
-  <SignatureCheck>
-    <Code>0</Code>
-  </SignatureCheck>
-
-

Anschließend an SignerInfo enthält die Response mit SignatureCheck/Code das Resultat der kryptographischen Prüfung der Signatur. In unserem Beispiel ist dort der Wert 0 enthalten, d. h. die Signatur konnte erfolgreich validiert werden. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

-
-  <CertificateCheck>
-    <Code>1</Code>
-  </CertificateCheck>
-
-

Abschließend enthält die Response mit CertificateCheck/Code das Resultat der Prüfung des Signatorzertifikats. Zunächst prüft MOA SP, ob ausgehend vom Signatorzertifikat eine Zertifikatskette zu einem im zugehörigen Vertrauensprofil konfigurierten sog. Trust Anchor gebildet werden kann. Gelingt dies, wird die Gültigkeit jedes Zertifikats dieser Kette überprüft. In unserem Beispiel enthält Code den Wert 1, d. h. MOA SP konnte die oben erläuterte Zertifikatskette nicht bilden. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

-

2.1.2.2 Erweitertes Beispiel

-
Request
-

Dieses erweiterte Beispiel zur Prüfung einer CMS-Signatur (VerifyCMSSignatureRequest.Extended.xml) demonstriert die Prüfung mehrerer Signatoren einer CMS-Signatur, die Angabe des Prüfzeitpunkts sowie die Prüfung einer Detached Signature, d. h. einer Signatur, in der die signierten Daten nicht enthalten sind und daher extra angegeben werden müssen.

-
-<VerifyCMSSignatureRequest 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  Signatories="1">
-  <DateTime>2004-08-17T08:00:00+02:00</DateTime>
-  <CMSSignature>MIIHiwYJKoZI...kfiwsvqSk48lou</CMSSignature>
-  <DataObject>
-    <Content>
-      <Base64Content>RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</Base64Content>
-    </Content>
-  </DataObject>
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyCMSSignatureRequest>
-
-

Liegt eine zu prüfende CMS-Signatur vor, die von mehreren Unterzeichnenden signiert worden ist, kann das Attribut VerifyCMSSignatureRequest/@Signatories verwendet werden, um jene Unterzeichnenden auszuwählen, deren Unterschriften von MOA SP geprüft werden sollen. Der Default-Wert für dieses optionale Attribut ist 1. Soll nicht die Unterschrift allein des ersten Unterzeichnenden geprüft werden, muss das Attribut explizit angegeben werden. Es enthält dann eine oder mehrere Ganzzahlwerte, getrennt durch Leerzeichen. Jede Ganzzahl bezeichnet einen Unterzeichnenden, wobei die Reihenfolge der Auflistung der Unterzeichner in der CMS-Signatur entspricht. Der Wert "1 3" würde beispielsweise aussagen, dass MOA SP die Unterschrift des ersten sowie des dritten Unterzeichnenden prüfen soll.

-

Mit dem optionalen Element DateTime kann der Zeitpunkt der Signaturprüfung explizit vorgegeben werden. Inhalt dieses Elements ist die Angabe von Datum und Uhrzeit entsprechend dem XML-Schema Datentyp dateTime. Enthält der angegebene Zeitpunkt keinen Zeitzonen-Offset zur UTC, wird der Zeitpunkt als lokale Zeit des Servers interpretiert, auf dem MOA SP läuft. Wird DateTime nicht angegeben, versucht MOA SP, den Zeitpunkt der Signaturerstellung aus der Signatur zu ermitteln (anhand des Signaturattributs SigningTime). Enthält die Signatur keinen Zeitpunkt der Signaturerstellung, verwendet MOA SP die aktuelle Systemzeit des Servers, auf dem es läuft.

-

Das optionale Element DataObject muss dann angegeben werden, wenn eine Detached Signature geprüft werden soll, d. h. wenn in der CMS-Signatur die signierten Daten nicht mitkodiert sind. In DataObject/Content/Base64Content sind in einem solchen Fall diese Daten in base64 kodierter Form bereit zu stellen.

-
Response
-

VerifyCMSSignatureRequest.Extended.resp.xml ist eine typische Response des SP Webservices auf den obigen Request. Er wird an dieser Stelle nicht näher analysiert, da er keine für das Thema des Beispiels relevanten Besonderheiten aufweist.

-

2.1.3 Prüfen einer XML-Signatur

-

2.1.3.1 Einfaches Beispiel

-
Request
-

VerifyXMLSignatureRequest.Simple.xml ist ein einfacher XML-Request zur Prüfung einer XML-Signatur. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

-
-<VerifyXMLSignatureRequest xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
-  <VerifySignatureInfo>
-    <VerifySignatureEnvironment>
-      <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-sha1"/>
-            <dsig:Reference Id="reference-1-1" URI="#xpointer(id('signed-data-1-1-1')/node())">
-              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-              <dsig:DigestValue>tLODyeiWFbAkQKwhrR23jtcgu4k=</dsig:DigestValue>
-            </dsig:Reference>
-          </dsig:SignedInfo>
-          <dsig:SignatureValue>...</dsig:SignatureValue>
-          <dsig:KeyInfo>...</dsig:KeyInfo>
-          <dsig:Object Id="signed-data-1-1-1">Diese Daten werden signiert.</dsig:Object>
-        </dsig:Signature>
-      </XMLContent>
-    </VerifySignatureEnvironment>
-
-

Das Element VerifySignatureEnvironment enthält jenes XML-Dokument, das die zu prüfende XML-Signatur enthält. Auch hier stehen eine Reihe von Möglichkeiten zur Verfügung, dieses XML-Dokument anzugeben. Im Beispiel wurde das Element XMLContent verwendet; alternativ stehen die Elemente Base64Content und LocRefContent bzw. gleichwertig zu LocRefContent das Attribut Reference zur Verfügung.

-

Im konkreten Beispiel enthält das angegebene XML-Dokument direkt als Root-Element die zu prüfende Signatur (dsig:Signature). Es handelt sich dabei um eine Enveloping Signature, d. h. die signierten Daten sind in einem dsig:Object als Teil der XML-Struktur der Signatur kodiert. Tatsächlich signiert ist hier die Zeichenkette Diese Daten werden signiert.

-
-    <VerifySignatureLocation
-      xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">/dsig:Signature</VerifySignatureLocation>
-  </VerifySignatureInfo>
-
-

Das Element VerifySignatureLocation enthält als Text den XPath-Ausdruck zur Selektion der XML-Signatur innerhalb des zu prüfenden XML-Dokuments. Die Auswertung des XPath-Ausdrucks muss genau ein Element dsig:Signature ergeben. Bitte beachten Sie, dass im Kontext des Elements VerifySignatureLocation alle im XPath-Ausdruck verwendeten Namespace-Präfixe bekannt sein müssen (hier das Präfix dsig).

-
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyXMLSignatureRequest>
-
-

Das Element TrustProfileID schließlich enthält den Bezeichner des Vertrauensprofils, gegen das die Zertifikatsprüfung von MOA SP durchgeführt wird. Ein Vertrauensprofil enthält die Zertifikate jene Zertifizierungsdiensteanbieter, denen als Aussteller von Signatorzertifikaten vertraut wird. Ein Vertrauensprofil mit dem gewählten Namen (hier Test-Signaturdienste) muss in der Konfiguration von MOA SP hinterlegt sein.

-
Response
-

VerifyXMLSignatureRequest.Simple.resp.xml 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ückt und gekürzt wurde.

-
-<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>CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,
-      O=Stabsstelle IKT-Strategie des Bundes,C=AT</dsig:X509SubjectName>
-      <dsig:X509IssuerSerial>
-        <dsig:X509IssuerName>CN=Test CA - Signaturdienste,OU=Technik und Standards,
-        O=Stabstelle IKT-Strategie des Bundes,C=AT</dsig:X509IssuerName>
-        <dsig:X509SerialNumber>9</dsig:X509SerialNumber>
-      </dsig:X509IssuerSerial>
-      <dsig:X509Certificate>...</dsig:X509Certificate>
-      <PublicAuthority>
-        <Code>BKA-IKT</Code>
-      </PublicAuthority>
-    </dsig:X509Data>
-  </SignerInfo>
-
-

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind.

-

dsig:X509SubjectName ist immer vorhanden und enthält den Namen des Signators. dsig:X509IssuerSerial ist ebenfalls immer vorhanden und enthält den Namen des Austellers des Signatorzertifikats (dsig:X509IssuerName) sowie die Seriennummer des Zertifikats (dsig:X509SerialNumber). Auch dsig:X509Certificate ist ist immer vorhanden und enthält das Signatorzertifikat in base64 kodierter Form.

-

Optional vorhanden - in diesem Beispiel nicht ersichtlich - ist das inhaltslose Element QualifiedCertificate, und zwar dann, wenn es sich beim Signatorzertifikat um ein qualifiziertes Zertifikat handelt. Ebenfalls optional vorhanden ist schließlich das Element PublicAuthority, und zwar dann, wenn das Signatorzertifikat die österreichspezifische Zertifikatserweiterung Verwaltungseigenschaft aufweist. Ist in dieser Zertifikatserweiterung das Verwaltungskennzeichen mitkodiert, wird dieses Kennzeichen als Textinhalt des optionalen Elements PublicAuthority/Code geliefert.

-
-  <SignatureCheck>
-    <Code>0</Code>
-  </SignatureCheck>
-
-

Anschließend an SignerInfo enthält die Response mit SignatureCheck/Code das Resultat der kryptographischen Prüfung der Signatur. In unserem Beispiel ist dort der Wert 0 enthalten, d. h. die Signatur konnte erfolgreich validiert werden. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

-
-  <CertificateCheck>
-    <Code>0</Code>
-  </CertificateCheck>
-
-

Abschließend enthält die Response mit CertificateCheck/Code das Resultat der Prüfung des Signatorzertifikats. Zunächst prüft MOA SP, ob ausgehend vom Signatorzertifikat eine Zertifikatskette zu einem im zugehörigen Vertrauensprofil konfigurierten sog. Trust Anchor gebildet werden kann. Gelingt dies, wird die Gültigkeit jedes Zertifikats dieser Kette überprüft. In unserem Beispiel enthält Code den Wert 0, d. h. MOA SP konnte die Kette bilden, und alle Zertifikate der Kette sind gültig. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

-

2.1.3.2 Erweitertes Beispiel

-
Request
-

Dieses erweiterte Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.Enveloped.xml) demonstriert die Prüfung einer Enveloped Signature, d. h. einer Signatur, die in ein XML-Dokument integriert ist, die Angabe des Prüfzeitpunkts sowie die Anweisung an MOA SP, in der Response die von der Signatur abgedeckten Daten zu retournieren.

-
-<VerifyXMLSignatureRequest xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
-  <DateTime>2004-08-18T17:00:00+02:00</DateTime>
-
-

Mit dem optionalen Element DateTime kann der Zeitpunkt der Signaturprüfung explizit vorgegeben werden. Inhalt dieses Elements ist die Angabe von Datum und Uhrzeit entsprechend dem XML-Schema Datentyp dateTime. Enthält der angegebene Zeitpunkt keinen Zeitzonen-Offset zur UTC, wird der Zeitpunkt als lokale Zeit des Servers interpretiert, auf dem MOA SP läuft. Wird DateTime nicht angegeben, versucht MOA SP, den Zeitpunkt der Signaturerstellung aus der Signatur zu ermitteln (anhand des Signaturattributs SigningTime). Enthält die Signatur keinen Zeitpunkt der Signaturerstellung, verwendet MOA SP die aktuelle Systemzeit des Servers, auf dem es läuft.

-
-  <VerifySignatureInfo>
-    <VerifySignatureEnvironment Reference="http://localhost:8080/referencedData/XMLDocument.signed.xml"/>
-    <VerifySignatureLocation xmlns:doc="urn:document"
-      xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">/doc:XMLDocument/dsig:Signature</VerifySignatureLocation>
-  </VerifySignatureInfo>
-
-

Das Element VerifySignatureEnvironment enthält in diesem Fall mit dem Attribut Reference eine Referenz auf das XML-Dokument (XMLDocument.signed.xml), das die zu prüfende Signatur beinhaltet. Als Textinhalt von VerifySignatureLocation ist ein XPath-Ausdruck angegeben, der die zu prüfende Signatur innerhalb des XML-Dokuments auswählt. Bitte beachten Sie, dass im Kontext des Elements VerifySignatureLocation alle im XPath-Ausdruck verwendeten Namespace-Präfixe bekannt sein müssen (hier die Präfixe doc und dsig).

-
-  <ReturnHashInputData/>
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyXMLSignatureRequest>
-
-

Durch Angabe des optionalen, leeren Elements ReturnHashInputData wird MOA SP angewiesen, im Response jene Daten zurückzuliefern, die von der Signatur abgedeckt sind, d. h. tatsächlich signiert wurden (siehe unten). Diese Information ist für die MOA SP verwendende Anwendung essentiell, da sie wissen muss, ob tatsächlich die von ihr geforderten Daten signiert wurden. Wird HashInputData im Request nicht angegeben, muss die Anwendung selbst die Signatur analysieren, um diese Information zu erhalten.

-
Response
-

VerifyXMLSignatureRequest.Enveloped.resp.xml 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ückt und gekürzt wurde.

-
-<VerifyXMLSignatureResponse 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <SignerInfo>
-    <dsig:X509Data>...</dsig:X509Data>
-  </SignerInfo>
-
-

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind (siehe Einfaches Beispiel).

-
-  <HashInputData PartOf="SignedInfo">
-    <Base64Content>PGRvYzp...hNTERvY3VtZW50Pg==</Base64Content>
-  </HashInputData>
-
-

Wurde im Request - so wie in diesem Beispiel - das Element ReturnHashInputData angegeben, enthält - die Response nach SignerInfo für jede dsig:Reference in dsig:SignedInfo der - XML-Signatur (bzw. auch für jede dsig:Reference aus einem dsig:Manifest, auf - das mittels des Attributs Type="http://www.w3.org/2000/09/xmldsig#Manifest" in einer dsig:Reference aus dsig:SignedInfo verwiesen - wird; solche Manifeste kommen aber in diesem Beispiel nicht vor) ein Element HashInputData.

-

Die Reihenfolge der HashInputData-Elemente - entspricht der Reihenfolge der dsig:Reference-Elemente in dsig:SignedInfo der - XML-Signatur (enthält die XML-Signatur auch dsig:Manifest-Elemente, auf die jeweils in einer dsig:Reference aus dsig:SignedInfo verwiesen wird, werden zuerst HashInputData-Elemente für alle dsig:Reference-Elemente - aus dsig:SignedInfo und anschließend HashInputData-Elemente für alle dsig:Reference-Elemente - aus den einzelnen dsig:Manifest-Elementen geliefert).

-

Das Attribut PartOf weist mit dem Wert SignedInfo darauf hin, dass die dsig:Reference, -für welche die Hasheingangsdaten gelten, Teil von dsig:SignedInfo ist (für eine dsig:Reference aus -einem dsig:SignedInfo würde der gelieferte Wert XMLDSIGManifest lauten; weiters -würde HashInputData in einem solchen Fall ein weiteres Attribut - - -ReferringSigReference aufweisen, dessen Wert die Nummer jener dsig:Reference aus dsig:SignedInfo als -positive Ganzzahl repräsentiert, die auf das beinhaltende dsig:Manifest verweist.).

-

Der Inhalt wird dabei stets mittels Base64Content in - base64-kodierter Form geliefert.

-
-  <SignatureCheck>
-    <Code>0</Code>
-  </SignatureCheck>
-  <CertificateCheck>
-    <Code>0</Code>
-  </CertificateCheck>
-</VerifyXMLSignatureResponse>
-
-

Die Elemente SignatureCheck und CertificateCheck enthalten die Resultate der kryptographischen Prüfung der Signatur sowie der Zertifikatsprüfung (siehe Einfaches Beispiel).

-

2.1.3.3 Prüfung eines XMLDSIG-Manifests

-
Request
-

Dieses Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.XMLDSigManifest.xml) demonstriert die Prüfung eines in der XML-Signatur vorhandenden Manifests nach XMLDSig. Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

-
-<VerifyXMLSignatureRequest
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <VerifySignatureInfo>
-    <VerifySignatureEnvironment>
-      <XMLContent>
-        <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="signature-1-1">
-          <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-sha1"/>
-            <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#dsig-manifest-1-1">
-              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-              <dsig:DigestValue>nUUaW6OtcsNvV/QhqmkU2QXT1Mw=</dsig:DigestValue>
-            </dsig:Reference>
-          </dsig:SignedInfo>
-          <dsig:SignatureValue>315gCwZI...OXFwr+</dsig:SignatureValue>
-          <dsig:KeyInfo>...</dsig:KeyInfo>
-          <dsig:Object Id="signed-data-1-1-1">Diese Daten sind signiert.</dsig:Object>
-          <dsig:Object>
-            <dsig:Manifest Id="dsig-manifest-1-1">
-              <dsig:Reference Id="reference-1-1" URI="#xpointer(id('signed-data-1-1-1')/node())">
-                <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
-                <dsig:DigestValue>EYxznGxNRAIcHQeUsj+zsK+uaHA=</dsig:DigestValue>
-              </dsig:Reference>
-            </dsig:Manifest>
-          </dsig:Object>
-        </dsig:Signature>
-      </XMLContent>
-    </VerifySignatureEnvironment>
-
-

Das Element VerifySignatureEnvironment enthält als XMLContent die zu prüfende XML-Signatur. Man erkennt, dass sich die einzige dsig:Reference im dsig:SignedInfo der XML-Signatur auf ein Manifest nach XMLDSig bezieht (erkennbar am Attribut Type, das auf den Wert http://www.w3.org/2000/09/xmldsig#Manifest gesetzt ist). Im Response (siehe unten) werden wir deshalb ein eigenes Resultat für die Manifest-Prüfung erhalten.

-

Das Manifest selbst ist in einem dsig:Object, also innerhalb der XML-Struktur der XML-Signatur kodiert. Es enthält eine dsig:Reference, welche sich auf die Zeichenkette Diese Daten sind signiert. bezieht.

-
-    <VerifySignatureLocation>//dsig:Signature</VerifySignatureLocation>
-  </VerifySignatureInfo>
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyXMLSignatureRequest>
-
-

Das Element VerifySignatureLocation wählt die zu prüfende Signatur innerhalb des in VerifySignatureEnvironment angegebenen XML-Dokuments aus. Das Element TrustProfileID wählt das Vertrauensprofil aus, gegen das die Zertifikatsprüfung durchgeführt werden soll.

-
Response
-

VerifyXMLSignatureRequest.XMLDSigManifest.resp.xml 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ückt und gekürzt wurde.

-
-<VerifyXMLSignatureResponse 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <SignerInfo>
-    <dsig:X509Data>...</dsig:X509Data>
-  </SignerInfo>
-  <SignatureCheck>
-    <Code>0</Code>
-  </SignatureCheck>
-
-

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind (siehe Einfaches Beispiel). Das Element SignatureCheck enthält das Resultat der kryptographischen Prüfung der Signatur (siehe Einfaches Beispiel).

-
-  <XMLDSIGManifestCheck>
-    <Code>0</Code>
-    <Info>
-      <ReferringSigReference>1</ReferringSigReference>
-    </Info>
-  </XMLDSIGManifestCheck>
-
-

Neu ist in dieser Response das an SignatureCheck anschließende Element XMLDSIGManifestCheck. Ein oder mehrere solche Elemente werden immer dann zurückgeliefert, wenn in dsig:SignedInfo der XML-Signatur dsig:Reference Elemente existieren, die sich auf ein Manifest nach XMLDSIG beziehen (siehe oben). Je solcher dsig:Reference enthält die Antwort ein korrespondierendes Element XMLDSIGManifestCheck, im konkreten Beispiel als eines.

-

Das Element Code gibt das Ergebnis der durchgeführten Prüfung des XMLDSIG-Manifests an. In diesem Fall bedeutet 0, dass die Prüfung jeder dsig:Reference im dsig:Manifest (im konkreten Beispiel also genau einer dsig:Reference) erfolgreich durchgeführt werden konnte. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

-

Das Element Info/ReferringSigReference enthält als Textinhalt die Nummer jenes dsig:Reference Elements in dsig:SignedInfo der XML-Signatur, welches auf das untersuchte Manifest nach XMLDSIG verweist, wobei mit 1 zu zählen begonnen wird.

-
-  <CertificateCheck>
-    <Code>0</Code>
-  </CertificateCheck>
-</VerifyXMLSignatureResponse>
-
-

Das Element CertificateCheck enthält das Resultat der Zertifikatsprüfung (siehe Einfaches Beispiel).

-

2.3.1.4 Ergänzungsobjekte

-

Dieses Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.Supplements.xml) demonstriert die Verwendung von Ergänzungsobjekten. Ein Ergänzungsobjekt betrifft entweder ein signiertes Datum (Zusammenhang mit einem dsig:Reference der XML-Signatur) oder jenes Dokument, in dem sich die zu prüfende XML-Signatur befindet (Zusammenhang mit VerifySignatureEnvironment). Es muss dann angegeben werden, wenn auf ein signiertes Datum bzw. in einem signierten Datum bzw. in dem die XML-Signatur enthaltenden XML-Dokument auf weitere Daten per Referenz verwiesen wird, diese Referenz aber von MOA SP nicht aufgelöst werden kann. Das Ergänzungsobjekt enthält dann genau diese Daten die nicht von MOA SS aufgelöst werden können.

-

Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

-
-<VerifyXMLSignatureRequest xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
-  <VerifySignatureInfo>
-    <VerifySignatureEnvironment>
-      <XMLContent>
-        <doc:XMLDocument ... xsi:schemaLocation="urn:document urn:XMLDocument.xsd">
-          <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
-          <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
-Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
-          <dsig:Signature Id="signature-1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-            <dsig:SignedInfo>
-              ...
-              <dsig:Reference Id="reference-1-1" URI="#Para2">
-                <dsig:Transforms>
-                  <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">
-                      <xsl:include href="XMLDocument.Para.xsl"/>
-                    </xsl:stylesheet>
-                  </dsig:Transform>
-                  <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
-                </dsig:Transforms>
-                ...
-              </dsig:Reference>
-            </dsig:SignedInfo>
-            <dsig:SignatureValue>5rXIIkbP/djWmTgQEICy...0Sf8jvnz+d</dsig:SignatureValue>
-            <dsig:KeyInfo>...</dsig:KeyInfo>
-          </dsig:Signature>
-        </doc:XMLDocument>
-      </XMLContent>
-    </VerifySignatureEnvironment>
-
-

Das Element VerifySignatureEnvironment enthält das XML-Dokument mit der zu prüfenden XML-Signatur.

-

Man erkennt, dass das Attribut dsig:Reference/@URI das Element doc:Paragraph mit dem auf den Wert Para2 gesetzten ID-Attribut ParaId referenziert. MOA kann jedoch den Umstand, dass es sich bei doc:Paragraph/@ParaId um ein ID-Attribut handelt, nur dann erkennen, wenn es das XML-Dokument validierend parst. Der dazu nötige Verweis auf das passende XML-Schema ist zwar mit dem Attribut xsi:schemaLocation vorhanden, jedoch handelt es sich dabei mit urn:XMLDocument.xsd um eine nicht auflösbare Referenz. Deshalb wird im Request ein passendes Ergänzungsobjekt benötigt (siehe unten).

-

Weiters erkennt man, dass dsig:Reference ein XSLT-Transformation enthält. Im darin kodierten Stylesheet-Parameter (dsig:Transform/xsl:stylesheet) wird ein weiterer Stylesheet inkludiert (XMLDocument.Para.xsl). Diese Referenz ist aber wiederum für MOA SP nicht auflösbar. Auch hier wird also ein passendes Ergänzungsobjekt benötigt (siehe unten).

-
-    <VerifySignatureLocation xmlns:doc="urn:document" 
-      xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">/doc:XMLDocument/dsig:Signature</VerifySignatureLocation>
-  </VerifySignatureInfo>
-
-

Das Element VerifySignatureLocation wählt die zu prüfende Signatur innerhalb des in VerifySignatureEnvironment angegebenen XML-Dokuments aus.

-
-  <SupplementProfile>
-    <Content Reference="XMLDocument.Para.xsl">
-      <LocRefContent>http://localhost:8080/referencedData/XMLDocument.Para.xsl</LocRefContent>
-    </Content>
-  </SupplementProfile>
-
-

Das erste Element SupplementProfile enthält nun das Ergänzungsobjekt für den oben beschriebenen inkludierten Stylesheet. Content/@Reference enthält die Referenz genau so, wie sie oben im Attribut xsl:stylesheet/@href angegeben wurde. Im Inhalt von Content werden entweder explizit jene Daten angegeben, die von MOA statt des Auflösens der Referenz verwendet werden sollen (Base64Content oder XMLContent), oder aber es wird - wie im konkreten Beispiel - mit LocRefContent eine auflösbare Referenz für diese Daten an MOA SP übergeben.

-
-  <SupplementProfile>
-    <Content Reference="urn:XMLDocument.xsd">
-      <XMLContent>
-        <xs:schema targetNamespace="urn:document" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
-          xmlns="urn:document" elementFormDefault="qualified" attributeFormDefault="unqualified">
-          ...
-        </xs:schema>
-      </XMLContent>
-    </Content>
-  </SupplementProfile>
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyXMLSignatureRequest>
-
-

Das zweite Element SupplementProfile enthält analog das Ergänzungsobjekt für das oben beschriebene XML-Schema. Content/@Reference enthält die Referenz genau so, wie sie oben im Attribut xsi:schemaLocation angegeben wurde.

-
Response
-

VerifyXMLSignatureRequest.Supplements.resp.xml ist eine typische Response des SP Webservices auf den obigen Request. Er wird an dieser Stelle nicht näher analysiert, da er keine für das Thema des Beispiels relevanten Besonderheiten aufweist.

-

2.1.3.5 Signatur-Manifest des Security-Layers

-
Request
-

Dieses Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.SigManifest.xml) demonstriert die Überprüfung des Zusammenhangs zwischen den Referenz-Eingangsdaten und den Hash-Eingangsdaten für die dsig:Reference-Elemente einer XML-Signatur. Mit Hilfe dieser Prüfung kann eine Anwendung feststellen, ob bei der Erstellung einer XML-Signatur jene Transformationen bzw. auch jene inkludierten Stylesheets (vgl. Implizite Transformationsparameter) einer XSLT-Transformation angewendet wurden, welche die Anwendung vorgegeben hat. Bei erfolgreicher Prüfung dieses Zusammenhangs kann die Anwendung die Referenz-Eingangsdaten einer dsig:Reference als gesichert ansehen, obwohl eigentlich die Hash-Eingangsdaten durch die Signatur gesichert sind. Dies ist jenen Fällen sinnvoll, in denen die Anwendung grundsätzlich mit XML-Daten arbeitet, diese Daten jedoch für das Signieren durch eine Person in ein für diese Person verständliches Format wie z.B. HTML umgewandelt werden sollen.

-
-<VerifyXMLSignatureRequest 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <VerifySignatureInfo>
-    <VerifySignatureEnvironment>
-      <XMLContent>
-        <doc:XMLDocument xmlns:doc="urn:document" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="urn:document http://localhost:8080/referencedData/XMLDocument.xsd">
-          <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
-          <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
-Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
-          <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="signature-1-1">
-            <dsig:SignedInfo>
-              ...
-              <dsig:Reference Id="reference-1-1" URI="#Para2">
-                <dsig:Transforms>
-                  <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">
-                      <xsl:include href="http://localhost:8080/referencedData/XMLDocument.Para.xsl"/>
-                    </xsl:stylesheet>
-                  </dsig:Transform>
-                  <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
-                </dsig:Transforms>
-                ...
-              </dsig:Reference>
-              <dsig:Reference 
-                Type="http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest" 
-                URI="#manifest-1-1">
-                ...
-              </dsig:Reference>
-              <dsig:Reference Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" ...>...</dsig:Reference>
-            </dsig:SignedInfo>
-            <dsig:SignatureValue>jnXc/X+hUY...uBxo9q</dsig:SignatureValue>
-            <dsig:KeyInfo>...</dsig:KeyInfo>
-            <dsig:Object>
-              <dsig:Manifest Id="manifest-1-1">
-                <dsig:Reference URI="http://localhost:8080/referencedData/XMLDocument.Para.xsl">
-                  ...
-                </dsig:Reference>
-              </dsig:Manifest>
-            </dsig:Object>
-            <dsig:Object Id="etsi-signed-1-1">
-              <etsi:QualifyingProperties Target="#signature-1-1" xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#">
-              ...
-              </etsi:QualifyingProperties>
-            </dsig:Object>
-          </dsig:Signature>
-        </doc:XMLDocument>
-      </XMLContent>
-    </VerifySignatureEnvironment>
-
-

Das Element VerifySignatureEnvironment enthält das XML-Dokument mit der zu prüfenden XML-Signatur. Die XML-Signatur wurde von einer Bürgerkarten-Umgebung erstellt. Man erkennt, dass das Element dsig:SignedInfo der XML-Signatur drei dsig:Reference-Elemente enthält.

-

Die erste dsig:Reference bezieht sich auf die eigentlich signierten Nutzdaten. Das zweite doc:Paragraph-Element stellt die Referenz-Eingangsdaten für diese dsig:Reference dar, welche mit Hilfe einer XSLT-Transformation in ein kleines HTML-Dokument übergeführt wird, worüber dann der Hashwert der dsig:Reference gebildet wird (Hash-Eingangsdaten).

-

Die zweite dsig:Reference bezieht sich auf das von der Bürgerkarten-Umgebung angefertigte Signaturmanifest. Das Signaturmanifest ist vorhanden, weil die XSLT-Transformation der ersten dsig:Reference einen weiteren Stylesheet inkludiert, und die Daten dieses weiteren Stylesheets ansonsten nicht von der XML-Signatur abgedeckt wären (vgl. Implizite Transformationsparameter). Das Signaturmanifest enthält eine einzige dsig:Reference, die den inkludierten Stylesheet referenziert und so in die XML-Signatur einbindet.

-

Die dritte dsig:Reference bezieht sich auf die von der Bürgerkarten-Umgebung angefertigten Signatureigenschaften, die hier nicht näher betrachtet werden.

-
-    <VerifySignatureLocation xmlns:doc="urn:document">/doc:XMLDocument/dsig:Signature</VerifySignatureLocation>
-  </VerifySignatureInfo>
-
-

Das Element VerifySignatureLocation wählt die zu prüfende Signatur innerhalb des in VerifySignatureEnvironment angegebenen XML-Dokuments aus.

-
-  <SignatureManifestCheckParams ReturnReferenceInputData="true">
-    <ReferenceInfo>
-      <VerifyTransformsInfoProfile>
-        <dsig:Transforms>
-          <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">
-              <xsl:include href="http://localhost:8080/referencedData/XMLDocument.Para.xsl"/>
-            </xsl:stylesheet>
-          </dsig:Transform>
-          <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
-        </dsig:Transforms>
-        <TransformParameter URI="http://localhost:8080/referencedData/XMLDocument.Para.xsl"/>
-      </VerifyTransformsInfoProfile>
-      <VerifyTransformsInfoProfile>
-        <dsig:Transforms>
-          <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
-        </dsig:Transforms>
-      </VerifyTransformsInfoProfile>
-    </ReferenceInfo>
-  </SignatureManifestCheckParams>
-  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
-</VerifyXMLSignatureRequest>
-
-

Mit Angabe des optionalen Elements SignatureManifestCheckParams wird MOA SP angewiesen, den oben skizzierten Zusammenhang zwischen Referenz-Eingangsdaten und Hash-Eingangsdaten zu überprüfen. Wird das Attribut ReturnReferenceInputData wie im Beispiel auf den Wert true gesetzt, liefert MOA SP in der Response die Hash-Eingangsdaten für alle Referenzen in dsig:SignedInfo der XML-Signatur an die Anwendung zurück, was in der Regel von der Anwendung wohl gewünscht wird, wenn MOA SP schon den Zusammenhang zwischen Referenz-Eingangsdaten und Hash-Eingangsdaten prüfen soll.

-

Die Prüfung des Zusammenhangs untergliedert sich in zwei Teilprüfungen:

-
    -
  • Überprüfung, ob jede dsig:Reference in dsig:SignedInfo der Signatur eine vorgegebene Transformationskette inkludiert;
  • -
  • Überprüfung, ob die in der vorgegebenen Transformationskette ggf. enthaltenen inkludierten Stylesheets (implizite Transformationsparameter) durch ein Signaturmanifest mitsigniert sind.
  • -
-

Damit MOA SP die erste Teilprüfung durchführen kann, muss in SignatureManifestCheckParams je dsig:Reference Element in dsig:SignedInfo der XML-Signatur ein Element ReferenceInfo angeben. Ausgenommen sind dsig:Reference-Elemente, die auf ein Signaturmanifest (Attribut Type ist gesetzt und hat den Wert http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest), auf ein XMLDSIG-Manifest (Attribut Type ist gesetzt und hat den Wert http://www.w3.org/2000/09/xmldsig#Manifest) oder auf Signatureigenschaften (Attribut Type ist gesetzt und hat den Wert http://uri.etsi.org/01903/v1.1.1#SignedProperties) verweisen.

-

Das Element ReferenceInfo enthält eine oder mehrere erlaubte Transformationsketten, die jeweils durch ein Element VerifyTransformsInfoProfile/dsig:Transforms repräsentiert werden. Im konkreten Beispiel werden für die einzige zu prüfende dsig:Reference zwei erlaubte Transformationsketten angegeben. Die Transformationen in der dsig:Reference müssen einer dieser beiden Ketten entsprechen; im konkreten Beispiel entsprechen sie der ersten.

-

Nachdem die erste erlaubte Transformationskette eine XSLT-Transformation mit einem inkludierten Stylesheet enthält, muss MOA SP auch überprüfen, ob dieser inkludierte Stylesheet korrekt durch ein Signaturmanifest mitunterschrieben wurde. Nachdem wichtig ist, dass nicht irgendein beliebiger Stylesheet verwendet und mitunterschrieben wurde, sondern genau jener, den die Anwendung bei der Signaturerstellung vorgegeben hat, muss die Anwendung MOA SP mitteilen, welcher Stylesheet das sein muss. Die Anwendung verwendet dazu das Element VerifyTransformsInfoProfile/TransformParameter. Das Attribut TransformParameter/@URI enthält die Referenz auf den Stylesheet genau so, wie er im Stylesheet-Parameter der zu prüfenden Signatur verwendet wird (dsig:Transform/xsl:stylesheet/xsl:inlcude/@href). Für den Inhalt dieses Elements hat die Anwendung drei Möglichkeiten:

-
    -
  • Die Anwendung lässt den Inhalt leer. Dies wird sie dann machen, wenn sie darauf vertrauen kann, dass die Auflösung der in TransformParameter/@URI angegebenen Referenz bei der Signaturprüfung zum gleichen Resultat führt wie seinerzeit beim Erstellen der Signatur (z.B. weil die Referenz auf einen Webserver unter Kontrolle der Anwendung zeigt);
  • -
  • Die Anwendung gibt im Element TransformParameter/Base64Content explizit den inkludierten Stylesheet an. MOA SP verwendet dann diesen Stylesheet, um den Hashwert der dsig:Reference im Signaturmanifest zu kontrollieren;
  • -
  • Die Anwendung gibt im Element TransformParameter/Hash den Hashwert des inkludierten Stylesheets an. MOA SP löst dann die Referenz in dsig:Transform/xsl:stylesheet/xsl:inlcude/@href auf und stellt sicher, dass der über das Auflösungsergebnis gebildete Hashwert jenem in TransformParameter/Hash entspricht. Diese Möglichkeit wird die Anwendung dann verwenden, wenn es sich um einen sehr umfangreichen Stylesheet handelt, der nicht im Request mitübertragen werden soll.
  • -
-
Response
-

VerifyXMLSignatureRequest.SigManifest.resp.xml 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ückt und gekürzt wurde.

-
-<VerifyXMLSignatureResponse 
-  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
-  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
-  <SignerInfo>...</SignerInfo>
-
-

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind (siehe Einfaches Beispiel).

-
-  <ReferenceInputData PartOf="SignedInfo">
-    <XMLContent xml:space="preserve">
-      <doc:Paragraph ParaId="Para2" xmlns:doc="urn:document" 
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...</doc:Paragraph>
-    </XMLContent>
-  </ReferenceInputData>
-  <ReferenceInputData PartOf="SignedInfo">
-    <XMLContent xml:space="preserve">
-      <dsig:Manifest Id="manifest-1-1" xmlns:doc="urn:document" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-        ...
-      </dsig:Manifest>
-    </XMLContent>
-  </ReferenceInputData>
-  <ReferenceInputData PartOf="SignedInfo">
-    <XMLContent xml:space="preserve">
-      <etsi:SignedProperties xmlns:doc="urn:document" 
-        xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-        ...
-      </etsi:SignedProperties>
-    </XMLContent>
-  </ReferenceInputData>
-
-

Nachdem im Request spezifiziert wurde, dass in der Response die Referenzeingangsdaten für alle dsig:Reference-Elemente - von dsig:SignedInfo (bzw. auch für jede dsig:Reference aus einem dsig:Manifest, - auf das mittels des Attributs Type="http://www.w3.org/2000/09/xmldsig#Manifest" in einer dsig:Reference aus dsig:SignedInfo verwiesen - wird; solche Manifeste kommen aber in diesem Beispiel nicht vor) der geprüften - XML-Signatur übermittelt - werden sollen, enthält - die Response nach SignerInfo drei ReferenceInputData-Elemente. Das erste ReferenceInputData-Element - enthält das zuvor besprochene doc:Paragraph Element, das zweite das Signaturmanifest, das - dritte die Signatureigenschaften. Das Attribut PartOf jedes Elements weist mit dem Wert SignedInfo darauf hin, - dass die dsig:Reference, für welche die Referenzeingangsdaten gelten, Teil von dsig:SignedInfo ist.

-
-  <SignatureCheck>
-    <Code>0</Code>
-  </SignatureCheck>
-
-

Das Element SignatureCheck enthält das Resultat der kryptographischen Prüfung der Signatur (siehe Einfaches Beispiel).

-
-  <SignatureManifestCheck>
-    <Code>0</Code>
-  </SignatureManifestCheck>
-
-

Das Element SignatureManifestCheck enhält das Resultat der Prüfung des Zusammenhangs zwischen Referenz-Eingangsdaten und Hash-Eingangsdaten. Der Kode 0 im konkreten Beispiel bedeutet, dass alle Referenzen die in der Anfrage zur Überprüfung der XML-Signatur gemachten Einschränkungen bezüglich der erlaubten Transformationskette(n) einhalten, sowie dass die Anforderungen hinsichtlich des Signaturmanifests werden eingehalten. Für eine Übersicht der möglichen Kodes siehe die Spezifikation zu MOA SP/SS, Abschnitt 5.1.3.1.4.

-
-  <CertificateCheck>
-    <Code>0</Code>
-  </CertificateCheck>
-</VerifyXMLSignatureResponse>
-
-

Das Element CertificateCheck enthält das Resultat der Zertifikatsprüfung (siehe Einfaches Beispiel).

-

2.2 Webservice-Clients

-

Abschnitt 2.1 bespricht eine Reihe von typischen XML-Requests, die über die Webservice-Schnittstelle an MOA SP/SS gesendet werden können, um entweder Signaturen zu erstellen (MOA SS) oder Signaturen zu prüfen (MOA SP). Dieser Abschnitt zeigt die Verwendung des prototypischen Webservice-Clients, der mit dieser Dokumentation zu MOA SP/SS ausgeliefert wird.

-

2.2.1 Übersicht

-

Der Webservice-Client existiert in drei Varianten, wobei jede Variante in einer eigenen Java-Klasse implementiert ist:

-
    -
  • Der einfache Client (HTTP.java) arbeitet ohne Authentifikation. Er prüft weder die Authentizität des verwendeten MOA-Webservices, noch identifiziert er sich selbst gegenüber dem MOA-Webservice.
  • -
  • Der Client mit Server-Authentisierung (HTTPSServerAuth.java) prüft die Authentizität des verwendeten MOA-Websservices an Hand dessen SSL-Serverzertifikats, identifiziert sich selbst jedoch nicht gegenüber dem MOA-Webservice.
  • -
  • Der Client mit Client- und Server-Authentisierung (HTTPSClientAuth.java) prüft einerseits die Authentizität des verwendeten MOA-Websservices an Hand dessen SSL-Serverzertifikats; andererseits weist er sich selbst mittels eines SSL-Client-Zertifikats gegenüber dem MOA-Webservice aus.
  • -
-

Welcher der drei Varianten des Webservice-Clients zum Einsatz kommen soll, hängt von der Art ab, wie das MOA-Webservice betrieben wird, d.h. ob es Server- bzw. Client-Authentisierung unterstützt bzw. verlangt. Befinden sich sowohl MOA-Webservice als auch der Webservice-Client im gleichen, abgeschotteten Netzwerk, kann auch eine Kommunikation ohne Authenifikation in Betracht gezogen werden. Ansonsten wird der Standardfall wohl der Betrieb mit Server-Authentisierung (Verwendung von MOA SP) bzw. mit Server- und Client-Authentisierung (Verwendung von MOA SS) sein.

-

Hinweis: Das Wurzelverzeichnis dieses Handbuchs stellt ein komplettes und sofort verwendbares Eclipse Projekt dar.

-

2.2.2 Gemeinsamkeiten

-

Dieser Abschnitt beschreibt die Gemeinsamkeiten aller drei Varianten des Webservice-Clients.

-

Zunächst einmal benötigen alle drei Varianten die folgenden Java-Bibliotheken, die im Ordner clients/webservice/lib/ dieses Handbuchs bereits enthalten sind:

- - - - - - - - - - - - - - - - - - - - - - -
Java-BibliothekBemerkung
J2SE J2SE 1.3.1 SDK oder J2SE 1.4.2 SDK oder J2SE 5.0 SDK.
Apache XercesXML-Parser, Version 2.0.2 oder höher; nicht nötig wenn JDSE 1.4.2 oder höher verwendet wird.
AXIS FrameworkWebservice-Framework, Version 1.1.
JSSEJava Secure Socket Extension, Version 1.0.3 oder höher; nur notwendig für die Varianten HTTPServerAuth und HTTPClientAuth.
-

Weiters ist allen drei Varianten der folgende Kern-Ablauf gemeinsam:

-
    -
  1. Der Webservice-Client liest einen vorbereiteten MOA-XML-Request (z. B. einen der in Abschnitt 2.1 gezeigten) vom Dateisystem ein.
  2. -
  3. Der Webservice-Client erstellt einen SOAP-Request mit dem vom Dateisystem gelesenen MOA-XML-Request als Nutzlast.
  4. -
  5. Der Webservice-Client sendet den erstellten SOAP-Request über HTTP an MOA SP/SS.
  6. -
  7. Der Webservice-Client empfängt die SOAP-Response von MOA SP/SS.
  8. -
  9. Der Webservice-Client extrahiert die Nutzlast des SOAP-Responses (d. h. die zum MOA-XML-Request aus Schritt 1 passende MOA-XML-Response), gibt diese auf die Konsole aus und speichert sie im Dateisystem.
  10. -
-

Konfiguriert werden können alle drei Varianten mit Hilfe von zwei Kommandozeilen-Parametern:

-
    -
  1. Der erste Kommandozeilenparameter gibt an, ob MOA SS (Wert sign) oder MOA SP (Wert verify) kontaktiert werden soll.
  2. -
  3. Der zweite Kommandozeilenparameter enthält Pfad und Dateiname einer Java-Properties-Datei, die die weiteren Konfigurationsparameter für den Webservice-Client enthält. Ein relativer Pfad wird als relativ zum Arbeitsverzeichnis der Java Virtual Machine interpretiert. Genaue Infos zu den möglichen Konfigurationsparametern entnehmen Sie bitte der Quellcodedokumentation der jeweiligen Variante des Webservice-Clients. http.properties enthält eine auf dieses Handbuch abgestimmte Konfiguration.
  4. -
-

2.2.3 Besonderheiten von HTTPSServerAuth.java

-

Diese Variante des Webservice-Clients verwendet JSSE, um im Schritt 3 des Kernablaufs aus Abschnitt 2.2.2 eine SSL-Verbindung mit Server-Authentifizierung zum MOA SP/SS Server aufzubauen. In dieser SSL-Verbindung sendet der Webservice-Client dann den erstellten SOAP-Request über HTTPS.

-

Die Konfiguration von JSSE (Speicher für die vertrauenswürdigen Serverzertifikate, Typ dieses Speichers, Passwort für diesen Speicher) wird mittels zusätzlicher Parameter in der in Abschnitt 2.2.2 besprochenen Java-Properties-Datei vorgenommen. Genaue Infos zu diesen Konfigurationsparametern entnehmen Sie bitte der Quellcodedokumentation von HTTPSServerAuth.java. http.properties enthält eine auf dieses Handbuch abgestimmte Konfiguration.

-

Falls Sie Probleme beim SSL-Verbindungsaufbau zwischen Webservice-Client und MOA SP/SS Webservice haben, empfiehlt sich die Aktivierung des JSSE Loggings. Das Setzen der dafür notwendigen Java System Property ist im Quellcode von HTTPSServerAuth.java bereits enthalten, jedoch auskommentiert. Suchen Sie einfach nach dem String javax.net.debug, um zur entsprechenden Stelle im Quellcode zu gelangen.

-

2.2.4 Besonderheiten von HTTPSClientAuth.java

-

Diese Variante des Webservice-Clients verwendet JSSE, um im Schritt 3 des Kernablaufs aus Abschnitt 2.2.2 eine SSL-Verbindung mit Server- und Client-Authentifizierung zum MOA SP/SS Server aufzubauen. In dieser SSL-Verbindung sendet der Webservice-Client dann den erstellten SOAP-Request über HTTPS.

-

Die gegenüber Abschnitt 2.2.3 zusätzlich notwendige Konfiguration von JSSE (Speicher für das SSL-Client-Zertifikat sowie den dazugehörigen privaten Schlüssel, Typ dieses Speichers, Passwort für diesen Speicher) wird mittels zusätzlicher Parameter in der in Abschnitt 2.2.2 besprochenen Java-Properties-Datei vorgenommen. Genaue Infos zu diesen Konfigurationsparametern entnehmen Sie bitte der Quellcodedokumentation von HTTPSClientAuth.java. http.properties enthält eine auf dieses Handbuch abgestimmte Konfiguration.

-

Beachten Sie bitte auch den Hinweis zum JSSE Logging aus Abschnitt 2.2.3.

-

3 Verwendung der Klassenbibliothek

-

Neben dem Betrieb von MOA SP/SS als Webservice ist als Alternative auch die Verwendung von MOA SP/SS als Klassenbibliothek möglich, also die direkte Einbindung in ein Java-Programm unter Verwendung des Application Programmers Interface (API) von MOA SP/SS.

-

3.1 Vorbereitung

-

Um das API von MOA SP/SS verwenden zu können, müssen einerseits die MOA-Bibliotheken selbst, andererseits eine Reihe von unterstützenden Bibliotheken in den Klassenpfad aufgenommen werden. Eine Übersicht dazu finden Sie im Installationshandbuch im Abschnitt 3. -

3.2 Allgemeines

-

Der strukturelle Aufbau der API entspricht weitgehend der Struktur eines MOA-XML-Requests. Es werden daher in diesem Abschnitt nur zwei grundlegende Beispiele gebracht; für komplexere Aufgaben können die XML-Beispiele aus Abschnitt 2.1 als Vorlage verwendet und einfach in die "API-Welt" übertragen werden. -

3.3 Beispiele

-

Dieses Handbuch enthält zwei Beispiele für die Verwendung der API von MOA SP/SS: -

    -
  1. CreateXMLSignature.java: Erstellung einer einfachen XML-Signatur; dieses Beispiel entspricht dem MOA-XML-Request aus Abschnitt 2.1.1.1.
    - Die Konfiguration der API erfolgt über Kommandozeilenparameter (Lage der Konfigurationsdatei für MOA SP/SS, Lage der Konfigurationsdatei für das Logging mit Log4j). Detaillierte Informationen dazu finden Sie in der Quellcodedokumentation des Beispiels.
  2. -
  3. VerifyXMLSignature.java: Prüfung einer einfachen XML-Signatur; dieses Beispiel entspricht dem MOA-XML-Request aus Abschnitt 2.1.3.1.
    - Die Konfiguration der API erfolgt über Kommandozeilenparameter (Lage der Konfigurationsdatei für MOA SP/SS, Lage der Konfigurationsdatei für das Logging mit Log4j). Detaillierte Informationen dazu finden Sie in der Quellcodedokumentation des Beispiels.
    - Die Auswahl der zu prüfenden Signatur erfolgt ebenfalls per Kommandozeilenparameter. Detaillierte Informationen dazu finden Sie ebenfalls in der Quellcodedokumentation des Beispiels.
  4. -
-

3.4 API-Dokumentation

-

Für die vollständige Dokumentation des API von MOA SP/SS sei auf die Java Doc der API verwiesen. -

-

A Referenzierte Software

-

Auf folgende Software-Pakete wird in diesem Handbuch verwiesen:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameBeschreibung
Apache Xerces 2 XML-Parser aus dem Apache Project
Apache AxisWebservice-Framework aus dem Apache Project
J2SE 1.3.1 SDK/JRE Java 2 Standard Edition in der Version 1.3.1 (Software Development Kit bzw. Java Runtime Environment)
J2SE 1.4.2 SDK/JREJava 2 Standard Edition in der Version 1.4.2 (Software Development Kit bzw. Java Runtime Environment)
J2SE 5.0 SDK/JRE Java 2 Standard Edition in der Version 5.0 (Software Development Kit bzw. Java Runtime Environment)
JSSEJava Secure Socket Extension
-

 

- - diff --git a/spss.server/data/deploy/tomcat/server.mod_jk.xml b/spss.server/data/deploy/tomcat/server.mod_jk.xml deleted file mode 100644 index e6035b8be..000000000 --- a/spss.server/data/deploy/tomcat/server.mod_jk.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spss.server/data/deploy/tomcat/server.xml b/spss.server/data/deploy/tomcat/server.xml deleted file mode 100644 index 3e5966ca9..000000000 --- a/spss.server/data/deploy/tomcat/server.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spss.server/data/deploy/tomcat/unix/moa-env.sh b/spss.server/data/deploy/tomcat/unix/moa-env.sh deleted file mode 100644 index 49d6723a3..000000000 --- a/spss.server/data/deploy/tomcat/unix/moa-env.sh +++ /dev/null @@ -1,12 +0,0 @@ -MOA_START=`pwd` - -CONFIG_OPT=-Dmoa.spss.server.configuration=$MOA_START/conf/moa-spss/spss.config.xml -LOGGING_OPT=-Dlog4j.configuration=file:$MOA_START/conf/moa-spss/log4j.properties -# NODE_ID_OPT=-Dmoa.node-id=node1 -# 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 $LOGGING_OPT $NODE_ID_OPT $TRUST_STORE_OPT $TRUST_STORE_PASS_OPT $TRUST_STORE_TYPE_OPT" - -echo CATALINA_OPTS=$CATALINA_OPTS diff --git a/spss.server/data/deploy/tomcat/uriworkermap.properties b/spss.server/data/deploy/tomcat/uriworkermap.properties deleted file mode 100644 index 673acf65d..000000000 --- a/spss.server/data/deploy/tomcat/uriworkermap.properties +++ /dev/null @@ -1,4 +0,0 @@ -# a sample mod_jk uriworkermap.properties file for mapping -# MOA SP/SS web service requests to workers - -/moa-spss/*=moaworker \ No newline at end of file diff --git a/spss.server/data/deploy/tomcat/win32/startTomcat.bat b/spss.server/data/deploy/tomcat/win32/startTomcat.bat deleted file mode 100644 index b7d740d12..000000000 --- a/spss.server/data/deploy/tomcat/win32/startTomcat.bat +++ /dev/null @@ -1,27 +0,0 @@ -rem ---------------------------------------------------------------------------------------------- -rem Modify these entries according to your needs - -rem JDK home directory (no trailing path separator) -set JAVA_HOME= - -rem Tomcat 4.1.x home directory (no trailing path separator) -set CATALINA_HOME= - -rem ---------------------------------------------------------------------------------------------- - -set MOA_SPSS_CFG_HOME=%CATALINA_HOME%\conf\moa-spss - -set PARAM_SPSSCONFIG=-Dmoa.spss.server.configuration=%MOA_SPSS_CFG_HOME%\spss.config.xml -set PARAM_LOGGING=-Dlog4j.configuration=file:%MOA_SPSS_CFG_HOME%\log4j.properties -set PARAM_NODEID=-Dmoa.node-id=Node1 -set PARAMS_MOA=%PARAM_SPSSCONFIG% %PARAM_LOGGING% %PARAM_NODEID% - -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/spss.server/data/deploy/tomcat/win32/stopTomcat.bat b/spss.server/data/deploy/tomcat/win32/stopTomcat.bat deleted file mode 100644 index 09dd83f2d..000000000 --- a/spss.server/data/deploy/tomcat/win32/stopTomcat.bat +++ /dev/null @@ -1,13 +0,0 @@ -rem ---------------------------------------------------------------------------------------------- -rem Modify these entries according to your needs - -rem JDK home directory (no trailing path separator) -set JAVA_HOME= - -rem Tomcat 4.1.x home directory (no trailing path separator) -set CATALINA_HOME= - -rem ---------------------------------------------------------------------------------------------- - -cd %CATALINA_HOME% -bin\catalina.bat stop \ No newline at end of file diff --git a/spss.server/data/deploy/tomcat/workers.properties b/spss.server/data/deploy/tomcat/workers.properties deleted file mode 100644 index 9350ddc77..000000000 --- a/spss.server/data/deploy/tomcat/workers.properties +++ /dev/null @@ -1,6 +0,0 @@ -# a sample workers.properties file defining a single mod_jk worker - -worker.list=moaworker -worker.moaworker.type=ajp13 -worker.moaworker.host=localhost -worker.moaworker.port=8009 diff --git a/spss.server/data/deploy/tools/certtool.bat b/spss.server/data/deploy/tools/certtool.bat deleted file mode 100644 index 0504211b8..000000000 --- a/spss.server/data/deploy/tools/certtool.bat +++ /dev/null @@ -1,25 +0,0 @@ -@echo off - -rem -rem Script to invoke the CertTool class -rem -rem Author: Patrick Peck -rem Version: $Id: certtool.bat,v 1.6 2003/05/08 11:46:29 peck Exp $ -rem - - -if %OS%=="Windows_NT" @setlocal - -set CERTTOOL=at.gv.egovernment.moa.spss.server.tools.CertTool -set TOOLSPATH=%~p0 -set CLASSPATH=%TOOLSPATH%tools.jar;%TOOLSPATH%iaik_moa_full.jar;%TOOLSPATH%iaik_jce_full.jar;%TOOLSPATH%iaik_ecc.jar;%TOOLSPATH%log4j-1.2.7.jar - -if "%JAVA_HOME%"=="" goto noJavaHome -%JAVA_HOME%\bin\java.exe -classpath %CLASSPATH% %CERTTOOL% %1 %2 %3 %4 %5 %6 %7 %8 %9 -goto end - -:noJavaHome -echo error: JAVA_HOME not defined - -:end -if %OS%=="Windows_NT" @endlocal \ No newline at end of file diff --git a/spss.server/data/deploy/tools/certtool.sh b/spss.server/data/deploy/tools/certtool.sh deleted file mode 100644 index c7ff374f4..000000000 --- a/spss.server/data/deploy/tools/certtool.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# -# Script to invoke the CertTool class -# -# Author:Patrick Peck -# Version: $Id: certtool.sh,v 1.9 2003/06/23 16:01:27 peck Exp $ -# - - -if [ -z "$JAVA_HOME" ]; then - echo "error: JAVA_HOME not defined"; - exit; -fi - -CERTOOL=at.gv.egovernment.moa.spss.server.tools.CertTool -TOOLSPATH=`dirname $PWD/$0` -CLASSPATH=$TOOLSPATH/tools.jar:$TOOLSPATH/iaik_moa_full.jar:$TOOLSPATH/iaik_jce_full.jar:$TOOLSPATH/iaik_ecc.jar:$TOOLSPATH/log4j-1.2.7.jar - -$JAVA_HOME/bin/java -classpath $CLASSPATH $CERTOOL $* diff --git a/spss.server/data/deploy/tools/configtool.bat b/spss.server/data/deploy/tools/configtool.bat deleted file mode 100644 index 868df11f0..000000000 --- a/spss.server/data/deploy/tools/configtool.bat +++ /dev/null @@ -1,25 +0,0 @@ -@echo off - -rem -rem Script to invoke the ConfigTool class -rem -rem Author: Gregor Karlinger -rem Version: $Id: $ -rem - - -if %OS%=="Windows_NT" @setlocal - -set CONFIGTOOL=at.gv.egovernment.moa.spss.server.tools.ConfigTool -set TOOLSPATH=%~p0 -set CLASSPATH=%TOOLSPATH%tools.jar;%TOOLSPATH%xalan.jar; - -if "%JAVA_HOME%"=="" goto noJavaHome -%JAVA_HOME%\bin\java.exe -classpath %CLASSPATH% %CONFIGTOOL% %1 %2 %3 %4 %5 %6 %7 %8 %9 -goto end - -:noJavaHome -echo error: JAVA_HOME not defined - -:end -if %OS%=="Windows_NT" @endlocal \ No newline at end of file diff --git a/spss.server/data/deploy/tools/configtool.sh b/spss.server/data/deploy/tools/configtool.sh deleted file mode 100644 index f7f29bae1..000000000 --- a/spss.server/data/deploy/tools/configtool.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# -# Script to invoke the ConfigTool class -# -# Author: Gregor Karlinger -# Version: $Id: $ -# - - -if [ -z "$JAVA_HOME" ]; then - echo "error: JAVA_HOME not defined"; - exit; -fi - -CONFIGTOOL=at.gv.egovernment.moa.spss.server.tools.ConfigTool -TOOLSPATH=`dirname $PWD/$0` -CLASSPATH=$TOOLSPATH/tools.jar:$TOOLSPATH/xalan.jar - -$JAVA_HOME/bin/java -classpath $CLASSPATH $CONFIGTOOL $* diff --git a/spss.server/licenses/Apache-2.0.txt b/spss.server/licenses/Apache-2.0.txt deleted file mode 100644 index 57bc88a15..000000000 --- a/spss.server/licenses/Apache-2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/spss.server/licenses/IAIK-License.txt b/spss.server/licenses/IAIK-License.txt deleted file mode 100644 index c0db63b22..000000000 --- a/spss.server/licenses/IAIK-License.txt +++ /dev/null @@ -1,13 +0,0 @@ -IAIK MOA Runtime Lizenz - -Stiftung SIC gewährt dem Lizenznehmer eine nicht-exklusive, nicht-übertragbare -Runtime Lizenz für die "IAIK MOA" Module im Kontext von MOA SP/SS und MOA ID. -Alle Versuche, Teile oder die kompletten IAIK Crypto Toolkits, die zusammen -mit dem MOA Produktbündel ausgeliefert werden, für andere Zwecke als jenem -für Applikationen im MOA Kontext zu verwenden, sind nicht erlaubt. Auch weitere -Versuche, die sich auf die Entwicklung von Anwendungen , oder aber darüber hinaus -auf die Schaffung eines eigenen Toolkits, oder die Aufnahme in ein weiters -weiteres Toolkit beziehen, sind nicht erlaubt. -Die hier beschriebene Runtime Lizenz ist nicht übertragbar auf weitere -Vertragspartner des Kunden, Personen, Organisationen oder Unternehmen -außerhalb der Organisation des Lizenznehmers. diff --git a/spss.server/licenses/Jaxen.txt b/spss.server/licenses/Jaxen.txt deleted file mode 100644 index bef65a520..000000000 --- a/spss.server/licenses/Jaxen.txt +++ /dev/null @@ -1,40 +0,0 @@ -Copyright 2003 (C) The Werken Company. All Rights Reserved. - - Redistribution and use of this software and associated documentation - ("Software"), with or without modification, are permitted provided - that the following conditions are met: - - 1. Redistributions of source code must retain copyright - statements and notices. Redistributions must also contain a - copy of this document. - - 2. Redistributions in binary form must reproduce the - above copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - - 3. The name "jaxen" must not be used to endorse or promote - products derived from this Software without prior written - permission of The Werken Company. For written permission, - please contact bob@werken.com. - - 4. Products derived from this Software may not be called "jaxen" - nor may "jaxen" appear in their names without prior written - permission of The Werken Company. "jaxen" is a registered - trademark of The Werken Company. - - 5. Due credit should be given to The Werken Company. - (http://jaxen.werken.com/). - - THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT - NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE WERKEN COMPANY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/spss.server/licenses/PostgreSQL-JDBC.txt b/spss.server/licenses/PostgreSQL-JDBC.txt deleted file mode 100644 index 30d54d778..000000000 --- a/spss.server/licenses/PostgreSQL-JDBC.txt +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 1997-2005, PostgreSQL Global Development Group -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -3. Neither the name of the PostgreSQL Global Development Group nor the names - of its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/spss.server/res/resources/properties/spss_messages_de.properties b/spss.server/res/resources/properties/spss_messages_de.properties deleted file mode 100644 index febcf01a9..000000000 --- a/spss.server/res/resources/properties/spss_messages_de.properties +++ /dev/null @@ -1,151 +0,0 @@ -# This file contains exception messages in the standard Java properties -# format. The messages may contain formatting patterns as definied in the -# java.text.MessageFormat class. - -# -# Error messages: the key corresponds to the error code -# - -1100=Fehler beim Validieren der Anfrage: {0} -1101=Bei enveloping Datenobjekten muss entweder Content oder Reference übergeben werden -1102=Bei detached Datenobjekten darf das Attribut Reference nicht leer sein -1103=Ungültiger Wert für Attribut Structure im Element DataObjectInfo: {0} -1104=Ungültiger Wert für DateTime: {0} -1105=Ungültiger Wert für Attribut Index in Element CreateSignatureLocation: {0} -1106=Interner Fehler beim Parsen der XML-Daten -1107=Kein Kind-Element im Element XMLContent gefunden -1108=Ungültiger Wert für dsig:Algorithm: {0} -1109=XMLContent darf nur ein Kind-Element enthalten -1110=Entweder Content oder Reference muss gesetzt sein -1111=Reference muss gesetzt sein, wenn kein Content angegeben ist -1112=Bei leerer Reference muss CreateSignatureEnvironment vorhanden sein -1113=Der Endpunkt akzeptiert keine Anfragen vom Typ: {0} - -2200=Fehler beim Erzeugen der Antwort -2201=Transformations-Algorithmus unbekannt: {0} -2202=Kein XPath-Element für XPath-Transformation gefunden -2203=TrustProfileID unbekannt: {0} -2207=Ungültiges URI-Format: {0} -2208=Fehler beim Öffnen des Datenobjekts (URI={0}) -2209=Fehler beim Parsen der XML-Daten -2210=Fehler beim Lesen des Datenobjekts -2211=Referenzierte Daten können nicht als XML interpretiert werden (URI={0}) -2212=Fehler beim Auswerten des XPath-Ausdrucks: {0} -2213=Zugriff auf das Dateisystem verweigert (URI={0}) -2214=Ungültiges URL-Format: {0} -2215=Kein Stylesheet für XSLT-Transformation gefunden -2216=Kein XPath-Filter2 Element für XPath-Filter2-Transform gefunden -2217=Kein InclusiveNamespaces Element für Exclusive Canonicalization Transform gefunden -2218=Das Signature Environment enthält keine validen XML-Daten -2219=Fehler beim Lesen des Signature Environment -2220=Allgemeiner Fehler beim Erzeugen der Signatur [{0}] -2221=Fehler bei der Behandlung des Schlüssels [{0}] -2222=Fehler beim Erstellen des Manifests [{0}] -2223=Fehler beim Erstellen der Referenz [{0}] -2224=Hashwert nicht verfügbar [{0}] -2225=Signier-Algorithmus wird nicht unterstützt [{0}] -2226=Fehler beim Einbetten der Signatur [{0}] -2227=Fehler beim Berechnen des Signaturwertes [{0}] -2228=Fehler beim Behandeln der SignedProperties [{0}] -2229=Signator-Zertifikat nicht verfügbar [{0}] -2230=Fehler beim Auflösen eines Supplements [{0}] -2231=Die Schlüsselgruppe ist nicht verfügbar -2232=Die Schlüsselgruppe ist leer -2233=Fehler beim Durchführen der Transformation [{0}] -2234=CreateTransformsInfoProfileID nicht vorhanden (ID={0}) -2235=CreateSignatureEnvironment muss entweder Reference oder Content enthalten -2236=CreateSignatureEnvironmentProfileID nicht vorhanden (ID={0}) -2237=Fehler beim Auflösen der internen Referenz (URI={0}) -2238=Fehler beim Auflösen des Transformationsparameters (URI={0}) -2240=Allgemeiner Fehler beim Verifizieren der Signatur [{0}] -2241=Algorithmus wird nicht unterstützt [{0}] -2242=Fehler beim Parsen der CMS Signatur [{0}] -2243=Signator-Zertifikat nicht verfügbar [{0}] -2244=Fehler beim Lesen der Signatur-Daten -2245=Fehler beim Codieren des Signator-Zertifikats -2246=Fehler beim Umwandeln des SubjectDN des Signator-Zertifikats nach RFC2253: {0} -2247=Allgemeiner Fehler beim Verifizieren der Signatur [{0}] -2248=Fehler beim Vorbereiten der Daten [{0}] -2249=Das Attribut Signatories enthält einen ungültigen Index (Index={0}) -2262=Fehler beim Behandeln des Manifests [{0}] -2263=Fehler beim Parsen der Properties [{0}] -2264=Fehler beim Behandeln der Referenz [{0}] -2265=Fehler beim Durchführen der Transformation [{0}] -2266=Signatur ist kein dsig:Signature-Element -2267=SupplementProfileID nicht vorhanden (ID={0}) -2268=VerifyTransformsInfoProfileID nicht vorhanden (ID={0}) -2269=Fehler beim Parsen der Transformation [{0}] -2270=Fehler beim Decodieren des Hash-Wertes -2271=Falsche Anzahl an ReferenceInfo Elementen in SignatureManfestCheckParams -2280=Die Angabe XMLContent wird derzeit nicht unterstützt -2281=XML-Supplement kann nicht serialisiert werden (Reference="{0}") -2282=Datenobjekt mit der URI={0} wurde dem Request nicht bereit gestellt - - -2900=Interner Server-Fehler - -3201=Objekt kann nicht geladen werden (Reference="{0}", LocRef-URI="{1}") -3202=Supplement für Signaturumgebung kann nicht geladen werden (Reference="{0}", LocRef-URI="{1}") -3203=Signaturumgebung kann nicht geladen werden (Reference="{0}", LocRef-URI="{1}") - -9900=Nicht klassifizierter Fehler in Subsystem -9901=Nicht klassifizierter Laufzeitfehler in Subsystem -9999=Nicht klassifizierter Fehler - - -# -# Server internal messages -# - -init.00=Fehler beim Lesen der MOA SP/SS Konfiguration: das Service steht nicht zur Verfügung -init.01=MOA SP/SS Konfiguration erfolgreich geladen -init.02=Fehler beim Löschen der Archivdaten -init.03=Fehler beim Aktivieren des IAIK-JCE/JSSE/JDK1.3 Workaround: SSL ist möglicherweise nicht verfügbar -init.04=Fehler beim Initialisieren des Schema Pools - -config.00=Fehler beim Erstellen des KeyGroupMapping: KeyGroup mit id={0} unbekannt - die Erstellung des KeyGroupMapping wird fortgeführt -config.01=Fehler in der Konfiguration: Wert für maximale Archivierungsdauer von Widerrufsinformationen (ArchiveDuration) nicht konfiguriert oder ungültig -config.02=Fehler in der Konfiguration: {0} mit id={1}: falscher Profiltyp in Datei {2} -config.03=Fehler in der Konfiguration: {0} mit id={1} konnte nicht geladen werden -config.04=Fehler in der Konfiguration: {0} mit id={1} existiert bereits -config.05=Umgebungsvariable {0} nicht gesetzt: benutze Default-Konfiguration -config.06=Die MOA SP/SS Konfiguration wurde erfolgreich aktualisiert. -config.07=Fehler in der Konfiguration: Reason code {0} unbekannt -config.08=Fehler beim Konfigurieren der IAIK-Module -config.09=Fehler beim Öffnen der Schlüssel-Datei {0} -config.10=Fehler beim Einlesen der Konfiguration (siehe Log-Datei für Details) -config.11=Fehler biem Erstellen der Konfiguration (siehe Log-Datei für Details) -config.12=Fehler beim Einlesen des Profils -config.13=Fehler beim Erstellen des CRLDistributionPoint: CAIssuerDN={0} ungültig -config.14=Das Attribut {0} für das TrustProfile mit id={1} ist ungültig (Wert={2}) -config.15=Fehler beim Erstellen des TrustProfile id={0}: Name des Konfigurations-Verzeichnisses konnte nicht in eine URL umgewandet werden -config.16=Fehler beim Erstellen von X509IssuerSerial (IssuerName={0}, SerialNumber={1}) -config.17=DigestAlgorithmName unbekannt (AlgorithmName={0}) -config.18=Lade Keystore: {0} -config.19=Key ID={0} -config.20=Fehler beim Aktualisieren der MOA SP/SS Konfiguration. Die bestehende Konfiguration wird beibehalten -config.21=Lade Konfiguration von {0} -config.22=Lade {0} mit id={1} von Datei {2} -config.23=MOA SP/SS Konfiguration: {0} nicht gesetzt oder ungültiger Wert, verwende den Default-Wert: {1} -config.25=Fehler in der Konfiguration: Das SoftwareKeyModule mit id={0} konnte nicht geladen werden, da die Datei {1} nicht existiert oder ein Verzeichnis bezeichnet -config.26=Fehler beim Erstellen der KeyGroup mit id={0}: KeyModule mit id={1} unbekannt -config.27=Fehler in der Konfiguration: Das Attribut {0} des TrustProfiles mit id={1} zeigt nicht auf ein existierendes Verzeichnis -config.28=Einen detaillierten Fehlerbericht entnehmen Sie bitte der Log-Datei. -config.29=Es sind folgende leichte Fehler aufgetreten: -config.31=Fehler in der Konfiguration der KeyGroup mit id={0}: Der Schlüssel im KeyModule id={1} mit IssuerName={2} und SerialNumber={3} konnte nicht geladen werden -config.32=Fehler in der Konfiguration: Verzeichnisangabe für den Zertifikatsspeicher ist ungültig ({0}). - - -handler.00=Starte neue Transaktion: TID={0}, Service={1} -handler.01=Aufruf von Adresse={0} -handler.02=Client-Zertifikat: Subject={0}, Serial={1}, Issuer={2} -handler.03=Client-Zertifikat nicht verfügbar -handler.04=Anfrage erfolgreich abgearbeitet -handler.05=Fehler beim Abarbeiten der Anfrage -handler.06=SOAP Attachment mit der id={0} für Request hinterlegt (MIME Type des Attachments={1}) -handler.07=SOAP Request empfangen: Request={0} - -invoker.00=Das Signature Environment konnte nicht validierend geparst werden -invoker.01=Keine passende Transformationskette gefunden (Index={0}) -invoker.02=Der Hashwert der Transformation stimmt nicht überein (Index={0}) -invoker.03=Signatorzertifikat aus Trustprofile mit id={0} konnte nicht geparst werden (Dateiname={1}) diff --git a/spss.server/res/resources/security/cacerts b/spss.server/res/resources/security/cacerts deleted file mode 100644 index 6eeaba418..000000000 Binary files a/spss.server/res/resources/security/cacerts and /dev/null differ diff --git a/spss.server/res/resources/tools/ConfigurationMapper.xsl b/spss.server/res/resources/tools/ConfigurationMapper.xsl deleted file mode 100644 index fd47cbf84..000000000 --- a/spss.server/res/resources/tools/ConfigurationMapper.xsl +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - MOA SPSS 1.3 Configuration File created by MOA SPSS Configuration Mapper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.w3.org/TR/2001/REC-xml-c14n-20010315 - - - - - - - - http://www.w3.org/2000/09/xmldsig#sha1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pkix - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CRL - OCSP - - - - - - - - - - - - - - 365 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all - - - unused - - - keyCompromise - - - cACompromise - - - affiliationChanged - - - superseded - - - cessationOfOperation - - - certificateHold - - - privilegeWithdrawn - - - aACompromise - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spss.server/res/resources/wsdl/MOA-SPSS-1.3.wsdl b/spss.server/res/resources/wsdl/MOA-SPSS-1.3.wsdl deleted file mode 100644 index c5cd8fc0f..000000000 --- a/spss.server/res/resources/wsdl/MOA-SPSS-1.3.wsdl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spss.server/res/resources/wsdl/MOA-SPSS-1.3.xsd b/spss.server/res/resources/wsdl/MOA-SPSS-1.3.xsd deleted file mode 100644 index 756b51279..000000000 --- a/spss.server/res/resources/wsdl/MOA-SPSS-1.3.xsd +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage - - - - Resultat, falls die Signaturerstellung erfolgreich war - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. - - - - - - - - - - mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert - - - - - - - - - - - only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resultat, falls die Signaturerstellung gescheitert ist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. - - - - - Profilbezeichner für einen Transformationsweg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. - - - - Der Transformationsparameter explizit angegeben. - - - - - Der Hashwert des Transformationsparameters. - - - - - - - - - - - - - - - - - - - - - - Explizite Angabe des Transformationswegs - - - - - - - Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. - - - - - - - - - - - - - - - - diff --git a/spss.server/server-config.wsdd b/spss.server/server-config.wsdd deleted file mode 100644 index 088fe76fd..000000000 --- a/spss.server/server-config.wsdd +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - http://reference.e-government.gv.at/namespace/moa/20020822# - - - /resources/wsdl/MOA-SPSS-1.3.wsdl - - - - - - - - - - http://reference.e-government.gv.at/namespace/moa/20020822# - - - /resources/wsdl/MOA-SPSS-1.3.wsdl - - - - - - - - - - - - - - - - diff --git a/spss.server/spec/MOA-SPSS-1.3.doc b/spss.server/spec/MOA-SPSS-1.3.doc deleted file mode 100644 index fabc4248e..000000000 Binary files a/spss.server/spec/MOA-SPSS-1.3.doc and /dev/null differ diff --git a/spss.server/src/at/gv/egovernment/moa/spss/MOAApplicationException.java b/spss.server/src/at/gv/egovernment/moa/spss/MOAApplicationException.java deleted file mode 100644 index 0d7abd1d3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/MOAApplicationException.java +++ /dev/null @@ -1,41 +0,0 @@ -package at.gv.egovernment.moa.spss; -/** - * Base class of application specific MOA exceptions. - * - * Application exceptions are exceptions that originate from application - * code (e.g. inconsistent data provided by the user, no permission to access - * certain resources, etc.) - * - * @author Patrick Peck - * @version $Id$ - */ -public class MOAApplicationException extends MOAException { - - /** - * Create a new MOAApplicationException. - * - * @param messageId The identifier of the message associated with this - * exception. - * @param parameters Additional message parameters. - */ - public MOAApplicationException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Create a new MOAApplicationException. - * - * @param messageId The identifier of the message associated with this - * MOAApplicationException. - * @param parameters Additional message parameters. - * @param wrapped The exception wrapped by this - * MOAApplicationException. - */ - public MOAApplicationException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/MOAException.java b/spss.server/src/at/gv/egovernment/moa/spss/MOAException.java deleted file mode 100644 index f9eb12d63..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/MOAException.java +++ /dev/null @@ -1,161 +0,0 @@ -package at.gv.egovernment.moa.spss; -import java.io.PrintStream; -import java.io.PrintWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.util.Constants; - -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * Base class of MOA specific exceptions. - * - * This class has the ability to wrap other exceptions which may be seen - * as the root cause for this exception. A similar mechanism is in place - * since JDK1.4 (see the getClause() method) but will not be used - * because of required compatibility with JDK1.3. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class MOAException extends Exception { - /** The message ID. */ - private String messageId; - /** The wrapped Throwable. */ - private Throwable wrapped; - - /** - * Create a MOAException. - * - * @param messageId The message ID of the message contained in the created - * MOAException. - * @param parameters The parameters needed to fill in the message arguments. - */ - public MOAException(String messageId, Object[] parameters) { - super(MessageProvider.getInstance().getMessage(messageId, parameters)); - this.messageId = messageId; - } - - /** - * Create a MOAException. - * - * @param messageId The message ID of the message contained in the created - * MOAException. - * @param parameters The parameters needed to fill in the message arguments. - * @param wrapped The exception wrapped by the created - * MOAException. - */ - public MOAException(String messageId, Object[] parameters, Throwable wrapped) { - - super(MessageProvider.getInstance().getMessage(messageId, parameters)); - this.messageId = messageId; - this.wrapped = wrapped; - } - - /** - * Returns the message ID of this exception. - * - * @return The message ID as provided in the constructor. - */ - public String getMessageId() { - return messageId; - } - - /** - * Returns the exception wrapped by this MOAException. - * - * @return The exception wrapped by this exception. Possibly - * null, if none was provided at construction time. - */ - public Throwable getWrapped() { - return wrapped; - } - - /** - * Convert this MOAException to an ErrorResponse - * element from the MOA namespace. - * - * @return An ErrorResponse element, containing the subelements - * ErrorCode and Info required by the MOA schema. - */ - public Element toErrorResponse() { - DocumentBuilder builder; - DOMImplementation impl; - Document doc; - Element errorResponse; - Element errorCode; - Element info; - - // create a new document - try { - builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - impl = builder.getDOMImplementation(); - } catch (ParserConfigurationException e) { - return null; - } - - // build the ErrorResponse element - doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null); - errorResponse = doc.getDocumentElement(); - - // add MOA namespace declaration - errorResponse.setAttributeNS( - Constants.XMLNS_NS_URI, - "xmlns", - Constants.MOA_NS_URI); - - // build the child elements - errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode"); - errorCode.appendChild(doc.createTextNode(messageId)); - info = doc.createElementNS(Constants.MOA_NS_URI, "Info"); - info.appendChild(doc.createTextNode(getMessage())); - errorResponse.appendChild(errorCode); - errorResponse.appendChild(info); - return errorResponse; - } - - /** - * Print a stack trace of this exception to System.err. - * - * @see java.lang.Throwable#printStackTrace() - */ - public void printStackTrace() { - printStackTrace(System.err); - } - - /** - * Print a stack trace of this exception, including the wrapped exception. - * - * @param s The stream to write the stack trace to. - * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) - */ - public void printStackTrace(PrintStream s) { - super.printStackTrace(s); - if (getWrapped() != null) { - s.print("Caused by: "); - getWrapped().printStackTrace(s); - } - } - - /** - * Print a stack trace of this exception, including the wrapped exception. - * - * @param s The stream to write the stacktrace to. - * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) - */ - public void printStackTrace(PrintWriter s) { - super.printStackTrace(s); - if (getWrapped() != null) { - s.print("Caused by: "); - getWrapped().printStackTrace(s); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java b/spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java deleted file mode 100644 index 0ff175b50..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/MOARuntimeException.java +++ /dev/null @@ -1,163 +0,0 @@ -package at.gv.egovernment.moa.spss; -import java.io.PrintStream; -import java.io.PrintWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.util.MessageProvider; -import at.gv.egovernment.moa.util.Constants; - -/** - * Base class of MOA specific runtime exceptions. - * - * This class has the ability to wrap other exceptions which may be seen - * as the root cause for this exception. A similar mechanism is in place - * since JDK1.4 (see the getClause() method) but will not be used - * because of required compatibility with JDK1.3. - * - * @author Patrick Peck - * @version $Id$ - */ -public class MOARuntimeException extends RuntimeException { - /** The message ID. */ - private String messageId; - /** The wrapped Throwable. */ - private Throwable wrapped; - - /** - * Create a MOAException. - * - * @param messageId The message ID of the message contained in the created - * MOAException. - * @param parameters The parameters needed to fill in the message arguments. - */ - public MOARuntimeException(String messageId, Object[] parameters) { - super(MessageProvider.getInstance().getMessage(messageId, parameters)); - this.messageId = messageId; - } - - /** - * Create a MOAException. - * - * @param messageId The message ID of the message contained in the created - * MOAException. - * @param parameters The parameters needed to fill in the message arguments. - * @param wrapped The exception wrapped by the created - * MOAException. - */ - public MOARuntimeException( - String messageId, - Object[] parameters, - Throwable wrapped) { - - super(MessageProvider.getInstance().getMessage(messageId, parameters)); - this.messageId = messageId; - this.wrapped = wrapped; - } - - /** - * Returns the message ID of this exception. - * - * @return The message ID as provided in the constructor. - */ - public String getMessageId() { - return messageId; - } - - /** - * Returns the exception wrapped by this MOARuntimeException. - * - * @return The exception wrapped by this exception. Possibly - * null, if none was provided at construction time. - */ - public Throwable getWrapped() { - return wrapped; - } - - /** - * Convert this MOARuntimeException to an ErrorResponse - * element from the MOA namespace. - * - * @return An ErrorResponse element, containing the subelements - * ErrorCode and Info required by the MOA schema. - */ - public Element toErrorResponse() { - DocumentBuilder builder; - DOMImplementation impl; - Document doc; - Element errorResponse; - Element errorCode; - Element info; - - // create a new document - try { - builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - impl = builder.getDOMImplementation(); - } catch (ParserConfigurationException e) { - return null; - } - - // build the ErrorResponse element - doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null); - errorResponse = doc.getDocumentElement(); - - // add MOA namespace declaration - errorResponse.setAttributeNS( - Constants.XMLNS_NS_URI, - "xmlns", - Constants.MOA_NS_URI); - - // build the child elements - errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode"); - errorCode.appendChild(doc.createTextNode(messageId)); - info = doc.createElementNS(Constants.MOA_NS_URI, "Info"); - info.appendChild(doc.createTextNode(getMessage())); - errorResponse.appendChild(errorCode); - errorResponse.appendChild(info); - return errorResponse; - } - - /** - * Print a stack trace of this exception to System.err. - * - * @see java.lang.Throwable#printStackTrace() - */ - public void printStackTrace() { - printStackTrace(System.err); - } - - /** - * Print a stack trace of this exception, including the wrapped exception. - * - * @param s The stream to write the stack trace to. - * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) - */ - public void printStackTrace(PrintStream s) { - super.printStackTrace(s); - if (getWrapped() != null) { - s.print("Caused by: "); - getWrapped().printStackTrace(s); - } - } - - /** - * Print a stack trace of this exception, including the wrapped exception. - * - * @param s The stream to write the stacktrace to. - * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) - */ - public void printStackTrace(PrintWriter s) { - super.printStackTrace(s); - if (getWrapped() != null) { - s.print("Caused by: "); - getWrapped().printStackTrace(s); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/MOASystemException.java b/spss.server/src/at/gv/egovernment/moa/spss/MOASystemException.java deleted file mode 100644 index 5a49b6852..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/MOASystemException.java +++ /dev/null @@ -1,40 +0,0 @@ -package at.gv.egovernment.moa.spss; -/** - * Base class of technical MOA exceptions. - * - * Technical exceptions are exceptions that originate from system failure (e.g., - * a database connection fails, a component is not available, etc.) - * - * @author Patrick Peck - * @version $Id$ - */ -public class MOASystemException extends MOAException { - - /** - * Create a new MOASystemException. - * - * @param messageId The identifier of the message associated with this - * exception. - * @param parameters Additional message parameters. - */ - public MOASystemException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Create a new MOASystemException. - * - * @param messageId The identifier of the message associated with this - * MOASystemException. - * @param parameters Additional message parameters. - * @param wrapped The exception wrapped by this - * MOASystemException. - */ - public MOASystemException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/Configurator.java b/spss.server/src/at/gv/egovernment/moa/spss/api/Configurator.java deleted file mode 100644 index a0efa8924..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/Configurator.java +++ /dev/null @@ -1,60 +0,0 @@ -package at.gv.egovernment.moa.spss.api; - -import org.apache.commons.discovery.tools.DiscoverClass; - -import at.gv.egovernment.moa.spss.MOAException; - -/** - * Configures the SP/SS API. - * - * Also handles dynamic configuration updates. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class Configurator { - - /** The default implementation class. */ - private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl"; - - /** The single instance of this class. */ - private static Configurator instance = null; - - public static synchronized Configurator getInstance() { - if (instance == null) { - try { - DiscoverClass discover = new DiscoverClass(); - instance = - (Configurator) discover.newInstance( - Configurator.class, - DEFAULT_IMPLEMENTATION); - } catch (Exception e) { - // this can not happen since we provide a valid default - // implementation - } - } - return instance; - } - - /** - * Initialize the SP/SS configuration. - * - * Only a single call to this method will have an effect. Use - * update() for reflecting changes in the configuration instead. - * - * @throws MOAException An error occurred updating the SP/SS configuration. - */ - public abstract void init() throws MOAException; - - /** - * Update the SP/SS configuration. - * - * This will only have an effect after the system has been initialized once - * using init(). - * - * @throws MOAException An error occurred updating the SP/SS configuration. - */ - public abstract void update() throws MOAException; - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java deleted file mode 100644 index e306127b3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java +++ /dev/null @@ -1,1012 +0,0 @@ -package at.gv.egovernment.moa.spss.api; - -import java.io.InputStream; -import java.math.BigInteger; -import java.security.cert.X509Certificate; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import org.apache.commons.discovery.tools.DiscoverClass; - -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; -import at.gv.egovernment.moa.spss.api.common.Transform; -import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.common.XPathFilter; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * An abstract factory for creating MOA SP/SS API objects. - * - * Use getInstance() to get a concrete factory instance. Using - * this instance, concrete MOA SP/SS API object can be created. - * - * @author Patrick Peck - * @author Gregor Karlinger - * @version $Id$ - */ -public abstract class SPSSFactory { - - /** The default implementation of this class. */ - private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.api.impl.SPSSFactoryImpl"; - - /** The single instance of this class. */ - private static SPSSFactory instance = null; - - /** - * Returns the single instance of this class. - * - * @return The single instance of this class. - */ - public static synchronized SPSSFactory getInstance() { - if (instance == null) { - try { - DiscoverClass discover = new DiscoverClass(); - instance = - (SPSSFactory) discover.newInstance( - SPSSFactory.class, - DEFAULT_IMPLEMENTATION); - } catch (Exception e) { - // this can not happen since we provide a valid default - // implementation - } - } - return instance; - } - - // - // Factory methods for creating XML signatures - // - - /** - * Create a new CreateXMLSignatureRequest object. - * - * @param keyIdentifier The identifier for the key group to use for signing. - * @param singleSignatureInfos A List of - * SingleSignatureInfo objects containing information about a - * single signature to be created. - * @return The CreateXMLSignatureRequest containing the above - * data. - * - * @pre keyIdentifier != null && keyIdentifier.length() > 0 - * @pre singleSignatureInfos != null - * @pre forall Object o in singleSignatureInfos | - * o instanceof at.gv.egovernment.moa.spss.api.common.SingleSignatureInfo - * @post return != null - */ - public abstract CreateXMLSignatureRequest createCreateXMLSignatureRequest( - String keyIdentifier, - List singleSignatureInfos); - - /** - * Create a new SingleSignatureInfo object. - * - * @param dataObjectInfos The data objects that will be signed (including - * transformations). - * @param createSignatureInfo Information about the signature environment. May - * be null. - * @param securityLayerConform If true, a Security Layer conform - * signature manifest is created, otherwise not. - * @return The SingleSignatureInfo containing the above data. - * - * @pre dataObjectInfos != null && dataObjectInfos.size() > 0 - * @pre forall Object o in dataObjectInfos | - * o instanceof at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo - * @post return != null - */ - public abstract SingleSignatureInfo createSingleSignatureInfo( - List dataObjectInfos, - CreateSignatureInfo createSignatureInfo, boolean securityLayerConform); - - /** - * Create a new DataObjectInfo object. - * - * @param structure The type of signature to create. - * @param childOfManifest If true, references will be returned - * as children of an XMLDsig manifest. Otherwise, they will be returned as - * children of the signature itself. - * @param dataObject The data object that will be signed. - * @param createTransformsInfoProfile Additional transformations to apply - * to the data object. - * @return The DataObjectInfo containing the above data. - * - * @pre DataObjectInfo.STRUCTURE_DETACHED.equals(structure) || - * DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure) - * @pre dataObject != null - * @pre createTransformsInfoProfile != null - * @post return != null - */ - public abstract DataObjectInfo createDataObjectInfo( - String structure, - boolean childOfManifest, - Content dataObject, - CreateTransformsInfoProfile createTransformsInfoProfile); - - /** - * Create a new CreateTransformsInfoProfile object containing a - * reference to a locally stored profile. - * - * @param profileID The profile ID to resolve during signature creation. - * @return The CreateTransformsInfoProfile containing the given - * profile ID. - * - * @pre profileID != null && profileID.length() > 0 - * @post return != null - */ - public abstract CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID); - - /** - * Create a new CreateTransformsInfoProfile object by providing - * the profile data explicitly. - * - * @param transformsInfo The transformations to apply to the associated - * data object. - * @param supplements Supplemental information for the transformation. May be - * null. - * @return The CreateTransformsInfoProfile containing the above - * data. - * - * @pre transformsInfo != null - * @pre supplements != null implies - * forall Object o in supplements | - * o instanceof at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation - * @post return != null - */ - public abstract CreateTransformsInfoProfile createCreateTransformsInfoProfile( - CreateTransformsInfo transformsInfo, - List supplements); - - /** - * Create a new CreateTransformsInfo object. - * - * @param transforms The Transforms to apply to the associated - * data object. May be null. - * @param finalDataMetaInfo Information about the type of the transformed - * data. - * @return The CreateTransformsInfo containing the above data. - * - * @pre transforms != null implies transforms.size > 0 - * @pre transforms != null implies - * forall Object o in transforms | - * o instanceof at.gv.egovernment.moa.spss.api.common.Transform - * @pre finalDataMetaInfo != null - * @post return != null - */ - public abstract CreateTransformsInfo createCreateTransformsInfo( - List transforms, - MetaInfo finalDataMetaInfo); - - /** - * Create a new CreateSignatureInfo object. - * - * @param createSignatureEnvironment The signature environment that will - * contain the signature. - * @param createSignatureEnvironmentProfile Additional information about - * the signture environment. - * @return The CreateSignatureInfo containing the above data. - * - * @pre createSignatureEnvironment != null - * @pre createSignatureEnvironmentProfile != null - * @post return != null - */ - public abstract CreateSignatureInfo createCreateSignatureInfo( - Content createSignatureEnvironment, - CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile); - - /** - * Create a new CreateSignatureEnvironmentProfile object - * containing a reference to a locally stored profile. - * - * @param profileID The profile ID to resolve during signature creation. - * @return The CreateSignatureEnvironmentProfile containing - * the given profile ID. - * - * @pre profileID != null && profileID.length() > 0 - * @post return != null - */ - public abstract CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID); - - /** - * Create a new CreateSignatureEnvironmentProfile object by - * providing the profile data explicitly. - * - * @param createSignatureLocation The location where the signature will be - * inserted. - * @param supplements Additional information about the signature environment. - * @return The CreateSignatureEnvironmentProfile containing the - * above data. - * - * @pre createSignatureLocation != null - * @pre supplements != null - * @pre forall Object o in supplements | - * o instanceof at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation - * @post return != null - */ - public abstract CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( - CreateSignatureLocation createSignatureLocation, - List supplements); - - /** - * Create a new CreateSignatureLocation object. - * - * @param xPathExpression The XPath expression to select the signature - * parent element within the signature environment. - * @param index The index of the node, after which the signature will be - * inserted. - * @param namespaceDeclarations The namespace prefix to URI mapping to apply - * while evaluating the XPath expression. - * @return The CreateSignatureLocation containing the above data. - * - * @pre xPathExpression != null - * @pre index >= 0 - * @pre namespaceDeclarations != null - */ - public abstract CreateSignatureLocation createCreateSignatureLocation( - String xPathExpression, - int index, - Map namespaceDeclarations); - - /** - * Create a new CreateXMLSignatureResponse object. - * - * @param responseElements The elements of the response, either - * SignatureEnvironmentResponse objects, or - * ErrorResponse objects. - * @return The new CreateXMLSignatureResponse containing the - * above data. - * - * @pre responseElements != null && responseElements.size() > 0 - * @pre forall Object o in responseElements | - * o instanceof at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureResponseElement - * @post return != null - */ - public abstract CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements); - - /** - * Create a new SignatureEnvironmentResponse object. - * - * @param signatureEnvironment The signature environment containing the - * signature. - * @return The SignatureEnvironmentResponse containing the - * signatureEnvironment. - * - * @pre signatureEnvironment != null - * @post return != null - */ - public abstract SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment); - - /** - * Create a new ErrorResponse object. - * - * @param code The numerical error code. - * @param info Verbose error information. - * @return The new ErrorResponse containing the above data. - * - * @pre code > 0 - * @pre info != null - * @post return != null - */ - public abstract ErrorResponse createErrorResponse(int code, String info); - - // - // Factory methods for verifying CMS signatures - // - - /** - * Create a new VerifyCMSSignatureRequest object. - * - * @param signatories The indexes of the signatories whose signature is to - * be verified. - * @param dateTime The date for which the verification is to be performed. - * May be null. - * @param cmsSignature The CMS signature. - * @param dataObject The signed data. May be null. - * @param trustProfileID The ID of the trust profile containing the trusted - * root certificates. - * @return The VerifyCMSSignatureRequest containing the above - * data. - * - * @pre signatories != null && signatories.length > 0 - * @pre signaturies != VerifyCMSSignatureRequest.ALL_SIGNATORIES implies - * for (int i = 0; i < signatories.length; i++) - * signatories[i] >= 1 - * @pre cmsSignature != null - * @pre trustProfileID != null && trustProfileID.length() > 0 - * @post return != null - */ - public abstract VerifyCMSSignatureRequest createVerifyCMSSignatureRequest( - int[] signatories, - Date dateTime, - InputStream cmsSignature, - CMSDataObject dataObject, - String trustProfileID); - - /** - * Create a new CMSDataObject object from data at a given URI. - * - * @param metaInfo Type information about the CMSDataObject. - * May be null. - * @param content The CMS content containing the data. - * @return The new CMSDataObject containing the data. - * - * @pre referenceURI != null - * @pre content != null - * @post return != null - */ - public abstract CMSDataObject createCMSDataObject( - MetaInfo metaInfo, - CMSContent content); - - /** - * Create a new CMSContent object from the data contained at the - * given URI. - * - * @param referenceURI The URI identifying the data. Must be resolvable. - * @return The CMSContent containing a reference to the signed - * data. - * - * @pre referenceURI != null - * @post return != null - */ - public abstract CMSContent createCMSContent(String referenceURI); - - /** - * Create a new CMSContent object from a byte stream. - * - * @param binaryContent The byte stream containing the signed data. - * @return The new CMSContent containing the data from the - * byte stream. - * - * @pre binaryContent != null - * @post return != null - */ - public abstract CMSContent createCMSContent(InputStream binaryContent); - - /** - * Create a new VerifyCMSSignatureResponse object. - * - * @param responseElements Verification information about each signature. - * @return The new VerifyCMSSignatureResponse containing the - * status of signature verification for each signature contained in the - * request. - * - * @pre responseElements != null && responseElements.size() > 0 - * @pre forall Object o in responseElements | - * o instanceof at.gv.egovernment.moa.spss.api.cmssign.VerifyCMSSignatureResponseElement - * @post return != null - */ - public abstract VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements); - - /** - * Create a new VerifyCMSSignatureResponseElement object. - * - * @param signerInfo Information about the signer certificate. - * @param signatureCheck Result of the singature value check. - * @param certificateCheck Result of the certificate status check. - * @return The new VerifyCMSSignatureResponseElement containing - * the above data. - * - * @pre signerInfo != null && signatureCheck != null && - * certificateCheck != null - * @post return != null - */ - public abstract VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement( - SignerInfo signerInfo, - CheckResult signatureCheck, - CheckResult certificateCheck); - - // - // Factory methods for verifying XML signatures - // - - /** - * Create a new VerifyXMLSignatureRequest object. - * - * @param dateTime The date for which the verification is to be performed. - * May be null. - * @param verifySignatureInfo Information about the signature environment and - * the location of the signature. - * @param supplementProfiles Supplemental information for the signature - * environment. May be null. - * @param signatureManifestParams Additional information for checking the - * signature manifest. May be null. - * @param returnHashInputData If true, hash input data will - * be returned in the response, otherwise not. - * @param trustProfileID The ID of the trust profile containing the trusted - * root certificates. - * @return The new VerifyXMLSignatureRequest containing the - * above data. - * - * @pre verifySignatureInfo != null - * @pre supplementProfiles != null implies - * forall Object o in supplementProfiles | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile - * @pre trustProfileID != null && trustProfileID.length() > 0 - * @post return != null - */ - public abstract VerifyXMLSignatureRequest createVerifyXMLSignatureRequest( - Date dateTime, - VerifySignatureInfo verifySignatureInfo, - List supplementProfiles, - SignatureManifestCheckParams signatureManifestParams, - boolean returnHashInputData, - String trustProfileID); - - /** - * Create a new VerifySignatureInfo object. - * - * @param verifySignatureEnvironment The signature environment containing - * the signature to be verified. - * @param verifySignatureLocation The location of the signature within the - * signature environment. - * @return The new VerifySignatureInfo containing the above data. - * - * @pre verifySignatureEnvironment != null - * @pre verifySignatureLocation != null - * @post return != null - */ - public abstract VerifySignatureInfo createVerifySignatureInfo( - Content verifySignatureEnvironment, - VerifySignatureLocation verifySignatureLocation); - - /** - * Create a new VerifySignatureLocation object. - * - * @param xPathExpression The XPath expression to select the signature - * element within the signature environment. - * @param namespaceDeclarations The namespace prefix to URI mapping to apply - * while evaluating the XPath expression. - * @return The new VerifySignatureLocation containing the above - * data. - * - * @pre xPathExpression != null - * @pre namespaceDeclarations != null - * @post return != null - */ - public abstract VerifySignatureLocation createVerifySignatureLocation( - String xPathExpression, - Map namespaceDeclarations); - - /** - * Create a new SupplementProfile object containing a reference - * to a locally stored profile. - * - * @param profileID The profile ID to resolve during signature verification. - * @return The SupplementProfile containing the profile ID. - * - * @pre profileID != null && profileID.length() > 0 - * @post return != null - */ - public abstract SupplementProfile createSupplementProfile(String profileID); - - /** - * Create a new SupplementProfile object by providing the profile - * data explicitly. - * - * @param supplementProfile The profile data. - * @return The SupplementProfile containing the profile data. - */ - public abstract SupplementProfile createSupplementProfile(XMLDataObjectAssociation supplementProfile); - - /** - * Create a new SignatureManifestCheckParams object. - * - * @param referenceInfos Information for checking the validity of a - * a reference. - * @param returnReferenceInputData If true, the input data to - * the calculation of reference digest values will be returned in the - * response, otherwise not. - * @return The SignatureManifestCheckParams containing the - * above data. - * - * @pre referenceInfos != null && referenceInfos.size() > 0 - * @pre forall Object o in referenceInfos | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo - * @post return != null - */ - public abstract SignatureManifestCheckParams createSignatureManifestCheckParams( - List referenceInfos, - boolean returnReferenceInputData); - - /** - * Create a new ReferenceInfo object. - * - * @param verifyTransformsInfoProfiles The transformation profiles valid for - * the associated reference. - * @return The ReferenceInfo containing the transformation - * profiles. - * - * @pre verifyTransformsInfoProfiles != null && - * verifyTransformsInfoProfiles.size() > 0 - * @pre forall Object o in verifyTransformsInfoProfiles | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile - * @post return != null - */ - public abstract ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles); - - /** - * Create a new VerifyTransformsInfoProfile object containing - * a reference to a locally stored profile. - * - * @param profileID The profile ID to resolve during signature verification. - * @return The VerifyTransformsInfoProfile containing the - * given profile ID. - * - * @pre profileID != null && profileID.length() > 0 - * @post return != null - */ - public abstract VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID); - - /** - * Create a new VerifyTransformsInfoProfile object by providing - * the profile data explicitly. - * - * @param transforms A valid chain of transformations for the reference. - * May be null. - * @param transformParameters Additional transformation information. - * @return The VerifyTransformsInfoProfile containing the above - * data. - * - * @pre transforms != null implies - * (transforms.size() > 0 && - * forall Object o in transforms | o instanceof Transform) - * @pre transformParameters != null implies - * forall Object o in transformParameters | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter - * @post return != null - */ - public abstract VerifyTransformsInfoProfile createVerifyTransformsInfoProfile( - List transforms, - List transformParameters); - - /** - * Create a new TransformParameter object with the data - * contained at the given URI. - * - * @param URI The URI identifying the data. The URI will be resolved during - * signature verification. - * @return The TransformParameter containing the URI of the - * data. - * - * @pre URI != null - * @post return != null - */ - public abstract TransformParameter createTransformParameter(String URI); - - /** - * Creata a new TransformParameter object containing the - * binary data. - * - * @param URI The URI identifying the data. - * @param binaryData The binary data. - * @return The TransformParameter containig the binary data. - * - * @pre URI != null - * @pre binary != null - * @post return != null - */ - public abstract TransformParameter createTransformParameter( - String URI, - InputStream binaryData); - - /** - * Create a new TransformParameter object containing the hash - * value of the transformation data. - * - * @param URI The URI identifying the data. It will be resolved during - * signature verification. - * @param digestMethod The digest method used for calculating the digest - * value. - * @param digestValue The hash value of the transformation data. - * @return The TransformParameter containing the above data. - * - * @pre URI != null - * @pre digestMethod != null - * @pre digestValue != null - */ - public abstract TransformParameter createTransformParameter( - String URI, - String digestMethod, - byte[] digestValue); - - /** - * Create a new VerifyXMLSignatureResponse object. - * - * @param signerInfo Information about the signer certificate. - * @param hashInputDatas The signed data objects. May be null. - * @param referenceInputDatas The reference input data objects. - * May be null. - * @param signatureCheck Status information about the signature check. - * @param signatureManifestCheck Status information about the signature - * manifest check. - * @param xmlDsigManifestChecks Status information about each XMLDsig manifest - * check. - * @param certificateCheck Status information about the signer certificate - * check. - * @return The VerifyXMLSignatureResponse containing the above - * data. - * - * @pre signerInfo != null - * @pre hashInputDatas != null implies - * forall Object o in hashInputDatas | - * o instanceof at.gv.egovernment.moa.spss.api.common.Content - * @pre referenceInputDatas != null implies - * forall Object o in referenceInputDatas | - * o instanceof at.gv.egovernment.moa.spss.api.common.Content - * @pre signatureCheck != null - * @pre xmlDsigManifestChecks != null implies - * forall Object o in xmlDsigManifestChecks | - * o instanceof at.gv.egovernment.moa.spss.api.xmlverifyManifestRefsCheckResult - * @pre certificateCheck != null - * @post return != null - */ - public abstract VerifyXMLSignatureResponse createVerifyXMLSignatureResponse( - SignerInfo signerInfo, - List hashInputDatas, - List referenceInputDatas, - ReferencesCheckResult signatureCheck, - ReferencesCheckResult signatureManifestCheck, - List xmlDsigManifestChecks, - CheckResult certificateCheck); - - /** - * Create a new ReferencesCheckResult object. - * - * @param code The status code. - * @param info Additional information about the reference check. - * @return The ReferencesCheckResult containing the above data. - * - * @pre code >= 0 - * @post return != null - */ - public abstract ReferencesCheckResult createReferencesCheckResult( - int code, - ReferencesCheckResultInfo info); - - /** - * Create a new ReferencesCheckResultInfo object. - * - * @param anyOtherInfo Arbitrary XML content describing the check result. - * May be null. - * @param failedReferences The indexes of the failed references. May be - * null. - * @return The ReferencesCheckResultInfo containing the above - * data. - * - * @post return != null - */ - public abstract ReferencesCheckResultInfo createReferencesCheckResultInfo( - NodeList anyOtherInfo, - int[] failedReferences); - - /** - * Create a new ManifestRefsCheckResult object. - * - * @param code The status code. - * @param info Additional information about the manifest check. May be - * null. - * @return The ManifestRefsCheckResult containing the above - * data. - * - * @pre code >= 0 - * @post return != null - */ - public abstract ManifestRefsCheckResult createManifestRefsCheckResult( - int code, - ManifestRefsCheckResultInfo info); - - /** - * Create a new ManifestRefsCheckResultInfo object. - * - * @param anyOtherInfo Arbitrary XML content describing the check result. - * May be null. - * @param failedReferences The indexes of the failed references. May be - * null. - * @param referringSigReference The index of the reference in the signature. - * @return The ManifestRefsCheckResultInfo containing the - * above data. - * - * @pre referringSigReference > 0 - * @post return != null - */ - public abstract ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo( - NodeList anyOtherInfo, - int[] failedReferences, - int referringSigReference); - - // - // Factory methods for common objects - // - - /** - * Create a new Content object referencing data via a URI. - * - * @param referenceURI The URI pointing to the content. - * @return The Content object containing the reference. - * - * @pre referenceURI != null && referenceURI.length() > 0 - * @post return != null - */ - public abstract Content createContent(String referenceURI); - - /** - * Create a new Content object containing binary data. - * - * @param binaryData An InputStream containing the binary data. - * @param referenceURI An URI identifying the data. May be null. - * @return The Content object containing the data. - * - * @pre binaryData != null - * @post return != null - */ - public abstract Content createContent( - InputStream binaryData, - String referenceURI); - - /** - * Create a new Content object containing location reference data. - * - * @param locationReferenceURI a URI pointing to the actual remote location of the content. - * - * @param referenceURI An URI identifying the data. May be null. - * - * @return The Content object containing the data. - * - * @pre locationReferenceURI != null - * @post return != null - */ - public abstract Content createContent( - String locationReferenceURI, - String referenceURI); - - /** - * Create a new Content object containing XML data. - * - * @param xmlData The XML data contained in the new Content. - * @param referenceURI An URI identifying the data. May be null. - * @return The Content object containing the data. - * - * @pre xmlData != null - * @post return != null - */ - public abstract Content createContent(NodeList xmlData, String referenceURI); - - /** - * Create a new XMLDataObjectAssociation object. - * - * @param metaInfo Information about the content type. May be - * null. - * @param content The Content object containing the data. - * @return The XMLDataObjectAssociation containing the above - * data. - * - * @pre content != null - * @pre content.getContentType() == Content.CONTENT_XML || - * content.getContentType() == Contetn.CONTENT_BINARY - * @pre content.getReference() != null - * @post return != null - */ - public abstract XMLDataObjectAssociation createXMLDataObjectAssociation( - MetaInfo metaInfo, - Content content); - - /** - * Create a new MetaInfo object. - * - * @param mimeType The MIME type part of the meta information. - * @param description Descriptive meta information. May be null. - * @param otherInfo XML meta information. May be null. - * @param type Type information for XML signature creation. May be null. - * @return The MetaInfo object containing the above data. - * - * @pre mimeType != null && mimeType.length() > 0 - * @pre otherInfo != null implies - * forall Node n in otherInfo | n.getNodeType() == Node.ELEMENT - */ - public abstract MetaInfo createMetaInfo( - String mimeType, - String description, - NodeList otherInfo, - String type); - - /** - * Create a CanonicalizationTransform type of Transform. - * - * @param algorithmURI The algorithm URI of the canonicalization. - * @return The created CanonicalizationTransform object. - * - * @pre CanonicalizationTransform.CANONICAL_XML.equals(algorithmURI) || - * CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals(algorithmURI) - * @post return != null - */ - public abstract Transform createCanonicalizationTransform(String algorithmURI); - - /** - * Create an ExclusiveCanonicalizationTransform type of - * Transform. - * - * @param algorithmURI The algorithm URI of the exclusive canonicalization. - * @param inclusiveNamespacePrefixes The prefixes of the namespaces to - * treat according to canonical XML. - * @return The new ExclusiveCanonicalizationTransform - * - * @pre ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals(algorithmURI) || - * ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS.equals(algorithmURI) - * @pre inclusiveNamespacePrefixes != null - * @pre forall Object o in inclusiveNamespacePrefixes | o instanceof String - * @post return != null - */ - public abstract Transform createExclusiveCanonicalizationTransform( - String algorithmURI, - List inclusiveNamespacePrefixes); - - /** - * Create a Base64Transform type of Transform. - * - * @return A Transform denoting a Base64 decoding. - * - * @post return != null - */ - public abstract Transform createBase64Transform(); - - /** - * Create a EnvelopedSignatureTransform type of - * Transform. - * - * @return A Transform denoting an enveloped signature. - * - * @post return != null - */ - public abstract Transform createEnvelopedSignatureTransform(); - - /** - * Create an XSLTTransform type of Transform. - * - * @param styleSheet The XSLT stylesheet contained in the - * Transform. - * @return A Transform containing the XSLT stylesheet. - * - * @post return != null - */ - public abstract Transform createXSLTTransform(Element styleSheet); - - /** - * Create an XPathTransform type of Transform. - * - * @param xPathExpression The XPath expression to use in the created - * Transform. - * @param namespaceDeclarations The namespace prefix to URI mapping to - * apply on evaluation of the XPath expression. - * @return The XPathTransform containing the above data. - * - * @pre xPathExpression != null - * @pre namespaceDeclarations != null - * @post return != null - */ - public abstract Transform createXPathTransform( - String xPathExpression, - Map namespaceDeclarations); - - /** - * Create a new XPathFilter2Transform type of - * Transform. - * - * @param xPathFilters The filters contained in the newly created - * XPathFilter2Transform. - * @return The XPathFilter2Transform containing the given - * filters. - * - * @pre xPathFilters != null && - * forall Object o in xPathFilters | - * o instanceof at.gv.egovernment.moa.spss.api.common.XPathFilter - * @post return != null - */ - public abstract Transform createXPathFilter2Transform(List xPathFilters); - - /** - * Create a new XPathFilter object. - * - * @param filterType The type of filter. - * @param xPathExpression The XPath expression contained in this filter. - * @param namespaceDeclarations The namespace prefix to URI mapping to apply - * on evaluation of the XPath expression. - * @return The XPathFilter containing the above data. - * - * @pre XPathFilter.SUBTRACT_TYPE.equals(filterType) || - * XPathFilter.INTERSECT_TYPE.equals(filterType) || - * XPathFilter.UNION_TYPE.equals(filterType) - * @pre xPathExpression != null - * @pre namespaceDeclarations != null - * @post return != null - */ - public abstract XPathFilter createXPathFilter( - String filterType, - String xPathExpression, - Map namespaceDeclarations); - - /** - * Create a new CheckResult object. - * - * @param code The check code. - * @param info Verbose information about the check. May be null. - * @return The CheckResult containing the above data. - * - * @pre code >= 0 - * @post return != null - */ - public abstract CheckResult createCheckResult(int code, NodeList info); - - /** - * Create a new SignerInfo object. - * - * @param signerCertificate The signer certificate in binary form. - * @param qualifiedCertificate true, if the signer certificate is - * a qualified certificate, otherwise false. - * @param publicAuthority true, if the signer certificate is a - * public authority certificate, otherwise false. - * @param publicAuthorityID The identification of the public authority - * (if publicAuthority is true). May be - * null. - * @return The SignerInfo containing the above data. - * - * @pre signerCertSubjectName != null - * @pre signerCertIssuerSerial != null - * @pre signerCertificate != null - */ - public abstract SignerInfo createSignerInfo( - X509Certificate signerCertificate, - boolean qualifiedCertificate, - boolean publicAuthority, - String publicAuthorityID); - - /** - * Create a new X509IssuerSerial object. - * - * @param issuerName The distinguished name of the issuer. - * @param issuerSerial The certificate serial number. - * @return The X509IssuerSerial containing the above data. - * - * @pre issuerName != null - * @pre issuerSerial != null - */ - public abstract X509IssuerSerial createX509IssuerSerial( - String issuerName, - BigInteger issuerSerial); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/SignatureCreationService.java b/spss.server/src/at/gv/egovernment/moa/spss/api/SignatureCreationService.java deleted file mode 100644 index a84ca2a83..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/SignatureCreationService.java +++ /dev/null @@ -1,57 +0,0 @@ -package at.gv.egovernment.moa.spss.api; - -import at.gv.egovernment.moa.spss.MOAException; - -import org.apache.commons.discovery.tools.DiscoverClass; - - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; - -/** - * Interface providing functions for signature creation. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class SignatureCreationService { - - /** The default implementation class. */ - private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.invoke.SignatureCreationServiceImpl"; - - /** The single instance of this class. */ - private static SignatureCreationService instance = null; - - /** - * Get an instance of the SignatureCreationService. - * - * @return A concrete instance of the SignatureCreationService. - */ - public static synchronized SignatureCreationService getInstance() { - if (instance == null) { - try { - DiscoverClass discover = new DiscoverClass(); - instance = - (SignatureCreationService) discover.newInstance( - SignatureCreationService.class, - DEFAULT_IMPLEMENTATION); - } catch (Exception e) { - // this can not happen since we provide a valid default - // implementation - } - } - return instance; - } - - /** - * Create an XML signature. - * - * @param request Information on how to create the signature. - * @return A CreateXMLSignatureResponse containing the - * signature. - * @throws MOAException Error in server side MOA module. - */ - public abstract CreateXMLSignatureResponse createXMLSignature(CreateXMLSignatureRequest request) - throws MOAException; -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java b/spss.server/src/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java deleted file mode 100644 index d0fcb029a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java +++ /dev/null @@ -1,69 +0,0 @@ -package at.gv.egovernment.moa.spss.api; - -import org.apache.commons.discovery.tools.DiscoverClass; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * Interface providing functions for verifying signatures. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class SignatureVerificationService { - - /** The default implementation class. */ - private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.invoke.SignatureVerificationServiceImpl"; - - /** The single instance of this class. */ - private static SignatureVerificationService instance = null; - - /** - * Get an instance of the SignatureVerificationService. - * - * @return A concrete instance of the - * SignatureVerificationService. - */ - public static synchronized SignatureVerificationService getInstance() { - if (instance == null) { - try { - DiscoverClass discover = new DiscoverClass(); - instance = - (SignatureVerificationService) discover.newInstance( - SignatureVerificationService.class, - DEFAULT_IMPLEMENTATION); - } catch (Exception e) { - // this can not happen since we provide a valid default - // implementation - } - } - return instance; - } - - /** - * Verify a CMS signature. - * - * @param request Detailed information on the verification that should be - * performed. - * @return A VerifyCMSSignatureResponse object that contains - * information about the performed verification. - * @throws MOAException Error in server side MOA module. - */ - public abstract VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) - throws MOAException; - /** - * Verfiy an XML Signature. - * - * @param request information on the verification that should be performed. - * @return A VerifyXMLSignatureResponse object that contains - * information about the performed verification. - * @throws MOAException Error in server side MOA module. - */ - public abstract VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) - throws MOAException; -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java deleted file mode 100644 index b4ecb3937..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java +++ /dev/null @@ -1,28 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -/** - * Base class for objects containing CMS content. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CMSContent { - /** - * Indicates that this object contains a reference to the CMS content. - */ - public static final int REFERENCE_CONTENT = 0; - /** - * Indicates that this object contains the CMS content explicitly. - */ - public static final int EXPLICIT_CONTENT = 1; - - /** - * Gets the type of the contained content. - * - * @return The type of content, either REFERENCE_CONTENT or - * EXPLICIT_CONTENT. - */ - public int getContentType(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java deleted file mode 100644 index 58c2b0259..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java +++ /dev/null @@ -1,19 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -import java.io.InputStream; - -/** - * Encapsulates binary CMS content. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CMSContentExcplicit extends CMSContent { - /** - * Gets the content as a stream. - * - * @return A stream containing the binary content. - */ - public InputStream getBinaryContent(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java deleted file mode 100644 index 7c4e6d913..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java +++ /dev/null @@ -1,17 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -/** - * Encapsulates CMS content that is referenced by an URI. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CMSContentReference extends CMSContent { - /** - * Gets the reference URI from wher the content can be retrieved. - * - * @return The reference URI. - */ - public String getReference(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java deleted file mode 100644 index 37f6fd396..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -import at.gv.egovernment.moa.spss.api.common.MetaInfo; - -/** - * A data object used for verification of CMS signatures. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CMSDataObject { - /** - * Gets the meta information of the content. - * - * @return An object containig the meta information. - */ - public MetaInfo getMetaInfo(); - /** - * Gets the actual content of the data object. - * - * @return The actual content. - */ - public CMSContent getContent(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java deleted file mode 100644 index 6d1f389af..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -import java.io.InputStream; -import java.util.Date; - -/** - * Object that encapsulates a request to verify a CMS signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyCMSSignatureRequest { - /** - * Indicates, that signature checks for all signatories must be returned. - */ - public static int[] ALL_SIGNATORIES = new int[] { -1 }; - /** - * Gets the positions of signatories whose signature must be verified. - * - * @return The positions of signatories. - */ - public int[] getSignatories(); - /** - * Gets the date and time for which the signature verification has to - * be performed. - * - * @return Date and time for which the signature verification has - * to be performed. - */ - public Date getDateTime(); - /** - * Gets the binary CMS signature. - * - * @return An InputStream from which the binary CMS signature - * can be read. - */ - public InputStream getCMSSignature(); - /** - * Gets the data object necessary for the verification. - * - * @return The data object necessary for verification. - */ - public CMSDataObject getDataObject(); - /** - * Gets the profile ID of trusted certificates to be used for signature - * verification. - * - * @return The profile ID of trusted certificates. - */ - public String getTrustProfileId(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java deleted file mode 100644 index 5f2e6d255..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -import java.util.List; - - -/** - * Object that encapsulates the response on a request to verify a CMS - * signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyCMSSignatureResponse { - /** - * Gets the response elements. - * - * @return The response elements. - */ - public List getResponseElements(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java b/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java deleted file mode 100644 index 49ddb9419..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.gv.egovernment.moa.spss.api.cmsverify; - -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * Contains detailed information about the verification of a signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyCMSSignatureResponseElement { - /** - * Gets a SignerInfo element according to CMS. - * - * @return The SignerInfo element according to CMS. - */ - public SignerInfo getSignerInfo(); - /** - * Gets the result of the signature verification. - * - * @return The result of the signature verification. - */ - public CheckResult getSignatureCheck(); - /** - * Gets the result of the certificate verification. - * - * @return The result of the certificate verification. - */ - public CheckResult getCertificateCheck(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/Base64Transform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/Base64Transform.java deleted file mode 100644 index 94785727d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/Base64Transform.java +++ /dev/null @@ -1,13 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * A Transform performing a Base64 decoding. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface Base64Transform extends Transform { - /** Algorithm URI of the Base64 Transform type. */ - public static final String BASE64_DECODING = - "http://www.w3.org/2000/09/xmldsig#base64"; -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java deleted file mode 100644 index 352461e52..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java +++ /dev/null @@ -1,17 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import at.gv.egovernment.moa.util.Constants; - -/** - * A canonicalization type of Transform. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface CanonicalizationTransform extends Transform { - /** Algorithm URI of canonical XML. */ - public static final String CANONICAL_XML = Constants.C14N_URI; - /** Algorithm URI of canonical XML with comments. */ - public static final String CANONICAL_XML_WITH_COMMENTS = - Constants.C14N_WITH_COMMENTS_URI; -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/CheckResult.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/CheckResult.java deleted file mode 100644 index 974483d82..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/CheckResult.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import org.w3c.dom.NodeList; - -/** - * Object encapsulating the result of a signature verification. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CheckResult { - /** - * Gets the result code. - * - * @return The result code. - */ - public int getCode(); - /** - * Gets descriptive information. - * - * @return Descriptive information. - */ - public NodeList getInfo(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/Content.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/Content.java deleted file mode 100644 index 0777c3d65..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/Content.java +++ /dev/null @@ -1,47 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * Encapsulates content data. - * - * @author Patrick Peck - * @author Stephan Grill - * @author Gregor Karlinger - * @version $Id$ - */ -public interface Content { - - /** - * Indicates that this object contains a URI reference to some content. - */ - public static final int REFERENCE_CONTENT = 0; - - /** - * Indicates that this object contains binary content. - */ - public static final int BINARY_CONTENT = 1; - - /** - * Indicates that this object contains XML content. - */ - public static final int XML_CONTENT = 2; - - /** - * Indicates that this object contains a location reference content. - */ - public static final int LOCREF_CONTENT = 3; - - /** - * Gets the type of content contained in this object. - * - * @return The type of content, one of BINARY_CONTENT, XML_CONTENT, - * REFERENCE_CONTENT or LOCREF_CONTENT. - */ - public int getContentType(); - - /** - * Gets the reference to the content data (a URI). - * - * @return The reference to the content data. - */ - public String getReference(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentBinary.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentBinary.java deleted file mode 100644 index 664afa406..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentBinary.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.io.InputStream; - -/** - * Encapsulates binary content. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface ContentBinary extends Content { - /** - * Get the binary content. - * - * @return An InputStream from which the binary content can - * be read. - */ - public InputStream getBinaryContent(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java deleted file mode 100644 index f640f2b92..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java +++ /dev/null @@ -1,17 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * Encapsulates location reference content. - * - * @author Gregor Karlinger - * @version $Id$ - */ -public interface ContentLocRef extends Content -{ - /** - * Gets the location reference URI pointing to the actual remote location of the content. - * - * @return the location reference URI. - */ - public String getLocationReferenceURI(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentReference.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentReference.java deleted file mode 100644 index c10f0c2f8..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentReference.java +++ /dev/null @@ -1,11 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * Content containing a reference to content data. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface ContentReference extends Content { - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentXML.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentXML.java deleted file mode 100644 index ad5930452..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ContentXML.java +++ /dev/null @@ -1,19 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import org.w3c.dom.NodeList; - -/** - * Encapsulates arbitrary XML content. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface ContentXML extends Content { - /** - * Gets the XML content stored in this object. - * - * @return The XML content. - */ - public NodeList getXMLContent(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ElementSelector.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/ElementSelector.java deleted file mode 100644 index 862cb84da..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ElementSelector.java +++ /dev/null @@ -1,28 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.util.Map; - -/** - * A class containing data for selecting single elements using an XPath - * expression. - * - * Derived classes are used to point to the CreateSignatureLocation - * and the VerifySignatureLocation. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface ElementSelector { - /** - * Gets the XPath expression pointing to a single element. - * - * @return The XPath expression to select the signature parent element. - */ - public String getXPathExpression(); - /** - * Gets the namespace prefix to URI mapping to use when evaluating the XPath. - * - * @return The namespace prefix to URI mapping. - */ - public Map getNamespaceDeclarations(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java deleted file mode 100644 index f951e35c0..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * An enveloped signature type of Transform. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface EnvelopedSignatureTransform extends Transform { - /** - * Algorithm URI of the enveloped signature type of Transform. - */ - public static final String ENVELOPED_SIGNATURE = - "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java deleted file mode 100644 index 369270259..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java +++ /dev/null @@ -1,27 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.util.List; - -import at.gv.egovernment.moa.util.Constants; - -/** - * An exclusive canonicalization type of Transform. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface ExclusiveCanonicalizationTransform extends Transform { - /** Algorithm URI of exclusive canonical XML. */ - public static final String EXCLUSIVE_CANONICAL_XML = Constants.EXC_C14N_URI; - /** Algorithm URI of exclusive canonical XML with comments. */ - public static final String EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS = - Constants.EXC_C14N_WITH_COMMENTS_URI; - - /** - * Sets the namespace prefixes that are handled in the same manner as in - * canonical XML. - * - * @return The inclusive namespace prefixes. - */ - public List getInclusiveNamespacePrefixes(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/InputData.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/InputData.java deleted file mode 100644 index fd2b69c6d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/InputData.java +++ /dev/null @@ -1,47 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * Interface specifying accessors for two attributes needed for returning - * HashInputData and ReferenceInputData information - * as part of VerifyXMLSignatureResponse. - * - * @author Gregor Karlinger - * - * @version $Id$ - */ -public interface InputData extends Content -{ - /** - * Possible value returned by {@link #getPartOf}. - */ - public static String CONTAINER_SIGNEDINFO_ = "SignedInfo"; - - /** - * Possible value returned by {@link #getPartOf}. - */ - public static String CONTAINER_XMLDSIGMANIFEST_ = "XMLDSIGManifest"; - - /** - * Value returned by {link getReferringReferenceNumber}, signalling that the - * attribute is not used. - */ - public static int REFERER_NONE_ = -1; - - /** - * Returns a String signalling what kind of container the - * XMLDSIG Reference this InputData belongs - * to is part of. - * - * @return the kind of container. - */ - public String getPartOf(); - - /** - * If this InputData belongs to an XMLDSIG Reference - * being part of either a XMLDSIGManifest or a SignatureManifest, this method - * returns a positive int value signalling the particular Reference - * of the XMLDSIG SignedInfo referring to the XMLDSIGManifest or - * SignatureManifest respectively. - */ - public int getReferringReferenceNumber(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java deleted file mode 100644 index 56a1793af..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import org.w3c.dom.NodeList; - -/** - * Object encapsulating descriptive meta information. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface MetaInfo { - /** - * Gets the mime type of the associated object. - * - * @return The mimetype of the associated object. - */ - public String getMimeType(); - /** - * Gets the descriptive information (URI). - * - * @return URI referencing the descriptive information. - */ - public String getDescription(); - /** - * Gets the elemental informations. - * - * @return The elemental informations. - */ - public NodeList getAnyElements(); - /** - * Gets the XML signature creation type information of the associated object. - * - * @return the XML signature creation type information of the associated object. - */ - public String getType(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/SignerInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/SignerInfo.java deleted file mode 100644 index c3b4aaadc..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/SignerInfo.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.security.cert.X509Certificate; - - -/** - * Contains information about the signer. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SignerInfo { - /** - * Gets the signer certificate. - * - * @return The signer certificate. - */ - public X509Certificate getSignerCertificate(); - /** - * Checks, whether the certificate contained in this object is qualified. - * - * @return true, if the certificate is qualified, otherwise - * false. - */ - public boolean isQualifiedCertificate(); - /** - * Checks, whether the certificate contained in this object is a - * public authority certificate. - * - * @return true, if the certificate is a public authority - * certificate, otherwise false. - */ - public boolean isPublicAuthority(); - /** - * Gets the public authority ID, if the certificate contained in this - * object is from a public authority. - * - * @return The public authority ID. - */ - public String getPublicAuhtorityID(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/Transform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/Transform.java deleted file mode 100644 index 49a4e7c35..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/Transform.java +++ /dev/null @@ -1,16 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -/** - * Base class for XMLDsig Transform elements. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface Transform { - /** - * Gets the algorithm URI of this Transform. - * - * @return The algorithm URI of this Transform. - */ - public String getAlgorithmURI(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java deleted file mode 100644 index d2ea88968..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.math.BigInteger; - -/** - * Contains an X.509 issuer distinguished name/serial number pair. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface X509IssuerSerial { - /** - * Gets the issuer distinguished name. - * - * @return The issuer distinguished name. - */ - public String getX509IssuerName(); - /** - * Gets the issuer serial number. - * - * @return The issuer serial number. - */ - public BigInteger getX509SerialNumber(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java deleted file mode 100644 index e1e034222..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - - -/** - * Object encapsulating arbitrary content and optional descriptive meta - * information. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface XMLDataObjectAssociation { - /** - * Gets descriptive meta information. - * - * @return The descriptive meta information. - */ - public MetaInfo getMetaInfo(); - /** - * Gets the actual content. - * - * @return The content of this association. - */ - public Content getContent(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter.java deleted file mode 100644 index 247776ce0..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.util.Map; - -/** - * An XPath expression set operation. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface XPathFilter { - /** Subtract this filter's node set from the resulting node set. */ - public static final String SUBTRACT_TYPE = "subtract"; - /** Intersect this filter's node set with the resulting node set. */ - public static final String INTERSECT_TYPE = "intersect"; - /** Compute the union of this filter's node set and the resulting node set. */ - public static final String UNION_TYPE = "union"; - - /** - * Gets the type of this XPathFilter. - * - * @return The type of this XPathFilter. - */ - public String getFilterType(); - /** - * Gets the XPath expression for selecting the nodes. - * - * @return The XPath expression for selecting the nodes. - */ - public String getXPathExpression(); - /** - * Gets The namespace prefix to URI mapping used during evaluation of the - * XPath expression. - * - * @return The namespace prefix to URI mapping. - */ - public Map getNamespaceDeclarations(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java deleted file mode 100644 index 335d37dbf..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.util.List; - -/** - * An XPath type of Transform containing multiple filters for - * performing set operations on XPath selections. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface XPathFilter2Transform extends Transform { - /** Algorithm URI for the XPath Filter2 Transform. */ - public static final String XPATH_FILTER2 = - "http://www.w3.org/2002/06/xmldsig-filter2"; - - /** - * Gets the XPathFilters contained in this - * XPathFilter2Transform. - * - * @return The XPathFilters. - */ - public List getFilters(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathTransform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathTransform.java deleted file mode 100644 index f1cc1a2bc..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XPathTransform.java +++ /dev/null @@ -1,30 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import java.util.Map; - -/** - * A Transform performing an XPath selection. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface XPathTransform extends Transform { - /** Algorithm URI of the XPath Transform. */ - public static final String XPATH = - "http://www.w3.org/TR/1999/REC-xpath-19991116"; - - /** - * Gets the XPath expression used for selection. - * - * @return The XPath expression used for selection. - */ - public String getXPathExpression(); - /** - * Gets The namespace prefix to URI mapping used during evaluation of the - * XPath expression. - * - * @return The namespace prefix to URI mapping. - */ - public Map getNamespaceDeclarations(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java deleted file mode 100644 index 7f44bb060..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java +++ /dev/null @@ -1,23 +0,0 @@ -package at.gv.egovernment.moa.spss.api.common; - -import org.w3c.dom.Element; - -/** - * A Transform containing an XSLT stylesheet. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface XSLTTransform extends Transform { - /** Algorithm URI for the XSLT type of Transform. */ - public static final String XSLT = - "http://www.w3.org/TR/1999/REC-xslt-19991116"; - - /** - * Gets the XSLT stylesheet element used for the transformation. - * - * @return The XSLT stylesheet element used for the transformation. - */ - public Element getStylesheet(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java deleted file mode 100644 index 4af075da2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Base64Transform; - -/** - * Default implementation of Base64Transform. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class Base64TransformImpl - extends TransformImpl - implements Base64Transform { - - /** - * Create a new Base64TransformImpl object. - */ - public Base64TransformImpl() { - setAlgorithmURI(BASE64_DECODING); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java deleted file mode 100644 index dd700cf21..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.io.InputStream; - -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; - -/** - * Default implementation of CMSContentExplicit. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CMSContentExplicitImpl implements CMSContentExcplicit { - - /** The binary content, as a stream. */ - private InputStream binaryContent; - - /** - * Sets the binary content as a stream. - * - * @param content The binary content as a stream. - */ - public void setBinaryContent(InputStream content) { - this.binaryContent = content; - } - - public InputStream getBinaryContent() { - return binaryContent; - } - - /** - * Gets the type of content. - * - * @return EXPLICIT_CONTENT - */ - public int getContentType() { - return EXPLICIT_CONTENT; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java deleted file mode 100644 index f9c080a0d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentReference; - -/** - * Default implementation of CMSContentReference. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CMSContentReferenceImpl implements CMSContentReference { - - /** The reference pointing to the actual data. */ - private String reference; - - /** - * Sets the reference URI. - * - * @param referenceURI The URI pointing to the content data. - */ - public void setReference(String referenceURI) { - this.reference = referenceURI; - } - - public String getReference() { - return reference; - } - - /** - * Gets the content type. - * - * @return REFERENCE_CONTENT - */ - public int getContentType() { - return REFERENCE_CONTENT; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java deleted file mode 100644 index 6eec4e847..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; - -/** - * Default implementation of CMLSDataObject. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CMSDataObjectImpl implements CMSDataObject { - - /** The MetaInfo associated with the CMS data object. */ - private MetaInfo metaInfo; - /** The CMSContent contained in this data object. */ - private CMSContent cmsContent; - - /** - * Sets the meta information associated with the CMS data object. - * - * @param metaInfo The meta information. - */ - public void setMetaInfo(MetaInfo metaInfo) { - this.metaInfo = metaInfo; - } - - public MetaInfo getMetaInfo() { - return metaInfo; - } - - /** - * Sets the data of this CMSDataObject. - * - * @param cmsContent The actual data of this CMSDataObject. - */ - public void setContent(CMSContent cmsContent) { - this.cmsContent = cmsContent; - } - - public CMSContent getContent() { - return cmsContent; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java deleted file mode 100644 index cf446d1b4..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; - -/** - * Default implementation of CanonicalizationTransform. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CanonicalizationTransformImpl - extends TransformImpl - implements CanonicalizationTransform { - - /** - * Create a new CanonicalizationTransformImpl object. - * - * @param algorithmURI Algorithm URI of the canonicalization - * Transform type. - */ - public CanonicalizationTransformImpl(String algorithmURI) { - setAlgorithmURI(algorithmURI); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java deleted file mode 100644 index 2acb12e51..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.api.common.CheckResult; - -/** - * Default implementation of CheckResult. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CheckResultImpl implements CheckResult { - /** The result code. */ - private int code; - - /** Additional information. */ - private NodeList info; - - /** - * Sets a result code. - * - * @param code The result code. - */ - public void setCode(int code) { - this.code = code; - } - - /** - * @see at.gv.egovernment.moa.spss.api.CheckResult#getCode() - */ - public int getCode() { - return code; - } - - /** - * Sets a descriptive information. - * - * @param info The descriptive information. - */ - public void setInfo(NodeList info) { - this.info = info; - } - - /** - * @see at.gv.egovernment.moa.spss.api.CheckResult#getInfo() - */ - public NodeList getInfo() { - return info; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java deleted file mode 100644 index bbed6bf8b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.io.InputStream; - -import at.gv.egovernment.moa.spss.api.common.ContentBinary; - -/** - * Default implementation of ContentBinary. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ContentBinaryImpl extends ContentImpl implements ContentBinary { - - /** The binary content as a stream. */ - private InputStream binaryContent; - - /** - * Sets the binary content as a stream. - * - * @param binaryContent The binary content as a stream. - */ - public void setBinaryContent(InputStream binaryContent) { - this.binaryContent = binaryContent; - } - - public InputStream getBinaryContent() { - return binaryContent; - } - - /** - * Gets the type of content. - * - * @return BINARY_CONTENT - */ - public int getContentType() { - return BINARY_CONTENT; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java deleted file mode 100644 index 7f331d2cd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Content; - -/** - * Default base class for Content implementations. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class ContentImpl implements Content { - /** The reference pointing to the content data. */ - private String reference; - - /** - * Sets the reference pointing to the content data. - * - * @param referenceURI The URI of the content data. - */ - public void setReference(String referenceURI) { - this.reference = referenceURI; - } - - public String getReference() { - return reference; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java deleted file mode 100644 index 902f7bd72..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.ContentLocRef; - -/** - * Default implementation of ContentLocRef. - * - * @author Gregor Karlinger - * @version $Id$ - */ -public class ContentLocRefImpl extends ContentImpl implements ContentLocRef -{ - /** - * The location reference URI pointing to the actual remote location of the content. - */ - private String locationReferenceURI_; - - /** - * @see at.gv.egovernment.moa.spss.api.common.ContentLocRef#getLocationReference() - */ - public String getLocationReferenceURI() - { - return locationReferenceURI_; - } - - /** - * Sets the location reference URI pointing to the actual remote location of the content. - * - * @param locationReferenceURI the location reference URI. - */ - public void setLocationReferenceURI(String locationReferenceURI) - { - locationReferenceURI_ = locationReferenceURI; - } - - /** - * Gets the type of content. - * - * @return LOCREF_CONTENT. - */ - public int getContentType() { - return LOCREF_CONTENT; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java deleted file mode 100644 index 50609aa0e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.ContentReference; - -/** - * Default implementation of ContentReference. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ContentReferenceImpl - extends ContentImpl - implements ContentReference { - - /** - * Gets the type of content. - * - * @return REFERENCE_CONTENT - */ - public int getContentType() { - return REFERENCE_CONTENT; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java deleted file mode 100644 index c03f5edde..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.api.common.ContentXML; - -/** - * Default implementation of ContentXML. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ContentXMLImpl extends ContentImpl implements ContentXML { - - /** The nodes making up the XML content. */ - private NodeList xmlContent; - - /** - * Sets the nodes making up the XML content. - * - * @param xmlContent The XML content. - */ - public void setXMLContent(NodeList xmlContent) { - this.xmlContent = xmlContent; - } - - public NodeList getXMLContent() { - return xmlContent; - } - - /** - * Gets the type of content. - * - * @return XML_CONTENT - */ - public int getContentType() { - return XML_CONTENT; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java deleted file mode 100644 index 22e4cd61d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; - -/** - * Default implementation of - * . - * - * @author Patrick Peck - * @version $Id$ - */ -public class CreateSignatureEnvironmentProfileExplicitImpl - implements CreateSignatureEnvironmentProfileExplicit { - - /** The insertion location of the signature to be created. */ - private CreateSignatureLocation createSignatureLocation; - - /** Supplemental information for evaluating the signature environment. */ - private List supplements; - - /** - * Sets the insertion location of the signature to be created. - * - * @param createSignatureLocation The insertion location of the signature to - * be created. - */ - public void setCreateSignatureLocation(CreateSignatureLocation createSignatureLocation) { - this.createSignatureLocation = createSignatureLocation; - } - - public CreateSignatureLocation getCreateSignatureLocation() { - return createSignatureLocation; - } - - /** - * Sets the supplemental information for evaluating the signature - * environment. - * - * @param supplements The supplemental information. - */ - public void setSupplements(List supplements) { - this.supplements = - supplements != null - ? Collections.unmodifiableList(new ArrayList(supplements)) - : null; - } - - public List getSupplements() { - return supplements; - } - - /** - * Gets the type of profile. - * - * @return EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE - */ - public int getCreateSignatureEnvironmentProfileType() { - return EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java deleted file mode 100644 index 1c7dc6439..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileID; - -/** - * Default implementation of CreateSignatureEnvironmentProfileID. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CreateSignatureEnvironmentProfileIDImpl - implements CreateSignatureEnvironmentProfileID { - - /** The profile ID. */ - private String createSignatureEnvironmentProfileID; - - /** - * Sets the profile ID. - * - * @param profileID The profile ID. - */ - public void setCreateSignatureEnvironmentProfileID(String profileID) { - this.createSignatureEnvironmentProfileID = profileID; - } - - public String getCreateSignatureEnvironmentProfileID() { - return createSignatureEnvironmentProfileID; - } - - /** - * Gets the type of profile. - * - * @return ID_CREATESIGNATUREENVIRONMENTPROFILE - */ - public int getCreateSignatureEnvironmentProfileType() { - return ID_CREATESIGNATUREENVIRONMENTPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java deleted file mode 100644 index 097af7fff..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; - -/** - * Default implementation of CreateSignatureInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateSignatureInfoImpl implements CreateSignatureInfo { - - /** The signature environment that will contain the newly created - * signature. */ - private Content createSignatureEnvironment; - - /** Additional information about the signature environment. */ - private CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile; - - /** - * Sets the signature environment that will contain the newly created - * signature. - * - * @param createSignatureEnvironment The signature environment. - */ - public void setCreateSignatureEnvironment(Content createSignatureEnvironment) { - this.createSignatureEnvironment = createSignatureEnvironment; - } - - public Content getCreateSignatureEnvironment() { - return createSignatureEnvironment; - } - - /** - * Sets the signature environment profile containing additional information - * about the signature environment. - * - * @param profile The signature environment profile. - */ - public void setCreateSignatureEnvironmentProfile(CreateSignatureEnvironmentProfile profile) { - this.createSignatureEnvironmentProfile = profile; - } - - public CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile() { - return createSignatureEnvironmentProfile; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java deleted file mode 100644 index c0b36f505..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; - -/** - * Default implementation of CreateSignatureLocation. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateSignatureLocationImpl - extends ElementSelectorImpl - implements CreateSignatureLocation { - - /** The index of the newly created signature. */ - private int index; - - /** - * Sets the index of the newly created signature. - * - * @param index The index of the newly created signature. - */ - public void setIndex(int index) { - this.index = index; - } - - public int getIndex() { - return index; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java deleted file mode 100644 index ff4108248..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; - -/** - * Default implementation of CreateTransformsInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateTransformsInfoImpl implements CreateTransformsInfo { - /** The dsig:Transforms. */ - private List transforms; - /** Meta information about the data resulting from the transforms. */ - private MetaInfo finalDataMetaInfo; - - /** - * Sets the transforms. - * - * @param transforms The transforms. - */ - public void setTransforms(List transforms) { - this.transforms = - transforms != null - ? Collections.unmodifiableList(new ArrayList(transforms)) - : null; - } - - public List getTransforms() { - return transforms; - } - - /** - * Sets the meta information about the data resulting from the transforms. - * - * @param finalDataMetaInfo The meta information. - */ - public void setFinalDataMetaInfo(MetaInfo finalDataMetaInfo) { - this.finalDataMetaInfo = finalDataMetaInfo; - } - - public MetaInfo getFinalDataMetaInfo() { - return finalDataMetaInfo; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java deleted file mode 100644 index 508b6c083..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; - -/** - * Default implementation of CreateTransformsInfoProfileExplicit. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateTransformsInfoProfileExplicitImpl - implements CreateTransformsInfoProfileExplicit { - - /** Transformation information. */ - private CreateTransformsInfo transformsInfo; - /** Additional data for the transformations. */ - private List supplements = new ArrayList(); - - /** - * Sets the transformation information. - * - * @param transformsInfo The transformation information. - */ - public void setCreateTransformsInfo(CreateTransformsInfo transformsInfo) { - this.transformsInfo = transformsInfo; - } - - public CreateTransformsInfo getCreateTransformsInfo() { - return transformsInfo; - } - - /** - * Sets the additional data for the transformations. - * - * @param supplements The additional data. - */ - public void setSupplements(List supplements) { - this.supplements = - supplements != null - ? Collections.unmodifiableList(new ArrayList(supplements)) - : null; - } - - public List getSupplements() { - return supplements; - } - - /** - * Gets the type of profile. - * - * @return EXPLICIT_CREATETRANSFORMSINFOPROFILE - */ - public int getCreateTransformsInfoProfileType() { - return EXPLICIT_CREATETRANSFORMSINFOPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java deleted file mode 100644 index 5cd1fcc48..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID; - -/** - * Default implementation of CreateTransformsInfoProfileID. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateTransformsInfoProfileIDImpl - implements CreateTransformsInfoProfileID { - - /** The profile ID. */ - private String createTransformsID; - - /** - * Sets the profile ID. - * @param createTransformsID The profile ID. - */ - public void setCreateTransformsInfoProfileID(String createTransformsID) { - this.createTransformsID = createTransformsID; - } - - public String getCreateTransformsInfoProfileID() { - return createTransformsID; - } - - /** - * Gets the type of profile. - * - * @return ID_CREATETRANSFORMSINFOPROFILE - */ - public int getCreateTransformsInfoProfileType() { - return ID_CREATETRANSFORMSINFOPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java deleted file mode 100644 index 08f94cc31..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; - -/** - * Default implementation of CreateXMLSignatureRequest. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateXMLSignatureRequestImpl - implements CreateXMLSignatureRequest { - - /** The identifier for selecting the private keys for creating the signature.*/ - private String keyIdentifier; - /** Information for creating a single signature. */ - private List singleSignatureInfos = new ArrayList(); - - /** - * Sets the identifier for selecting the private keys for creating the - * signature. - * - * @param keyIdentifier The identifier for selecting the private keys. - */ - public void setKeyIdentifier(String keyIdentifier) { - this.keyIdentifier = keyIdentifier; - } - - public String getKeyIdentifier() { - return keyIdentifier; - } - - /** - * Sets the information for creating single signatures. - * - * @param singleSignaureInfos The information for creating single signatures. - */ - public void setSingleSignatureInfos(List singleSignaureInfos) { - this.singleSignatureInfos = - singleSignaureInfos != null - ? Collections.unmodifiableList(new ArrayList(singleSignaureInfos)) - : null; - } - - public List getSingleSignatureInfos() { - return singleSignatureInfos; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java deleted file mode 100644 index 590258e30..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; - -/** - * Default implementation of CreateXMLSignatureResponse. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class CreateXMLSignatureResponseImpl - implements CreateXMLSignatureResponse { - - /** The elements contained in the response. */ - private List responseElements = new ArrayList(); - - /** - * Sets the elements contained in the response. - * - * @param responseElements The response elements. - */ - public void setResponseElements(List responseElements) { - this.responseElements = - responseElements != null - ? Collections.unmodifiableList(new ArrayList(responseElements)) - : null; - } - - public List getResponseElements() { - return responseElements; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java deleted file mode 100644 index 8ab2241de..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; - -/** - * Default implementation of DataObjectInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class DataObjectInfoImpl implements DataObjectInfo { - /** The signature structure type. */ - private String stucture; - /** Whether a reference will be placed in the signature itself or in the - * manifest */ - private boolean childOfManifest; - /** The data object to be signed. */ - private Content dataObject; - /** The profile containing additional information for the transformations. */ - private CreateTransformsInfoProfile createTransformsInfoProfile; - - /** - * Sets the signature structure type. - * - * @param structure The signature structure type. - */ - public void setStructure(String structure) { - this.stucture = structure; - } - - public String getStructure() { - return stucture; - } - - /** - * Sets whether a reference will be placed in the signature itself or in the - * manifest. - * - * @param childOfManifest Whether to put the reference in the signature of - * in the manifest. - */ - public void setChildOfManifest(boolean childOfManifest) { - this.childOfManifest = childOfManifest; - } - - public boolean isChildOfManifest() { - return childOfManifest; - } - - /** - * Sets the data object to be signed. - * - * @param dataObject The data object to be signed. - */ - public void setDataObject(Content dataObject) { - this.dataObject = dataObject; - } - - public Content getDataObject() { - return dataObject; - } - - /** - * Sets additional information for the transformations. - * - * @param profile The profile containing additional information for the - * transformations. - */ - public void setCreateTransformsInfoProfile(CreateTransformsInfoProfile profile) { - this.createTransformsInfoProfile = profile; - } - - public CreateTransformsInfoProfile getCreateTransformsInfoProfile() { - return createTransformsInfoProfile; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java deleted file mode 100644 index e460bd584..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.spss.api.common.ElementSelector; - -/** - * Default implementation of ElementSelector. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ElementSelectorImpl implements ElementSelector { - /** The XPath expression pointing to the element. */ - private String xPathExpression; - /** The namespace declarations to apply for evaluating the XPath */ - private Map namespaceDeclarations = new HashMap(); - - /** - * Sets the XPath expression pointing to the element. - * - * @param xPathExpression XPath expression pointing to the element. - */ - public void setXPathExpression(String xPathExpression) { - this.xPathExpression = xPathExpression; - } - - public String getXPathExpression() { - return xPathExpression; - } - - /** - * Sets namespace declarations to apply for evaluating the XPath. - * - * @param namespaceDeclarations The namespace declarations to apply for - * evaluating the XPath. - */ - public void setNamespaceDeclarations(Map namespaceDeclarations) { - this.namespaceDeclarations = namespaceDeclarations; - } - - public Map getNamespaceDeclarations() { - return namespaceDeclarations; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java deleted file mode 100644 index a1be3d86a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; - -/** - * Default implementation of EnvelopedSignatureTransform. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class EnvelopedSignatureTransformImpl - extends TransformImpl - implements EnvelopedSignatureTransform { - - /** - * Create a EnvelopedSignatureTransformImpl. - */ - public EnvelopedSignatureTransformImpl() { - setAlgorithmURI(ENVELOPED_SIGNATURE); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java deleted file mode 100644 index d7047ab44..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; - -/** - * Default implementation of ErrorResponse. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ErrorResponseImpl implements ErrorResponse { - /** The error code. */ - private int code; - /** Verbose error message. */ - private String info; - - /** - * Sets the error code. - * - * @param code The error code. - */ - public void setErrorCode(int code) { - this.code = code; - } - - public int getErrorCode() { - return code; - } - - /** - * Sets the verbose error information. - * - * @param info The verbose error information. - */ - public void setInfo(String info) { - this.info = info; - } - - public String getInfo() { - return info; - } - - /** - * Gets the response type. - * - * @return ERROR_RESPONSE - */ - public int getResponseType() { - return ERROR_RESPONSE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java deleted file mode 100644 index bf21c8634..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; - -/** - * Default implementation of ExclusiveCanonicalizationTransform. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ExclusiveCanonicalizationTransformImpl - extends TransformImpl - implements ExclusiveCanonicalizationTransform { - - /** The namespaces to treat according to canonical XML. */ - private List inclusiveNamespacePrefixes; - - /** - * Create a ExclusiveCanonicalizationTransformImpl object. - * - * @param algorithmURI The algorithm URI identifying the transformation - * algorithm. - */ - public ExclusiveCanonicalizationTransformImpl(String algorithmURI) { - setAlgorithmURI(algorithmURI); - } - - /** - * Sets the namespaces to treat according to canonical XML. - * @param inclusiveNamespacePrefixes The namespaces to treat according to - * canonical XML. - */ - public void setInclusiveNamespacePrefixes(List inclusiveNamespacePrefixes) { - this.inclusiveNamespacePrefixes = - inclusiveNamespacePrefixes != null - ? Collections.unmodifiableList(new ArrayList(inclusiveNamespacePrefixes)) - : null; - } - - public List getInclusiveNamespacePrefixes() { - return inclusiveNamespacePrefixes; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java deleted file mode 100644 index 42d61559e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.io.InputStream; - -import at.gv.egovernment.moa.spss.MOARuntimeException; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.ContentBinary; -import at.gv.egovernment.moa.spss.api.common.InputData; - -/** - * Content wrapper decorating a binary content with two additional attributes - * needed for returning HashInputData and ReferenceInputData - * information as part of VerifyXMLSignatureResponse. - * - * @author Gregor Karlinger - * - * @version $Id$ - */ -public class InputDataBinaryImpl implements ContentBinary, InputData -{ - /** - * The wrapped Content. - */ - protected ContentBinary wrapped_; - - /** - * This attribute signals what kind of container the XMLDSIG Reference - * this InputData belongs to is part of. - */ - protected String partOf_; - - /** - * If this InputData belongs to an XMLDSIG Reference - * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute - * (a positive int) signals the particular Reference of the XMLDSIG - * SignedInfo referring to the XMLDSIGManifest or SignatureManifest - * respectively. - */ - protected int referringReferenceNumber_; - - /** - * Creates a new instance. - * - * @param wrapped The wrapped Content. Must be of type {@link Content#BINARY_CONTENT}. - * - * @param partOf see {@link InputData} - * - * @param referringReferenceNumber see {@link InputData} - */ - public InputDataBinaryImpl(Content wrapped, String partOf, int referringReferenceNumber) throws MOARuntimeException - { - if (wrapped.getContentType() != Content.BINARY_CONTENT) throw new MOARuntimeException("9901", null); - - wrapped_ = (ContentBinary) wrapped; - partOf_ = partOf; - referringReferenceNumber_ = referringReferenceNumber; - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() - */ - public int getContentType() - { - return wrapped_.getContentType(); - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() - */ - public String getReference() - { - return wrapped_.getReference(); - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.ContentBinary#getBinaryContent() - */ - public InputStream getBinaryContent() - { - return wrapped_.getBinaryContent(); - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() - */ - public String getPartOf() - { - return partOf_; - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() - */ - public int getReferringReferenceNumber() - { - return referringReferenceNumber_; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java deleted file mode 100644 index 029a402f5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.MOARuntimeException; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.ContentXML; -import at.gv.egovernment.moa.spss.api.common.InputData; - -/** - * Content wrapper decorating an XML content with two additional attributes - * needed for returning HashInputData and ReferenceInputData - * information as part of VerifyXMLSignatureResponse. - * - * @author Gregor Karlinger - * - * @version $Id$ - */ -public class InputDataXMLImpl implements ContentXML, InputData -{ - /** - * The wrapped ContentXML. - */ - protected ContentXML wrapped_; - - /** - * This attribute signals what kind of container the XMLDSIG Reference - * this InputData belongs to is part of. - */ - protected String partOf_; - - /** - * If this InputData belongs to an XMLDSIG Reference - * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute - * (a positive int) signals the particular Reference of the XMLDSIG - * SignedInfo referring to the XMLDSIGManifest or SignatureManifest - * respectively. - */ - protected int referringReferenceNumber_; - - /** - * Creates a new instance. - * - * @param wrapped The wrapped ContentBinary. Must be of type {@link Content#XML_CONTENT}. - * - * @param partOf see {@link InputData} - * - * @param referringReferenceNumber see {@link InputData} - */ - public InputDataXMLImpl(Content wrapped, String partOf, int referringReferenceNumber) - { - if (wrapped.getContentType() != Content.XML_CONTENT) throw new MOARuntimeException("9901", null); - - wrapped_ = (ContentXML) wrapped; - partOf_ = partOf; - referringReferenceNumber_ = referringReferenceNumber; - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() - */ - public int getContentType() - { - return wrapped_.getContentType(); - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() - */ - public String getReference() - { - return wrapped_.getReference(); - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.ContentXML#getXMLContent() - */ - public NodeList getXMLContent() - { - return wrapped_.getXMLContent(); - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() - */ - public String getPartOf() - { - return partOf_; - } - - /** - * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() - */ - public int getReferringReferenceNumber() - { - return referringReferenceNumber_; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java deleted file mode 100644 index 9174e3a46..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; - -/** - * Default implementation of ManifestRefsCheckResult. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ManifestRefsCheckResultImpl implements ManifestRefsCheckResult { - /** The numerical check code. */ - private int code; - /** Additional information about the check. */ - private ManifestRefsCheckResultInfo info; - - /** - * Sets the check code. - * - * @param code A numerical representation of the result of the manifest check. - */ - public void setCode(int code) { - this.code = code; - } - - public int getCode() { - return code; - } - - /** - * Sets a reference to the manifest. - * - * @param info The reference to the manifest. - */ - public void setInfo(ManifestRefsCheckResultInfo info) { - this.info = info; - } - - public ManifestRefsCheckResultInfo getInfo() { - return info; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java deleted file mode 100644 index 0071a14f3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; - -/** - * Default implementation of ManifestRefsCheckResultInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ManifestRefsCheckResultInfoImpl - extends ReferencesCheckResultInfoImpl - implements ManifestRefsCheckResultInfo { - - /** The position of the signature reference containing the reference to the - * manifest being described by this object.*/ - private int referringSignatureReference; - - /** - * Sets the position of the signature reference containing the reference to - * the manifest being described by this object. - * @param referringSignatureReference The position of the signature reference. - */ - public void setReferringSignatureReference(int referringSignatureReference) { - this.referringSignatureReference = referringSignatureReference; - } - - public int getReferringSignatureReference() { - return referringSignatureReference; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java deleted file mode 100644 index 93aceb033..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.api.common.MetaInfo; - -/** - * Default implementation of MetaInfo. - * @author Fatemeh Philippi - * @version $Id$ - */ -public class MetaInfoImpl implements MetaInfo { - /** Information about the MIME type. */ - private String mimeType; - /** URI pointing to a description of the content. */ - private String description; - /** Descriptive XML content. */ - private NodeList anyElements; - /** Type information for XML signature creation */ - private String type; - - /** - * Sets the MIME type. - * - * @param mimeType The MIME type to set. - */ - public void setMimeType(String mimeType) { - this.mimeType = mimeType; - } - - public String getMimeType() { - return mimeType; - } - - /** - * Sets the URI pointing to a description of the content. - * - * @param description The URI pointing to a description of the content. - */ - public void setDescription(String description) { - this.description = description; - } - - public String getDescription() { - return description; - } - - /** - * Sets descriptive XML content. - * - * @param anyElements The elements to set. - */ - public void setAnyElements(NodeList anyElements) { - this.anyElements = anyElements; - } - - public NodeList getAnyElements() { - return anyElements; - } - - /** - * Sets the XML signature creation type information. - * - * @param type the XML signature creation type information to set. - */ - public void setType(String type) { - this.type = type; - } - - public String getType() { - return type; - } - - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java deleted file mode 100644 index 923a4bce1..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; - -/** - * Default implementation of ReferenceInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class ReferenceInfoImpl implements ReferenceInfo { - /** Profile containing the transforms allowed in the signature. */ - private List verifyTransformsInfoProfiles; - - /** - * Sets the transforms profile used for verifying the transforms contained - * in the signature. - * - * @param verifyTransformsInfoProfiles The profiles containing the transforms - * allowed in the signature. - */ - public void setVerifyTransformsInfoProfiles(List verifyTransformsInfoProfiles) { - this.verifyTransformsInfoProfiles = - verifyTransformsInfoProfiles != null - ? Collections.unmodifiableList( - new ArrayList(verifyTransformsInfoProfiles)) - : null; - } - - public List getVerifyTransformsInfoProfiles() { - return verifyTransformsInfoProfiles; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java deleted file mode 100644 index 6bb4d30ac..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; - -/** - * Default implementation of ReferencesCheckResult. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ReferencesCheckResultImpl implements ReferencesCheckResult { - /** The check code. */ - private int code; - /** Additional information about the reference check. */ - private ReferencesCheckResultInfo info; - - /** - * Sets the check code. - * - * @param code A numerical representation of the result of the reference - * check. - */ - public void setCode(int code) { - this.code = code; - } - - public int getCode() { - return code; - } - - /** - * Sets additional information about the reference check. - * - * @param manifestRefsCheckResultInfo Additional information about the - * reference check. - */ - public void setInfo(ReferencesCheckResultInfo manifestRefsCheckResultInfo) { - this.info = manifestRefsCheckResultInfo; - } - - public ReferencesCheckResultInfo getInfo() { - return info; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java deleted file mode 100644 index a21b417ae..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; - -/** - * Default implementation of ReferencesCheckResultInfo. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ReferencesCheckResultInfoImpl - implements ReferencesCheckResultInfo { - - /** Additional information about the references check. */ - private NodeList anyOtherInfo; - /** The indexes of the failed references. */ - private int[] failedReferences = new int[0]; - - /** - * Sets additional information about the references check. - * @param anyOtherInfo Additional information about the references check. - */ - public void setAnyOtherInfo(NodeList anyOtherInfo) { - this.anyOtherInfo = anyOtherInfo; - } - - public NodeList getAnyOtherInfo() { - return anyOtherInfo; - } - - /** - * Sets the indexes of the failed references. - * - * @param failedReferences The indexes of the failed references. - */ - public void setFailedReferences(int[] failedReferences) { - this.failedReferences = failedReferences; - } - - public int[] getFailedReferences() { - return failedReferences; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java deleted file mode 100644 index bf15bf37e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java +++ /dev/null @@ -1,568 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.io.InputStream; -import java.math.BigInteger; -import java.security.cert.X509Certificate; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; -import at.gv.egovernment.moa.spss.api.common.Transform; -import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.common.XPathFilter; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * Default implementation of SPSSFactory. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SPSSFactoryImpl extends SPSSFactory { - - public CreateXMLSignatureRequest createCreateXMLSignatureRequest( - String keyIdentifier, - List singleSignatureInfos) { - CreateXMLSignatureRequestImpl createXMLSignatureRequest = - new CreateXMLSignatureRequestImpl(); - createXMLSignatureRequest.setKeyIdentifier(keyIdentifier); - createXMLSignatureRequest.setSingleSignatureInfos(singleSignatureInfos); - return createXMLSignatureRequest; - } - - public SingleSignatureInfo createSingleSignatureInfo( - List dataObjectInfos, - CreateSignatureInfo createSignatureInfo, - boolean securityLayerConform) { - SingleSignatureInfoImpl singleSignatureInfo = new SingleSignatureInfoImpl(); - singleSignatureInfo.setDataObjectInfos(dataObjectInfos); - singleSignatureInfo.setCreateSignatureInfo(createSignatureInfo); - singleSignatureInfo.setSecurityLayerConform(securityLayerConform); - return singleSignatureInfo; - } - public DataObjectInfo createDataObjectInfo( - String structure, - boolean childOfManifest, - Content dataObject, - CreateTransformsInfoProfile createTransformsInfoProfile) { - DataObjectInfoImpl dataObjectInfo = new DataObjectInfoImpl(); - dataObjectInfo.setStructure(structure); - dataObjectInfo.setChildOfManifest(childOfManifest); - dataObjectInfo.setDataObject(dataObject); - dataObjectInfo.setCreateTransformsInfoProfile(createTransformsInfoProfile); - return dataObjectInfo; - } - - public CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID) { - - CreateTransformsInfoProfileIDImpl createTransformsInfoProfile = - new CreateTransformsInfoProfileIDImpl(); - createTransformsInfoProfile.setCreateTransformsInfoProfileID(profileID); - return createTransformsInfoProfile; - } - - public CreateTransformsInfoProfile createCreateTransformsInfoProfile( - CreateTransformsInfo transformsInfo, - List supplements) { - CreateTransformsInfoProfileExplicitImpl createTransformsInfoProfile = - new CreateTransformsInfoProfileExplicitImpl(); - createTransformsInfoProfile.setCreateTransformsInfo(transformsInfo); - createTransformsInfoProfile.setSupplements(supplements); - return createTransformsInfoProfile; - } - - public CreateTransformsInfo createCreateTransformsInfo( - List transforms, - MetaInfo finalDataMetaInfo) { - CreateTransformsInfoImpl createTransformsInfo = - new CreateTransformsInfoImpl(); - - createTransformsInfo.setTransforms(transforms); - createTransformsInfo.setFinalDataMetaInfo(finalDataMetaInfo); - return createTransformsInfo; - } - - public CreateSignatureInfo createCreateSignatureInfo( - Content createSignatureEnvironment, - CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile) { - CreateSignatureInfoImpl createSignatureInfo = new CreateSignatureInfoImpl(); - createSignatureInfo.setCreateSignatureEnvironment( - createSignatureEnvironment); - createSignatureInfo.setCreateSignatureEnvironmentProfile( - createSignatureEnvironmentProfile); - return createSignatureInfo; - } - - public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( - CreateSignatureLocation createSignatureLocation, - List supplements) { - CreateSignatureEnvironmentProfileExplicitImpl createSignatureEnvironmentProfile = - new CreateSignatureEnvironmentProfileExplicitImpl(); - createSignatureEnvironmentProfile.setCreateSignatureLocation( - createSignatureLocation); - createSignatureEnvironmentProfile.setSupplements(supplements); - return createSignatureEnvironmentProfile; - } - - public CreateSignatureLocation createCreateSignatureLocation( - String signatureLocationXPath, - int signatureLocationIndex, - Map namespaceDeclarations) { - CreateSignatureLocationImpl createSignatureLocation = - new CreateSignatureLocationImpl(); - createSignatureLocation.setIndex(signatureLocationIndex); - createSignatureLocation.setNamespaceDeclarations(namespaceDeclarations); - createSignatureLocation.setXPathExpression(signatureLocationXPath); - return createSignatureLocation; - } - - public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID) { - CreateSignatureEnvironmentProfileIDImpl createSignatureEnvironmentProfile = - new CreateSignatureEnvironmentProfileIDImpl(); - createSignatureEnvironmentProfile.setCreateSignatureEnvironmentProfileID( - profileID); - return createSignatureEnvironmentProfile; - } - - public CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements) { - CreateXMLSignatureResponseImpl createXMLSignatureResponse = - new CreateXMLSignatureResponseImpl(); - createXMLSignatureResponse.setResponseElements(responseElements); - return createXMLSignatureResponse; - } - - public SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment) { - SignatureEnvironmentResponseImpl signatureEnvironmentResponse = - new SignatureEnvironmentResponseImpl(); - signatureEnvironmentResponse.setSignatureEnvironment(signatureEnvironment); - return signatureEnvironmentResponse; - } - - public ErrorResponse createErrorResponse(int code, String info) { - ErrorResponseImpl errorResponse = new ErrorResponseImpl(); - errorResponse.setErrorCode(code); - errorResponse.setInfo(info); - return errorResponse; - } - - public VerifyCMSSignatureRequest createVerifyCMSSignatureRequest( - int[] signatories, - Date dateTime, - InputStream cmsSignature, - CMSDataObject dataObject, - String trustProfileID) { - VerifyCMSSignatureRequestImpl verifyCMSSignatureRequest = - new VerifyCMSSignatureRequestImpl(); - verifyCMSSignatureRequest.setDateTime(dateTime); - verifyCMSSignatureRequest.setCMSSignature(cmsSignature); - verifyCMSSignatureRequest.setDataObject(dataObject); - verifyCMSSignatureRequest.setTrustProfileId(trustProfileID); - verifyCMSSignatureRequest.setSignatories(signatories); - return verifyCMSSignatureRequest; - } - - public CMSDataObject createCMSDataObject( - MetaInfo metaInfo, - CMSContent content) { - - CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); - cmsDataObject.setMetaInfo(metaInfo); - cmsDataObject.setContent(content); - - return cmsDataObject; - } - - public CMSContent createCMSContent(InputStream binaryContent) { - CMSContentExplicitImpl cmsContent = new CMSContentExplicitImpl(); - - cmsContent.setBinaryContent(binaryContent); - return cmsContent; - } - - public CMSContent createCMSContent(String referenceURI) { - CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); - - cmsContent.setReference(referenceURI); - return cmsContent; - } - - - public CMSDataObject createCMSDataObject( - MetaInfo metaInfo, - String referenceURI) { - CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); - CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); - cmsDataObject.setMetaInfo(metaInfo); - cmsContent.setReference(referenceURI); - return cmsDataObject; - } - - public VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements) { - VerifyCMSSinatureResponseImpl verifyCMSSignatureResponse = - new VerifyCMSSinatureResponseImpl(); - verifyCMSSignatureResponse.setResponseElements(responseElements); - return verifyCMSSignatureResponse; - } - - public VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement( - SignerInfo signerInfo, - CheckResult signatureCheck, - CheckResult certificateCheck) { - VerifyCMSSignatureResponseElementImpl verifyCMSSignatureResponseElement = - new VerifyCMSSignatureResponseElementImpl(); - verifyCMSSignatureResponseElement.setSignerInfo(signerInfo); - verifyCMSSignatureResponseElement.setSignatureCheck(signatureCheck); - verifyCMSSignatureResponseElement.setCertificateCheck(certificateCheck); - return verifyCMSSignatureResponseElement; - } - - public VerifyXMLSignatureRequest createVerifyXMLSignatureRequest( - Date dateTime, - VerifySignatureInfo verifySignatureInfo, - List supplementProfiles, - SignatureManifestCheckParams signatureManifestParams, - boolean returnHashInputData, - String trustProfileID) { - VerifyXMLSignatureRequestImpl verifyXMLSignatureRequest = - new VerifyXMLSignatureRequestImpl(); - verifyXMLSignatureRequest.setDateTime(dateTime); - verifyXMLSignatureRequest.setSignatureInfo(verifySignatureInfo); - verifyXMLSignatureRequest.setSupplementProfiles(supplementProfiles); - verifyXMLSignatureRequest.setSignatureManifestCheckParams( - signatureManifestParams); - verifyXMLSignatureRequest.setReturnHashInputData(returnHashInputData); - verifyXMLSignatureRequest.setTrustProfileId(trustProfileID); - return verifyXMLSignatureRequest; - } - - public VerifySignatureInfo createVerifySignatureInfo( - Content verifySignatureEnvironment, - VerifySignatureLocation verifySignatureLocation) { - VerifySignatureInfoImpl verifySignatureInfo = new VerifySignatureInfoImpl(); - verifySignatureInfo.setVerifySignatureEnvironment( - verifySignatureEnvironment); - verifySignatureInfo.setVerifySignatureLocation(verifySignatureLocation); - return verifySignatureInfo; - } - - public VerifySignatureLocation createVerifySignatureLocation( - String xPathExpression, - Map namespaceDeclarations) { - VerifySignatureLocationImpl verifySignatureLocation = - new VerifySignatureLocationImpl(); - verifySignatureLocation.setXPathExpression(xPathExpression); - verifySignatureLocation.setNamespaceDeclarations(namespaceDeclarations); - return verifySignatureLocation; - } - - public SupplementProfile createSupplementProfile(String profileID) { - SupplementProfileIDImpl supplementProfileID = new SupplementProfileIDImpl(); - supplementProfileID.setSupplementProfileID(profileID); - return supplementProfileID; - } - - public SupplementProfile createSupplementProfile(XMLDataObjectAssociation supplementProfile) { - SupplementProfileExplicitImpl supplementProfileExplicit = - new SupplementProfileExplicitImpl(); - supplementProfileExplicit.setSupplementProfile(supplementProfile); - return supplementProfileExplicit; - } - - public SignatureManifestCheckParams createSignatureManifestCheckParams( - List referenceInfos, - boolean returnReferenceInputData) { - SignatureManifestCheckParamsImpl signatureManifestCheckParams = - new SignatureManifestCheckParamsImpl(); - signatureManifestCheckParams.setReferenceInfos(referenceInfos); - signatureManifestCheckParams.setReturnReferenceInputData( - returnReferenceInputData); - return signatureManifestCheckParams; - } - - public ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles) { - ReferenceInfoImpl referenceInfo = new ReferenceInfoImpl(); - referenceInfo.setVerifyTransformsInfoProfiles(verifyTransformsInfoProfiles); - return referenceInfo; - } - - public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile( - List transforms, - List transformParameters) { - VerifyTransformsInfoProfileExplicitImpl verifyTransformsInfoProfile = - new VerifyTransformsInfoProfileExplicitImpl(); - - verifyTransformsInfoProfile.setTransforms(transforms); - verifyTransformsInfoProfile.setTransformParameters(transformParameters); - - return verifyTransformsInfoProfile; - } - - public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID) { - VerifyTransformsInfoProfileIDImpl verifyTransformsInfoProfile = - new VerifyTransformsInfoProfileIDImpl(); - verifyTransformsInfoProfile.setVerifyTransformsInfoProfileID(profileID); - return verifyTransformsInfoProfile; - } - - - public TransformParameter createTransformParameter(String URI, String digestMethod, byte[] digestValue) { - TransformPatameterHashImpl transformParameter = - new TransformPatameterHashImpl(); - transformParameter.setURI(URI); - transformParameter.setDigestMethod(digestMethod); - transformParameter.setDigestValue(digestValue); - return transformParameter; - } - - public TransformParameter createTransformParameter( - String URI, - InputStream binaryData) { - TransformParameterBinaryImpl transformParameter = - new TransformParameterBinaryImpl(); - transformParameter.setURI(URI); - transformParameter.setBinaryContent(binaryData); - return transformParameter; - } - - public TransformParameter createTransformParameter(String URI) { - TransformParameterURIImpl transformParameter = - new TransformParameterURIImpl(); - transformParameter.setURI(URI); - return transformParameter; - } - - public VerifyXMLSignatureResponse createVerifyXMLSignatureResponse( - SignerInfo signerInfo, - List hashInputDatas, - List referenceInputDatas, - ReferencesCheckResult signatureCheck, - ReferencesCheckResult signatureManifestCheck, - List xmlDsigManifestChecks, - CheckResult certificateCheck) { - VerifyXMLSignatureResponseImpl verifyXMLSignatureResponse = - new VerifyXMLSignatureResponseImpl(); - verifyXMLSignatureResponse.setSignerInfo(signerInfo); - verifyXMLSignatureResponse.setHashInputDatas(hashInputDatas); - verifyXMLSignatureResponse.setReferenceInputDatas(referenceInputDatas); - verifyXMLSignatureResponse.setSignatureCheck(signatureCheck); - verifyXMLSignatureResponse.setSignatureManifestCheck( - signatureManifestCheck); - verifyXMLSignatureResponse.setXMLDsigManifestChecks(xmlDsigManifestChecks); - verifyXMLSignatureResponse.setCertificateCheck(certificateCheck); - return verifyXMLSignatureResponse; - } - - public ReferencesCheckResult createReferencesCheckResult( - int code, - ReferencesCheckResultInfo info) { - ReferencesCheckResultImpl referencesCheckResult = - new ReferencesCheckResultImpl(); - referencesCheckResult.setCode(code); - referencesCheckResult.setInfo(info); - return referencesCheckResult; - } - - public ReferencesCheckResultInfo createReferencesCheckResultInfo( - NodeList anyOtherInfo, - int[] failedReferences) { - ReferencesCheckResultInfoImpl referencesCheckResultInfo = - new ReferencesCheckResultInfoImpl(); - referencesCheckResultInfo.setAnyOtherInfo(anyOtherInfo); - referencesCheckResultInfo.setFailedReferences(failedReferences); - return referencesCheckResultInfo; - } - - public ManifestRefsCheckResult createManifestRefsCheckResult( - int code, - ManifestRefsCheckResultInfo info) { - ManifestRefsCheckResultImpl manifestRefsCheckResult = - new ManifestRefsCheckResultImpl(); - manifestRefsCheckResult.setCode(code); - manifestRefsCheckResult.setInfo(info); - return manifestRefsCheckResult; - } - - public ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo( - NodeList anyOtherInfo, - int[] failedReferences, - int referringSigReference) { - ManifestRefsCheckResultInfoImpl manifestRefsCheckResultInfo = - new ManifestRefsCheckResultInfoImpl(); - manifestRefsCheckResultInfo.setAnyOtherInfo(anyOtherInfo); - manifestRefsCheckResultInfo.setReferringSignatureReference( - referringSigReference); - manifestRefsCheckResultInfo.setFailedReferences(failedReferences); - return manifestRefsCheckResultInfo; - } - - public Content createContent(InputStream binaryData, String referenceURI) { - ContentBinaryImpl content = new ContentBinaryImpl(); - content.setBinaryContent(binaryData); - content.setReference(referenceURI); - return content; - } - - public Content createContent(String locationReferenceURI, String referenceURI) { - ContentLocRefImpl content = new ContentLocRefImpl(); - content.setLocationReferenceURI(locationReferenceURI); - content.setReference(referenceURI); - return content; - } - - public Content createContent(String referenceURI) { - ContentReferenceImpl content = new ContentReferenceImpl(); - content.setReference(referenceURI); - return content; - } - - public Content createContent(NodeList xmlData, String referenceURI) { - ContentXMLImpl content = new ContentXMLImpl(); - content.setXMLContent(xmlData); - content.setReference(referenceURI); - return content; - } - - public XMLDataObjectAssociation createXMLDataObjectAssociation( - MetaInfo metaInfo, - Content xmlContent) { - XMLDataObjectAssociationImpl xmlDataObjectAssociation = - new XMLDataObjectAssociationImpl(); - xmlDataObjectAssociation.setMetaInfo(metaInfo); - xmlDataObjectAssociation.setContent(xmlContent); - return xmlDataObjectAssociation; - } - - public MetaInfo createMetaInfo( - String mimeType, - String description, - NodeList otherInfo, - String type) { - MetaInfoImpl metaInfo = new MetaInfoImpl(); - metaInfo.setMimeType(mimeType); - metaInfo.setDescription(description); - metaInfo.setAnyElements(otherInfo); - metaInfo.setType(type); - return metaInfo; - } - - public Transform createCanonicalizationTransform(String algorithmURI) { - CanonicalizationTransformImpl transform = new CanonicalizationTransformImpl(algorithmURI); - return transform; - } - - public Transform createExclusiveCanonicalizationTransform(String algorithmURI, List inclusiveNamespacePrefixes) { - ExclusiveCanonicalizationTransformImpl transform = new ExclusiveCanonicalizationTransformImpl(algorithmURI); - transform.setInclusiveNamespacePrefixes(inclusiveNamespacePrefixes); - return transform; - } - - public Transform createBase64Transform() { - Base64TransformImpl transform = new Base64TransformImpl(); - return transform; - } - - public Transform createEnvelopedSignatureTransform() { - EnvelopedSignatureTransformImpl transform = - new EnvelopedSignatureTransformImpl(); - return transform; - } - - public Transform createXSLTTransform(Element styleSheet) { - XSLTransformImpl transform = new XSLTransformImpl(); - transform.setStylesheet(styleSheet); - return transform; - } - - public Transform createXPathTransform( - String xPathExpression, - Map namespaceDeclarations) { - XPathTransformImpl transform = new XPathTransformImpl(); - transform.setXPathExpression(xPathExpression); - transform.setNamespaceDelcarations(namespaceDeclarations); - return transform; - } - - public Transform createXPathFilter2Transform(List xPathFilters) { - XPathFilter2TransformImpl transform = new XPathFilter2TransformImpl(); - transform.setFilters(xPathFilters); - return transform; - } - - public XPathFilter createXPathFilter( - String filterType, - String xPathExpression, - Map namespaceDeclarations) { - XPathFilterImpl xPathFilter = new XPathFilterImpl(); - xPathFilter.setFilterType(filterType); - xPathFilter.setXPathExpression(xPathExpression); - xPathFilter.setNamespaceDelcarations(namespaceDeclarations); - return xPathFilter; - } - - public CheckResult createCheckResult(int code, NodeList info) { - CheckResultImpl checkResult = new CheckResultImpl(); - checkResult.setCode(code); - checkResult.setInfo(info); - return checkResult; - } - - public SignerInfo createSignerInfo( - X509Certificate signerCertificate, - boolean qualifiedCertificate, - boolean publicAuthority, - String publicAuthorityID) { - SignerInfoImpl signerInfo = new SignerInfoImpl(); - signerInfo.setSignerCertificate(signerCertificate); - signerInfo.setQualifiedCertificate(qualifiedCertificate); - signerInfo.setPublicAuthority(publicAuthority); - signerInfo.setPublicAuhtorityID(publicAuthorityID); - return signerInfo; - } - - public X509IssuerSerial createX509IssuerSerial( - String issuerName, - BigInteger serialNumber) { - X509IssuerSerialImpl x509IssuerSerial = new X509IssuerSerialImpl(); - x509IssuerSerial.setX509IssuerName(issuerName); - x509IssuerSerial.setX509SerialNumber(serialNumber); - return x509IssuerSerial; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java deleted file mode 100644 index 57d30ad3b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; - -/** - * Default implementation of SignatureEnvironmentResponse. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SignatureEnvironmentResponseImpl - implements SignatureEnvironmentResponse { - - /** The signature environment containing the XML signature. */ - private Element signatureEnvironment; - - /** - * Sets the XML structure which contains the signature. - * - * @param signatureEnvironment A general XML structure containing the signature. - */ - public void setSignatureEnvironment(Element signatureEnvironment) { - this.signatureEnvironment = signatureEnvironment; - } - - public Element getSignatureEnvironment() { - return signatureEnvironment; - } - - /** - * Gets the type of CreateXMLSignatureResponseElement. - * - * @return SIGNATURE_ENVIRONMENT_RESPONSE - */ - public int getResponseType() { - return SIGNATURE_ENVIRONMENT_RESPONSE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java deleted file mode 100644 index 5924f8447..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; - -/** - * Default implementation of SignatureManifestCheckParams. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SignatureManifestCheckParamsImpl - implements SignatureManifestCheckParams { - - /** Referential information. */ - private List referenceInfos; - /** Whether to return the signature source data. */ - private boolean returnReferenceInputData = true; - - /** - * Sets the referantial information. - * - * @param referenceInfos The referential information. - */ - public void setReferenceInfos(List referenceInfos) { - this.referenceInfos = - referenceInfos != null - ? Collections.unmodifiableList(new ArrayList(referenceInfos)) - : null; - } - - public List getReferenceInfos() { - return referenceInfos; - } - - /** - * Sets whether to return signature source data. - * - * @param returnReferenceInputData Whether to return signature source data. - */ - public void setReturnReferenceInputData(boolean returnReferenceInputData) { - this.returnReferenceInputData = returnReferenceInputData; - } - - public boolean getReturnReferenceInputData() { - return returnReferenceInputData; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java deleted file mode 100644 index 277f1a008..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.security.cert.X509Certificate; - -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * Default implementation of SignerInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SignerInfoImpl implements SignerInfo { - - /** The signer certificate. */ - private X509Certificate signerCertificate; - /** Determines, whether signerCertificate is a qualified - * certificate. */ - private boolean qualifiedCertificate; - /** Determines, whether signerCertificate is from a public - * authority. */ - private boolean publicAuthority; - /** The public authority ID of the signerCertificate. */ - private String publicAuthorityID; - - /** - * Sets the signer certificate. - * - * @param signerCertificate The signer certificate. - */ - public void setSignerCertificate(X509Certificate signerCertificate) { - this.signerCertificate = signerCertificate; - } - - public X509Certificate getSignerCertificate() { - return signerCertificate; - } - - /** - * Sets, whether the certificate contained in this object is qualified or not. - * - * @param qualifiedCertificate Is true, if the certificate is - * qualified, otherwise false. - */ - public void setQualifiedCertificate(boolean qualifiedCertificate) { - this.qualifiedCertificate = qualifiedCertificate; - } - - public boolean isQualifiedCertificate() { - return qualifiedCertificate; - } - - /** - * Sets, whether the certificate contained in this object is an - * e-government certificate or not. - * - * @param publicAuthority Is true, if the certificate is - * public authority certificate, otherwise false. - */ - public void setPublicAuthority(boolean publicAuthority) { - this.publicAuthority = publicAuthority; - } - - public boolean isPublicAuthority() { - return publicAuthority; - } - - /** - * Sets the public authority ID of the signer certificate. - * - * @param publicAuhtorityID The public authority ID of the signer certificate. - */ - public void setPublicAuhtorityID(String publicAuhtorityID) { - this.publicAuthorityID = publicAuhtorityID; - } - - public String getPublicAuhtorityID() { - return publicAuthorityID; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java deleted file mode 100644 index b50a65c68..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; - -/** - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SingleSignatureInfoImpl implements SingleSignatureInfo { - - private List dataObjectInfos = new ArrayList(); - - private CreateSignatureInfo createSignatureInfo; - - private boolean securityLayerConform = true; - - public void setDataObjectInfos(List dataObjectInfos) { - this.dataObjectInfos = - dataObjectInfos != null - ? Collections.unmodifiableList(new ArrayList(dataObjectInfos)) - : null; - } - - public List getDataObjectInfos() { - return dataObjectInfos; - } - - public void setCreateSignatureInfo(CreateSignatureInfo createSignatureInfo) { - this.createSignatureInfo = createSignatureInfo; - } - - public CreateSignatureInfo getCreateSignatureInfo() { - return createSignatureInfo; - } - - public void setSecurityLayerConform(boolean securityLayerConform) { - this.securityLayerConform = securityLayerConform; - } - - public boolean isSecurityLayerConform() { - return securityLayerConform; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java deleted file mode 100644 index 78723fec2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; - -/** - * Default implementation of SupplementProfileExplicit. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SupplementProfileExplicitImpl implements SupplementProfileExplicit { - - /** Supplemental information for verifying a signature. */ - private XMLDataObjectAssociation supplement; - - /** - * Sets the supplemental information for verifying a signature. - * - * @param supplement The supplemental information for verifying a signature. - */ - public void setSupplementProfile(XMLDataObjectAssociation supplement) { - this.supplement = supplement; - } - - public XMLDataObjectAssociation getSupplementProfile() { - return supplement; - } - - /** - * Gets the type of SupplementProfile. - * - * @return EXPLICIT_SUPPLEMENTPROFILE - */ - public int getSupplementProfileType() { - return EXPLICIT_SUPPLEMENTPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java deleted file mode 100644 index 320827fad..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileID; - -/** - * Default implementation of SupplementProfileID. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class SupplementProfileIDImpl implements SupplementProfileID { - /** The profile ID. */ - private String profileID; - - /** - * Sets the SupplementProfile profile ID. - * - * @param profileID The profile ID. - */ - public void setSupplementProfileID(String profileID) { - this.profileID = profileID; - } - - public String getSupplementProfileID() { - return profileID; - } - - /** - * Gets the type of SupplementProfile. - * - * @return ID_SUPPLEMENTPROFILE - */ - public int getSupplementProfileType() { - return ID_SUPPLEMENTPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java deleted file mode 100644 index 51c7a543f..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Transform; - -/** - * @author Fatemeh Philippi - * @version $Id$ - */ -public class TransformImpl implements Transform { - /** The URI identifying the transformation algorithm. */ - private String algorithmURI; - - /** - * Sets the URI identifying the transformation algorithm. - * - * @param algorithmURI The URI identifying the transformation algorithm. - */ - public void setAlgorithmURI(String algorithmURI) { - this.algorithmURI = algorithmURI; - } - - public String getAlgorithmURI() { - return algorithmURI; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java deleted file mode 100644 index 2901fb1bb..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.io.InputStream; - -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterBinary; - -/** - * Default implementation of TransformParameterBinary. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class TransformParameterBinaryImpl - extends TransformParameterImpl - implements TransformParameterBinary { - - /** The binary content as a stream. */ - private InputStream binaryContent; - - /** - * Sets the binary content as a stream. - * - * @param binaryContent The binary content as a stream. - */ - public void setBinaryContent(InputStream binaryContent) { - this.binaryContent = binaryContent; - } - - public InputStream getBinaryContent() { - return binaryContent; - } - - /** - * Gets the TransformParameter type. - * - * @return BINARY_TRANSFORMPARAMETER - */ - public int getTransformParameterType() { - return BINARY_TRANSFORMPARAMETER; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java deleted file mode 100644 index 9fe60638e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -/** - * Default base implementation of TransformParameter. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class TransformParameterImpl { - /** An URI identifying the TransformParameter. */ - private String uri; - - /** - * Sets the URI identifying the TransformParameter. - * @param uri The URI identifying the TransformParameter. - */ - public void setURI(String uri) { - this.uri = uri; - } - - public String getURI() { - return uri; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java deleted file mode 100644 index 25449504c..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterURI; - -/** - * Default implementation of TransformParameterURI. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class TransformParameterURIImpl - extends TransformParameterImpl - implements TransformParameterURI { - - /** - * Gets the type of TransformParameter. - * - * @return URI_TRANSFORMPARAMETER - */ - public int getTransformParameterType() { - return URI_TRANSFORMPARAMETER; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java deleted file mode 100644 index a7843e68c..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterHash; - -/** - * Default implementation of TransformParameterHash - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class TransformPatameterHashImpl - extends TransformParameterImpl - implements TransformParameterHash { - - /** The method used to calculate the digest value. */ - private String digestMethod; - /** The digest value. */ - private byte[] digestValue; - - /** - * Sets method used to calculate the digest value. - * @param digestMethod The method used to calculate the digest value. - */ - public void setDigestMethod(String digestMethod) { - this.digestMethod = digestMethod; - } - - public String getDigestMethod() { - return digestMethod; - } - - /** - * Sets the digest value. - * - * @param digestValue The digest value. - */ - public void setDigestValue(byte[] digestValue) { - this.digestValue = digestValue; - } - - public byte[] getDigestValue() { - return digestValue; - } - - /** - * Gets the type of TransformParameter. - * - * @return HASH_TRANSFORMPARAMETER - */ - public int getTransformParameterType() { - return HASH_TRANSFORMPARAMETER; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java deleted file mode 100644 index a3c37aaef..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.io.InputStream; -import java.util.Date; - -import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; - -/** - * Default implementation of VerifyCMSSignatureRequest. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyCMSSignatureRequestImpl - implements VerifyCMSSignatureRequest { - - /** The indexes of the signatories whose signature should be verified. */ - private int[] signatories; - /** The profile ID of trusted certificates. */ - private String trustProfileId; - /** The data object necessary for signature verification. */ - private CMSDataObject dataObject; - /** The CMS signature to verify. */ - private InputStream cmsSignature; - /** The date for which to verify the signature. */ - private Date dateTime; - - /** - * Sets the indexes of the signatories whose signature should be verified. - * - * @param signatories The indexes of the signatories whose signature should be - * verified. - */ - public void setSignatories(int[] signatories) { - this.signatories = signatories; - } - - public int[] getSignatories() { - return signatories; - } - - /** - * Sets the date for which to verify the signature. - * - * @param dateTime The date for which to verify the signature. - */ - public void setDateTime(Date dateTime) { - this.dateTime = dateTime; - } - - public Date getDateTime() { - return dateTime; - } - - /** - * Sets the CMS signature to verify. - * @param signature The CMS signature to verify. - */ - public void setCMSSignature(InputStream signature) { - this.cmsSignature = signature; - - } - - public InputStream getCMSSignature() { - return cmsSignature; - } - - /** - * Sets the data object necessary for signature verification. - * @param dataObject The data object necessary for signature verification. - */ - public void setDataObject(CMSDataObject dataObject) { - this.dataObject = dataObject; - } - - public CMSDataObject getDataObject() { - return dataObject; - } - - /** - * Sets the profile ID of trusted certificates. - * @param trustProfileId The profile ID of trusted certificates. - */ - public void setTrustProfileId(String trustProfileId) { - this.trustProfileId = trustProfileId; - } - - public String getTrustProfileId() { - return trustProfileId; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java deleted file mode 100644 index 40dc04683..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * Default implementation of VerifyCMSSignatureResponseElement. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyCMSSignatureResponseElementImpl - implements VerifyCMSSignatureResponseElement { - - /** Information about the signer certificate. */ - private SignerInfo signerInfo; - /** Information about the signature check. */ - private CheckResult signatureCheck; - /** Information about the certificate check. */ - private CheckResult certificateCheck; - - /** - * Sets a SignerInfo element according to CMS. - * - * @param signerInfo The SignerInfo element according to CMS. - */ - public void setSignerInfo(SignerInfo signerInfo) { - this.signerInfo = signerInfo; - } - - public SignerInfo getSignerInfo() { - return signerInfo; - } - - /** - * Sets a result of the signature verification. - * - * @param signatureCheck The result of the signature verification. - */ - public void setSignatureCheck(CheckResult signatureCheck) { - this.signatureCheck = signatureCheck; - } - - public CheckResult getSignatureCheck() { - return signatureCheck; - } - - /** - * Sets a result of the certificate verification. - * - * @param certificateCheck The result of the certificate verification. - */ - public void setCertificateCheck(CheckResult certificateCheck) { - this.certificateCheck = certificateCheck; - } - - public CheckResult getCertificateCheck() { - return certificateCheck; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java deleted file mode 100644 index f258380e0..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; - -/** - * Default implementation of VerifyCMSSignatureResponse. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyCMSSinatureResponseImpl - implements VerifyCMSSignatureResponse { - - /** The elements contained in the response. */ - private List responseElements; - - /** - * Sets the elements contained in the response. - * - * @param responseElements The elements contained in the response. - */ - public void setResponseElements(List responseElements) { - this.responseElements = - responseElements != null - ? Collections.unmodifiableList(new ArrayList(responseElements)) - : null; - } - - public List getResponseElements() { - return responseElements; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java deleted file mode 100644 index 2653e2fd2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; - -/** - * Default implementation of VerifySignatureInfo. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifySignatureInfoImpl implements VerifySignatureInfo { - /** The location of the signature to be verified. */ - private VerifySignatureLocation verifySignatureLocation; - /** The environment containing the signature to be verified. */ - private Content verifySignatureEnvironment; - - /** - * Sets the location of the signature to be verified. - * - * @param verifySignatureLocation The location of the signature to be - * verified. - */ - public void setVerifySignatureLocation(VerifySignatureLocation verifySignatureLocation) { - this.verifySignatureLocation = verifySignatureLocation; - } - - public VerifySignatureLocation getVerifySignatureLocation() { - return verifySignatureLocation; - } - - /** - * Sets the signature environment containing the signature to be verified. - * - * @param verifySignatureEnvironment The signature environment containing the - * signature to be verified. - */ - public void setVerifySignatureEnvironment(Content verifySignatureEnvironment) { - this.verifySignatureEnvironment = verifySignatureEnvironment; - } - - public Content getVerifySignatureEnvironment() { - return verifySignatureEnvironment; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java deleted file mode 100644 index 933e42987..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; - -/** - * Default implementation of VerifySignatureLocation. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifySignatureLocationImpl - extends ElementSelectorImpl - implements VerifySignatureLocation { - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java deleted file mode 100644 index 594f9c246..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; - -/** - * Default implementation of . - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyTransformsDataImpl implements ReferenceInfo { - /** Information about the transformations contained in the signature. */ - private List verifyTransformsInfoProfiles; - - /** - * Sets the information about the transformations contained in the signature. - * - * @param verifyTransformsInfoProfiles The profiles containing transformation - * information. - */ - public void setVerifyTransformsInfoProfiles(List verifyTransformsInfoProfiles) { - this.verifyTransformsInfoProfiles = - verifyTransformsInfoProfiles != null - ? Collections.unmodifiableList( - new ArrayList(verifyTransformsInfoProfiles)) - : null; - } - - public List getVerifyTransformsInfoProfiles() { - return verifyTransformsInfoProfiles; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java deleted file mode 100644 index d9a864499..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; - -/** - * Default implementation of VerifyTransformsInfoProfileExplicit. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyTransformsInfoProfileExplicitImpl - implements VerifyTransformsInfoProfileExplicit { - - /** The transforms contained in this profile. */ - private List transforms; - /** Additional information for the transforms. */ - private List transformParameters = new ArrayList(); - - /** - * Sets the transforms contained in this profile. - * - * @param transforms The transforms contained in this profile. - */ - public void setTransforms(List transforms) { - this.transforms = - transforms != null - ? Collections.unmodifiableList(new ArrayList(transforms)) - : null; - } - - public List getTransforms() { - return transforms; - } - - /** - * Sets additional information for the transforms. - * - * @param transformParameters Additional information for the transforms. - */ - public void setTransformParameters(List transformParameters) { - this.transformParameters = new ArrayList(transformParameters); - } - - public List getTransformParameters() { - return transformParameters; - } - - /** - * Gets the type of VerifyTransformsInfoProfile. - * - * @return EXPLICIT_VERIFYTRANSFORMSINFOPROFILE - */ - public int getVerifyTransformsInfoProfileType() { - return EXPLICIT_VERIFYTRANSFORMSINFOPROFILE; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java deleted file mode 100644 index fb1f10cea..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileID; - -/** - * Default implementation of VerifyTransformsInfoProfileID. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyTransformsInfoProfileIDImpl implements VerifyTransformsInfoProfileID { - - /** The profile ID. */ - private String verifyTransformsInfoProfileID; - - /** - * Sets the profile ID. - * - * @param profileID The profile ID. - */ - public void setVerifyTransformsInfoProfileID(String profileID) { - this.verifyTransformsInfoProfileID = profileID; - } - - public String getVerifyTransformsInfoProfileID() { - return verifyTransformsInfoProfileID; - } - - /** - * Gets the type of VerifyTransformsInfoProfile. - * - * @return ID_VERIFYTRANSFORMSINFOPROFILE - */ - public int getVerifyTransformsInfoProfileType() { - return ID_VERIFYTRANSFORMSINFOPROFILE; - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java deleted file mode 100644 index 26d7def4c..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; - -/** - * Default implementation of VerifyXMLSignatureRequest. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyXMLSignatureRequestImpl - implements VerifyXMLSignatureRequest { - /** Date and time for signature verification. */ - private Date dateTime; - /** The signature to be verified. */ - private VerifySignatureInfo verifySignatureInfo; - /** Supplemental information about the singature. */ - private List supplementProfiles; - /** Additional parameters for checking the signature manifest. */ - private SignatureManifestCheckParams signatureManifestCheckParams; - /** Whether to return the hash input data. */ - private boolean returnHashInputData; - /** The profile ID of the trust profile containing the trusted certificates. - */ - private String trustProfileId; - - /** - * Sets the date and time for signature verification. - * - * @param dateTime The date and time for signature verification. - */ - public void setDateTime(Date dateTime) { - this.dateTime = dateTime; - } - - public Date getDateTime() { - return dateTime; - } - - /** - * Sets the signature to be verified. - * - * @param signatureInfo The signature to be verified. - */ - public void setSignatureInfo(VerifySignatureInfo signatureInfo) { - this.verifySignatureInfo = signatureInfo; - } - - public VerifySignatureInfo getSignatureInfo() { - return verifySignatureInfo; - } - - /** - * Sets supplemental information about the singature. - * @param supplementProfiles - */ - public void setSupplementProfiles(List supplementProfiles) { - this.supplementProfiles = - supplementProfiles != null - ? Collections.unmodifiableList(new ArrayList(supplementProfiles)) - : null; - } - - public List getSupplementProfiles() { - return supplementProfiles; - } - - /** - * Sets supplemental information about the singature. - * @param params Supplemental information about the singature. - */ - public void setSignatureManifestCheckParams(SignatureManifestCheckParams params) { - this.signatureManifestCheckParams = params; - } - - public SignatureManifestCheckParams getSignatureManifestCheckParams() { - return signatureManifestCheckParams; - } - - /** - * Sets whether to return hash input data. - * - * @param returnSignedData Whether to return hash input data. - */ - public void setReturnHashInputData(boolean returnSignedData) { - this.returnHashInputData = returnSignedData; - } - - public boolean getReturnHashInputData() { - return returnHashInputData; - } - - /** - * Sets the profile ID of trusted certificates. - * - * @param trustProfileId The profile ID of trusted certificates. - */ - public void setTrustProfileId(String trustProfileId) { - this.trustProfileId = trustProfileId; - } - - public String getTrustProfileId() { - return trustProfileId; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java deleted file mode 100644 index 989dbfb4a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java +++ /dev/null @@ -1,141 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * @author Fatemeh Philippi - * @version $Id$ - */ -public class VerifyXMLSignatureResponseImpl - implements VerifyXMLSignatureResponse { - - /** Information about the signer certificate. */ - private SignerInfo signerInfo; - - /** - * The hash input data objects. The list consists of {@link at.gv.egovernment.moa.spss.api.common.InputData}s. - * */ - private List hashInputDatas = new ArrayList(); - - /** - * The reference input data objects. The list consists of {@link at.gv.egovernment.moa.spss.api.common.InputData}s. - * */ - private List referenceInputDatas = new ArrayList(); - - /** Information about the signature check. */ - private ReferencesCheckResult signatureCheck; - /** Information about the signature manifest check. */ - private ReferencesCheckResult signatureManifestCheck; - /** Information about the XMLDsig manifest check. */ - private List xmlDsigManifestChecks = new ArrayList(); - /** Information about the certificate check. */ - private CheckResult certificateCheck; - - /** - * Sets information about the signer certificate. - * - * @param signerInfo Information about the signer certificate. - */ - public void setSignerInfo(SignerInfo signerInfo) { - this.signerInfo = signerInfo; - } - - public SignerInfo getSignerInfo() { - return signerInfo; - } - - /** - * Sets data signed by the signatory. - * - * @param hashInputDatas The signed datas. - */ - public void setHashInputDatas(List hashInputDatas) { - this.hashInputDatas = - hashInputDatas != null - ? Collections.unmodifiableList(new ArrayList(hashInputDatas)) - : null; - } - - public List getHashInputDatas() { - return hashInputDatas; - } - - /** - * Sets the source data elements. - * - * @param referenceInputDatas The source data elements. - */ - public void setReferenceInputDatas(List referenceInputDatas) { - this.referenceInputDatas = - referenceInputDatas != null - ? Collections.unmodifiableList(new ArrayList(referenceInputDatas)) - : null; - } - - public List getReferenceInputDatas() { - return referenceInputDatas; - } - - /** - * Sets the result of the signature verification. - * - * @param signatureCheck The result of the signature verification. - */ - public void setSignatureCheck(ReferencesCheckResult signatureCheck) { - this.signatureCheck = signatureCheck; - } - - public ReferencesCheckResult getSignatureCheck() { - return signatureCheck; - } - - /** - * Sets the result of the signature manifest verification. - * - * @param signatureManifestCheck The result of the signature manifest verification. - */ - public void setSignatureManifestCheck(ReferencesCheckResult signatureManifestCheck) { - this.signatureManifestCheck = signatureManifestCheck; - } - - public ReferencesCheckResult getSignatureManifestCheck() { - return signatureManifestCheck; - } - - /** - * Sets the result of the certification verification. - * - * @param certificateCheck The result of the certificate verification. - */ - public void setCertificateCheck(CheckResult certificateCheck) { - this.certificateCheck = certificateCheck; - } - - public CheckResult getCertificateCheck() { - return certificateCheck; - } - - /** - * Sets the XMLDSigManifestChecks. - * - * @param xmlDsigManifestChecks The XMLDSigManifestChecks. - */ - public void setXMLDsigManifestChecks(List xmlDsigManifestChecks) { - this.xmlDsigManifestChecks = - xmlDsigManifestChecks != null - ? Collections.unmodifiableList(new ArrayList(xmlDsigManifestChecks)) - : null; - } - - public List getXMLDsigManifestChecks() { - return xmlDsigManifestChecks; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java deleted file mode 100644 index e6d644fd9..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.math.BigInteger; - -import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; - -/** - * Default implementation of X509IssuerSerial. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class X509IssuerSerialImpl implements X509IssuerSerial { - /** The certificate serial number. */ - private BigInteger x509SerialNumber; - /** The certificate issuer DN. */ - private String x509IssuerName; - - /** - * Sets the issuer distinguished name. - * - * @param x509IssuerName The issuer distinguished name. - */ - public void setX509IssuerName(String x509IssuerName) { - this.x509IssuerName = x509IssuerName; - } - - public String getX509IssuerName() { - return x509IssuerName; - } - - /** - * Sets the certificate serial number. - * - * @param x509SerialNumber The issuer serial number. - */ - public void setX509SerialNumber(BigInteger x509SerialNumber) { - this.x509SerialNumber = x509SerialNumber; - } - - public BigInteger getX509SerialNumber() { - return x509SerialNumber; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java deleted file mode 100644 index b603c3367..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; - -/** - * Default implementation of XMLDataObjectAssociation. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class XMLDataObjectAssociationImpl implements XMLDataObjectAssociation { - - /** Meta information about the Content object. */ - private MetaInfo metaInfo; - /** The actual data contained in this object. */ - private Content content; - - /** - * Sets meta information about the Content object. - * @param metaInfo Meta information about the Content object. - */ - public void setMetaInfo(MetaInfo metaInfo) { - this.metaInfo = metaInfo; - } - - public MetaInfo getMetaInfo() { - return metaInfo; - } - - /** - * Sets the actual data contained in this object. - * - * @param content The actual data contained in this object. - */ - public void setContent(Content content) { - this.content = content; - } - - public Content getContent() { - return content; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java deleted file mode 100644 index a96a8f161..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.ArrayList; -import java.util.List; - -import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; - -/** - * Default implementation of XPathFilter2Transform. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class XPathFilter2TransformImpl - extends TransformImpl - implements XPathFilter2Transform { - - /** The XPath filters. */ - private List filters; - - /** - * Create a new XPathFilter2TransformImpl object. - */ - public XPathFilter2TransformImpl() { - setAlgorithmURI(XPATH_FILTER2); - } - - /** - * Sets the XPath filters contained in this - * XPathFilter2Transform. - * - * @param filters The XPath filters contained in this - * XPathFilter2Transform. - */ - public void setFilters(List filters) { - this.filters = new ArrayList(filters); - } - - public List getFilters() { - return filters; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java deleted file mode 100644 index 72d91bc58..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.spss.api.common.XPathFilter; - -/** - * Default implementation of XPathFilter. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class XPathFilterImpl implements XPathFilter { - /** The type of filter. */ - private String filterType; - /** The XPath expression of the filter. */ - private String xPathExpression; - /** The namespace prefix to URI mapping to while evaluating the XPath - * expression. */ - private Map namespaceDeclarations = new HashMap(); - - /** - * Sets the type of filter. - * - * @param filterType The type of filter. - */ - public void setFilterType(String filterType) { - this.filterType = filterType; - } - - public String getFilterType() { - return filterType; - } - - /** - * Sets the XPath expression of the filter. - * - * @param xPathExpression The XPath expression of the filter. - */ - public void setXPathExpression(String xPathExpression) { - this.xPathExpression = xPathExpression; - } - - public String getXPathExpression() { - return xPathExpression; - } - - /** - * Sets the namespace prefix to URI mapping to while evaluating the XPath - * expression. - * - * @param namespaceDeclarations The namespace prefix to URI mapping to while - * evaluating the XPath expression. - */ - public void setNamespaceDelcarations(Map namespaceDeclarations) { - this.namespaceDeclarations = namespaceDeclarations; - } - - public Map getNamespaceDeclarations() { - return namespaceDeclarations; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java deleted file mode 100644 index 1c9817ecc..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.spss.api.common.XPathTransform; - -/** - * Default implementation of XPathTransform. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class XPathTransformImpl - extends TransformImpl - implements XPathTransform { - - /** The XPath expression to evaluate. */ - private String xPathExpression; - /** The namespace prefix to URI mapping to while evaluating the XPath - * expression. */ - private Map namespaceDeclarations = new HashMap(); - - /** - * Create a new XPathTransformImpl object. - */ - public XPathTransformImpl() { - setAlgorithmURI(XPATH); - } - - /** - * Sets the XPath expression to evaluate. - * - * @param xPathExpression The XPath expression to evaluate. - */ - public void setXPathExpression(String xPathExpression) { - this.xPathExpression = xPathExpression; - } - - public String getXPathExpression() { - return xPathExpression; - } - - /** - * Sets the namespace prefix to URI mapping to while evaluating the XPath - * expression. - * - * @param namespaceDeclarations The namespace prefix to URI mapping to while - * evaluating the XPath expression. - */ - public void setNamespaceDelcarations(Map namespaceDeclarations) { - this.namespaceDeclarations = namespaceDeclarations; - } - - public Map getNamespaceDeclarations() { - return namespaceDeclarations; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java deleted file mode 100644 index c6ddc0fd6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.spss.api.impl; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.api.common.XSLTTransform; - -/** - * Default implementation of XSLTTransform. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class XSLTransformImpl extends TransformImpl implements XSLTTransform { - /** The XSLT stylesheet to apply. */ - private Element styleSheet; - - /** - * Create a new XSLTransformImpl object. - */ - public XSLTransformImpl() { - setAlgorithmURI(XSLT); - } - - /** - * Sets the XSLT stylesheet to apply. - * - * @param styleSheet The XSLT stylesheet to apply. - */ - public void setStylesheet(Element styleSheet) { - this.styleSheet = styleSheet; - } - - public Element getStylesheet() { - return styleSheet; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java deleted file mode 100644 index 319d3ac9d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java +++ /dev/null @@ -1,288 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; - -/** - * A parser to parse CreateXMLSignatureRequest DOM trees into - * CreateXMLSignatureRequest API objects. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CreateXMLSignatureRequestParser { - - // - // XPath expresssions to select elements in the CreateXMLSignatureRequest - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String KEY_IDENTIFIER_XPATH = - "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "KeyIdentifier"; - private static final String SINGLE_SIGNATURE_INFO_XPATH = - "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "SingleSignatureInfo"; - private static final String DATA_OBJECT_INFO_XPATH = MOA + "DataObjectInfo"; - private static final String DATA_OBJECT_XPATH = MOA + "DataObject"; - private static final String CREATE_SIGNATURE_INFO_XPATH = - MOA + "CreateSignatureInfo"; - private static final String CREATE_TRANSFORMS_INFO_PROFILE_XPATH = - (MOA + "CreateTransformsInfoProfile | ") - + (MOA + "CreateTransformsInfoProfileID"); - private static final String CREATE_SIGNATURE_ENVIRONMENT_XPATH = - MOA + "CreateSignatureEnvironment"; - private static final String CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH = - (MOA + "CreateSignatureEnvironmentProfile | ") - + (MOA + "CreateSignatureEnvironmentProfileID"); - private static final String SL_CONFORM_ATTR_NAME = "SecurityLayerConformity"; - - /** The factory to create API objects. */ - private SPSSFactory factory; - - /** - * Create a new CreateXMLSignatureRequestParser. - */ - public CreateXMLSignatureRequestParser() { - this.factory = SPSSFactory.getInstance(); - } - - /** - * Parse a CreateXMLSignatureRequest DOM element, as defined - * by the MOA schema. - * - * @param requestElem The CreateXMLSignatureRequest to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A CreateXMLSignatureRequest API object containing - * the data from the DOM element. - * @throws MOAApplicationException An error occurred parsing the request. - */ - public CreateXMLSignatureRequest parse(Element requestElem) - throws MOAApplicationException { - - List singleSignatureInfos = parseSingleSignatureInfos(requestElem); - String keyIdentifier = - XPathUtils.getElementValue(requestElem, KEY_IDENTIFIER_XPATH, null); - - return factory.createCreateXMLSignatureRequest( - keyIdentifier, - singleSignatureInfos); - } - - /** - * Parse all SingleSignatureInfo elements of the - * CreateXMLSignatureRequest. - * - * @param requestElem The CreateXMLSignatureRequest to parse. - * @return A List of SingleSignatureInfo API - * objects. - * @throws MOAApplicationException An error occurred parsing on of the - * SingleSignatureInfo elements. - */ - private List parseSingleSignatureInfos(Element requestElem) - throws MOAApplicationException { - - List singleSignatureInfos = new ArrayList(); - NodeIterator sigInfoElems = - XPathUtils.selectNodeIterator(requestElem, SINGLE_SIGNATURE_INFO_XPATH); - Element sigInfoElem; - - while ((sigInfoElem = (Element) sigInfoElems.nextNode()) != null) { - singleSignatureInfos.add(parseSingleSignatureInfo(sigInfoElem)); - } - - return singleSignatureInfos; - } - - /** - * Parse a SingleSignatureInfo DOM element. - * - * @param sigInfoElem The SingleSignatureInfo DOM element to - * parse. - * @return A SingleSignatureInfo API object containing the - * information of sigInfoElem. - * @throws MOAApplicationException An error occurred parsing the - * SingleSignatureInfo. - */ - private SingleSignatureInfo parseSingleSignatureInfo(Element sigInfoElem) - throws MOAApplicationException { - - List dataObjectInfos = parseDataObjectInfos(sigInfoElem); - CreateSignatureInfo createSignatureInfo = - parseCreateSignatureInfo(sigInfoElem); - boolean securityLayerConform; - - if (sigInfoElem.hasAttribute(SL_CONFORM_ATTR_NAME)) { - securityLayerConform = - BoolUtils.valueOf(sigInfoElem.getAttribute(SL_CONFORM_ATTR_NAME)); - } else { - securityLayerConform = true; - } - - return factory.createSingleSignatureInfo( - dataObjectInfos, - createSignatureInfo, - securityLayerConform); - } - - /** - * Parse the DataObjectInfo DOM elements contained in the given - * SingleSignatureInfo DOM element. - * - * @param sigInfoElem The SingleSignatureInfo DOM element - * whose DataObjectInfos to parse. - * @return A List of DataObjectInfo API objects - * containing the data from the DataObjectInfo DOM elements. - * @throws MOAApplicationException An error occurred parsing one of the - * DataObjectInfos. - */ - private List parseDataObjectInfos(Element sigInfoElem) - throws MOAApplicationException { - - List dataObjectInfos = new ArrayList(); - NodeIterator dataObjInfoElems = - XPathUtils.selectNodeIterator(sigInfoElem, DATA_OBJECT_INFO_XPATH); - Element dataObjInfoElem; - - while ((dataObjInfoElem = (Element) dataObjInfoElems.nextNode()) != null) { - dataObjectInfos.add(parseDataObjectInfo(dataObjInfoElem)); - } - return dataObjectInfos; - } - - /** - * Parse a DataObjectInfo DOM element. - * - * @param dataObjInfoElem The DataObjectInfo DOM element to - * parse. - * @return A DataObjectInfo API element containing the data - * from dataObjInfoElem. - * @throws MOAApplicationException An error occurred parsing the - * DataObjectInfo. - */ - private DataObjectInfo parseDataObjectInfo(Element dataObjInfoElem) - throws MOAApplicationException { - - String structure = dataObjInfoElem.getAttribute("Structure"); - Element dataObjectElem = - (Element) XPathUtils.selectSingleNode(dataObjInfoElem, DATA_OBJECT_XPATH); - Content dataObject = RequestParserUtils.parseContent(dataObjectElem); - CreateTransformsInfoProfile createTransformsInfoProfile = - parseCreateTransformsInfoProfile(dataObjInfoElem); - boolean childOfManifest; - - if (dataObjInfoElem.hasAttribute("ChildOfManifest")) { - childOfManifest = - BoolUtils.valueOf(dataObjInfoElem.getAttribute("ChildOfManifest")); - } else { - childOfManifest = false; - } - - return factory.createDataObjectInfo( - structure, - childOfManifest, - dataObject, - createTransformsInfoProfile); - } - - /** - * Parse a CreateTransformsInfoProfile DOM element. - * - * @param dataObjInfoElem The DataObjectInfo DOM element - * containing the CreateTransformsInfoProfile. - * @return The CreateTransformsInfoProfile API object containing - * the profile found in dataObjInfoElem. - * @throws MOAApplicationException An error occurred parsing the - * CreateTransformsInfoProfile. - */ - private CreateTransformsInfoProfile parseCreateTransformsInfoProfile(Element dataObjInfoElem) - throws MOAApplicationException { - - Element profileElem = - (Element) XPathUtils.selectSingleNode( - dataObjInfoElem, - CREATE_TRANSFORMS_INFO_PROFILE_XPATH); - - if ("CreateTransformsInfoProfile".equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); - return profileParser.parseCreateTransformsInfoProfile(profileElem); - - } else { - String profileID = DOMUtils.getText(profileElem); - return factory.createCreateTransformsInfoProfile(profileID); - } - } - - /** - * Parse the CreateSignatureInfo DOM element contained in - * a SingleSignatureInfo. - * - * @param sigInfoElem The SingleSignatureInfo DOM element - * containing the CreateSignatureInfo to be parsed. - * @return A CreateSignatureInfo API object containing the - * data from the CreateSignatureInfo DOM element, or - * null, if none was found. - */ - private CreateSignatureInfo parseCreateSignatureInfo(Element sigInfoElem) { - Element createInfoElem = - (Element) XPathUtils.selectSingleNode( - sigInfoElem, - CREATE_SIGNATURE_INFO_XPATH); - - if (createInfoElem != null) { - Element environmentElem = - (Element) XPathUtils.selectSingleNode( - createInfoElem, - CREATE_SIGNATURE_ENVIRONMENT_XPATH); - Content environment = RequestParserUtils.parseContent(environmentElem); - CreateSignatureEnvironmentProfile environmentProfile = - parseCreateSignatureEnvironmentProfile(createInfoElem); - - return factory.createCreateSignatureInfo(environment, environmentProfile); - } else { - return null; - } - } - - /** - * Parse the CreateSignatureEnvironmentProfile contained in - * the given CreateSignatureInfo DOM element. - * - * @param createInfoElem CreateSignatureInfo DOM element to - * parse. - * @return The CreateSignatureEnvironmentProfile contained - * in the given CreateSignatureInfo DOM element.. - */ - private CreateSignatureEnvironmentProfile parseCreateSignatureEnvironmentProfile(Element createInfoElem) { - Element profileElem = - (Element) XPathUtils.selectSingleNode( - createInfoElem, - CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH); - - if ("CreateSignatureEnvironmentProfile" - .equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); - return profileParser.parseCreateSignatureEnvironmentProfile(profileElem); - } else { - String profileID = DOMUtils.getText(profileElem); - return factory.createCreateSignatureEnvironmentProfile(profileID); - } - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java deleted file mode 100644 index eec9c4882..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java +++ /dev/null @@ -1,119 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.Iterator; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import at.gv.egovernment.moa.util.Constants; - -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; - -/** - * Convert a CreateXMLSignatureResponse API object into its - * XML representation, according to the MOA XML schema. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CreateXMLSignatureResponseBuilder { - private static final String MOA_NS_URI = Constants.MOA_NS_URI; - - /** The XML document containing the response element. */ - private Document responseDoc; - /** The response CreateXMLSignatureResponse DOM element. */ - private Element responseElem; - - /** - * Create a new CreateXMLSignatureResponseBuilder: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. - */ - public CreateXMLSignatureResponseBuilder() throws MOASystemException { - responseDoc = - ResponseBuilderUtils.createResponse("CreateXMLSignatureResponse"); - responseElem = responseDoc.getDocumentElement(); - } - - /** - * Build a document containing a CreateXMLSignatureResponse - * DOM element being the XML representation of the given - * CreateXMLSignatureResponse API object. - * - * @param response The CreateXMLSignatureResponse to convert - * to XML. - * @return A document containing the CreateXMLSignatureResponse - * DOM element. - */ - public Document build(CreateXMLSignatureResponse response) { - Iterator iter; - - for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - CreateXMLSignatureResponseElement responseElement = - (CreateXMLSignatureResponseElement) iter.next(); - - switch (responseElement.getResponseType()) { - case CreateXMLSignatureResponseElement.SIGNATURE_ENVIRONMENT_RESPONSE : - SignatureEnvironmentResponse envResponse = - (SignatureEnvironmentResponse) responseElement; - addSignatureEnvironment(envResponse); - break; - - case CreateXMLSignatureResponseElement.ERROR_RESPONSE : - ErrorResponse errorResponse = (ErrorResponse) responseElement; - addErrorResponse(errorResponse); - break; - } - - } - - return responseDoc; - } - - /** - * Add a SignatureEnvironment element to the response. - * - * @param envResponse The content to put under the - * SignatureEnvironment element. This should either be a - * dsig:Signature element (in case of a detached signature) or - * the signature environment containing the signature (in case of - * an enveloping signature). - */ - private void addSignatureEnvironment(SignatureEnvironmentResponse envResponse) { - Element content = envResponse.getSignatureEnvironment(); - Node importedSignature = responseDoc.importNode(content, true); - Element signatureEnvironment = - responseDoc.createElementNS(MOA_NS_URI, "SignatureEnvironment"); - signatureEnvironment.appendChild(importedSignature); - responseElem.appendChild(signatureEnvironment); - } - - /** - * Add a ErrorResponse element to the response. - * - * @param errorResponse The API object containing the information to put into - * the ErrorResponse DOM element. - */ - private void addErrorResponse(ErrorResponse errorResponse) { - Element errorElem = - responseDoc.createElementNS(MOA_NS_URI, "ErrorResponse"); - Element errorCodeElem = - responseDoc.createElementNS(MOA_NS_URI, "ErrorCode"); - Element infoElem = responseDoc.createElementNS(MOA_NS_URI, "Info"); - String errorCodeStr = Integer.toString(errorResponse.getErrorCode()); - - errorCodeElem.appendChild(responseDoc.createTextNode(errorCodeStr)); - errorElem.appendChild(errorCodeElem); - infoElem.appendChild(responseDoc.createTextNode(errorResponse.getInfo())); - errorElem.appendChild(errorCodeElem); - errorElem.appendChild(infoElem); - responseElem.appendChild(errorElem); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java deleted file mode 100644 index 66c08e0ab..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java +++ /dev/null @@ -1,285 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; - -/** - * Parse the various profile elements contained in the MOA web service requests - * and given as separate files in the MOA configuration. - * - * The profiles parsed must be schema valid according to the MOA XML schema. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ProfileParser { - - // - // XPath expressions to select parts of the profiles - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - private static final String CREATE_TRANSFORMS_XPATH = - MOA + "CreateTransformsInfo/" + DSIG + "Transforms"; - private static final String FINAL_DATA_META_INFO_XPATH = - MOA + "CreateTransformsInfo/" + MOA + "FinalDataMetaInfo"; - private static final String CREATE_SIGNATURE_LOCATION_XPATH = - MOA + "CreateSignatureLocation"; - private static final String SUPPLEMENT_XPATH = MOA + "Supplement"; - private static final String VERIFY_TRANSFORMS_XPATH = DSIG + "Transforms"; - private static final String TRANSFORM_PARAMETER_XPATH = - MOA + "TransformParameter"; - private static final String TRANSFORM_PARAMETER_CONTENT_XPATH = - MOA + "Base64Content | " + MOA + "Hash"; - private static final String DIGEST_METHOD_XPATH = DSIG + "DigestMethod"; - private static final String DIGEST_VALUE_XPATH = DSIG + "DigestValue"; - - /** The factory used to create API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - - /** - * Parse a CreateTransformsInfoProfile DOM element. - * - * @param profileElem The CreateTransformsInfoProfile element - * to parse. - * @return The CreateTransformsInfoProfile API object containing - * the data from the profileElem. - * @throws MOAApplicationException An error occurred parsing the DOM element. - */ - public CreateTransformsInfoProfile parseCreateTransformsInfoProfile(Element profileElem) - throws MOAApplicationException { - CreateTransformsInfo createTransformsInfo = - parseCreateTransformsInfo(profileElem); - List supplements = parseSupplements(profileElem); - - return factory.createCreateTransformsInfoProfile( - createTransformsInfo, - supplements); - } - - /** - * Parse the CreateTransformsInfo DOM element contained in a - * CreateTransformsInfoProfile. - * - * @param profileElem The CreateTransformsInfoProfile DOM - * element containing the CreateTransformsInfo. - * @return The CreateTransformsInfo API object containinig the - * data from the CreateTransformsInfo DOM element. - * @throws MOAApplicationException An error occurred parsing the - * CreateTransformsInfo DOM element. - */ - private CreateTransformsInfo parseCreateTransformsInfo(Element profileElem) - throws MOAApplicationException { - - Element transformsElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - CREATE_TRANSFORMS_XPATH); - Element metaInfoElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - FINAL_DATA_META_INFO_XPATH); - MetaInfo finalDataMetaInfo; - List transforms; - - // parse the dsig:Transforms - if (transformsElem != null) { - TransformParser transformsParser = new TransformParser(); - transforms = transformsParser.parseTransforms(transformsElem); - } else { - transforms = null; - } - - // parse the meta info - finalDataMetaInfo = RequestParserUtils.parseMetaInfo(metaInfoElem); - - return factory.createCreateTransformsInfo(transforms, finalDataMetaInfo); - } - - /** - * Parse a CreateSignatureEnvironmentProfile DOM element. - * - * @param profileElem The CreateSignatureEnvironmentProfile - * DOM element to parse. - * @return The CreateSignatureEnvironmentProfile API object - * containing the data from the profileElem. - */ - public CreateSignatureEnvironmentProfile parseCreateSignatureEnvironmentProfile(Element profileElem) { - CreateSignatureLocation createSignatureLocation = - parseCreateSignatureLocation(profileElem); - List supplements = parseSupplements(profileElem); - - return factory.createCreateSignatureEnvironmentProfile( - createSignatureLocation, - supplements); - } - - /** - * Parse a CreateSignatureLocation DOM element contained in - * a CreateSignatureEnvironmentProfile. - * - * @param profileElem The CreateSignatureEnvironmentProfile DOM - * element containing the CreateSignatureLocation. - * @return The CreateSignatureLocation API object containing - * the data from the CreateSignatureLocation DOM element. - */ - private CreateSignatureLocation parseCreateSignatureLocation(Element profileElem) { - Element locationElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - CREATE_SIGNATURE_LOCATION_XPATH); - String xPathExpression = DOMUtils.getText(locationElem); - Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); - String indexStr = locationElem.getAttribute("Index"); - int index = Integer.parseInt(indexStr); - - return factory.createCreateSignatureLocation( - xPathExpression, - index, - namespaceDeclarations); - } - - /** - * Parse all Supplement DOM elements contained in a given - * parent DOM element. - * - * @param supplementsParentElem The DOM element being the parent of the - * Supplements. - * @return A List of Supplement API objects - * containing the data from the Supplement DOM elements. - */ - private List parseSupplements(Element supplementsParentElem) { - List supplements = new ArrayList(); - NodeIterator supplementElems = - XPathUtils.selectNodeIterator(supplementsParentElem, SUPPLEMENT_XPATH); - Element supplementElem; - - while ((supplementElem = (Element) supplementElems.nextNode()) != null) { - XMLDataObjectAssociation supplement = - RequestParserUtils.parseXMLDataObjectAssociation(supplementElem); - supplements.add(supplement); - } - return supplements; - } - - /** - * Parse a SupplementProfile DOM element. - * - * @param profileElem The SupplementProfile DOM element to parse. - * @return The SupplementProfile API object containing the - * data from the SupplementProfile DOM element. - */ - public SupplementProfile parseSupplementProfile(Element profileElem) { - XMLDataObjectAssociation supplementProfile = - RequestParserUtils.parseXMLDataObjectAssociation(profileElem); - - return factory.createSupplementProfile(supplementProfile); - } - - /** - * Parse a VerifyTransformsInfoProfile DOM element. - * - * @param profileElem The VerifyTransformsInfoProfile DOM - * element to parse. - * @return A VerifyTransformsInfoProfile API object containing - * the information from the VerifyTransformsInfoProfile DOM - * element. - * @throws MOAApplicationException An error occurred parsing the - * VerifyTransformsInfoProfile. - */ - public VerifyTransformsInfoProfile parseVerifyTransformsInfoProfile(Element profileElem) - throws MOAApplicationException { - Element transformsElem = - (Element) XPathUtils.selectSingleNode( - profileElem, - VERIFY_TRANSFORMS_XPATH); - List transforms = null; - NodeIterator paramElems = - XPathUtils.selectNodeIterator(profileElem, TRANSFORM_PARAMETER_XPATH); - Element paramElem; - List transformParameters = new ArrayList(); - - // parse the dsig:Transforms - if (transformsElem != null) { - TransformParser transformsParser = new TransformParser(); - transforms = transformsParser.parseTransforms(transformsElem); - } - - // parse the TransformParameter elements - while ((paramElem = (Element) paramElems.nextNode()) != null) { - transformParameters.add(parseTransformParameter(paramElem)); - } - - return factory.createVerifyTransformsInfoProfile( - transforms, - transformParameters); - } - - /** - * Parse a TransformParameter DOM element. - * - * @param paramElem The TransformParameter DOM element to - * parse. - * @return The TransformParameter API object containing the - * information from the TransformParameter DOM element. - * @throws MOAApplicationException An error occurred parsing the - * TransformParameter DOM element. - */ - private TransformParameter parseTransformParameter(Element paramElem) - throws MOAApplicationException { - String uri = paramElem.getAttribute("URI"); - Element contentElem = - (Element) XPathUtils.selectSingleNode( - paramElem, - TRANSFORM_PARAMETER_CONTENT_XPATH); - - if (contentElem == null) { - return factory.createTransformParameter(uri); - } else if ("Base64Content".equals(contentElem.getLocalName())) { - String base64Str = DOMUtils.getText(contentElem); - InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); - - return factory.createTransformParameter(uri, binaryContent); - } else { // "Hash".equals(contentElem.getLocalName()) - String digestMethodStr = - XPathUtils.getElementValue(contentElem, DIGEST_METHOD_XPATH, ""); - String digestValueStr = - XPathUtils.getElementValue(contentElem, DIGEST_VALUE_XPATH, ""); - byte[] digestValue = null; - - try { - digestValue = Base64Utils.decode(digestValueStr, true); - } catch (IOException e) { - throw new MOAApplicationException("2270", null); - } - return factory.createTransformParameter( - uri, - digestMethodStr, - digestValue); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java deleted file mode 100644 index 9e8c7d0e2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java +++ /dev/null @@ -1,157 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.text.ParseException; -import java.util.Date; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; - -/** - * Utility methods for parsing XML requests definied in the MOA XML schema. - * - * @author Patrick Peck - * @version $Id$ - */ -public class RequestParserUtils { - // - // XPath expressions for parsing parts of a request - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String REFERENCE_ATTR_NAME = "Reference"; - private static final String MIME_TYPE_XPATH = MOA + "MimeType"; - private static final String DESCRIPTION_XPATH = MOA + "Description"; - private static final String TYPE_XPATH = MOA + "Type"; - private static final String XML_ASSOC_CONTENT_XPATH = MOA + "Content"; - private static final String CONTENT_XPATH = - MOA + "Base64Content | " + MOA + "XMLContent |" + MOA + "LocRefContent"; - private static final String ANY_OTHER_XPATH = - "*[namespace-uri() != \"" + Constants.MOA_NS_URI + "\"]"; - - /** - * Parse a XMLDataObjectAssociationType kind of DOM element. - * - * @param assocElem The XMLDataObjectAssociationType kind of - * DOM elmeent to parse. - * @return The XMLDataObjectAssociation API object containing - * the data from the XMLDataObjectAssociationType DOM element. - */ - public static XMLDataObjectAssociation parseXMLDataObjectAssociation(Element assocElem) { - SPSSFactory factory = SPSSFactory.getInstance(); - MetaInfo metaInfo = parseMetaInfo(assocElem); - Element contentElem = - (Element) XPathUtils.selectSingleNode(assocElem, XML_ASSOC_CONTENT_XPATH); - Content content = parseContent(contentElem); - - return factory.createXMLDataObjectAssociation(metaInfo, content); - } - - /** - * Parse a MetaInfoType kind of DOM element. - * - * @param metaInfoElem The MetaInfoType kind of DOM element. - * @return The MetaInfo API object containing the data from - * the metaInfoElem. - */ - public static MetaInfo parseMetaInfo(Element metaInfoElem) { - SPSSFactory factory = SPSSFactory.getInstance(); - String mimeType = - XPathUtils.getElementValue(metaInfoElem, MIME_TYPE_XPATH, null); - String description = - XPathUtils.getElementValue(metaInfoElem, DESCRIPTION_XPATH, null); - NodeList anyOther = - XPathUtils.selectNodeList(metaInfoElem, ANY_OTHER_XPATH); - String type = - XPathUtils.getElementValue(metaInfoElem, TYPE_XPATH, null); - - return factory.createMetaInfo(mimeType, description, anyOther, type); - } - - /** - * Parse a ContentOptionalRefType or - * ContentRequiredRefType kind of DOM element. - * @param contentParentElem The DOM element being the parent of the - * content element. - * @return The Content API object containing the data from - * the given DOM element. - */ - public static Content parseContent(Element contentParentElem) { - SPSSFactory factory = SPSSFactory.getInstance(); - String referenceURI = - contentParentElem.hasAttribute(REFERENCE_ATTR_NAME) - ? contentParentElem.getAttribute(REFERENCE_ATTR_NAME) - : null; - Element contentElem = - (Element) XPathUtils.selectSingleNode(contentParentElem, CONTENT_XPATH); - - if (contentElem == null) { - return factory.createContent(referenceURI); - } - - if ("Base64Content".equals(contentElem.getLocalName())) { - String base64String = DOMUtils.getText(contentElem); - return factory.createContent( - Base64Utils.decodeToStream(base64String, true), - referenceURI); - } else if ("LocRefContent".equals(contentElem.getLocalName())) { - String locationReferenceURI = DOMUtils.getText(contentElem); - return factory.createContent( - locationReferenceURI, - referenceURI); - } else { // "XMLContent".equals(contentElem.getLocalName()) - return factory.createContent( - contentElem.getChildNodes(), - referenceURI); - } - } - - /** - * Get the signing time from a Verfiy(CMS|XML)SignatureRequest. - * - * @param requestElem A Verify(CMS|XML)SignatureRequest DOM - * element. - * @param dateTimeXPath The XPath to lookup the DateTime element - * within the request. - * @return Date The date and time corresponding to the DateTime - * element in the request. If no DateTime element exists in the - * request, null is returned. - * @throws MOAApplicationException An error occurred during a parsing the - * DateTime element or creating the return value. - */ - public static Date parseDateTime(Element requestElem, String dateTimeXPath) - throws MOAApplicationException { - - Element dateTimeElem; - String dateTimeText; - - // select the DateTime element - dateTimeElem = - (Element) XPathUtils.selectSingleNode(requestElem, dateTimeXPath); - - // parse a date from the element value - if (dateTimeElem != null) { - dateTimeText = DOMUtils.getText(dateTimeElem); - try { - return DateTimeUtils.parseDateTime(dateTimeText); - } catch (ParseException e) { - throw new MOAApplicationException( - "1104", - new Object[] { dateTimeText }); - } - } else { - return null; - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java deleted file mode 100644 index 44134a70c..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java +++ /dev/null @@ -1,206 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.io.IOException; -import java.security.cert.CertificateEncodingException; -import java.security.cert.X509Certificate; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; - -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; - -/** - * Utility methods used by the verious ResponseBuilder classes. - * - * @author Patrick Peck - * @version $Id$ - */ -class ResponseBuilderUtils { - // - // shortcuts to various XML namespace constants - // - private static final String MOA_NS_URI = Constants.MOA_NS_URI; - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - private static final String DSIG_NS_URI = Constants.DSIG_NS_URI; - private static final String XMLNS_NS_URI = Constants.XMLNS_NS_URI; - - /** - * Create a response element with all the namespaces set. - * - * @param responseName The name of the response root element. - * @return A DOM document containing the response root element and predefined - * MOA, DSIG and XML namespace declarations. - * @throws MOASystemException An error building the response document. - */ - public static Document createResponse(String responseName) - throws MOASystemException { - - try { - DocumentBuilder docBuilder = - DocumentBuilderFactory.newInstance().newDocumentBuilder(); - DOMImplementation impl = docBuilder.getDOMImplementation(); - Document response; - Element root; - String attrValue; - - response = impl.createDocument(MOA_NS_URI, responseName, null); - root = response.getDocumentElement(); - - // add namespace prefix declarations - root.setAttributeNS(XMLNS_NS_URI, "xmlns", MOA_NS_URI); - attrValue = "xmlns:" + Constants.DSIG_PREFIX; - root.setAttributeNS(XMLNS_NS_URI, attrValue, DSIG_NS_URI); - - return response; - } catch (ParserConfigurationException e) { - throw new MOASystemException("2200", null, e); - } - } - - /** - * Add a SignerInfo element to the response. - * - * @param response The response document, in order to create new elements in - * it. - * @param root The root element into which the SignerInfo element - * will be inserted. - * @param cert The signer certificate to add. - * @param isQualified Indicates, whether cert is a qualified - * certificate. - * @param isPublicAuthority Indicates, whether cert is - * certificate owned by a public authority. - * @param publicAuthorityID Information about the public authority owning - * cert. Must not be null, if - * isPublicAuthority ! = null. - * @throws MOAApplicationException An error occurred reading data from the - * certificate. - */ - public static void addSignerInfo( - Document response, - Element root, - X509Certificate cert, - boolean isQualified, - boolean isPublicAuthority, - String publicAuthorityID) - throws MOAApplicationException { - - Element signerInfoElem = response.createElementNS(MOA_NS_URI, "SignerInfo"); - Element x509DataElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509Data"); - Element x509IssuerSerialElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerSerial"); - Element x509IssuerElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerName"); - String issuer = cert.getIssuerDN().getName(); - Element x509SerialNumberElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509SerialNumber"); - String serialNumber = cert.getSerialNumber().toString(); - Element x509SubjectNameElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509SubjectName"); - Element x509CertificateElem = - response.createElementNS(DSIG_NS_URI, DSIG + "X509Certificate"); - Element qualifiedCertificateElem = - isQualified - ? response.createElementNS(MOA_NS_URI, "QualifiedCertificate") - : null; - Element publicAuthorityElem = - isPublicAuthority - ? response.createElementNS(MOA_NS_URI, "PublicAuthority") - : null; - Element codeElem = - publicAuthorityID != null - ? response.createElementNS(MOA_NS_URI, "Code") - : null; - - // fill in text - x509IssuerElem.appendChild(response.createTextNode(issuer)); - x509SerialNumberElem.appendChild(response.createTextNode(serialNumber)); - try { - RFC2253NameParser parser = - new RFC2253NameParser(cert.getSubjectDN().getName()); - String subjectRfc2253 = parser.parse().getRFC2253String(); - x509SubjectNameElem.appendChild(response.createTextNode(subjectRfc2253)); - } catch (RFC2253NameParserException e) { - x509SubjectNameElem.appendChild( - response.createTextNode(cert.getSubjectDN().getName())); - } - try { - x509CertificateElem.appendChild( - response.createTextNode(Base64Utils.encode(cert.getEncoded()))); - } catch (CertificateEncodingException e) { - throw new MOAApplicationException("2245", null, e); - } catch (IOException e) { - throw new MOAApplicationException("2245", null, e); - } - - // build structure - x509DataElem.appendChild(x509SubjectNameElem); - x509IssuerSerialElem.appendChild(x509IssuerElem); - x509IssuerSerialElem.appendChild(x509SerialNumberElem); - x509DataElem.appendChild(x509IssuerSerialElem); - x509DataElem.appendChild(x509CertificateElem); - if (isQualified) { - x509DataElem.appendChild(qualifiedCertificateElem); - } - if (isPublicAuthority) { - x509DataElem.appendChild(publicAuthorityElem); - if (publicAuthorityID != null) { - codeElem.appendChild(response.createTextNode(publicAuthorityID)); - publicAuthorityElem.appendChild(codeElem); - } - } - signerInfoElem.appendChild(x509DataElem); - root.appendChild(signerInfoElem); - } - - /** - * Add an element containing Code and Info - * subelements. - * - * @param response The response document, in order to create new elements in - * it. - * @param root The root element into which to insert the newly created - * element. - * @param elementName The name of the newly created element. - * @param code The content of the Code subelement. - * @param info The content of the Info subelement. - */ - public static void addCodeInfoElement( - Document response, - Element root, - String elementName, - int code, - NodeList info) { - - Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); - Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); - Element infoElem; - int i; - - codeElem.appendChild(response.createTextNode(Integer.toString(code))); - codeInfoElem.appendChild(codeElem); - if (info != null) { - infoElem = response.createElementNS(MOA_NS_URI, "Info"); - - for (i = 0; i < info.getLength(); i++) { - infoElem.appendChild(info.item(i).cloneNode(true)); - } - codeInfoElem.appendChild(infoElem); - } - root.appendChild(codeInfoElem); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java deleted file mode 100644 index 2d01f2a0f..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java +++ /dev/null @@ -1,246 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.Base64Transform; -import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; -import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; -import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; -import at.gv.egovernment.moa.spss.api.common.Transform; -import at.gv.egovernment.moa.spss.api.common.XPathFilter; -import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; -import at.gv.egovernment.moa.spss.api.common.XPathTransform; -import at.gv.egovernment.moa.spss.api.common.XSLTTransform; - -/** - * A parser to parse XMLDsig Transform DOM elements into their - * MOA SPSS API representation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class TransformParser { - // - // XPath expressions for selecting information from the DOM tree - // - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - private static final String DSIG_FILTER2 = - Constants.DSIG_FILTER2_PREFIX + ":"; - private static final String XSLT = Constants.XSLT_PREFIX + ":"; - private static final String EC = Constants.DSIG_EC_PREFIX + ":"; - private static final String TRANSFORM_XPATH = DSIG + "Transform"; - private static final String XPATH_XPATH = DSIG + "XPath"; - private static final String XSLT_ELEMENT_XPATH = XSLT + "stylesheet"; - private static final String XPATH2_XPATH = - (DSIG_FILTER2 + "XPath[@Filter=\"intersect\"] | ") - + (DSIG_FILTER2 + "XPath[@Filter=\"subtract\"] | ") - + (DSIG_FILTER2 + "XPath[@Filter=\"union\"]"); - private static final String INCLUSIVE_NAMESPACES_XPATH = - EC + "InclusiveNamespaces"; - - /** - * The SPSSFactory to use for creating new API objects. - */ - private SPSSFactory factory = SPSSFactory.getInstance(); - - /** - * Parse an XMLDsig Transforms DOM element. - * - * @param transformsElem The Transforms DOM element to parse. - * @return A List of Transform API objects - * containing the data from the individual Transform DOM - * elements. - * @throws MOAApplicationException An error occurred parsing the - * Transforms DOM element. - */ - public List parseTransforms(Element transformsElem) - throws MOAApplicationException { - List transforms = new ArrayList(); - NodeIterator transformElems = - XPathUtils.selectNodeIterator(transformsElem, TRANSFORM_XPATH); - Element transformElem; - Transform transform; - - while ((transformElem = (Element) transformElems.nextNode()) != null) { - transform = parseTransform(transformElem); - transforms.add(transform); - } - - return transforms; - } - - /** - * Parse an XMLDsig Transform DOM element. - * - * @param transformElem Transform DOM element to parse. - * @return The Transform API object containing the data - * from the Transform DOM element. - * @throws MOAApplicationException An error occurred parsing the - * Transform DOM element. - */ - public Transform parseTransform(Element transformElem) - throws MOAApplicationException { - - String algorithmUri = transformElem.getAttribute("Algorithm"); - - if (CanonicalizationTransform.CANONICAL_XML.equals(algorithmUri) - || CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals( - algorithmUri)) { - return factory.createCanonicalizationTransform(algorithmUri); - } else if ( - ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals( - algorithmUri) - || ExclusiveCanonicalizationTransform - .EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS - .equals( - algorithmUri)) { - return parseExclusiveC14nTransform(algorithmUri, transformElem); - } else if (Base64Transform.BASE64_DECODING.equals(algorithmUri)) { - return factory.createBase64Transform(); - } else if ( - EnvelopedSignatureTransform.ENVELOPED_SIGNATURE.equals(algorithmUri)) { - return factory.createEnvelopedSignatureTransform(); - } else if (XPathTransform.XPATH.equals(algorithmUri)) { - return parseXPathTransform(transformElem); - } else if (XPathFilter2Transform.XPATH_FILTER2.equals(algorithmUri)) { - return parseXPathFilter2Transform(transformElem); - } else if (XSLTTransform.XSLT.equals(algorithmUri)) { - return parseXSLTTransform(transformElem); - } else { - throw new MOAApplicationException("1108", new Object[] { algorithmUri }); - } - } - - /** - * Parse an exclusive canonicalization type of transform. - * - * @param algorithmUri The algorithm URI of the canonicalization algorithm. - * @param transformElem The Transform DOM element to parse. - * @return An ExclusiveCanonicalizationTransform API object - * containing the data from the transformElem. - */ - private Transform parseExclusiveC14nTransform( - String algorithmUri, - Element transformElem) - { - - Element inclusiveNamespacesElem = - (Element) XPathUtils.selectSingleNode( - transformElem, - INCLUSIVE_NAMESPACES_XPATH); - - List inclusiveNamespaces = new ArrayList(); - if (inclusiveNamespacesElem != null) - { - StringTokenizer tokenizer = new StringTokenizer(inclusiveNamespacesElem.getAttribute("PrefixList")); - while (tokenizer.hasMoreTokens()) - { - inclusiveNamespaces.add(tokenizer.nextToken()); - } - } - return factory.createExclusiveCanonicalizationTransform( - algorithmUri, - inclusiveNamespaces); - } - - /** - * Parse an XPath type of Transform. - * - * @param transformElem The Transform DOM element to parse. - * @return The Transform API object representation of the - * Transform DOM element. - * @throws MOAApplicationException An error occurred parsing the - * Transform DOM element. - */ - private Transform parseXPathTransform(Element transformElem) - throws MOAApplicationException { - Element xPathElem = - (Element) XPathUtils.selectSingleNode(transformElem, XPATH_XPATH); - Map nsDecls; - - if (xPathElem == null) { - throw new MOAApplicationException("2202", null); - } - - nsDecls = DOMUtils.getNamespaceDeclarations(xPathElem); - nsDecls.remove(""); - - return factory.createXPathTransform(DOMUtils.getText(xPathElem), nsDecls); - } - - /** - * Parse an XPathFilter2 type of Transform. - * - * @param transformElem The Transform DOM element to parse. - * @return The Transform API object representation of the - * Transform DOM element. - * @throws MOAApplicationException An error occurred parsing the - * Transform DOM element. - */ - private Transform parseXPathFilter2Transform(Element transformElem) - throws MOAApplicationException { - List filters = new ArrayList(); - NodeIterator iter = - XPathUtils.selectNodeIterator(transformElem, XPATH2_XPATH); - Element filterElem; - - while ((filterElem = (Element) iter.nextNode()) != null) { - String filterAttr = filterElem.getAttribute("Filter"); - String filterType; - String expression; - Map nsDecls; - - if (filterAttr.equals("intersect")) { - filterType = XPathFilter.INTERSECT_TYPE; - } else if (filterAttr.equals("subtract")) { - filterType = XPathFilter.SUBTRACT_TYPE; - } else { - filterType = XPathFilter.UNION_TYPE; - } - - expression = DOMUtils.getText(filterElem); - nsDecls = DOMUtils.getNamespaceDeclarations(filterElem); - nsDecls.remove(""); - filters.add(factory.createXPathFilter(filterType, expression, nsDecls)); - } - if (filters.size() == 0) { - throw new MOAApplicationException("2216", null); - } - - return factory.createXPathFilter2Transform(filters); - } - - /** - * Parse an XSLT type of Transform. - * - * @param transformElem The Transform DOM element to parse. - * @return The Transform API object representation of the - * Transform DOM element. - * @throws MOAApplicationException An error occurred parsing the - * Transform DOM element. - */ - private Transform parseXSLTTransform(Element transformElem) - throws MOAApplicationException { - Element xsltElem = - (Element) XPathUtils.selectSingleNode(transformElem, XSLT_ELEMENT_XPATH); - - if (xsltElem == null) { - throw new MOAApplicationException("2215", null); - } - - return factory.createXSLTTransform(xsltElem); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java deleted file mode 100644 index 74d14b7cc..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java +++ /dev/null @@ -1,169 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.StringTokenizer; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.CollectionUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; - -/** - * A parser to parse VerifyCMSSignatureRequest DOM trees into - * VerifyCMSSignatureRequest API objects. - * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyCMSSignatureRequestParser { - - // - // XPath expressions for selecting parts of the DOM message - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String DATE_TIME_XPATH = MOA + "DateTime"; - private static final String CMS_SIGNATURE_XPATH = MOA + "CMSSignature"; - private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID"; - private static final String DATA_OBJECT_XPATH = MOA + "DataObject"; - private static final String META_INFO_XPATH = MOA + "MetaInfo"; - private static final String CONTENT_XPATH = MOA + "Content"; - private static final String BASE64_CONTENT_XPATH = MOA + "Base64Content"; - - /** The SPSSFactory for creating new API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - - /** - * Parse a VerifyCMSSignatureRequest DOM element, as defined - * by the MOA schema. - * - * @param requestElem The VerifyCMSSignatureRequest to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A VerifyCMSSignatureRequest API objects containing - * the data from the DOM element. - * @throws MOAApplicationException An error occurred parsing the request. - */ - public VerifyCMSSignatureRequest parse(Element requestElem) - throws MOAApplicationException { - - int[] signatories = parseSignatories(requestElem); - Date dateTime = - RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); - String cmsSignatureStr = - XPathUtils.getElementValue(requestElem, CMS_SIGNATURE_XPATH, ""); - CMSDataObject dataObject = parseDataObject(requestElem); - String trustProfileID = - XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); - InputStream cmsSignature = - Base64Utils.decodeToStream(cmsSignatureStr, true); - - return factory.createVerifyCMSSignatureRequest( - signatories, - dateTime, - cmsSignature, - dataObject, - trustProfileID); - } - - /** - * Parse the Signatories attribute contained in the - * VerifyCMSSignatureRequest DOM element. - * - * @param requestElem The VerifyCMSSignatureRequest DOM element. - * @return The signatories contained in the given - * VerifyCMSSignatureRequest DOM element. - */ - private int[] parseSignatories(Element requestElem) { - String signatoriesStr = requestElem.getAttribute("Signatories"); - - if ("all".equals(signatoriesStr)) { - return VerifyCMSSignatureRequest.ALL_SIGNATORIES; - } else { - StringTokenizer tokenizer = new StringTokenizer(signatoriesStr); - List signatoriesList = new ArrayList(); - int[] signatories; - - // put the signatories into a List - while (tokenizer.hasMoreTokens()) { - try { - signatoriesList.add(new Integer(tokenizer.nextToken())); - } catch (NumberFormatException e) { - // this cannot occur if the request has been validated - } - } - - // convert the List into an int array - signatories = CollectionUtils.toIntArray(signatoriesList); - - return signatories; - } - } - - /** - * Parse a the DataObject DOM element contained in a given - * VerifyCMSSignatureRequest DOM element. - * - * @param requestElem The VerifyCMSSignatureRequest DOM element - * to parse. - * @return The CMSDataObject API object containing the data - * from the DataObject DOM element. - */ - private CMSDataObject parseDataObject(Element requestElem) { - Element dataObjectElem = - (Element) XPathUtils.selectSingleNode(requestElem, DATA_OBJECT_XPATH); - - if (dataObjectElem != null) { - Element metaInfoElem = - (Element) XPathUtils.selectSingleNode(dataObjectElem, META_INFO_XPATH); - MetaInfo metaInfo = null; - Element contentElem = - (Element) XPathUtils.selectSingleNode(dataObjectElem, CONTENT_XPATH); - CMSContent content = parseContent(contentElem); - - if (metaInfoElem != null) { - metaInfo = RequestParserUtils.parseMetaInfo(metaInfoElem); - } - - return factory.createCMSDataObject(metaInfo, content); - } else { - return null; - } - - } - - /** - * Parse the content contained in a CMSContentBaseType kind of - * DOM element. - * - * @param contentElem The CMSContentBaseType kind of element to - * parse. - * @return A CMSDataObject API object containing the data - * from the given DOM element. - */ - private CMSContent parseContent(Element contentElem) { - Element base64ContentElem = - (Element) XPathUtils.selectSingleNode(contentElem, BASE64_CONTENT_XPATH); - - if (base64ContentElem != null) { - String base64Str = DOMUtils.getText(base64ContentElem); - InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); - return factory.createCMSContent(binaryContent); - } else { - return factory.createCMSContent( - contentElem.getAttribute("Reference")); - } - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java deleted file mode 100644 index 3fc8f223d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java +++ /dev/null @@ -1,101 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.Iterator; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * Convert a VerifyCMSSignatureResponse API object into its - * XML representation, according to the MOA XML schema. - * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyCMSSignatureResponseBuilder { - /** The XML document containing the response element. */ - private Document responseDoc; - /** The response VerifyCMSSignatureResponse DOM element. */ - private Element responseElem; - - /** - * Create a new VerifyCMSSignatureResponseBuilder: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. - */ - public VerifyCMSSignatureResponseBuilder() throws MOASystemException { - responseDoc = - ResponseBuilderUtils.createResponse("VerifyCMSSignatureResponse"); - responseElem = responseDoc.getDocumentElement(); - } - - /** - * Build a document containing a VerifyCMSSignatureResponse - * DOM element being the XML representation of the given - * VerifyCMSSignatureResponse API object. - * - * @param response The VerifyCMSSignatureResponse to convert - * to XML. - * @return A document containing the VerifyCMSSignatureResponse - * DOM element. - * @throws MOAApplicationException An error occurred building the response. - */ - public Document build(VerifyCMSSignatureResponse response) - throws MOAApplicationException { - - Iterator iter; - - for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - VerifyCMSSignatureResponseElement responseElement = - (VerifyCMSSignatureResponseElement) iter.next(); - addResponseElement(responseElement); - } - - return responseDoc; - } - - /** - * Add an element to the response. - * - * @param responseElement The element to add to the response. - * @throws MOAApplicationException An error occurred adding the element. - */ - private void addResponseElement(VerifyCMSSignatureResponseElement responseElement) - throws MOAApplicationException { - - SignerInfo signerInfo = responseElement.getSignerInfo(); - CheckResult signatureCheck = responseElement.getSignatureCheck(); - CheckResult certCheck = responseElement.getCertificateCheck(); - - ResponseBuilderUtils.addSignerInfo( - responseDoc, - responseElem, - signerInfo.getSignerCertificate(), - signerInfo.isQualifiedCertificate(), - signerInfo.isPublicAuthority(), - signerInfo.getPublicAuhtorityID()); - - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "SignatureCheck", - signatureCheck.getCode(), - signatureCheck.getInfo()); - - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "CertificateCheck", - certCheck.getCode(), - certCheck.getInfo()); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java deleted file mode 100644 index e736af522..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java +++ /dev/null @@ -1,275 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; - -/** - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyXMLSignatureRequestParser { - - // - // XPath expressions for parsing parts of the request - // - private static final String MOA = Constants.MOA_PREFIX + ":"; - private static final String DATE_TIME_XPATH = MOA + "DateTime"; - private static final String RETURN_HASH_INPUT_DATA_XPATH = - MOA + "ReturnHashInputData"; - private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID"; - private static final String VERIFY_SIGNATURE_ENVIRONMENT_XPATH = - MOA + "VerifySignatureInfo/" + MOA + "VerifySignatureEnvironment"; - private static final String VERIFY_SIGNATURE_LOCATION_XPATH = - MOA + "VerifySignatureInfo/" + MOA + "VerifySignatureLocation"; - private static final String SUPPLEMENT_PROFILE_XPATH = - MOA + "SupplementProfile | " + MOA + "SupplementProfileID"; - private static final String SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH = - MOA + "SignatureManifestCheckParams"; - private static final String VERIFY_TRANSFORMS_INFO_PROFILE_XPATH = - (MOA + "VerifyTransformsInfoProfile | ") - + (MOA + "VerifyTransformsInfoProfileID"); - private static final String REFERENCE_INFO_XPATH = MOA + "ReferenceInfo"; - - /** The SPSSFactory for creating new API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - - - /** - * Parse a VerifyXMLSignatureRequest DOM element, as defined - * by the MOA schema. - * - * @param requestElem The VerifyXMLSignatureRequest to parse. The - * request must have been successfully parsed against the schema for this - * method to succeed. - * @return A VerifyXMLSignatureRequest API object containing - * the data from the DOM element. - * @throws MOAApplicationException An error occurred parsing the request. - */ - public VerifyXMLSignatureRequest parse(Element requestElem) - throws MOAApplicationException { - - Date dateTime = - RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); - VerifySignatureInfo verifySignatureInfo = - parseVerifySignatureInfo(requestElem); - List supplementProfiles = parseSupplementProfiles(requestElem); - SignatureManifestCheckParams signatureManifestCheckParams = - parseSignatureManifestCheckParams(requestElem); - boolean returnHashInputData = - XPathUtils.selectSingleNode(requestElem, RETURN_HASH_INPUT_DATA_XPATH) - != null; - String trustProfileID = - XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); - - return factory.createVerifyXMLSignatureRequest( - dateTime, - verifySignatureInfo, - supplementProfiles, - signatureManifestCheckParams, - returnHashInputData, - trustProfileID); - } - - /** - * Parse the VerifySignatureInfo DOM element contained in - * the VerifyXMLSignatureRequest DOM element. - * - * @param requestElem The VerifyXMLSignatureRequest DOM element - * containing the VerifySignatureInfo DOM element. - * @return The VerifySignatureInfo API object containing the - * data from the DOM element. - */ - private VerifySignatureInfo parseVerifySignatureInfo(Element requestElem) { - Element verifySignatureEnvironmentElem = - (Element) XPathUtils.selectSingleNode( - requestElem, - VERIFY_SIGNATURE_ENVIRONMENT_XPATH); - Content verifySignatureEnvironment = - RequestParserUtils.parseContent(verifySignatureEnvironmentElem); - VerifySignatureLocation verifySignatureLocation = - parseVerifySignatureLocation(requestElem); - - return factory.createVerifySignatureInfo( - verifySignatureEnvironment, - verifySignatureLocation); - } - - /** - * Parse the VerifySignatureLocation DOM element contained - * in the given VerifyXMLSignatureRequest DOM element. - * - * @param requestElem The VerifyXMLSignatureRequst DOM element. - * @return The VerifySignatureLocation API object containing the - * data from the DOM element. - */ - private VerifySignatureLocation parseVerifySignatureLocation(Element requestElem) { - Element locationElem = - (Element) XPathUtils.selectSingleNode( - requestElem, - VERIFY_SIGNATURE_LOCATION_XPATH); - String xPathExpression = DOMUtils.getText(locationElem); - Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); - - return factory.createVerifySignatureLocation( - xPathExpression, - namespaceDeclarations); - } - - /** - * Parse the supplement profiles contained in the given - * VerifyXMLSignatureRequest DOM element. - * - * @param requestElem The VerifyXMLSignatureRequest DOM element. - * @return A List of SupplementProfile API objects - * containing the data from the SupplementProfile DOM elements. - */ - private List parseSupplementProfiles(Element requestElem) { - List supplementProfiles = new ArrayList(); - NodeIterator profileElems = - XPathUtils.selectNodeIterator(requestElem, SUPPLEMENT_PROFILE_XPATH); - Element profileElem; - - while ((profileElem = (Element) profileElems.nextNode()) != null) { - SupplementProfile profile; - - if ("SupplementProfile".equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); - profile = profileParser.parseSupplementProfile(profileElem); - } else { - String profileID = DOMUtils.getText(profileElem); - profile = factory.createSupplementProfile(profileID); - } - supplementProfiles.add(profile); - } - return supplementProfiles; - } - - /** - * Parse the SignatureManifestCheckParams DOM element contained - * in the given VerifyXMLSignatureRequest DOM element. - * @param requestElem The VerifyXMLSignatureRequest DOM element. - * @return The SignatureManifestCheckParams API object containing - * the data from the SignatureManifestCheckParams DOM element. - * @throws MOAApplicationException An error occurred parsing the - * SignatureManifestCheckParams DOM element. - */ - private SignatureManifestCheckParams parseSignatureManifestCheckParams(Element requestElem) - throws MOAApplicationException { - Element paramsElem = - (Element) XPathUtils.selectSingleNode( - requestElem, - SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH); - - if (paramsElem != null) { - String returnReferenceInputDataStr = - paramsElem.getAttribute("ReturnReferenceInputData"); - boolean returnReferencInputData = - BoolUtils.valueOf(returnReferenceInputDataStr); - List referenceInfos = parseReferenceInfos(paramsElem); - - return factory.createSignatureManifestCheckParams( - referenceInfos, - returnReferencInputData); - } else { - return null; - } - } - - /** - * Parse the ReferenceInfo DOM elements contained in a - * SignatureManifestCheckParams DOM element. - * - * @param paramsElem The SignatureManifestCheckParams DOM element - * containing the ReferenceInfo DOM elements. - * @return A List of RefernceInfo API objects - * containing the data from the ReferenceInfo DOM elements. - * @throws MOAApplicationException An error occurred parsing the - * ReferenceInfo DOM elements. - */ - private List parseReferenceInfos(Element paramsElem) - throws MOAApplicationException { - - List referenceInfos = new ArrayList(); - NodeIterator refInfoElems = - XPathUtils.selectNodeIterator(paramsElem, REFERENCE_INFO_XPATH); - Element refInfoElem; - - while ((refInfoElem = (Element) refInfoElems.nextNode()) != null) { - ReferenceInfo referenceInfo = parseReferenceInfo(refInfoElem); - - referenceInfos.add(referenceInfo); - } - - return referenceInfos; - } - - /** - * Parse a ReferenceInfo DOM element. - * - * @param refInfoElem The ReferenceInfo DOM element to parse. - * @return The ReferenceInfo API object containing the data - * from the given ReferenceInfo DOM element. - * @throws MOAApplicationException An error occurred parsing the - * ReferenceInfo DOM element. - */ - private ReferenceInfo parseReferenceInfo(Element refInfoElem) - throws MOAApplicationException { - List profiles = parseVerifyTransformsInfoProfiles(refInfoElem); - return factory.createReferenceInfo(profiles); - } - - /** - * Parse the VerifyTransformsInfoProfile DOM elements contained - * in a ReferenceInfo DOM element. - * - * @param refInfoElem ReferenceInfo DOM element containing - * the VerifyTransformsInfoProfile DOM elements. - * @return A List of VerifyTransformsInfoProfile - * API objects containing the profile data. - * @throws MOAApplicationException An error occurred building the - * VerifyTransformsInfoProfiles. - */ - private List parseVerifyTransformsInfoProfiles(Element refInfoElem) - throws MOAApplicationException { - - List profiles = new ArrayList(); - NodeIterator profileElems = - XPathUtils.selectNodeIterator( - refInfoElem, - VERIFY_TRANSFORMS_INFO_PROFILE_XPATH); - Element profileElem; - - while ((profileElem = (Element) profileElems.nextNode()) != null) { - if ("VerifyTransformsInfoProfile".equals(profileElem.getLocalName())) { - ProfileParser profileParser = new ProfileParser(); - profiles.add( - profileParser.parseVerifyTransformsInfoProfile(profileElem)); - } else { - String profileID = DOMUtils.getText(profileElem); - profiles.add(factory.createVerifyTransformsInfoProfile(profileID)); - } - } - return profiles; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java deleted file mode 100644 index 960d9571d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java +++ /dev/null @@ -1,310 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlbind; - -import java.io.IOException; -import java.util.Iterator; -import java.util.List; - -import org.w3c.dom.Document; -import org.w3c.dom.DocumentFragment; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.ContentBinary; -import at.gv.egovernment.moa.spss.api.common.ContentXML; -import at.gv.egovernment.moa.spss.api.common.InputData; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * Convert a VerifyXMLSignatureResponse API object into its - * XML representation, according to the MOA XML schema. - * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyXMLSignatureResponseBuilder { - private static final String MOA_NS_URI = Constants.MOA_NS_URI; - - /** The XML document containing the response element. */ - private Document responseDoc; - /** The response VerifyXMLSignatureResponse DOM element. */ - private Element responseElem; - - /** - * Create a new VerifyXMLSignatureResponseBuilder: - * - * @throws MOASystemException An error occurred setting up the resulting - * XML document. - */ - public VerifyXMLSignatureResponseBuilder() throws MOASystemException { - responseDoc = - ResponseBuilderUtils.createResponse("VerifyXMLSignatureResponse"); - responseElem = responseDoc.getDocumentElement(); - } - - /** - * Build a document containing a VerifyXMLSignatureResponse - * DOM element being the XML representation of the given - * VerifyXMLSignatureResponse API object. - * - * @param response The VerifyXMLSignatureResponse to convert - * to XML. - * @return A document containing the VerifyXMLSignatureResponse - * DOM element. - * @throws MOAApplicationException An error occurred building the response. - */ - public Document build(VerifyXMLSignatureResponse response) - throws MOAApplicationException { - - Iterator iter; - List responseData; - - // add the SignerInfo - ResponseBuilderUtils.addSignerInfo( - responseDoc, - responseElem, - response.getSignerInfo().getSignerCertificate(), - response.getSignerInfo().isQualifiedCertificate(), - response.getSignerInfo().isPublicAuthority(), - response.getSignerInfo().getPublicAuhtorityID()); - - // add HashInputData elements - responseData = response.getHashInputDatas(); - if (responseData != null && !responseData.isEmpty()) { - for (iter = responseData.iterator(); iter.hasNext();) { - InputData inputData = (InputData) iter.next(); - addContent("HashInputData", inputData); - } - } - - // add ReferenceInputData elements - responseData = response.getReferenceInputDatas(); - if (responseData != null && !responseData.isEmpty()) { - for (iter = responseData.iterator(); iter.hasNext();) { - InputData inputData = (InputData) iter.next(); - addContent("ReferenceInputData", inputData); - } - } - - // add the SignatureCheck - addReferencesCheckResult("SignatureCheck", response.getSignatureCheck()); - - // add the SignatureManifestCheck - if (response.getSignatureManifestCheck() != null) { - addReferencesCheckResult( - "SignatureManifestCheck", - response.getSignatureManifestCheck()); - } - - // add the XMLDsigManifestChecks - responseData = response.getXMLDsigManifestChecks(); - if (responseData != null && !responseData.isEmpty()) { - for (iter = responseData.iterator(); iter.hasNext();) { - ManifestRefsCheckResult checkResult = - (ManifestRefsCheckResult) iter.next(); - addManifestRefsCheckResult("XMLDSIGManifestCheck", checkResult); - } - } - - // add the CertificateCheck - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - "CertificateCheck", - response.getCertificateCheck().getCode(), - response.getCertificateCheck().getInfo()); - - return responseDoc; - } - - /** - * Add an element of type ContentBaseType to the response. - * - * @param elementName The name of the element. - * - * @param inputData The InputData to add. Based on the type of - * - * the InputData, either a Base64Content element - * or a XMLContent subelement will be added. An - * InputDataBinaryImpl will be added as a Base64Content - * child element. AnInputDataXMLImpl will be added as - * XMLContent child element. - * - * @throws MOAApplicationException An error occurred adding the content. - */ - private void addContent(String elementName, InputData inputData) - throws MOAApplicationException { - - Element contentElem = responseDoc.createElementNS(MOA_NS_URI, elementName); - - contentElem.setAttributeNS(null, "PartOf", inputData.getPartOf()); - if (inputData.getReferringReferenceNumber() != InputData.REFERER_NONE_) - contentElem.setAttributeNS( - null, - "ReferringSigReference", - Integer.toString(inputData.getReferringReferenceNumber())); - - switch (inputData.getContentType()) { - case Content.XML_CONTENT : - ContentXML contentXml = (ContentXML) inputData; - NodeList nodes = contentXml.getXMLContent(); - Element xmlElem; - int i; - - xmlElem = responseDoc.createElementNS(MOA_NS_URI, "XMLContent"); - //xmlElem.setAttributeNS(XML_NS_URI, "xml:space", "preserve"); - xmlElem.setAttribute("xml:space", "preserve"); - - for (i = 0; i < nodes.getLength(); i++) { - xmlElem.appendChild(responseDoc.importNode(nodes.item(i), true)); - } - contentElem.appendChild(xmlElem); - responseElem.appendChild(contentElem); - break; - case Content.BINARY_CONTENT : - Element binaryElem = - responseDoc.createElementNS(MOA_NS_URI, "Base64Content"); - ContentBinary contentBinary = (ContentBinary) inputData; - String base64Str; - - try { - base64Str = Base64Utils.encode(contentBinary.getBinaryContent()); - } catch (IOException e) { - throw new MOAApplicationException("2200", null, e); - } - binaryElem.appendChild(responseDoc.createTextNode(base64Str)); - contentElem.appendChild(binaryElem); - responseElem.appendChild(contentElem); - break; - } - } - - /** - * Add a ReferencesCheckResult to the response. - * - * @param elementName The DOM element name to use. - * @param checkResult The ReferencesCheckResult to add. - */ - private void addReferencesCheckResult( - String elementName, - ReferencesCheckResult checkResult) { - - NodeList info = null; - - if (checkResult.getInfo() != null) { - DocumentFragment fragment = responseDoc.createDocumentFragment(); - NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); - int[] failedReferences = checkResult.getInfo().getFailedReferences(); - - if (anyOtherInfo != null) { - addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); - } - - if (failedReferences != null) { - addFailedReferences(fragment, failedReferences); - } - - info = fragment.getChildNodes(); - } - - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - elementName, - checkResult.getCode(), - info); - } - - - /** - * Add a ManifestRefsCheckResult to the response. - * - * @param elementName The DOM element name to use. - * @param checkResult The ManifestRefsCheckResult to add. - */ - private void addManifestRefsCheckResult( - String elementName, - ManifestRefsCheckResult checkResult) { - - DocumentFragment fragment = responseDoc.createDocumentFragment(); - NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); - int[] failedReferences = checkResult.getInfo().getFailedReferences(); - Element referringSigRefElem; - String referringSigRefStr; - - // add any other elements - if (anyOtherInfo != null) { - addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); - } - - // add the failed references - if (failedReferences != null) { - addFailedReferences(fragment, failedReferences); - } - - // add the ReferringSigReference - referringSigRefElem = - responseDoc.createElementNS(MOA_NS_URI, "ReferringSigReference"); - referringSigRefStr = - Integer.toString(checkResult.getInfo().getReferringSignatureReference()); - referringSigRefElem.appendChild( - responseDoc.createTextNode(referringSigRefStr)); - fragment.appendChild(referringSigRefElem); - - // add XMLDSIGManifestCheckResult to the response - ResponseBuilderUtils.addCodeInfoElement( - responseDoc, - responseElem, - elementName, - checkResult.getCode(), - fragment.getChildNodes()); - } - - /** - * Add arbitrary XML content to a DOM DocumentFragment. - * - * @param fragment The fragment to add the XML content to. - * @param anyOtherInfo The XML content to add. - */ - private void addAnyOtherInfo( - DocumentFragment fragment, - NodeList anyOtherInfo) { - - int i; - - for (i = 0; i < anyOtherInfo.getLength(); i++) { - fragment.appendChild(responseDoc.importNode(anyOtherInfo.item(i), true)); - } - } - - /** - * Add the failed references as FailedReference DOM elements to - * the fragment. - * - * @param fragment The DOM document fragment to add the - * FailedReference elements to. - * @param failedReferences The indexes of the failed references. - */ - private void addFailedReferences( - DocumentFragment fragment, - int[] failedReferences) { - Element failedReferenceElem; - int i; - - for (i = 0; i < failedReferences.length; i++) { - failedReferenceElem = - responseDoc.createElementNS(MOA_NS_URI, "FailedReference"); - failedReferenceElem.appendChild( - responseDoc.createTextNode(Integer.toString(failedReferences[i]))); - fragment.appendChild(failedReferenceElem); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java deleted file mode 100644 index 425c410ad..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java +++ /dev/null @@ -1,30 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -/** - * Base class for signature environment profile data used in XML signature - * creation. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface CreateSignatureEnvironmentProfile { - /** - * Indicates that the profile data is given explicitly. - */ - public static int EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE = 0; - /** - * Indicates that the profile data is stored in the configuration and resolved - * using an ID. - */ - public static int ID_CREATESIGNATUREENVIRONMENTPROFILE = 1; - - /** - * Gets the type of this object. - * - * @return The type of CreateSignatureEnvironmentProfile denoted - * by this object. Either - * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE or - * ID_CREATESIGNATUREENVIRONMENTPROFILE. - */ - public int getCreateSignatureEnvironmentProfileType(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java deleted file mode 100644 index 6aebd102b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java +++ /dev/null @@ -1,30 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import java.util.List; - -/** - * A CreateSignatureEnvironmentProfile containing the profile - * data explicitly. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface CreateSignatureEnvironmentProfileExplicit - extends CreateSignatureEnvironmentProfile { - - /** - * Gets the location and index of where to insert the signature into the - * signature environment. - * - * @return The location and index of the signature in the signature - * environment. - */ - public CreateSignatureLocation getCreateSignatureLocation(); - /** - * Gets the supplemental information. - * - * @return The supplemental information. - */ - public List getSupplements(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java deleted file mode 100644 index 1c0d87adc..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java +++ /dev/null @@ -1,20 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -/** - * A CreateSignatureEnvironmentProfile containing a profile ID - * pointing to locally stored profile data. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface CreateSignatureEnvironmentProfileID - extends CreateSignatureEnvironmentProfile { - - /** - * Gets the profile ID. - * - * @return The profile ID. - */ - public String getCreateSignatureEnvironmentProfileID(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java deleted file mode 100644 index 5ceae4d0a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import at.gv.egovernment.moa.spss.api.common.Content; - -/** - * Encapsulates a signature object used during signature creation. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateSignatureInfo { - /** - * Gets the XML structure where the signature will be inserted. - * - * @return The XML structure where the signature will be inserted. - */ - public Content getCreateSignatureEnvironment(); - /** - * Gets the supplemental data for the signature environment. - * - * @return The supplemental data for the signature envoronment. - */ - public CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java deleted file mode 100644 index 81374ceaa..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java +++ /dev/null @@ -1,23 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import at.gv.egovernment.moa.spss.api.common.ElementSelector; - -/** - * Specifies where to insert the newly created signature. - * - * An XPath expression is used to select the signature parent element. An - * additional index specifies the node index after which to insert the - * signature into the parent element. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface CreateSignatureLocation extends ElementSelector { - /** - * Gets the node index, after which the signature will be inserted into the - * parent elemen. - * - * @return The index of the node after which the signature will be inserted. - */ - public int getIndex(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java deleted file mode 100644 index 94152434e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import java.util.List; - -import at.gv.egovernment.moa.spss.api.common.MetaInfo; - -/** - * Encapsulates information used for the transformation of the data object. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateTransformsInfo { - /** - * Gets the XMLDSig transforms. - * - * @return A List of Transform objects. - */ - public List getTransforms(); - /** - * Gets meta information about the data resulting from the transformation. - * - * @return Meta information about the resulting data. - */ - public MetaInfo getFinalDataMetaInfo(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java deleted file mode 100644 index 40acfd317..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java +++ /dev/null @@ -1,28 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -/** - * Base class for transformation informations used in signature creation. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateTransformsInfoProfile { - /** - * Indicates transformation information given explicitly. - */ - public static final int EXPLICIT_CREATETRANSFORMSINFOPROFILE = 0; - /** - * Indicates transformation information given as an ID. - */ - public static final int ID_CREATETRANSFORMSINFOPROFILE = 1; - - /** - * Gets the type of profile information this object contains. - * - * @return The type of transformation information, either - * EXPLICIT_CREATETRANSFORMSINFOPROFILE or - * ID_CREATETRANSFORMSINFOPROFILE. - */ - public int getCreateTransformsInfoProfileType(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java deleted file mode 100644 index aeb74445f..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import java.util.List; - -/** - * Encapsulates explicit transformation informations. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateTransformsInfoProfileExplicit - extends CreateTransformsInfoProfile { - /** - * Gets the transformation information of the data object. - * - * @return Transformation information of the data object. - */ - public CreateTransformsInfo getCreateTransformsInfo(); - /** - * Gets the supplemental information. - * - * @return The supplemental information. - */ - public List getSupplements(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java deleted file mode 100644 index 3631ead29..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java +++ /dev/null @@ -1,18 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -/** - * Encapsulates transformation information given via an identifier. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateTransformsInfoProfileID - extends CreateTransformsInfoProfile { - /** - * Gets the ID of the transformation. - * - * @return The transformation profile ID. - */ - public String getCreateTransformsInfoProfileID(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java deleted file mode 100644 index b8157fdfb..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import java.util.List; - - -/** - * Object that encapsulates a request to create an XML Signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateXMLSignatureRequest { - /** - * Gets the identifier for the keys to be used for the signature. - * - * @return The identifier for the keys to be used. - */ - public String getKeyIdentifier(); - /** - * Gets the information of the singleSignatureInfo elements. - * - * @return The information of singleSignatureInfo elements. - */ - public List getSingleSignatureInfos(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java deleted file mode 100644 index 6bf54e6a5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import java.util.List; - -/** - * Object that encapsulates the response on to a - * CreateXMLSignatureRequest to create an XML signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateXMLSignatureResponse { - /** - * Gets the response elements. - * - * @return The response elements. - */ - public List getResponseElements(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java deleted file mode 100644 index 2162d82fd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java +++ /dev/null @@ -1,29 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -/** - * Base class for SignatureEnvironmentResponse and - * ErrorResponse elements in a - * CreateXMLSignatureResponse. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface CreateXMLSignatureResponseElement { - /** - * Indicates that this object contains a SignatureEnvironment. - */ - public static final int SIGNATURE_ENVIRONMENT_RESPONSE = 0; - /** - * Indicates that this objet contains an ErrorResponse. - */ - public static final int ERROR_RESPONSE = 1; - - /** - * Gets the type of response object. - * - * @return The type of response object, either - * SIGNATURE_ENVIRONMENT_RESPONSE or ERROR_RESPONSE. - */ - public int getResponseType(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java deleted file mode 100644 index 43d49c587..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import at.gv.egovernment.moa.spss.api.common.Content; - -/** - * Encapsulates information required to create a single signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface DataObjectInfo { - /** - * Indicates that a detached signature will be created. - */ - public static final String STRUCTURE_DETACHED = "detached"; - /** - * Indicates that an enveloping signature will be created. - */ - public static final String STRUCTURE_ENVELOPING = "enveloping"; - - /** - * Gets the structure of the signature. - * - * @return The structure of the signature. - */ - public String getStructure(); - /** - * Checks whether a refercence will be placed in the signature itself or - * in the manifest. - * - * @return true if a reference will be placed in the manifest, - * false if it will be placed in the signature. - */ - public boolean isChildOfManifest(); - /** - * Gets information related to a single data object. - * - * @return Information related to a single data object. - */ - public Content getDataObject(); - /** - * Gets information for the transformation of the data object. - * - * @return The transformation information. - */ - public CreateTransformsInfoProfile getCreateTransformsInfoProfile(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java deleted file mode 100644 index 30fa4fb52..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - - -/** - * Object containing detailed error information. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface ErrorResponse extends CreateXMLSignatureResponseElement { - /** - * Gets the error code. - * - * @return The error code. - */ - public int getErrorCode(); - /** - * Gets verbose error information. - * - * @return Verbose error information. - */ - public String getInfo(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java deleted file mode 100644 index 449349a68..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import org.w3c.dom.Element; - -/** - * Contains the signature if the signature creation was successful. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SignatureEnvironmentResponse - extends CreateXMLSignatureResponseElement { - /** - * Gets the XML structure which contains the signature. - * - * @return A general XML structure containing the signature. - */ - public Element getSignatureEnvironment(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java deleted file mode 100644 index 9c74c5157..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlsign; - -import java.util.List; - -/** - * Encapsulates data to create a single signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SingleSignatureInfo { - /** - * Gets the dataObjectInfo information. - * - * @return The dataObjectInfo information. - */ - public List getDataObjectInfos(); - /** - * Gets the signature object. - * - * @return The signature object used during signature creation. - */ - public CreateSignatureInfo getCreateSignatureInfo(); - /** - * Check whether a Security Layer conform signature manifest will be created. - * - * @return true, if a Security Layer conform signature manifest - * will be created, false otherwise. - */ - public boolean isSecurityLayerConform(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java deleted file mode 100644 index 1984ba349..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java +++ /dev/null @@ -1,24 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - - -/** - * Contains the results of manifest checks according to XMLDsig. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface ManifestRefsCheckResult { - /** - * Gets the check code. - * - * @return A numerical representation of the result of the manifest check. - */ - public int getCode(); - /** - * Gets the reference to the manifest. - * - * @return The reference to the manifest. - */ - public ManifestRefsCheckResultInfo getInfo(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java deleted file mode 100644 index 258840162..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java +++ /dev/null @@ -1,19 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - - -/** - * Encapsulates information referring to the manifest of the check. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface ManifestRefsCheckResultInfo extends ReferencesCheckResultInfo { - /** - * Gets the position of the signature reference containing the - * reference to the manifest being described by this object. - * - * @return The position of the signature reference. - */ - public int getReferringSignatureReference(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java deleted file mode 100644 index 4c644583b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java +++ /dev/null @@ -1,19 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import java.util.List; - -/** - * Contains transformation parameters which are locally available. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface ReferenceInfo { - /** - * Gets the transformation info. - * - * @return The transformation info. - */ - public List getVerifyTransformsInfoProfiles(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java deleted file mode 100644 index 7b5488613..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java +++ /dev/null @@ -1,23 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Contains information about the verification status of references contained - * in the signature. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface ReferencesCheckResult { - /** - * Gets the check code. - * - * @return A numerical representation of the result of the reference check. - */ - public int getCode(); - /** - * Gets the additional information about the result. - * - * @return Additional information about the result. - */ - public ReferencesCheckResultInfo getInfo(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java deleted file mode 100644 index be21b61c2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import org.w3c.dom.NodeList; - -/** - * Additional information contained in a ReferencesCheckResult. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface ReferencesCheckResultInfo { - /** - * Gets the additional info of the failed dsig:reference element. - * - * @return The info elements. - */ - public NodeList getAnyOtherInfo(); - /** - * Gets the positions of the failed signature references containing the - * references to the manifests being described by this object. - * - * @return The positions of the failed signature references. - */ - public int[] getFailedReferences(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java deleted file mode 100644 index 8f0efacf3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import java.util.List; - -/** - * Contains parameters used to check the signature manifest. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SignatureManifestCheckParams { - /** - * Gets the referential information. - * - * @return The referential information. - */ - public List getReferenceInfos(); - /** - * Gets information on whether signature source data should be returned. - * - * @return true, if signature source data should be returned, - * otherwise false. - */ - public boolean getReturnReferenceInputData(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java deleted file mode 100644 index 569e691ca..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java +++ /dev/null @@ -1,28 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Base class for supplementary information. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SupplementProfile { - /** - * Indicates that this object contains explicit supplementary information. - */ - public static final int EXPLICIT_SUPPLEMENTPROFILE = 0; - /** - * Indicates that this object contains a profile id where supplementary - * information can be found. - */ - public static final int ID_SUPPLEMENTPROFILE = 1; - - /** - * Gets the type of supplementary information contained in this object. - * - * @return The type of supplementary information contained in this object, - * either EXPLICIT_SUPPLEMENT or ID_SUPPLEMENT. - */ - public int getSupplementProfileType(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java deleted file mode 100644 index 7dd37a2d1..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java +++ /dev/null @@ -1,19 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; - -/** - * Encapsulates explicit supplementary information. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SupplementProfileExplicit extends SupplementProfile { - /** - * Gets the supplemental object. - * - * @return The supplemental object. - */ - public XMLDataObjectAssociation getSupplementProfile(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java deleted file mode 100644 index 5b5083be9..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java +++ /dev/null @@ -1,18 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Encapsulates supplementary information stored in a profile. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface SupplementProfileID extends SupplementProfile { - /** - * Gets the id of the profile where the supplementary information can be - * found. - * - * @return The profile id. - */ - public String getSupplementProfileID(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java deleted file mode 100644 index 3e173e0cd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java +++ /dev/null @@ -1,40 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Object encapsulating transform parameters either as a URI, binary or - * hashed. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface TransformParameter { - /** - * Indicates that this object contains a transform parameter given as - * a URI. - */ - public static final int URI_TRANSFORMPARAMETER = 0; - /** - * Indicates that this object contains binary transform parameter. - */ - public static final int BINARY_TRANSFORMPARAMETER = 1; - /** - * Indicatest that this object contains a binary hash of the transform - * parameter. - */ - public static final int HASH_TRANSFORMPARAMETER = 2; - - /** - * Gets the type of transform parameter contained in this object. - * - * @return The type of transform parameter, being one of - * URI_TRANSFORMPARAMETER, BINARY_TRANSFORMPARAMETER - * or HASH_TRANSFORMPARAMETER. - */ - public int getTransformParameterType(); - /** - * Gets the transform parameter URI. - * - * @return The transform parameter URI. - */ - public String getURI();} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java deleted file mode 100644 index 600227dfd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java +++ /dev/null @@ -1,21 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import java.io.InputStream; - -/** - * Encapsulates a binary transform parameter. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface TransformParameterBinary extends TransformParameter { - /** - * Gets the binary transform parameter. - * - * @return An InputStream from which the binary content can - * be read. - */ - public InputStream getBinaryContent(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java deleted file mode 100644 index ec45ea4f4..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - - -/** - * Contains a hash of the transform parameter. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface TransformParameterHash extends TransformParameter { - /** - * Gets the method used for calculating the digest value. - * - * @return The digest method. - */ - public String getDigestMethod(); - /** - * Gets the binary hash of the transform parameter. - * - * @return A binary representation of the hash. - */ - public byte[] getDigestValue(); - - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java deleted file mode 100644 index 4a6f0a58f..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java +++ /dev/null @@ -1,12 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Encapsulates a transform parameter given as a URI. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface TransformParameterURI extends TransformParameter { - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java deleted file mode 100644 index 386651c47..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import at.gv.egovernment.moa.spss.api.common.Content; - -/** - * Encapsulates a signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifySignatureInfo { - /** - * Gets the content of the VerifySignatureEnvironment element. - * - * @return A MOAElement containing the - * VerifySignatureEnvironment in a DOM-like structure. - */ - public Content getVerifySignatureEnvironment(); - /** - * Gets the location of the signature. - * - * @return The location of the signature within the signature environment. - */ - public VerifySignatureLocation getVerifySignatureLocation(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java deleted file mode 100644 index f05e3e889..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java +++ /dev/null @@ -1,13 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import at.gv.egovernment.moa.spss.api.common.ElementSelector; - -/** - * Specifies where to find the signature to be verified. - * - * @author Patrick Peck - * @version $Id$ - */ -public interface VerifySignatureLocation extends ElementSelector { - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java deleted file mode 100644 index 909fc58a2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java +++ /dev/null @@ -1,28 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Object for explicitly specifying a transformation path. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyTransformsInfoProfile { - /** - * Indicates that this object contains the transformation path explicitly. - */ - public static final int EXPLICIT_VERIFYTRANSFORMSINFOPROFILE = 0; - /** - * Indicatest that this object contains a transformation info id. - */ - public static final int ID_VERIFYTRANSFORMSINFOPROFILE = 1; - - /** - * Gets the type of transformation information contained in this object. - * - * @return The type of transformation information, either - * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE or - * ID_VERIFYTRANSFORMSINFOPROFILE. - */ - public int getVerifyTransformsInfoProfileType(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java deleted file mode 100644 index ff19683da..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import java.util.List; - -/** - * Encapsulates explicit transformation information. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyTransformsInfoProfileExplicit extends VerifyTransformsInfoProfile { - /** - * Gets the XMLDSig transforms element. - * - * @return The List of Transforms. - */ - public List getTransforms(); - /** - * Gets the transformation parameters. - * - * @return The transformation parameters. - */ - public List getTransformParameters(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java deleted file mode 100644 index 0df3664da..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java +++ /dev/null @@ -1,18 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -/** - * Encapsulates transformation info id for signature verification. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyTransformsInfoProfileID extends VerifyTransformsInfoProfile { - /** - * Gets the identifier referencing the transformation info. - * - * @return The identifier referencing the transformation info. - */ - public String getVerifyTransformsInfoProfileID(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java deleted file mode 100644 index eb71f500b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java +++ /dev/null @@ -1,55 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import java.util.Date; -import java.util.List; - - -/** - * Object that encapsulates a request to verify an XML signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyXMLSignatureRequest { - /** - * Gets the date and time for which the signature verification has to - * be performed. - * - * @return Date and time for which the signature verification has - * to be performed. - */ - public Date getDateTime(); - /** - * Gets the signature to be verified. - * - * @return The signature to be verified. - */ - public VerifySignatureInfo getSignatureInfo(); - /** - * Gets the supplemental information. - * - * @return The supplemental information. - */ - public List getSupplementProfiles(); - /** - * Gets parameters for Security Layer signature verification. - * - * @return Parameters for Security Layer signature verification. - */ - public SignatureManifestCheckParams getSignatureManifestCheckParams(); - /** - * Checks, whether actually signed data shall be returned. - * - * @return true, if signed data will be returned, - * otherwise false. - */ - public boolean getReturnHashInputData(); - /** - * Gets the profile id of the set of trusted certificates to be used for - * signature verification. - * - * @return The id of the trusted certificates. - */ - public String getTrustProfileId(); -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java deleted file mode 100644 index 14ac71e67..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java +++ /dev/null @@ -1,60 +0,0 @@ -package at.gv.egovernment.moa.spss.api.xmlverify; - -import java.util.List; - -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * Object that encapsulates the response on a request to verify an XML - * signature. - * - * @author Patrick Peck - * @author Stephan Grill - * @version $Id$ - */ -public interface VerifyXMLSignatureResponse { - /** - * Gets a SignerInfo element according to XMLDSig. - * - * @return A SignerInfo element according to XMLDSig. - */ - public SignerInfo getSignerInfo(); - /** - * Gets datas signed by the signatory. - * - * @return The signed datas. - */ - public List getHashInputDatas(); - /** - * Gets source datas elements. - * - * @return The source datas elements. - */ - public List getReferenceInputDatas(); - /** - * Gets the result of the signature verification. - * - * @return The result of the signature verification. - */ - public ReferencesCheckResult getSignatureCheck(); - /** - * Gets the result of the signature manifest verification. - * - * @return The result of the signature manifest verification. - */ - public ReferencesCheckResult getSignatureManifestCheck(); - /** - * Gets XMLDSigManifestCheck elements. - * - * @return The XMLDSigManifestCheck elements. - */ - public List getXMLDsigManifestChecks(); - /** - * Gets the result of the certification verification. - * - * @return The result of the certificate verification. - */ - public CheckResult getCertificateCheck(); - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/overview.htm b/spss.server/src/at/gv/egovernment/moa/spss/overview.htm deleted file mode 100644 index 9b17bbf91..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/overview.htm +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - -MOA SP/SS API documentation overview. - - -

Using the MOA SP/SS API

- -

Invoking the services

-In general, invoking the MOA SP/SS API involves the following steps: -
    -
  1. Set the moa.spss.server.configuration system property to point -to the main MOA SP/SS configuration file. This needs to be done only once per -JVM instance. You may also call -{@link at.gv.egovernment.moa.spss.api.Configurator#init} at this point to -pre-initialize MOA SP/SS (if not, it is done automatically upon service -invocation).
  2. -
  3. Create an instance of the service to be used -({@link at.gv.egovernment.moa.spss.api.SignatureCreationService} or -{@link at.gv.egovernment.moa.spss.api.SignatureVerificationService}), -via its getInstance() method.
  4. -
  5. Create an instance of the -{@link at.gv.egovernment.moa.spss.api.SPSSFactory}, via its -{@link at.gv.egovernment.moa.spss.api.SPSSFactory#getInstance} method.
  6. -
  7. Use the create... methods of the SPSSFactory to -create the desired {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest}, -{@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest} or -{@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest} object. -
  8. -
  9. Call one of the service methods: -{@link at.gv.egovernment.moa.spss.api.SignatureCreationService#createXMLSignature(at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest) createXMLSignature()}, -{@link at.gv.egovernment.moa.spss.api.SignatureVerificationService#verifyCMSSignature(at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest) verifyCMSSignature()} or -{@link at.gv.egovernment.moa.spss.api.SignatureVerificationService#verifyXMLSignature(at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest) verifyXMLSignature()}. -
  10. -
  11. Analyze the result of the service call, given as a -{@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse}, -{@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse} or -{@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse}. -In case of an error, a {@link at.gv.egovernment.moa.spss.MOAException} -is thrown by the service. Please be aware that errors during signature creation -are reported as part of a CreateXMLSignatureResponse. -
- -

Creating MOA SP/SS API objects

-

-Invoking the MOA SP/SS API Service classes involves creating -a Request object using the {@link at.gv.egovernment.moa.spss.api.SPSSFactory SPSSFactory}. -Object creation using the SPSSFactory is always bottom-up, meaning -that in order to create an object all of its components must have been created -before. -

-

-The names of the MOA SP/SS API classes have been chosen to correspond to the -MOA SP/SS schema elements. The structure of the classes (i.e., their fields) -also corresponds to the structure of the respective MOA SP/SS schema elements. -However, a few classes escape this naming convention, mainly because the -corresponding schema elements contain xsd:choice components: -

    -
  • The various Profile classes have subclasses called -ProfileID and ProfileExplicit -(e.g., {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID} and -{@link at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit}), -so that the profile can be given either as an ID (which is to be resolved from the -MOA SP/SS configuration) or explicitly.
  • -
  • The classes {@link at.gv.egovernment.moa.spss.api.common.Content}, -{@link at.gv.egovernment.moa.spss.api.cmsverify.CMSContent} and -{@link at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter} have -subclasses specifying the type of content they actually contain. E.g., -{@link at.gv.egovernment.moa.spss.api.common.ContentBinary} will contain -a byte stream.
  • -
- -

-

-For clarity, the MOA SP/SS API classes have been organized in several packages -listed in the following table: -

- - - - - - - - - - - - - - - - - - - - - -
PackagePurpose
{@link at.gv.egovernment.moa.spss.api.xmlsign}Components of the {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest} and - {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse}
{@link at.gv.egovernment.moa.spss.api.cmsverify}Components of the - {@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest} and - {@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse}
{@link at.gv.egovernment.moa.spss.api.xmlverify}Components of the - {@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest} and - {@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse}
{@link at.gv.egovernment.moa.spss.api.common}Common components used across the classes of the above packages
- -

Converting MOA SP/SS API objects to and from DOM trees

-The package {@link at.gv.egovernment.moa.spss.api.xmlbind} contains helper -classes to: -
    -
  • Parse a DOM tree containing a CreateXMLSignatureRequest, -VerifyCMSSignatureRequest or -VerifyCMSSignatureRequest into its respective MOA SP/SS API object -representation. For example, to parse a CreateXMLSignatureRequest -DOM tree, the {@link at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser#parse(org.w3c.dom.Element) CreateXMLSignatureRequestParser.parse()} -method can be used.
    -Note: The DOM tree of the request must be derived from a schema valid -XML document. Otherwise, unexpected behaviour will almost certainly result.
  • -
  • Build a CreateXMLSignatureResponse, -VerifyCMSSignatureResponse or a -VerifyXMLSignatureResponse DOM tree from the respective MOA SP/SS -API object. For example, to build a VerifyXMLSignatureResponse -DOM tree, the {@link at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder#build(at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse) VerifyXMLSignatureResponseBuilder.build()} -can be used.
    -Note:The serialized DOM tree will be schema valid. -
  • -
-The DOM trees can easily be read from and written to XML byte streams using -the methods in the {@link at.gv.egovernment.moa.util.DOMUtils} class. -
- -

Utilities and Logging

-

The packages {@link at.gv.egovernment.moa.util} and -{@link at.gv.egovernment.moa.spss.util} contain utility classes developed for -the MOA SP/SS implementation. Since the classes contained in these packages are -tailored towards the MOA SP/SS implementation, they are far from being complete -in the sense of providing a utility class library. Therefore, they may or may -not prove useful in the context of your application. Their interfaces may also -change in future releases. -

- -

The package {@link at.gv.egovernment.moa.logging} contains classes for -logging messages to the MOA SP/SS log hierarchy via the -{@link at.gv.egovernment.moa.logging.Logger} class. -

- -

Related Documentation

- -See also the API example in the -MOA SP/SS documentation. - - - \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java deleted file mode 100644 index bd78012ef..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java +++ /dev/null @@ -1,165 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import iaik.pki.revocation.RevocationSourceTypes; - -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; - -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * A class representing a CRL distribution point. - * - * @author Sven Aigner - * @author Patrick Peck - * @version $Id$ - */ -public class CRLDistributionPoint - extends DistributionPoint - implements iaik.pki.revocation.CRLDistributionPoint -{ - - private static Map RC_MAPPING = new HashMap(); - - static { - - // create the mapping between reason code strings and their integer values - RC_MAPPING.put( - "unused", - new Integer(iaik.asn1.structures.DistributionPoint.unused)); - RC_MAPPING.put( - "keyCompromise", - new Integer(iaik.asn1.structures.DistributionPoint.keyCompromise)); - RC_MAPPING.put( - "cACompromise", - new Integer(iaik.asn1.structures.DistributionPoint.cACompromise)); - RC_MAPPING.put( - "affiliationChanged", - new Integer(iaik.asn1.structures.DistributionPoint.affiliationChanged)); - RC_MAPPING.put( - "superseded", - new Integer(iaik.asn1.structures.DistributionPoint.superseded)); - RC_MAPPING.put( - "cessationOfOperation", - new Integer(iaik.asn1.structures.DistributionPoint.cessationOfOperation)); - RC_MAPPING.put( - "certificateHold", - new Integer(iaik.asn1.structures.DistributionPoint.certificateHold)); - RC_MAPPING.put( - "privilegeWithdrawn", - new Integer(iaik.asn1.structures.DistributionPoint.privilegeWithdrawn)); - RC_MAPPING.put( - "aACompromise", - new Integer(iaik.asn1.structures.DistributionPoint.aACompromise)); - } - - /** - * The name of the CA issuing the CRL referred to by this DP. - */ - private String issuerName_; - - /** - * The reason codes applicable for the distribution point. - */ - private int reasonCodes; - - /** - * Create a CRLDistributionPoint. - * - * @param issuerName The name of the CA issuing the CRL referred to by this DP. - * - * @param uri The URI of the distribution point. - * - * @param reasonCodeStr A list of reason codes (a space-separated enumeration). - */ - public CRLDistributionPoint(String issuerName, String uri, String reasonCodeStr) - { - super(uri); - issuerName_ = issuerName; - this.reasonCodes = extractReasonCodes(reasonCodeStr); - } - - /** - * @see DistributionPoint#getType() - */ - public String getType() - { - return RevocationSourceTypes.CRL; - } - - /** - * Convert a list of reason codes provided as a String to a - * binary representation. - * - * @param reasonCodeStr A String containing a blank-separated, - * textual representation of reason codes. - * @return int A binary representation of reason codes. - * @see iaik.asn1.structures.DistributionPoint - */ - private int extractReasonCodes(String reasonCodeStr) { - int codes = 0; - StringTokenizer tokenizer = new StringTokenizer(reasonCodeStr); - String token; - Integer reasonCode; - - while (tokenizer.hasMoreTokens()) { - token = tokenizer.nextToken(); - reasonCode = (Integer) RC_MAPPING.get(token); - if (reasonCode != null) { - codes |= reasonCode.intValue(); - } else { - MessageProvider msg = MessageProvider.getInstance(); - Logger.warn( - new LogMsg(msg.getMessage("config.07", new Object[] { token }))); - } - } - - // If reasonCodeStr is empty, set all possible reason codes - if (codes == 0) codes = - iaik.asn1.structures.DistributionPoint.unused | - iaik.asn1.structures.DistributionPoint.keyCompromise | - iaik.asn1.structures.DistributionPoint.cACompromise | - iaik.asn1.structures.DistributionPoint.affiliationChanged | - iaik.asn1.structures.DistributionPoint.superseded | - iaik.asn1.structures.DistributionPoint.cessationOfOperation | - iaik.asn1.structures.DistributionPoint.certificateHold | - iaik.asn1.structures.DistributionPoint.privilegeWithdrawn | - iaik.asn1.structures.DistributionPoint.aACompromise; - - return codes; - } - - /** - * Return a binary representation of the reason codes of this distribution - * point. - * - * @return The binary representation of the reason codes. - */ - public int getReasonCodes() { - return reasonCodes; - } - - /** - * Return a String representation of this distribution point. - * - * @return The String representation of this distribution point. - * @see java.lang.Object#toString() - */ - public String toString() { - return "(DistributionPoint - " - + ("URI<" + getUri()) - + ("> REASONCODES<" + getReasonCodes() + ">)"); - } - - /** - * @see iaik.pki.revocation.CRLDistributionPoint#getIssuerName() - */ - public String getIssuerName() - { - return issuerName_; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java deleted file mode 100644 index 4c2b3aea3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import at.gv.egovernment.moa.spss.MOASystemException; - -/** - * Exception signalling an error in the configuration. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ConfigurationException extends MOASystemException { - - /** - * Create a ConfigurationException. - * - * @see at.gv.egovernment.moa.spss.MOAException#MOAException(String, Object[]) - */ - public ConfigurationException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Create a ConfigurationException. - * @see at.gv.egovernment.moa.spss.MOAException#MOAException(String, Object[], Throwable) - */ - public ConfigurationException( - String messageId, - Object[] parameters, - Throwable wrapped) { - - super(messageId, parameters, wrapped); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java deleted file mode 100644 index 14ceb71cd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java +++ /dev/null @@ -1,1239 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigInteger; -import java.net.MalformedURLException; -import java.security.Principal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.traversal.NodeIterator; - -import org.xml.sax.SAXException; - -import iaik.ixsil.exceptions.URIException; -import iaik.ixsil.util.URI; -import iaik.pki.pathvalidation.ChainingModes; -import iaik.pki.revocation.RevocationSourceTypes; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * A class that builds configuration data from a DOM based representation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ConfigurationPartsBuilder { - - // - // XPath namespace prefix shortcuts - // - - private static final String CONF = Constants.MOA_CONFIG_PREFIX + ":"; - private static final String DSIG = Constants.DSIG_PREFIX + ":"; - - // - // chaining mode constants appearing in the configuration file - // - - private static final String CM_CHAINING = "chaining"; - private static final String CM_PKIX = "pkix"; - - // - // XPath expressions to select certain parts of the configuration - // - - private static final String ROOT = "/" + CONF + "MOAConfiguration/"; - - private static final String DIGEST_METHOD_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "XMLDSig/" - + CONF + "DigestMethodAlgorithm"; - private static final String C14N_ALGORITHM_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "XMLDSig/" - + CONF + "CanonicalizationAlgorithm"; - private static final String HARDWARE_CRYPTO_MODULE_XPATH = - ROOT + CONF + "Common/" - + CONF + "HardwareCryptoModule"; - private static final String HARDWARE_KEY_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "KeyModules/" - + CONF + "HardwareKeyModule"; - private static final String SOFTWARE_KEY_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "KeyModules/" - + CONF + "SoftwareKeyModule"; - private static final String KEYGROUP_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "KeyGroup"; - private static final String KEYGROUP_MAPPING_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "KeyGroupMapping"; - private static final String ISSUER_XPATH = - DSIG + "X509IssuerName"; - private static final String SERIAL_XPATH = - DSIG + "X509SerialNumber"; - private static final String CERTSTORE_LOCATION_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "PathConstruction/" - + CONF + "CertificateStore/" - + CONF + "DirectoryStore/" - + CONF + "Location"; - private static final String AUTO_ADD_CERTIFICATES_XPATH_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "PathConstruction/" - + CONF + "AutoAddCertificates"; - private static final String USE_AUTHORITY_INFO_ACCESS_XPATH_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "PathConstruction/" - + CONF + "UseAuthorityInformationAccess"; - private static final String CHAINING_MODES_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "PathValidation/" - + CONF + "ChainingMode"; - private static final String CHAINING_MODES_DEFAULT_XPATH = - CHAINING_MODES_XPATH + "/" - + CONF + "DefaultMode"; - private static final String TRUST_ANCHOR_XPATH = - CHAINING_MODES_XPATH + "/" - + CONF + "TrustAnchor"; - private static final String TRUST_PROFILE_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "PathValidation/" - + CONF + "TrustProfile"; - private static final String DISTRIBUTION_POINTS_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "DistributionPoint"; - private static final String ENABLE_REVOCATION_CHECKING_XPATH_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "EnableChecking"; - private static final String MAX_REVOCATION_AGE_XPATH_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "MaxRevocationAge"; - private static final String REVOCATION_SERVICEORDER_XPATH_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "ServiceOrder/" - + CONF + "Service"; - private static final String ENABLE_ARCHIVING_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "Archiving/" - + CONF + "EnableArchiving"; - private static final String CRL_ARCHIVE_DURATION_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "Archiving/" - + CONF + "ArchiveDuration"; - private static final String ACHIVE_JDBC_URL_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "Archiving/" - + CONF + "Archive/" - + CONF + "DatabaseArchive/" - + CONF + "JDBCURL"; - private static final String ACHIVE_JDBC_DRIVER_CLASS_ = - ROOT + CONF + "SignatureVerification/" - + CONF + "CertificateValidation/" - + CONF + "RevocationChecking/" - + CONF + "Archiving/" - + CONF + "Archive/" - + CONF + "DatabaseArchive/" - + CONF + "JDBCDriverClassName"; - private static final String CREATE_TRANSFORMS_INFO_PROFILE_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "CreateTransformsInfoProfile"; - private static final String CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH = - ROOT + CONF + "SignatureCreation/" - + CONF + "CreateSignatureEnvironmentProfile"; - private static final String VERIFY_TRANSFORMS_INFO_PROFILE_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "VerifyTransformsInfoProfile"; - private static final String SUPPLEMENT_PROFILE_XPATH = - ROOT + CONF + "SignatureVerification/" - + CONF + "SupplementProfile"; - - // - // default values for configuration parameters - // - - /** The accepted canonicalization algorithm URIs, as an array */ - private static final String[] ACCEPTED_C14N_ALGORITHMS_ARRAY = - { - Constants.C14N_URI, - Constants.C14N_WITH_COMMENTS_URI, - Constants.EXC_C14N_URI, - Constants.EXC_C14N_WITH_COMMENTS_URI }; - - /** The accepted canonicalization algorithm URIs, as a Set */ - private static final Set ACCEPTED_C14N_ALGORITHMS = - new HashSet(Arrays.asList(ACCEPTED_C14N_ALGORITHMS_ARRAY)); - - /** Default canonicalization algorithm, if none/illegal has been configured */ - private static final String C14N_ALGORITHM_DEFAULT = Constants.C14N_URI; - - /** The accepted digest method algorithm URIs, as an array */ - private static final String[] ACCEPTED_DIGEST_ALGORITHMS_ARRAY = - { Constants.SHA1_URI }; - - /** The accepted digest method algorithm URIs, as a Set */ - private static final Set ACCEPTED_DIGEST_ALGORITHMS = - new HashSet(Arrays.asList(ACCEPTED_DIGEST_ALGORITHMS_ARRAY)); - - /** Default digest algorithm URI, if none/illegal has been configured */ - private static final String DIGEST_ALGORITHM_DEFAULT = Constants.SHA1_URI; - - /** The root element of the MOA configuration */ - private Element configElem; - - /** - * The directory containing the underlying configuration file. - */ - private File configRoot_; - - /** Whether any warnings were encountered building the configuration. */ - private List warnings = new ArrayList(); - - /** - * Create a new ConfigurationPartsBuilder. - * - * @param configElem The root element of the MOA configuration. - * - * @param configRoot The directory containing the underlying configuration file. - */ - public ConfigurationPartsBuilder(Element configElem, File configRoot) - { - this.configElem = configElem; - configRoot_ = configRoot; - } - - /** - * Returns the root element of the MOA configuration. - * - * @return The root element of the MOA configuration. - */ - public Element getConfigElem() { - return configElem; - } - - /** - * Returns the directory containing the underlying configuration file. - * - * @return the directory containing the underlying configuration file. - */ - public File getConfigRoot() - { - return configRoot_; - } - - /** - * Returns the warnings encountered during building the configuration. - * - * @return A List of Strings, containing the - * warning messages. - */ - public List getWarnings() { - return warnings; - } - - /** - * Returns the digest method algorithm name. - * - * @return The digest method algorithm name from the configuration. - */ - public String getDigestMethodAlgorithmName() - { - String digestMethod = getElementValue(getConfigElem(), DIGEST_METHOD_XPATH, null); - - if (digestMethod == null || !ACCEPTED_DIGEST_ALGORITHMS.contains(digestMethod)) - { - info( - "config.23", - new Object[] { "DigestMethodAlgorithm", DIGEST_ALGORITHM_DEFAULT }); - digestMethod = DIGEST_ALGORITHM_DEFAULT; - } - - return digestMethod; - } - - /** - * Returns the canonicalization algorithm name. - * - * @return The canonicalization algorithm name from the configuration. - */ - public String getCanonicalizationAlgorithmName() - { - String c14nAlgorithm = getElementValue(getConfigElem(), C14N_ALGORITHM_XPATH, null); - - if (c14nAlgorithm == null || !ACCEPTED_C14N_ALGORITHMS.contains(c14nAlgorithm)) - { - info( - "config.23", - new Object[] { "CanonicalizationAlgorithm", C14N_ALGORITHM_DEFAULT }); - c14nAlgorithm = C14N_ALGORITHM_DEFAULT; - } - - return c14nAlgorithm; - } - - /** - * Build the configured hardware crypto modules. - * - * @return The hardware crypto modules from the configuration. - */ - public List buildHardwareCryptoModules() - { - List modules = new ArrayList(); - NodeIterator modIter = XPathUtils.selectNodeIterator( - getConfigElem(), - HARDWARE_CRYPTO_MODULE_XPATH); - - Element modElem; - while ((modElem = (Element) modIter.nextNode()) != null) { - String name = getElementValue(modElem, CONF + "Name", null); - String slotId = getElementValue(modElem, CONF + "SlotId", null); - String userPIN = getElementValue(modElem, CONF + "UserPIN", null); - HardwareCryptoModule module = new HardwareCryptoModule(name, slotId, userPIN); - modules.add(module); - } - - return modules; - } - - /** - * Build the configured hardware keys. - * - * @param keyModules The keyModules that the configuration already knows about. To - * prevent multiple key modules with the same ID. - * @return The hardware keys contained in the configuration. - */ - public List buildHardwareKeyModules(List keyModules) - { - Set existingIds = toIdSet(keyModules); - List hardwareKeys = new ArrayList(); - NodeIterator hkIter = - XPathUtils.selectNodeIterator(getConfigElem(), HARDWARE_KEY_XPATH); - Element keyElem; - - while ((keyElem = (Element) hkIter.nextNode()) != null) - { - String id = getElementValue(keyElem, CONF + "Id", null); - String name = getElementValue(keyElem, CONF + "Name", null); - String slotId = getElementValue(keyElem, CONF + "SlotId", null); - String userPIN = getElementValue(keyElem, CONF + "UserPIN", null); - - if (existingIds.contains(id)) - { - warn( - "config.04", - new Object[] { "Hardware- oder SoftwareKeyModule", id }); - } - else - { - KeyModule key = new HardwareKeyModule(id, name, slotId, userPIN); - hardwareKeys.add(key); - existingIds.add(id); - } - - } - - return hardwareKeys; - } - - /** - * Build the configured software keys. - * - * @param keyModules The keyModules that the configuration already knows about. To - * prevent multiple key modules with the same ID. - * - * @return The software keys contained in the configuration. - */ - public List buildSoftwareKeyModules(List keyModules) - { - Set existingIds = toIdSet(keyModules); - List softwareKeys = new ArrayList(); - NodeIterator skIter = - XPathUtils.selectNodeIterator(getConfigElem(), SOFTWARE_KEY_XPATH); - - Element keyElem; - while ((keyElem = (Element) skIter.nextNode()) != null) - { - String id = getElementValue(keyElem, CONF + "Id", null); - String fileName = getElementValue(keyElem, CONF + "FileName", null); - String passWord = getElementValue(keyElem, CONF + "Password", null); - - if (existingIds.contains(id)) - { - warn( - "config.04", - new Object[] { "Hardware- oder SoftwareKeyModule", id }); - } - else - { - File keyFile; - KeyModule key; - - // make keyFile absolute - keyFile = new File(fileName); - if (!keyFile.isAbsolute()) { - keyFile = new File(configRoot_, fileName); - } - - // check for existence - if (!keyFile.exists() || keyFile.isDirectory()) { - warn("config.25", new Object[] { id, keyFile.getAbsolutePath()}); - } else { - // create a new key module - key = new SoftwareKeyModule(id, keyFile.getAbsolutePath(), passWord); - softwareKeys.add(key); - existingIds.add(id); - } - } - } - - return softwareKeys; - } - - /** - * Build the key group configuration. - * - * @param keyModules The KeyModules that the configuration - * knows about. Used to check for errors in the configuration. - * @return The mapping between key group IDs and key groups. - */ - public Map buildKeyGroups(List keyModules) - { - Set keyModuleIds = toIdSet(keyModules); - Map keyGroups = new HashMap(); - NodeIterator kgIter; - Element keyGroupElem; - - // select all KeyGroup elements and build the KeyGroup objects from them - kgIter = XPathUtils.selectNodeIterator(getConfigElem(), KEYGROUP_XPATH); - while ((keyGroupElem = (Element) kgIter.nextNode()) != null) - { - String keyGroupId = getElementValue(keyGroupElem, CONF + "Id", null); - Set keyGroupEntries = - buildKeyGroupEntries(keyGroupId, keyModuleIds, keyGroupElem); - KeyGroup keyGroup = new KeyGroup(keyGroupId, keyGroupEntries); - - if (keyGroups.containsKey(keyGroupId)) - { - warn("config.04", new Object[] { "KeyGroup", keyGroupId }); - } - else - { - keyGroups.put(keyGroup.getId(), keyGroup); - } - } - - return keyGroups; - } - - /** - * Return the set of IDs contained in the given KeyModules. - * - * @param keyModules The KeyModules from which to extract the - * IDs. - * @return The IDs from the given KeyModules. - */ - private Set toIdSet(List keyModules) { - Set ids = new HashSet(); - Iterator iter; - - for (iter = keyModules.iterator(); iter.hasNext();) { - KeyModule keyModule = (KeyModule) iter.next(); - ids.add(keyModule.getId()); - } - - return ids; - } - - /** - * Build the key entries belonging to a key group. - * - * @param keyGroupId The ID of the key group we are building here. Passed - * for logging purposes. - * @param keyModuleIds The IDs of the HardwareKeyModules and - * SoftwareKeyModules that exist in the configuration. - * @param keyGroupElem The KeyGroup DOM element to parse. - * @return A Set of KeyGroupEntry objects. - */ - private Set buildKeyGroupEntries( - String keyGroupId, - Set keyModuleIds, - Element keyGroupElem) { - - Set entries = new HashSet(); - NodeIterator keyEntryIter; - Element keyEntryElem; - - // select all Key elements and put them into the Map - keyEntryIter = XPathUtils.selectNodeIterator(keyGroupElem, CONF + "Key"); - while ((keyEntryElem = (Element) keyEntryIter.nextNode()) != null) - { - String keyModuleId = getElementValue(keyEntryElem, CONF + "KeyModuleId", ""); - Element keyCertElem = (Element) XPathUtils.selectSingleNode(keyEntryElem, CONF + "KeyCertIssuerSerial"); - IssuerAndSerial issuerSerial = buildIssuerAndSerial(keyCertElem); - - if (!keyModuleIds.contains(keyModuleId)) { - warn("config.26", new Object[] { keyGroupId, keyModuleId }); - } else if (issuerSerial != null) { - KeyGroupEntry entry = new KeyGroupEntry(keyModuleId, issuerSerial); - entries.add(entry); - } - } - return entries; - } - - /** - * Build the key group mapping. - * - * @param keyGroups The available key groups. - * @param anonymous The IssuerAndSerial to be used for key group - * mappings not protected by a certificate. - * @return The key group mapping. - */ - public Map buildKeyGroupMappings(Map keyGroups, IssuerAndSerial anonymous) { - Map mappings = new HashMap(); - NodeIterator mappingIter; - Element mappingElem; - - // select all KeyGroupMapping elements - mappingIter = - XPathUtils.selectNodeIterator(getConfigElem(), KEYGROUP_MAPPING_XPATH); - - // build the mapping for each KeyGroupMapping element - while ((mappingElem = (Element) mappingIter.nextNode()) != null) - { - Element issuerSerialElem = (Element) XPathUtils.selectSingleNode(mappingElem, CONF + "CustomerId"); - - // build the IssuerAndSerial who has access to the key groups - IssuerAndSerial issuerAndSerial; - if (issuerSerialElem != null) - { - issuerAndSerial = buildIssuerAndSerial(issuerSerialElem); - } - else - { - // IssuerSerial element: the keygroup is generally available - issuerAndSerial = anonymous; - } - - // add the key groups to the mappings - if (issuerAndSerial != null) { - Map groups = (Map) mappings.get(issuerAndSerial); - NodeIterator keyGroupIter; - Element keyGroupElem; - - if (groups == null) - { - // no mapping exist -> build one - groups = new HashMap(); - mappings.put(issuerAndSerial, groups); - } - - // select the available key groups and add them to the mapping - keyGroupIter = XPathUtils.selectNodeIterator(mappingElem, CONF + "KeyGroupId"); - while ((keyGroupElem = (Element) keyGroupIter.nextNode()) != null) - { - String keyGroupId = getElementValue(keyGroupElem, ".", null); - KeyGroup keyGroup = (KeyGroup) keyGroups.get(keyGroupId); - - if (keyGroup != null) - { - groups.put(keyGroupId, keyGroup); - } else - { - warn("config.00", new Object[] { keyGroupId }); - } - } - } - } - - return mappings; - } - - /** - * Returns the default chaining mode from the configuration. - * - * @return The default chaining mode. - */ - public String getDefaultChainingMode() - { - String defaultChaining = getElementValue( - getConfigElem(), - CHAINING_MODES_DEFAULT_XPATH, - CM_PKIX); - - return translateChainingMode(defaultChaining); - - } - - /** - * Build the chaining modes for all configured trust anchors. - * - * @return The mapping from trust anchors to chaining modes. - */ - public Map buildChainingModes() - { - Map chainingModes = new HashMap(); - NodeIterator trustIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_ANCHOR_XPATH); - - Element trustAnchorElem; - while ((trustAnchorElem = (Element) trustIter.nextNode()) != null) - { - IssuerAndSerial issuerAndSerial = buildIssuerAndSerial( - (Element)XPathUtils.selectSingleNode(trustAnchorElem, CONF + "Identification")); - String mode = getElementValue(trustAnchorElem, CONF + "Mode", null); - - if (issuerAndSerial != null) - { - chainingModes.put(issuerAndSerial, translateChainingMode(mode)); - } - } - - return chainingModes; - } - - /** - * Build an IssuerAndSerial from the DOM representation. - * - * @param root The root element (being of type dsig: - * X509IssuerSerialType. - * @return The issuer and serial number contained in the root - * element or null if could not be built for any reason. - */ - private IssuerAndSerial buildIssuerAndSerial(Element root) { - String issuer = getElementValue(root, ISSUER_XPATH, null); - String serial = getElementValue(root, SERIAL_XPATH, null); - - if (issuer != null && serial != null) { - try { - RFC2253NameParser nameParser = new RFC2253NameParser(issuer); - Principal issuerDN = nameParser.parse(); - - return new IssuerAndSerial(issuerDN, new BigInteger(serial)); - } catch (RFC2253NameParserException e) { - warn("config.16", new Object[] { issuer, serial }, e); - return null; - } catch (NumberFormatException e) { - warn("config.16", new Object[] { issuer, serial }, e); - return null; - } - } - return null; - } - - /** - * Translate the chaining mode from the configuration file to one used in the - * IAIK MOA API. - * - * @param chainingMode The chaining mode from the configuration. - * @return The chaining mode as provided by the ChainingModes - * interface. - * @see iaik.pki.pathvalidation.ChainingModes - */ - private String translateChainingMode(String chainingMode) { - if (chainingMode.equals(CM_CHAINING)) { - return ChainingModes.CHAIN_MODE; - } else if (chainingMode.equals(CM_PKIX)) { - return ChainingModes.PKIX_MODE; - } else { - return ChainingModes.PKIX_MODE; - } - } - - /** - * Build the distribution points mapping. - * - * @return The mapping from certificate authorities to distribution points. - */ - public Map buildDistributionPoints() - { - Map dPs = new HashMap(); - NodeIterator dPIter; - Element dPElem; - - // select all DistributionPoint elements - dPIter = XPathUtils.selectNodeIterator(getConfigElem(), DISTRIBUTION_POINTS_XPATH); - - // build the mapping of CA name to distribution points - while ((dPElem = (Element) dPIter.nextNode()) != null) { - String caIssuerDNText = getElementValue(dPElem, CONF + "CAIssuerDN", ""); - RFC2253NameParser nameParser = new RFC2253NameParser(caIssuerDNText); - NodeIterator cRLDPIter = XPathUtils.selectNodeIterator(dPElem, CONF + "CRLDP"); - NodeIterator oCSPDPPIter = XPathUtils.selectNodeIterator(dPElem, CONF + "OCSPDP"); - - try - { - String caIssuerDN = nameParser.parse().getName(); - - // check, if a mapping exists or make a new mapping - Set dPsForCA = (Set) dPs.get(caIssuerDN); - if (dPsForCA == null) - { - dPsForCA = new HashSet(); - dPs.put(caIssuerDN, dPsForCA); - } - - // add the CRL distribution points of this CA to the set - Element cRLDPElem; - while ((cRLDPElem = (Element) cRLDPIter.nextNode()) != null) - { - CRLDistributionPoint cRLDP = (CRLDistributionPoint) buildDistributionPoint(cRLDPElem, caIssuerDN); - dPsForCA.add(cRLDP); - } - - // add the OCSP distribution points of this CA to the set - Element oCSPPElem; - while ((oCSPPElem = (Element) oCSPDPPIter.nextNode()) != null) - { - OCSPDistributionPoint oCSPDP = (OCSPDistributionPoint) buildDistributionPoint(oCSPPElem, null); - dPsForCA.add(oCSPDP); - } -} - catch (RFC2253NameParserException e) - { - warn("config.13", new Object[] { caIssuerDNText }, e); - } - - } - - return dPs; - } - - /** - * Build a distribution point from the DOM representation. - * - * @param dpElem The root element of the distribution point. - * - * @param issuerName The name of the CA issuing the CRL referred to by this DP, or null - * if this DP refers to an OCSP responder. - * - * @return The distribution point. - */ - private DistributionPoint buildDistributionPoint(Element dpElem, String issuerName) - { - String uri = getElementValue(dpElem, CONF + "Location", null); - - if ("CRLDP".equals(dpElem.getLocalName())) - { - NodeIterator reasonCodesIter = XPathUtils.selectNodeIterator(dpElem, CONF + "ReasonCode"); - Element reasonCodeElem; - StringBuffer reasonCodesSB = new StringBuffer(); - while ((reasonCodeElem = (Element)reasonCodesIter.nextNode()) != null) - { - if (reasonCodesSB.length() > 0) reasonCodesSB.append(" "); - reasonCodesSB.append(getElementValue(reasonCodeElem, ".", "").trim()); - } - return new CRLDistributionPoint(issuerName, uri, reasonCodesSB.toString()); - } - else - { - return new OCSPDistributionPoint(uri); - } - } - - /** - * Return the CRL archive duration. - * - * @return The value of the CRL archive duration setting from the configuration, or 0 if - * no value is set in the configuration. - */ - public int getRevocationArchiveDuration() - { - String archiveDuration = getElementValue(getConfigElem(), CRL_ARCHIVE_DURATION_XPATH, null); - try - { - return Integer.parseInt(archiveDuration); - } - catch (NumberFormatException e) - { - warn("config.01", null); - return 365; - } - } - - /** - * Build the CreateTransformsInfoProfiles. - * - * @return The mapping from profile ID to profile. - */ - public Map buildCreateTransformsInfoProfiles() - { - return loadProfiles(CREATE_TRANSFORMS_INFO_PROFILE_XPATH, "CreateTransformsInfoProfile"); - } - - /** - * Build the CreateSignatureEnvironmentProfiles. - * - * @return The mapping from profile ID to profile. - */ - public Map buildCreateSignatureEnvironmentProfiles() - { - return loadProfiles(CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH, "CreateSignatureEnvironmentProfile"); - } - - /** - * Build the VerifyTransformsInfoProfiles. - * - * @return The mapping from profile ID to profile. - */ - public Map buildVerifyTransformsInfoProfiles() - { - return loadProfiles(VERIFY_TRANSFORMS_INFO_PROFILE_XPATH, "VerifyTransformsInfoProfile"); - } - - /** - * Build the SupplementProfiles. - * - * @return The mapping from profile ID to profile. - */ - public Map buildSupplementProfiles() - { - return loadProfiles(SUPPLEMENT_PROFILE_XPATH, "SupplementProfile"); - } - - /** - * Load a profile mapping. - * - * @param xpath The XPath to select the profiles from the configuration. - * - * @param profileRoot The name of the profile root element. - * - * @return Map The profile ID to profile mapping. - */ - private Map loadProfiles(String xpath, String profileRoot) - { - Map profiles = new HashMap(); - NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), xpath); - Element profileElem; - - while ((profileElem = (Element) profileIter.nextNode()) != null) - { - String id = getElementValue(profileElem, CONF + "Id", null); - String fileName = getElementValue(profileElem, CONF + "Location", null); - - if (profiles.containsKey(id)) - { - warn("config.04", new Object[] { profileRoot, id }); - } - else - { - try - { - File profileFile = new File(fileName); - - // make profileFile absolute - if (!profileFile.isAbsolute()) profileFile = new File(configRoot_, fileName); - - // load the profile - info("config.22", new Object[] { profileRoot, id, profileFile.getAbsoluteFile()}); - Element profile = loadProfile(profileFile); - - if (profile.getTagName().equals(profileRoot)) - { - profiles.put(id, profile); - } - else - { - warn("config.02", new Object[] { profileRoot, id, fileName }); - } - } catch (ConfigurationException e) { - warn("config.03", new Object[] { profileRoot, id }); - } - } - } - - return profiles; - } - - /** - * Load a profile from a file. - * - * @param root The absolute directory path of the main configuration file. - * @param profileFile The file containing the profile. - * @return The profile in its DOM representation. - * @throws ConfigurationException An error occurred loading the profile. - */ - private Element loadProfile(File profileFile) throws ConfigurationException { - - Element profile; - - try { - profile = parseXml(new FileInputStream(profileFile)); - } catch (Exception e) { - throw new ConfigurationException("config.12", null, e); - } - - return profile; - } - - /** - * Bulid 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 = new TrustProfile(id, trustAnchorsLocURI.toString(), signerCertsLocStr); - trustProfiles.put(id, profile); - } - - return trustProfiles; - } - - /** - * Returns the location of the certificate store. - * - * @return the location of the certificate store. - */ - public String getCertStoreLocation() - { - String certStoreLocStr = getElementValue(getConfigElem(), CERTSTORE_LOCATION_XPATH, null); - File certStoreLocFile; - - // No value specified in configuration file: Set it to a reasonable (absolute) default - if (certStoreLocStr == null) - return new File(configRoot_, "certstore").getAbsolutePath(); - - // Make cert store location an absolute value - certStoreLocFile = new File(certStoreLocStr); - if (!certStoreLocFile.isAbsolute()) - { - certStoreLocFile = new File(configRoot_, certStoreLocStr); - } - - // Check if cert store location exists, eventually try to create it - if (!certStoreLocFile.isDirectory()) - { - boolean created = false; - try - { - created = certStoreLocFile.mkdirs(); - } - finally - { - if (!created) - { - warn("config.32", new Object[] { certStoreLocFile.getAbsolutePath() }); - } - } - } - - return certStoreLocFile.getAbsolutePath(); - } - - // - // various utility methods - // - - /** - * Parse a configuration XML file. - * - * @param inputStream The stream from which to read the XML data. - * @return The DOM representation of the XML data. - * @throws ParserConfigurationException XML parser not configured properly. - * @throws SAXException An error parsing the XML file. - * @throws IOException An error reading the stream. - */ - private static Element parseXml(InputStream inputStream) - throws ParserConfigurationException, SAXException, IOException { - return DOMUtils - .parseDocument(inputStream, true, Constants.ALL_SCHEMA_LOCATIONS, null) - .getDocumentElement(); - } - - /** - * Return the value of an element located by an XPath. - * - * @param root The root element from which to evaluate the xpath. - * @param xpath The XPath pointing to the element. - * @param def The default value, if no element can be found with the given - * xpath. - * @return The element value or def, if the element cannot be - * found. - */ - private String getElementValue(Element root, String xpath, String def) { - - Element elem = (Element) XPathUtils.selectSingleNode(root, xpath); - return elem != null ? DOMUtils.getText(elem) : def; - } - - /** - * Return the value of an attribute located by an XPath. - * - * @param root The root element from which to evaluate the xpath. - * @param xpath The XPath pointing to the attribute. - * @param def The default value, if no attribute can be found with the given - * xpath. - * @return The element value or def, if the attribute cannot be - * found. - */ - private String getAttributeValue(Element root, String xpath, String def) { - Attr attr = (Attr) XPathUtils.selectSingleNode(root, xpath); - return attr != null ? attr.getValue() : def; - } - - /** - * Log an info 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 info(String messageId, Object[] parameters) { - MessageProvider msg = MessageProvider.getInstance(); - Logger.info(new LogMsg(msg.getMessage(messageId, parameters))); - } - - /** - * 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 warn(String messageId, Object[] args) { - MessageProvider msg = MessageProvider.getInstance(); - String txt = msg.getMessage(messageId, args); - - Logger.warn(new LogMsg(txt)); - warnings.add(txt); - } - - /** - * Log a warning. - * - * @param messageId The message ID. - * @param args Additional parameters for the message. - * @param t An exception being the cause of the warning. - * @see at.gv.egovernment.moa.spss.server.util.MessageProvider - */ - private void warn(String messageId, Object[] args, Throwable t) { - MessageProvider msg = MessageProvider.getInstance(); - String txt = msg.getMessage(messageId, args); - - Logger.warn(new LogMsg(txt), t); - warnings.add(txt); - } - - /** - * Returns whether revocation information should be archived. - * - * @return whether revocation information should be archived. - */ - public boolean getEnableRevocationArchiving() - { - String enableArchiving = getElementValue(getConfigElem(), ENABLE_ARCHIVING_XPATH, null); - return Boolean.valueOf(enableArchiving).booleanValue(); - } - - /** - * Returns the JDBC URL for the revocation archive database. - * - * @return the JDBC URL for the revocation archive database, or nullnullConfiguration data is read from an XML file, whose location is given by - * the moa.spss.server.configuration system property.

- *

This class implements the Singleton pattern. The reload() - * method can be used to update the configuration data. Therefore, it is not - * guaranteed that consecutive calls to getInstance() will return - * the same ConfigurationProvider all the time. During the - * processing of a web service request, the current - * TransactionContext should be used to obtain the - * ConfigurationProvider local to that request.

- * - * @author Patrick Peck - * @author Sven Aigner - * @version $Id$ - */ -public class ConfigurationProvider -{ - /** - * The name of the system property which contains the file name of the - * configuration file. - */ - public static final String CONFIG_PROPERTY_NAME = - "moa.spss.server.configuration"; - - /** - * A fake IssuerAndSerial object for storing KeyGroup information - * accessible by all clients. - */ - private static final IssuerAndSerial ANONYMOUS_ISSUER_SERIAL = - new IssuerAndSerial(new Name(), new BigInteger("0")); - - /** Singleton instance. null, if none has been created. */ - private static ConfigurationProvider instance; - - // - // configuration data - // - - /** The warnings generated when building the configuration. */ - private List warnings = new ArrayList(); - - /** The default digest method algorithm name */ - private String digestMethodAlgorithmName; - - /** The default canonicalization algorithm name */ - private String canonicalizationAlgorithmName; - - /** - * A List of HardwareCryptoModule objects for - * configuring hardware modules. - */ - private List hardwareCryptoModules; - - /** - * A List of HardwareKey objects containing the - * configuration data for hardware keys. - */ - private List hardwareKeyModules; - - /** - * A List of SoftwareKey objects containing the - * configuration data for software keys. - */ - private List softwareKeyModules; - - /** - * A Map which contains a KeyGroupId (a String) to - * KeyGroup mapping. - */ - private Map keyGroups; - - /** - * A Map which contains the IssuerAndSerial to - * KeyGroup mapping. - */ - private Map keyGroupMappings; - - /** The default chaining mode. */ - private String defaultChainingMode; - - /** - * A Map which contains the IssuerAndSerial to - * chaining mode (a String) mapping. - */ - private Map chainingModes; - - /** - * A Map which contains the CAIssuerDN (a String) - * to distribution points (a Set of - * DistributionPoints) mapping. - */ - private Map distributionPoints; - - /** - * The CRL archive duration. - */ - private int cRLArchiveDuration; - - /** - * Indicates whether revocation information should be archived. - */ - private boolean enableRevocationArchiving_; - - /** - * The location of the certificate store. - */ - private String certStoreLocation_; - - /** - * A Map which contains a mapping from - * CreateSignatureEnvironmentProfile Ids (String) to - * CreateSignatureEnvironmentProfile elements (an Element). - */ - private Map createSignatureEnvironmentProfiles; - - /** - * A Map which contains a mapping from - * CreateTransformsInfoProfile Ids (String) to - * CreateTransformsInfoProfile elements (an Element). - */ - private Map createTransformsInfoProfiles; - - /** - * A Map which contains a mapping from - * VerifyTransformsInfoProfile Ids (String) to - * VerifyTransformsInfoProfile elements (an Element). - */ - private Map verifyTransformsInfoProfiles; - - /** - * A Map which contains a mapping from - * SupplementProfile Ids (String) to SupplementProfile elements - * (an Element). - */ - private Map supplementProfiles; - - /** - * A Map which contains a TrustProfile Id (a String - * to trust profile (a TrustProfile) mapping. - */ - private Map trustProfiles; - - /** - * The JDBC URL for the revocation archive database. - */ - private String revocationArchiveJDBCURL_; - - /** - * The JDBC driver class name for the revocation archive database. - */ - private String revocationArchiveJDBCDriverClass_; - - /** - * Indicates whether revocation checking should be done. - */ - private boolean enableRevocationChecking_; - - /** - * The maximum age of a revocation information for considering it still as valid. - */ - private long maxRevocationAge_; - - /** - * The service order for revocation checking. - */ - private String[] serviceOrder_; - - /** - * Indicates whether certificates found during certificate path construction - * should be added to the certificate store. - */ - private boolean autoAddCertificates_; - - /** - * Indicates whether the certificate extension Authority Info Access should - * be used during certificate path construction. - */ - private boolean useAuthorityInfoAccess_; - - /** - * Return the single instance of configuration data. - * - * @return MOAConfigurationProvider The current configuration data. - * @throws ConfigurationException Failure to load the configuration data. - */ - public static synchronized ConfigurationProvider getInstance() - throws ConfigurationException { - - if (instance == null) { - reload(); - } - return instance; - } - - /** - * Reload the configuration data and set it if successful. - * - * @return MOAConfigurationProvider The loaded configuration data. - * @throws ConfigurationException Failure to load the configuration data. - */ - public static synchronized ConfigurationProvider reload() - throws ConfigurationException { - String fileName = System.getProperty(CONFIG_PROPERTY_NAME); - - if (fileName == null) { - // find out where we are running and use the configuration provided - // under WEB-INF/conf/moa-spss/MOA-SPSSConfiguration - URL url = ConfigurationProvider.class.getResource("/"); - fileName = - new File(url.getPath()).getParent() - + "/conf/moa-spss/MOA-SPSSConfiguration.xml"; - info("config.05", new Object[] { CONFIG_PROPERTY_NAME }); - } - - instance = new ConfigurationProvider(fileName); - return instance; - } - - /** - * Constructor for ConfigurationProvider. - * - * @param fileName The name of the configuration file. - * @throws ConfigurationException An error occurred loading the configuration. - */ - public ConfigurationProvider(String fileName) throws ConfigurationException { - load(fileName); - } - - /** - * Load the configuration data from XML file with the given name and build - * the internal data structures representing the MOA configuration. - * - * @param fileName The name of the XML file to load. - * @throws ConfigurationException The MOA configuration could not be - * read/built. - */ - private void load(String fileName) throws ConfigurationException { - FileInputStream stream = null; - File configFile; - File configRoot; - Element configElem; - ConfigurationPartsBuilder builder; - List allKeyModules; - - - // load the main config file - try { - configFile = new File(fileName); - configRoot = new File(configFile.getParent()); - info("config.21", new Object[] { configFile.getAbsoluteFile()}); - stream = new FileInputStream(fileName); - configElem = DOMUtils.parseXmlValidating(new FileInputStream(fileName)); - } catch (Throwable t) { - throw new ConfigurationException("config.10", null, t); - } - - // build the internal datastructures - try { - builder = new ConfigurationPartsBuilder(configElem, configRoot); - digestMethodAlgorithmName = builder.getDigestMethodAlgorithmName(); - canonicalizationAlgorithmName = - builder.getCanonicalizationAlgorithmName(); - hardwareCryptoModules = builder.buildHardwareCryptoModules(); - hardwareKeyModules = - builder.buildHardwareKeyModules(Collections.EMPTY_LIST); - softwareKeyModules = - builder.buildSoftwareKeyModules(hardwareKeyModules); - allKeyModules = new ArrayList(hardwareKeyModules); - allKeyModules.addAll(softwareKeyModules); - keyGroups = builder.buildKeyGroups(allKeyModules); - keyGroupMappings = - builder.buildKeyGroupMappings(keyGroups, ANONYMOUS_ISSUER_SERIAL); - defaultChainingMode = builder.getDefaultChainingMode(); - chainingModes = builder.buildChainingModes(); - useAuthorityInfoAccess_ = builder.getUseAuthorityInfoAccess(); - autoAddCertificates_ = builder.getAutoAddCertificates(); - trustProfiles = builder.buildTrustProfiles(); - distributionPoints = builder.buildDistributionPoints(); - enableRevocationChecking_ = builder.getEnableRevocationChecking(); - maxRevocationAge_ = builder.getMaxRevocationAge(); - serviceOrder_ = builder.getServiceOrder(); - enableRevocationArchiving_ = builder.getEnableRevocationArchiving(); - cRLArchiveDuration = builder.getRevocationArchiveDuration(); - revocationArchiveJDBCURL_ = builder.getRevocationArchiveJDBCURL(); - revocationArchiveJDBCDriverClass_ = builder.getRevocationArchiveJDBCDriverClass(); - certStoreLocation_ = builder.getCertStoreLocation(); - createTransformsInfoProfiles = builder.buildCreateTransformsInfoProfiles(); - createSignatureEnvironmentProfiles = builder.buildCreateSignatureEnvironmentProfiles(); - verifyTransformsInfoProfiles = builder.buildVerifyTransformsInfoProfiles(); - supplementProfiles = builder.buildSupplementProfiles(); - warnings = new ArrayList(builder.getWarnings()); - } catch (Throwable t) { - throw new ConfigurationException("config.11", null, t); - } finally { - try { - if (stream != null) { - stream.close(); - } - } catch (IOException e) { - // don't complain about this - } - } - } - - /** - * Returns the warnings encountered during building the configuration. - * - * @return A List of Strings, containing the - * warning messages. - */ - public List getWarnings() { - return warnings; - } - - /** - * Return the name of the digest algorithm used during signature creation. - * - * @return The digest method algorithm name, or an empty String, - * if none has been configured. - */ - public String getDigestMethodAlgorithmName() { - return digestMethodAlgorithmName; - } - - /** - * Return the name of the canonicalization algorithm used during signature - * creation. - * - * @return The canonicalization algorithm name, or an empty - * String if none has been configured. - */ - public String getCanonicalizationAlgorithmName() { - return canonicalizationAlgorithmName; - } - - /** - * Return the configured hardware crypto modules. - * - * @return A List of HardwareCryptoModule objects - * containing the hardware crypto module configurations. - */ - public List getHardwareCryptoModules() { - return hardwareCryptoModules; - } - - /** - * Return the hardware key modules configuration. - * - * @return A List of HardwareKeyModule objects - * containing the configuration of the hardware key modules. - */ - public List getHardwareKeyModules() { - return hardwareKeyModules; - } - - /** - * Return the software key module configuration. - * - * @return A List of SoftwareKeyModule objects - * containing the configuration of the software key modules. - */ - public List getSoftwareKeyModules() { - return softwareKeyModules; - } - - /** - * Return the key group mapping. - * - * @return A mapping from key group ID (a String) to - * KeyGroup mapping. - */ - public Map getKeyGroups() { - return keyGroups; - } - - /** - * Return the set of KeyGroupEntrys of a given key group, which a - * client (identified by an issuer/serial pair) may access. - * - * @param issuer The issuer of the client certificate. - * @param serial The serial number of the client certificate. - * @param keyGroupId The ID of the key group. - * @return A Set of all the KeyGroupEntrys in the - * given key group, if the user may access them. Returns null, if - * the user may not access the given key group or if the key group does not - * exist. - */ - public Set getKeyGroupEntries( - Principal issuer, - BigInteger serial, - String keyGroupId) { - - IssuerAndSerial issuerAndSerial; - Map mapping; - - if (issuer == null && serial == null) { - issuerAndSerial = ANONYMOUS_ISSUER_SERIAL; - } else { - issuerAndSerial = new IssuerAndSerial(issuer, serial); - } - - mapping = (Map) keyGroupMappings.get(issuerAndSerial); - if (mapping != null) { - KeyGroup keyGroup = (KeyGroup) mapping.get(keyGroupId); - - if (keyGroup != null) { - return keyGroup.getKeyGroupEntries(); - } - } - - // If no key group is available for a client identified by a certificate, - // try to find a key group in the anonymous key group mapping - if (issuer != null || serial != null) - { - mapping = (Map) keyGroupMappings.get(ANONYMOUS_ISSUER_SERIAL); - if (mapping != null) - { - KeyGroup keyGroup = (KeyGroup) mapping.get(keyGroupId); - if (keyGroup != null) return keyGroup.getKeyGroupEntries(); - } - } - - return null; - } - - /** - * Return the chaining mode for a given trust anchor. - * - * @param trustAnchor The trust anchor for which the chaining mode should be - * returned. - * @return The chaining mode for the given trust anchor. If the trust anchor - * has not been configured separately, the system default will be returned. - */ - public String getChainingMode(X509Certificate trustAnchor) { - Principal issuer = trustAnchor.getIssuerDN(); - BigInteger serial = trustAnchor.getSerialNumber(); - IssuerAndSerial issuerAndSerial = new IssuerAndSerial(issuer, serial); - - String mode = (String) chainingModes.get(issuerAndSerial); - return mode != null ? mode : defaultChainingMode; - } - - /** - * Return the distribution points for a given CA. - * - * @param cert The certificate for which the distribution points should be - * looked up. The issuer information is used to perform the lookup. - * - * @return A Set of DistributionPoint objects. The - * set will be empty, if no distribution points have been configured - * for this certificate. - */ - public Set getDistributionPoints(X509Certificate cert) - { - try { - RFC2253NameParser nameParser = - new RFC2253NameParser(cert.getIssuerDN().toString()); - String caIssuerDN = nameParser.parse().getName(); - Set dps = (Set) distributionPoints.get(caIssuerDN); - - if (dps == null) { - return Collections.EMPTY_SET; - } - return dps; - } catch (RFC2253NameParserException e) { - return Collections.EMPTY_SET; - } - } - - /** - * Return the CRL archive duration. - * - * @return The duration of how long to keep CRL archive entries (measured in - * days). - */ - public int getCRLArchiveDuration() { - return cRLArchiveDuration; - } - - /** - * Returns whether revocation information should be archived. - * - * @return whether revocation information should be archived. - */ - public boolean getEnableRevocationArchiving() - { - return enableRevocationArchiving_; - } - - /** - * Returns the location of the certificate store. - * - * @return the location of the certificate store. - */ - public String getCertStoreLocation() - { - return certStoreLocation_; - } - - /** - * Return a CreateTransformsInfoProfile with the given ID. - * - * @param id The CreateTransformsInfoProfile ID. - * @return The CreateTransformsInfoProfile with the given - * ID or null, if none exists. - */ - public Element getCreateTransformsInfoProfile(String id) { - return (Element) createTransformsInfoProfiles.get(id); - } - - /** - * Return a CreateSignatureEnvironmentProfile with the given ID. - * - * @param id The CreateSignatureEnvironmentProfile ID. - * @return The CreateSignatureEnvironmentProfile with the given - * ID or null, if none exists. - */ - public Element getCreateSignatureEnvironmentProfile(String id) { - return (Element) createSignatureEnvironmentProfiles.get(id); - } - - /** - * Return a VerifyTransformsInfoProfile with the given ID. - * - * @param id The VerifyTransformsInfoProfile ID. - * @return The VerifyTransformsInfoProfile with the given ID or - * null, if none exists. - */ - public Element getVerifyTransformsInfoProfile(String id) { - return (Element) verifyTransformsInfoProfiles.get(id); - } - - /** - * Return a SupplementProfile with the given ID. - * - * @param id The SupplementProfile ID. - * @return The SupplementProfile with the given ID or - * null, if none exists. - */ - public Element getSupplementProfile(String id) { - return (Element) supplementProfiles.get(id); - } - - /** - * Return a TrustProfile with the given ID. - * - * @param id The TrustProfile ID. - * @return The TrustProfile with the given ID or - * null, if none exists. - */ - public TrustProfile getTrustProfile(String id) { - return (TrustProfile) trustProfiles.get(id); - } - - /** - * Log a warning. - * - * @param messageId The message ID. - * @param parameters Additional parameters for the message. - * @see at.gv.egovernment.moa.spss.server.util.MessageProvider - */ - private static void info(String messageId, Object[] parameters) { - MessageProvider msg = MessageProvider.getInstance(); - Logger.info(new LogMsg(msg.getMessage(messageId, parameters))); - } - - /** - * 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 warn(String messageId, Object[] args) { - MessageProvider msg = MessageProvider.getInstance(); - String txt = msg.getMessage(messageId, args); - - Logger.warn(new LogMsg(txt)); - warnings.add(txt); - } - - /** - * Returns the JDBC URL for the revocation archive database. - * - * @return the JDBC URL for the revocation archive database. - */ - public String getRevocationArchiveJDBCURL() - { - return revocationArchiveJDBCURL_; - } - - /** - * Returns the JDBC driver class name for the revocation archive database. - * - * @return the JDBC driver class name for the revocation archive database. - */ - public String getRevocationArchiveJDBCDriverClass() - { - return revocationArchiveJDBCDriverClass_; - } - - /** - * Returns whether revocation checking should be done. - * - * @return whether revocation checking should be done. - */ - public boolean getEnableRevocationChecking() - { - return enableRevocationChecking_; - } - - /** - * Returns the maximum age of a revocation information for considering it - * still as valid. - * - * @return the maximum age of a revocation information for considering it - * still as valid. - */ - public long getMaxRevocationAge() - { - return maxRevocationAge_; - } - - /** - * Returns the service order for revocation checking. - * - * @return the service order for revocation checking. Valid array entries are - * {@link RevocationSourceTypes#OCSP} and {@link RevocationSourceTypes#CRL}. - */ - public String[] getServiceOrder() - { - return serviceOrder_; - } - - /** - * Returns whether certificates found during certificate path construction - * should be added to the certificate store. - * - * @return whether certificates found during certificate path construction - * should be added to the certificate store. - */ - public boolean getAutoAddCertificates() - { - return autoAddCertificates_; - } - - /** - * Returns whether the certificate extension Authority Info Access should - * be used during certificate path construction. - * - * @return whether the certificate extension Authority Info Access should - * be used during certificate path construction. - */ - public boolean getUseAuthorityInfoAccess() - { - return useAuthorityInfoAccess_; - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java deleted file mode 100644 index 5c0646449..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -/** - * Abstract base class for distribution points. - * - * @author Gregor Karlinger - * @version $Id$ - * */ -public abstract class DistributionPoint implements iaik.pki.revocation.DistributionPoint -{ - /** - * The distribution point URI. - */ - private String uri_; - - /** - * Create a DistributionPoint with a URI. - * - * @param uri The URI of the distribution point. - */ - public DistributionPoint(String uri) - { - uri_ = uri; - } - - /** - * @see iaik.pki.revocation.DistributionPoint#getType() - */ - public abstract String getType(); - - /** - * @see iaik.pki.revocation.DistributionPoint#getUri() - */ - public String getUri() - { - return uri_; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java deleted file mode 100644 index 62e8d63a6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java +++ /dev/null @@ -1,60 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -/** - * Contains configuration data for a hardware crypto module. - * - * @author Patrick Peck - * @version $Id$ - */ -public class HardwareCryptoModule { - /** The name of the module. */ - private String name; - /** The slod ID of the module. */ - private String slotID; - /** The user PIN of the module. */ - private String userPIN; - - /** - * Create a new HardwareCryptoModule. - * - * @param name The name of this HardwareCryptoModule. - * @param slotID The slot ID of this HardwareCryptoModule. - * @param userPIN The user PIN to access this - * HardwareCryptoModule. - */ - public HardwareCryptoModule(String name, String slotID, String userPIN) { - this.name = name; - this.slotID = slotID; - this.userPIN = userPIN; - } - - /** - * Returns the name of this HardwareCryptoModule. - * - * @return The name of this HardwareCryptoModule. - */ - public String getName() { - return name; - } - - /** - * Returns the slot ID of this HardwareCryptoModule. - * - * @return The slot ID. - */ - public String getSlotID() { - return slotID; - } - - - /** - * Returns the user PIN of this HardwareCryptoModule. - * - * @return The user PIN used to access the module. - */ - public String getUserPIN() { - return userPIN; - } - - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java deleted file mode 100644 index 622c8d110..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java +++ /dev/null @@ -1,59 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -/** - * A class that contains information about a hardware key module. - * - * @author Patrick Peck - * @version $Id$ - */ -public class HardwareKeyModule extends KeyModule { - /** The name of the module. */ - private String name; - /** The slod ID of the module. */ - private String slotID; - /** The user PIN of the module. */ - private String userPIN; - - /** - * Create a new HardwareKey. - * - * @param id The key module ID. - * @param name The name of the key. - * @param slotID The slot ID of the key within the hardware module. May be - * null. - * @param userPIN The user PIN to access the key. - */ - public HardwareKeyModule(String id, String name, String slotID, String userPIN) { - super(id); - this.name = name; - this.slotID = slotID; - this.userPIN = userPIN; - } - - /** - * Return the name of this HardwareKey. - * - * @return The name of this HardwareKey. - */ - public String getName() { - return name; - } - - /** - * Return the slot ID of this HardwareKey. - * - * @return The slot ID of this HardwareKey. - */ - public String getSlotID() { - return slotID; - } - - /** - * Return the user PIN to access this HardwareKey. - * - * @return The user PIN to access this HardwareKey. - */ - public String getUserPIN() { - return userPIN; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java deleted file mode 100644 index 0814c90d6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java +++ /dev/null @@ -1,125 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import java.math.BigInteger; -import java.security.Principal; - -import iaik.asn1.structures.Name; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; - -/** - * A class containing the issuer and serial number of a certificate, which can - * be used to uniquely identify the certificate. - * - * The issuer is contained as an RFC2253 encoded String. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IssuerAndSerial { - - /** The issuer distinguished name. */ - private String issuerDN; - /** The certificate serial number. */ - private BigInteger serial; - - /** - * Create an IssuerAndSerial object. - * - * The name of the issuer is converted to RFC2253. If it cannot be parsed, the - * DN contained in the issuer is set. - * - * @param issuer The isser of a certificate. - * @param serial The serial number of the certificate. - */ - public IssuerAndSerial(Principal issuer, BigInteger serial) { - String issuerDN = null; - if (issuer instanceof Name) { - try { - issuerDN = ((Name)issuer).getRFC2253String(); - } catch (RFC2253NameParserException e) { - // do nothing - } - } - if (issuerDN == null) { - RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); - try { - issuerDN = ((Name)parser.parse()).getRFC2253String(); - } catch (RFC2253NameParserException e) { - issuerDN = issuer.getName(); - } - } - this.serial = serial; - this.issuerDN = issuerDN; - } - - /** - * Create an IssuerAndSerial object. - * - * @param issuerDN The issuer distinguished name. Should be an RFC2253 name. - * @param serial The serial number of the certificate. - */ - public IssuerAndSerial(String issuerDN, BigInteger serial) { - this.issuerDN = issuerDN; - this.serial = serial; - } - - /** - * Return the issuer DN in RFC2253 format. - * - * @return The issuer part of this object. - */ - public String getIssuerDN() { - return issuerDN; - } - - /** - * Return the serial number. - * - * @return The serial number of this object. - */ - public BigInteger getSerial() { - return serial; - } - - /** - * Compare this IssuerAndSerial to another object. - * - * @param other The object to compare this IssuerAndSerial to. - * @return true, if other is an - * IssuerAndSerial object and the issuer and - * serial fields are both equal. false otherwise. - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if (other instanceof IssuerAndSerial) { - IssuerAndSerial ias = (IssuerAndSerial) other; - return getIssuerDN().equals(ias.getIssuerDN()) - && getSerial().equals(ias.getSerial()); - } - return false; - } - - /** - * Return the hash code of this IssuerAndSerial. - * - * @return The hash code of this IssuerAndSerial. - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return issuerDN.hashCode() ^ serial.hashCode(); - } - - /** - * Return a String representation of this - * IssuerAndSerial object. - * - * @return The String representation. - * @see java.lang.Object#toString() - */ - public String toString() { - return ("(IssuerAndSerial - Issuer<" + getIssuerDN()) - + ("> Serial<" + serial.toString() + ">)"); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java deleted file mode 100644 index 5fd108e1a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java +++ /dev/null @@ -1,69 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import java.util.Iterator; -import java.util.Set; - -/** - * A collection of KeyGroupEntrys with its own ID. - * - * @author Sven Aigner - * @author Patrick Peck - * @version $Id$ - */ -public class KeyGroup { - - /** The keys belonging to this key group. */ - private Set keyGroupEntries; - /** The key group ID. */ - private String id; - - /** - * Create a KeyGroup. - * - * @param id The ID of this KeyGroup. - * @param keyGroupEntries The keys belonging to this KeyGroup. - */ - public KeyGroup(String id, Set keyGroupEntries) { - this.id = id; - this.keyGroupEntries = keyGroupEntries; - } - - /** - * Return the KeyEntrys contained in this KeyGroup. - * - * @return The KeyEntrys contained in this KeyGroup. - */ - public Set getKeyGroupEntries() { - return keyGroupEntries; - } - - /** - * Return the ID of this KeyGroup. - * - * @return The KeyGroup ID. - */ - public String getId() { - return id; - } - - /** - * Return a String representation of this KeyGroup. - * - * @return The String representation. - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer sb = new StringBuffer(); - Iterator i; - - if (getKeyGroupEntries() != null) { - i = getKeyGroupEntries().iterator(); - - while (i.hasNext()) { - sb.append(" " + i.next()); - } - } - return "(KeyGroup - ID:" + id + " " + sb.toString() + ")"; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java deleted file mode 100644 index 2e39d6aa3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java +++ /dev/null @@ -1,106 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import java.math.BigInteger; - -/** - * A class containing information about an entry in a key group. - * - * @author Patrick Peck - * @version $Id$ - */ -public class KeyGroupEntry { - /** The module ID of the key. */ - private String moduleID; - /** The issuer DN of the certificate identifying the key. */ - private String issuerDN; - /** The serial number of the certificate identifying the key. */ - private BigInteger serialNumber; - - /** - * Create a new KeyGroupEntry. - * - * @param moduleID The key module ID to which this entry belongs to. - * @param issuerAndSerial The issuer and serial number which uniquely - * identifies a certificate within the key module. - */ - public KeyGroupEntry(String moduleID, IssuerAndSerial issuerAndSerial) { - this.moduleID = moduleID; - this.issuerDN = issuerAndSerial.getIssuerDN(); - this.serialNumber = issuerAndSerial.getSerial(); - } - - /** - * Create a new KeyGroupEntry. - * - * @param moduleID The key module ID to which this entry belongs to. - * @param issuerDN The isser DN of the certificate within the key module. - * @param serialNumber The serial number of the certificate within the key - * module. - */ - public KeyGroupEntry( - String moduleID, - String issuerDN, - BigInteger serialNumber) { - this.moduleID = moduleID; - this.issuerDN = issuerDN; - this.serialNumber = serialNumber; - } - - /** - * Return the key module ID to which this KeyGroupEntry belongs - * to. - * - * @return The key module ID. - */ - public String getModuleID() { - return moduleID; - } - - /** - * Return the issuer DN of this KeyGroupEntry for identifying the - * certificate within the key module. - * - * @return The issuer DN of the certificate. - */ - public String getIssuerDN() { - return issuerDN; - } - - /** - * Return the serial number of this KeyGroupEntry for identifying - * the certificate within the key module. - * - * @return The serial number of the certificate. - */ - public BigInteger getSerialNumber() { - return serialNumber; - } - - /** - * Compare this KeyGroupEntry to another. - * - * @param other The KeyGroupEntry to compare to. - * @return true, if module ID, isser DN and serial number of - * other match the ones contained in this object, otherwise - * false. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof KeyGroupEntry) { - KeyGroupEntry entry = (KeyGroupEntry) other; - return getModuleID().equals(entry.getModuleID()) - && getIssuerDN().equals(entry.getIssuerDN()) - && getSerialNumber().equals(entry.getSerialNumber()); - } - return false; - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getModuleID().hashCode() - ^ getIssuerDN().hashCode() - ^ getSerialNumber().hashCode(); - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyModule.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyModule.java deleted file mode 100644 index 412516d82..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyModule.java +++ /dev/null @@ -1,41 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -/** - * A class that contains information about a key module. - * - * @author Patrick Peck - * @version $Id$ - */ -public class KeyModule { - - /** The key module ID. */ - private String id; - - /** - * Create a Key object. - * - * @param id The key module ID. - */ - public KeyModule(String id) { - this.id = id; - } - - /** - * Return the key ID. - * - * @return The key ID. - */ - public String getId() { - return id; - } - - /** - * Return a String representation of this Key. - * - * @return The String representation. - * @see java.lang.Object#toString() - */ - public String toString() { - return "(Key - Id<" + id + ">)"; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java deleted file mode 100644 index e4509ac97..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java +++ /dev/null @@ -1,33 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -import iaik.pki.revocation.RevocationSourceTypes; - -/** - * A class representing a CRL distribution point. - * - * @author Gregor Karlinger - * @version $Id$ - */ -public class OCSPDistributionPoint - extends DistributionPoint - implements iaik.pki.revocation.DistributionPoint -{ - /** - * Create a OCSPDistributionPoint with a URI. - * - * @param uri The URI of the ocsp distribution point. - */ - public OCSPDistributionPoint(String uri) - { - super(uri); - } - - /** - * @see iaik.pki.revocation.DistributionPoint#getType() - */ - public String getType() - { - return RevocationSourceTypes.OCSP; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java deleted file mode 100644 index 479e98ca5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java +++ /dev/null @@ -1,48 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -/** - * A class containing information about a software key, stored in PKCS12 format. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SoftwareKeyModule extends KeyModule { - /** The name of the file containing the keys. */ - private String fileName; - /** The password for accessing the file. */ - private String passWord; - - /** - * Create a new SoftwareKey. - * - * @param id The key ID. - * @param fileName The name of the PKCS12 keystore file containing the key. - * @param passWord The password to access the keystore file. - */ - public SoftwareKeyModule(String id, String fileName, String passWord) { - super(id); - this.fileName = fileName; - this.passWord = passWord; - } - - /** - * Return the name of the PKCS12 keystore file containing this - * SoftwareKey. - * - * @return The name of the PKCS12 keystore file. - */ - public String getFileName() { - return fileName; - } - - /** - * Return the password to access the keystore file. - * - * @return The password to access the keystore file. - */ - public String getPassWord() { - return passWord; - } - - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/TrustProfile.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/TrustProfile.java deleted file mode 100644 index 929d5ce2b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/config/TrustProfile.java +++ /dev/null @@ -1,58 +0,0 @@ -package at.gv.egovernment.moa.spss.server.config; - -/** - * Information about a trust profile. - * - * @author Patrick Peck - * @version $Id$ - */ -public class TrustProfile { - /** The ID of the trust profile. */ - private String id; - /** The URI giving the location of the trust profile. */ - private String uri; - /** The URI giving the location of the allowed signer certificates. */ - private String signerCertsUri; - - /** - * Create a TrustProfile. - * - * @param id The ID of the TrustProfile to create. - * @param uri The URI of the TrustProfile to create. - * @param signerCertsUri The URI of the location of the allowed signer - * certificates of the TrustProfile to create. - */ - public TrustProfile(String id, String uri, String signerCertsUri) { - this.id = id; - this.uri = uri; - this.signerCertsUri = signerCertsUri; - } - - /** - * Return the ID of this TrustProfile. - * - * @return The TrustProfile ID. - */ - public String getId() { - return id; - } - - /** - * Return the URI of this TrustProfile. - * - * @return The URI of TrustProfile. - */ - public String getUri() { - return uri; - } - - /** - * Return the URI giving the location of the allowed signer certificates - * of this TrustProfile. - * - * @return The URI of TrustProfile. - */ - public String getSignerCertsUri() { - return signerCertsUri; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java deleted file mode 100644 index eaee58d3f..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.cmsverify; - -import iaik.pki.PKIProfile; -import iaik.server.modules.cmsverify.CMSSignatureVerificationProfile; - -/** - * An implementation of the CMSSignatureVerificationProfile - * interface. - * - * @see iaik.server.modules.cmsverify.CMSSignatureVerificationProfile - * @author Patrick Peck - * @version $Id$ - */ -public class CMSSignatureVerificationProfileImpl - implements CMSSignatureVerificationProfile { - - /** The profile for validating the certificate. */ - private PKIProfile certificateValidationProfile; - - /** - * @see iaik.server.modules.cmsverify.CMSSignatureVerificationProfile#getCertificateValidationProfile() - */ - public PKIProfile getCertificateValidationProfile() { - return certificateValidationProfile; - } - - /** - * Sets the profile for validating the signer certificate. - * - * @param certificateValidationProfile The certificate validation profile to - * set. - */ - public void setCertificateValidationProfile(PKIProfile certificateValidationProfile) { - this.certificateValidationProfile = certificateValidationProfile; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java deleted file mode 100644 index 713891714..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.server.modules.keys.KeyModuleConfiguration; - -/** - * Base implementation class for the KeyModuleConfiguration - * interface and the interfaces derived from it. - * - * @see iaik.server.modules.keys.KeyModuleConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public abstract class AbstractKeyModuleConfigurationImpl - implements KeyModuleConfiguration { - - /** The module ID. */ - private String moduleID; - - /** - * Creata new AbstractKeyModuleConfigurationImpl. - * - * @param moduleID The key module ID of this - * KeyModuleConfiguration. - */ - public AbstractKeyModuleConfigurationImpl(String moduleID) { - this.moduleID = moduleID; - } - - /** - * @see iaik.server.modules.keys.KeyModuleConfiguration#getModuleID() - */ - public String getModuleID() { - return moduleID; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java deleted file mode 100644 index 88d53d6ad..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java +++ /dev/null @@ -1,48 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import iaik.pki.store.observer.NotificationData; -import iaik.pki.store.observer.Observable; -import iaik.pki.store.observer.Observer; - -/** - * A base class for observable configuration data. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class AbstractObservableConfiguration implements Observable { - - /** The observers registered with this Observable. */ - private List observers = new ArrayList(); - - /** - * @see iaik.pki.store.observer.Observable#addObserver(iaik.pki.store.observer.Observer) - */ - public void addObserver(Observer observer) { - observers.add(observer); - } - - /** - * @see iaik.pki.store.observer.Observable#removeObserver(iaik.pki.store.observer.Observer) - */ - public boolean removeObserver(Observer observer) { - return observers.remove(observer); - } - - /** - * @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData) - */ - public void notify(NotificationData data) { - Iterator iter = observers.iterator(); - - for (iter = observers.iterator(); iter.hasNext();) { - Observer observer = (Observer) iter.next(); - observer.notify(data); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java deleted file mode 100644 index bf56d437c..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.store.revocation.archive.ArchiveConfiguration; -import iaik.pki.store.revocation.archive.ArchiveParameter; -import iaik.pki.store.revocation.archive.ArchiveTypes; - -import java.sql.Driver; -import java.sql.DriverManager; -import java.util.Enumeration; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the ArchiveConfiguration interface - * using configuration data provided by the MOA configuration file. - * - * @see iaik.pki.store.revocation.archive.ArchiveConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class ArchiveConfigurationImpl - extends AbstractObservableConfiguration - implements ArchiveConfiguration { - - /** The configuration parameters of the archive. */ - private ArchiveParameter archiveParameters; - - /** - * Create a new ArchiveConfigurationImpl. - * - * @param config The MOA configuration from which the configuration data is being read. - */ - public ArchiveConfigurationImpl(ConfigurationProvider config) - { - String jdbcUrl = config.getRevocationArchiveJDBCURL(); - this.archiveParameters = new DataBaseArchiveParameterImpl(jdbcUrl); - - // Register JDBC driver class - if (jdbcUrl != null) - { - String jdbcDriverClass = config.getRevocationArchiveJDBCDriverClass(); - try - { - Class.forName(jdbcDriverClass); - } - catch (ClassNotFoundException e) - { - // TODO 20030709 GK Improve exception handling - throw new RuntimeException("JDBC driver class \"" + jdbcDriverClass + " could not be found."); - } - - Enumeration regDrivers = DriverManager.getDrivers(); - boolean isRegistered = false; - while (regDrivers.hasMoreElements()) - { - Object currentDriver = regDrivers.nextElement(); - if (jdbcDriverClass.equals(currentDriver.getClass().getName())) isRegistered = true; - } - if (!isRegistered) - { - // Workaround for a driver which does not register itselve at invocation of Class.forName(drvname) - try - { - DriverManager.registerDriver((Driver)Class.forName(jdbcDriverClass).newInstance()); - } - catch (Exception e) - { - // TODO 20030709 GK Improve exception handling - throw new RuntimeException("Registering JDBC driver \"" + jdbcDriverClass + " failed."); - } - } - } - } - - /** - * Return the type of archive. - * - * This will always return ArchiveTypes.DATABASE. - * @return ArchiveTypes.DATABASE. - * @see iaik.pki.store.revocation.archive.ArchiveConfiguration#getType() - */ - public String getType() { - return ArchiveTypes.DATABASE; - } - - /** - * Return the ArchiveParameters describing this - * ArchiveConfiguration. - * - * @return The archive parameters. - * @see iaik.pki.store.revocation.archive.ArchiveConfiguration#getArchiveParameters() - */ - public ArchiveParameter getArchiveParameters() { - return archiveParameters; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java deleted file mode 100644 index 71b8680c8..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java +++ /dev/null @@ -1,69 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.logging.TransactionId; -import iaik.pki.revocation.RevocationSourceTypes; -import iaik.pki.store.revocation.RevocationInfoRetriever; -import iaik.pki.store.revocation.RevocationSource; -import iaik.pki.store.revocation.RevocationStoreException; -import iaik.pki.ldap.Handler; - -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLStreamHandler; -import java.util.Collection; -import java.util.Date; - -import at.gv.egovernment.moa.logging.Logger; - -/** - * A customized implementation of {@link iaik.pki.store.revocation.RevocationInfoRetriever}. Will be used - * instead of the default implementation {@link iaik.pki.store.revocation.CRLRetriever} to overcome a - * classloader problem in connection with the {@link java.net.URL} class in a Tomcat deployment environment. - * - * @author Gregor Karlinger - * @version $$ - */ -public class CRLRetriever implements RevocationInfoRetriever -{ - public void update(RevocationSource source, Collection supplementalRequestData, TransactionId tid) - throws RevocationStoreException - { - if (source == null) - { - throw new NullPointerException("RevocationSource parameter mustn't be null."); - } - Logger.info("Downloading crl from " + source.getUri()); - if (!source.getType().equals(RevocationSourceTypes.CRL)) - { - throw new RevocationStoreException( - source.getType() + " not supported", - null, - getClass().getName() + ":1"); - } - try - { - URL crlUrl; - try - { - crlUrl = new URL(source.getUri()); - } - catch (MalformedURLException e) - { - // Workaround for classloader problem with deployment in Tomcat 4.1 - URLStreamHandler handler = new Handler(); - crlUrl = new URL(null, source.getUri(), handler); - } - - InputStream crlInputStream = crlUrl.openStream(); - source.readFrom(crlInputStream, tid); - source.setDownloadTime(new Date()); - crlInputStream.close(); - } - catch (Exception iox) - { - Logger.warn("Cannot retrieve crl", iox); - throw new RevocationStoreException("Cannot retrieve CRL", iox, getClass().getName() + ":1"); - } - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java deleted file mode 100644 index e6e084e11..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.store.certstore.CertStoreConfiguration; -import iaik.pki.store.certstore.CertStoreParameters; -import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the CertStoreConfiguration interface based - * on MOA configuration data. - * - * @see iaik.pki.store.certstore.CertStoreConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class CertStoreConfigurationImpl - extends AbstractObservableConfiguration - implements CertStoreConfiguration { - - /** The configuration parameters of the CertStore. */ - private CertStoreParameters[] parameters; - - /** - * Create a new CertStoreConfigurationImpl. - * - * @param config The MOA configuration from which the configuration data is - * being read. - */ - public CertStoreConfigurationImpl(ConfigurationProvider config) - { - String certStoreRoot = config.getCertStoreLocation(); - - DirectoryCertStoreParameters dirParameters = new DirectoryCertStoreParametersImpl( - "MOA Directory CertStore", - certStoreRoot, - true, - false); - - parameters = new CertStoreParameters[] { dirParameters }; - } - - /** - * @see iaik.pki.store.certstore.CertStoreConfiguration#getParameters() - */ - public CertStoreParameters[] getParameters() { - return parameters; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java deleted file mode 100644 index 7aa4cbe4b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import iaik.logging.LoggerConfig; -import iaik.pki.PKIConfiguration; -import iaik.server.ConfigurationData; - -import at.gv.egovernment.moa.spss.server.config.HardwareCryptoModule; -import at.gv.egovernment.moa.spss.server.config.HardwareKeyModule; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.SoftwareKeyModule; - -/** - * An implementation of the ConfigurationData interface using - * MOA configuration data. - * - * @see iaik.server.ConfigurationData - * @author Patrick Peck - * @version $Id$ - */ -public class ConfigurationDataImpl implements ConfigurationData { - /** PKI configuration data. */ - private PKIConfiguration pkiConfiguration; - /** Crypto modules configuration data. */ - private List cryptoModuleConfigurations; - /** Key modules configuration data. */ - private List keyModuleConfigurations; - /** Logging configuration data. */ - private LoggerConfig loggerConfig; - - /** - * Create a new ConfigurationDataImpl. - * - * @param config The underlying MOA configuration data. - */ - public ConfigurationDataImpl(ConfigurationProvider config) { - this.pkiConfiguration = new PKIConfigurationImpl(config); - this.cryptoModuleConfigurations = buildCryptoModuleConfigurations(config); - this.keyModuleConfigurations = buildKeyModuleConfigurations(config); - this.loggerConfig = new LoggerConfigImpl(); - } - - /** - * Build the list of CryptoModuleConfigurations. - * - * @param config The underlying MOA configuration data. - * @return The list of CryptoModuleConfigurations configured in - * the MOA configuration. - */ - private List buildCryptoModuleConfigurations(ConfigurationProvider config) { - List modules = new ArrayList(); - Iterator iter = config.getHardwareCryptoModules().iterator(); - - while (iter.hasNext()) { - HardwareCryptoModule module = (HardwareCryptoModule) iter.next(); - modules.add(new HardwareCryptoModuleConfigurationImpl(module)); - } - - return modules; - } - - /** - * Build the list of KeyModuleConfigurations. - * - * @param config The underlying MOA configuration data. - * @return The list of KeyModuleConfigurations configured in the - * MOA configuration. - */ - private List buildKeyModuleConfigurations(ConfigurationProvider config) { - List keys = new ArrayList(); - Iterator iter; - - // add the hardware keys - iter = config.getHardwareKeyModules().iterator(); - while (iter.hasNext()) { - HardwareKeyModule key = (HardwareKeyModule) iter.next(); - keys.add(new HardwareKeyModuleConfigurationImpl(key)); - } - - // add the software keys - iter = config.getSoftwareKeyModules().iterator(); - while (iter.hasNext()) { - SoftwareKeyModule key = (SoftwareKeyModule) iter.next(); - keys.add(new SoftwareKeyModuleConfigurationImpl(key)); - } - - return keys; - } - - /** - * @see iaik.server.ConfigurationData#getPKIConfiguration() - */ - public PKIConfiguration getPKIConfiguration() { - return pkiConfiguration; - } - - /** - * @see iaik.server.ConfigurationData#getCryptoModuleConfigurations() - */ - public List getCryptoModuleConfigurations() { - return cryptoModuleConfigurations; - } - - /** - * @see iaik.server.ConfigurationData#getKeyModuleConfigurations() - */ - public List getKeyModuleConfigurations() { - return keyModuleConfigurations; - } - - /** - * @see iaik.server.ConfigurationData#getLoggerConfig() - */ - public LoggerConfig getLoggerConfig() { - return loggerConfig; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java deleted file mode 100644 index d67523944..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter; - -/** - * An implementation of the DataBaseArchiveParameter interface. - * - * @see iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter - * @author Patrick Peck - * @version $Id$ - */ -public class DataBaseArchiveParameterImpl implements DataBaseArchiveParameter { - - /** The JDBC URL for accessing the archive. */ - private String jDBCUrl; - - /** - * Create a new DataBaseArchiveParameterImpl. - * - * @param jDBCUrl The JDBC URL of the archive. - */ - public DataBaseArchiveParameterImpl(String jDBCUrl) { - this.jDBCUrl = jDBCUrl; - } - - /** - * @see iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter#getJDBCUrl() - */ - public String getJDBCUrl() { - return jDBCUrl; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java deleted file mode 100644 index 2b00d6766..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.store.certstore.CertStoreTypes; -import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; - -/** - * An implementation of the DirectoryCertStoreParameters interface. - * - * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters - * @author Patrick Peck - * @version $Id$ - */ -public class DirectoryCertStoreParametersImpl - implements DirectoryCertStoreParameters { - - /** The root directory of the CertStore. */ - private String rootDirectory; - /** Whether a new directory may be created. */ - private boolean createNew; - /** The CertStore ID. */ - private String id; - /** Whether the CertStore is read-only. */ - private boolean readOnly; - - /** - * Create a new DirectoryCertStoreParameterImpl. - * - * @param id The CertStore ID. - * @param rootDirectory The root directory of the CertStore. - * @param createNew Whether a new directory may be created. - * @param readOnly Whether the CertStore is read-only. - */ - public DirectoryCertStoreParametersImpl( - String id, - String rootDirectory, - boolean createNew, - boolean readOnly) { - - this.id = id; - this.rootDirectory = rootDirectory; - this.createNew = createNew; - this.readOnly = readOnly; - } - - /** - * @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 createNew; - } - - /** - * @see iaik.pki.store.certstore.CertStoreParameters#getId() - */ - public String getId() { - return id; - } - - /** - * @see iaik.pki.store.certstore.CertStoreParameters#isReadOnly() - */ - public boolean isReadOnly() { - return readOnly; - } - - /** - * @return CertStoreTypes.DIRECTORY - * @see iaik.pki.store.certstore.CertStoreParameters#getType() - */ - public String getType() { - return CertStoreTypes.DIRECTORY; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java deleted file mode 100644 index 3c8f4c002..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.server.modules.crypto.HardwareCryptoModuleConfiguration; - -import at.gv.egovernment.moa.spss.server.config.HardwareCryptoModule; - -/** - * An implementation of the HardwareCryptoModuleConfiguration - * wrapping a HardwareCryptoModule from the MOA configuration. - * - * @author Patrick Peck - * @version $Id$ - */ -public class HardwareCryptoModuleConfigurationImpl - implements HardwareCryptoModuleConfiguration { - - /** The wrapped HardwareCryptoModule. */ - private HardwareCryptoModule module; - - /** - * Create a new HardwareCryptoModuleConfigurationImpl. - * - * @param module The HardwareCryptoModule from the underlying MOA - * configuration. - */ - public HardwareCryptoModuleConfigurationImpl(HardwareCryptoModule module) { - this.module = module; - } - - /** - * @see iaik.server.modules.crypto.HardwareCryptoModuleConfiguration#getModuleName() - */ - public String getModuleName() { - return module.getName(); - } - - /** - * @see iaik.server.modules.crypto.HardwareCryptoModuleConfiguration#getSlotID() - */ - public String getSlotID() { - return module.getSlotID(); - } - - /** - * @see iaik.server.modules.crypto.HardwareCryptoModuleConfiguration#getUserPIN() - */ - public char[] getUserPIN() { - return module.getUserPIN().toCharArray(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java deleted file mode 100644 index d905588c6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.server.modules.keys.HardwareKeyModuleConfiguration; - -import at.gv.egovernment.moa.spss.server.config.HardwareKeyModule; - -/** - * An implementation of the HardwareKeyModuleConfiguration - * interface wrapping a HardwareKeyModule from the MOA - * configuration. - * - * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class HardwareKeyModuleConfigurationImpl - extends AbstractKeyModuleConfigurationImpl - implements HardwareKeyModuleConfiguration { - - /** The wrapped HardwareKeyModule. */ - private HardwareKeyModule keyModule; - - /** - * Create a new HardwareKeyModuleConfigurationImpl. - * - * @param keyModule The HardwareKeyModule from the underlying - * MOA configuration. - */ - public HardwareKeyModuleConfigurationImpl(HardwareKeyModule keyModule) { - super(keyModule.getId()); - this.keyModule = keyModule; - } - - /** - * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration#getModuleName() - */ - public String getModuleName() { - return keyModule.getName(); - } - - /** - * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration#getSlotID() - */ - public String getSlotID() { - return keyModule.getSlotID(); - } - - /** - * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration#getUserPIN() - */ - public char[] getUserPIN() { - return keyModule.getUserPIN().toCharArray(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java deleted file mode 100644 index 2508b7946..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java +++ /dev/null @@ -1,173 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import iaik.pki.revocation.RevocationSourceTypes; -import iaik.pki.store.revocation.RevocationFactory; -import iaik.pki.store.revocation.RevocationSourceStore; -import iaik.pki.store.truststore.TrustStoreFactory; -import iaik.server.ConfigurationData; -import iaik.server.Configurator; -import iaik.server.modules.keys.KeyEntryID; -import iaik.server.modules.keys.KeyModule; -import iaik.server.modules.keys.KeyModuleFactory; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.KeyGroup; -import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry; -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * A class responsible for configuring the IAIK MOA modules. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IaikConfigurator { - - /** The warnings encountered during configuration. */ - private List warnings = new ArrayList(); - - /** - * Configure the IAIK MOA subsystem. - * - * - * @param moaConfig The underlying MOA configuration. - * @throws ConfigurationException An error occurred configuring the IAIK - * MOA subsystem. - */ - public void configure(ConfigurationProvider moaConfig) - throws ConfigurationException { - ConfigurationData configData = new ConfigurationDataImpl(moaConfig); - - warnings = new ArrayList(); - - try { - TransactionId transId = new TransactionId("IaikConfigurator"); - Configurator.init(configData, transId); - - // Set customized CRL retriever to overcome a classloader problem when MOA is deployed in Tomcat - RevocationSourceStore rss = RevocationFactory.getInstance(transId).getRevocationSourceStore(); - rss.setRetriever(new CRLRetriever(), RevocationSourceTypes.CRL); - if ((moaConfig.getSoftwareKeyModules().size() > 0) || (moaConfig.getHardwareKeyModules().size() > 0)) { - dumpKeyEntryIDs(); - } - checkKeyGroupConfig(moaConfig); - TrustStoreFactory.reset(); - } catch (iaik.server.ConfigurationException e) { - throw new ConfigurationException("config.08", null, e); - } catch (Throwable t) { - throw new ConfigurationException("config.08", null, t); - } - } - - /** - * Return the warnings encountered during configuration. - * - * @return The warnings. - */ - public List getWarnings() { - return warnings; - } - - /** - * Dump all KeyEntryIDs contained in the configured - * KeyModules to the log file. - */ - private void dumpKeyEntryIDs() { - MessageProvider msg = MessageProvider.getInstance(); - KeyModule module = KeyModuleFactory.getInstance(new TransactionId("dump")); - Set keyEntryIds = module.getPrivateKeyEntryIDs(); - Iterator iter; - - for (iter = keyEntryIds.iterator(); iter.hasNext();) { - KeyEntryID keyEntryId = (KeyEntryID) iter.next(); - Logger.info( - new LogMsg(msg.getMessage("config.19", new Object[] { keyEntryId }))); - } - } - - /** - * Check that each key group entry in each key group can be resolved to a - * KeyEntryID. - * - * Logs a warning for each key group entry that cannot be resolved. - * - * @param moaConfig The MOA configuration to check. - */ - private void checkKeyGroupConfig(ConfigurationProvider moaConfig) { - Map keyGroups = moaConfig.getKeyGroups(); - Iterator iter; - - for (iter = keyGroups.values().iterator(); iter.hasNext();) { - KeyGroup keyGroup = (KeyGroup) iter.next(); - Set keyGroupEntries = keyGroup.getKeyGroupEntries(); - Iterator kgIter; - - for (kgIter = keyGroupEntries.iterator(); kgIter.hasNext();) { - KeyGroupEntry entry = (KeyGroupEntry) kgIter.next(); - - if (!findKeyEntryID(entry)) { - warn( - "config.31", - new Object[] { - keyGroup.getId(), - entry.getModuleID(), - entry.getIssuerDN(), - entry.getSerialNumber()}); - } - } - } - } - - /** - * Find out that a certain KeyGroupEntry could be resolved to a KeyEntryID - * by the Configurator. - * - * @param keyGroupEntry The key group entry to find. - * @return true, if the keyGroupEntry could be - * resolved to a KeyEntryID; otherwise false. - */ - private boolean findKeyEntryID(KeyGroupEntry keyGroupEntry) { - KeyModule module = KeyModuleFactory.getInstance(new TransactionId("check")); - Set keyEntryIDs = module.getPrivateKeyEntryIDs(); - Iterator iter; - - for (iter = keyEntryIDs.iterator(); iter.hasNext();) { - KeyEntryID entry = (KeyEntryID) iter.next(); - - if (entry.getCertificateIssuer().equals(keyGroupEntry.getIssuerDN()) - && entry.getCertificateSerialNumber().equals( - keyGroupEntry.getSerialNumber()) - && entry.getModuleID().equals(keyGroupEntry.getModuleID())) { - return true; - } - } - - return false; - } - - /** - * 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 warn(String messageId, Object[] args) { - MessageProvider msg = MessageProvider.getInstance(); - String txt = msg.getMessage(messageId, args); - - Logger.warn(new LogMsg(txt)); - warnings.add(txt); - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java deleted file mode 100644 index 9679e8d18..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import java.util.Properties; - -import iaik.logging.LogConfigurationException; -import iaik.logging.LoggerConfig; - -import at.gv.egovernment.moa.logging.LoggingContextManager; - -/** - * Default implementation of the LoggerConfig interface. - * - * @author Patrick Peck - * @version $Id$ - */ -public class LoggerConfigImpl implements LoggerConfig { - - /** The implementation of iaik.logging.LogFactory. */ - private static final String DEFAULT_IMPLEMENTATION = - "at.gv.egovernment.moa.spss.server.logging.IaikLogFactory"; - - public String getFactory() { - return DEFAULT_IMPLEMENTATION; - } - - public Properties getProperties() throws LogConfigurationException { - return new Properties(); - } - - public String getNodeId() { - return LoggingContextManager.getInstance().getLoggingContext().getNodeID(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java deleted file mode 100644 index 1c42cc4af..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.PKIConfiguration; -import iaik.pki.pathvalidation.ValidationConfiguration; -import iaik.pki.revocation.RevocationConfiguration; -import iaik.pki.store.certstore.CertStoreConfiguration; -import iaik.pki.store.revocation.archive.ArchiveConfiguration; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the PKIConfiguration interface using data - * from the MOA configuration. - * - * @see iaik.pki.PKIConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class PKIConfigurationImpl implements PKIConfiguration { - /** The CertStore configuration. */ - private CertStoreConfiguration certStoreConfiguration; - /** The revocation checking configuration. */ - private RevocationConfiguration revocationConfiguration; - /** The revocation archive configuration. */ - private ArchiveConfiguration archiveConfiguration; - /** The certificate validation configuration. */ - private ValidationConfiguration validationConfiguration; - - /** - * Create a new PKIConfigurationImpl. - * - * @param config The underlying MOA configuration which will be used to build - * the configuration data contained in this object. - */ - public PKIConfigurationImpl(ConfigurationProvider config) { - - this.certStoreConfiguration = new CertStoreConfigurationImpl(config); - this.revocationConfiguration = new RevocationConfigurationImpl(config); - - boolean archiveInfo = config.getEnableRevocationArchiving(); - if (archiveInfo) - { - this.archiveConfiguration = new ArchiveConfigurationImpl(config); - } - else - { - this.archiveConfiguration = null; - } - - this.validationConfiguration = new ValidationConfigurationImpl(config); - } - - /** - * @see iaik.pki.PKIConfiguration#getCertStoreConfiguration() - */ - public CertStoreConfiguration getCertStoreConfiguration() { - return certStoreConfiguration; - } - - /** - * @see iaik.pki.PKIConfiguration#getRevocationConfiguration() - */ - public RevocationConfiguration getRevocationConfiguration() { - return revocationConfiguration; - } - - /** - * @see iaik.pki.PKIConfiguration#getArchiveConfiguration() - */ - public ArchiveConfiguration getArchiveConfiguration() { - return archiveConfiguration; - } - - /** - * @see iaik.pki.PKIConfiguration#getValidationConfiguration() - */ - public ValidationConfiguration getValidationConfiguration() { - return validationConfiguration; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java deleted file mode 100644 index bccb04a09..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import iaik.pki.revocation.RevocationConfiguration; - -import java.security.cert.X509Certificate; -import java.util.Date; -import java.util.Set; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the RevocationConfiguration interface using - * MOA configuration data. - * - * @see iaik.pki.revocation.RevocationConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class RevocationConfigurationImpl - extends AbstractObservableConfiguration - implements RevocationConfiguration { - - /** The ConfigurationProvider to read the configuration data - * from. */ - private ConfigurationProvider config; - - /** - * Create a new RevocationConfigurationImpl. - * - * @param config The underlying MOA configuration containing the configuration - * data. - */ - public RevocationConfigurationImpl(ConfigurationProvider config) { - this.config = config; - } - - /** - * @see iaik.pki.revocation.RevocationConfiguration#getAlternativeDistributionPoints - */ - public Set getAlternativeDistributionPoints(X509Certificate cert, X509Certificate issuer, Date date) - { - return config.getDistributionPoints(cert); - } - - /** - * @see iaik.pki.revocation.RevocationConfiguration#archiveRevocationInfo(java.lang.String, java.lang.String) - */ - public boolean archiveRevocationInfo(String type, String uri) - { - return config.getEnableRevocationArchiving(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java deleted file mode 100644 index 343f096ef..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -import iaik.server.modules.keys.ConfigurationException; -import iaik.server.modules.keys.SoftwareKeyModuleConfiguration; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; - -import at.gv.egovernment.moa.spss.server.config.SoftwareKeyModule; -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * An implementation of the SoftwareKeyModuleConfiguration wrapping - * a SoftwareKeyModule from the MOA configuration. - * - * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class SoftwareKeyModuleConfigurationImpl - extends AbstractKeyModuleConfigurationImpl - implements SoftwareKeyModuleConfiguration { - - /** The wrapped SoftwareKeyModule. */ - private SoftwareKeyModule keyModule; - - /** - * Create a new SoftwareKeyModuleConfigurationImpl. - * - * @param keyModule The SoftwareKeyModule from the underlying MOA - * configuration. - */ - public SoftwareKeyModuleConfigurationImpl(SoftwareKeyModule keyModule) { - super(keyModule.getId()); - this.keyModule = keyModule; - } - - /** - * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration#getKeyStoreTypeName() - */ - public String getKeyStoreTypeName() { - return KEY_STORE_TYPE_NAME_PKCS12; - } - - /** - * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration#getKeyStoreAsStream() - */ - public InputStream getKeyStoreAsStream() { - MessageProvider msg = MessageProvider.getInstance(); - - try { - String message = - msg.getMessage("config.18", new Object[] { keyModule.getFileName()}); - Logger.info(new LogMsg(message)); - return new FileInputStream(keyModule.getFileName()); - } catch (FileNotFoundException e) { - String message = - msg.getMessage("config.09", new Object[] { keyModule.getFileName()}); - - throw new ConfigurationException(message, e, null); - } - } - - /** - * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration#getKeyStoreAuthenticationData() - */ - public char[] getKeyStoreAuthenticationData() { - return keyModule.getPassWord().toCharArray(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java deleted file mode 100644 index f6fbad215..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.config; - -import java.security.cert.X509Certificate; -import java.security.spec.AlgorithmParameterSpec; - -import iaik.pki.pathvalidation.ValidationConfiguration; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the ValidationConfiguration interface using - * MOA configuration data. - * - * @see iaik.pki.pathvalidation.ValidationConfiguration - * @author Patrick Peck - * @version $Id$ - */ -public class ValidationConfigurationImpl - extends AbstractObservableConfiguration - implements ValidationConfiguration { - - /** The ConfigurationProvider to read the configuration data - * from. */ - private ConfigurationProvider config; - - /** - * Create a new ValidationConfigurationImpl. - * - * @param config The underlying MOA configuration data. - */ - public ValidationConfigurationImpl(ConfigurationProvider config) { - this.config = config; - } - - /** - * @see iaik.pki.pathvalidation.ValidationConfiguration#getChainingMode(java.security.cert.X509Certificate) - */ - public String getChainingMode(X509Certificate cert) { - return config.getChainingMode(cert); - } - - /** - * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsSpec(java.security.cert.X509Certificate) - */ - public AlgorithmParameterSpec getPublicKeyParamsAsSpec(X509Certificate cert) { - return null; - } - - /** - * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsCert(java.security.cert.X509Certificate) - */ - public X509Certificate getPublicKeyParamsAsCert(X509Certificate cert) { - return null; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java deleted file mode 100644 index 76f03ae07..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.pki; - -import iaik.pki.PKIProfile; -import iaik.pki.pathvalidation.ValidationProfile; -import iaik.pki.revocation.RevocationProfile; -import iaik.pki.store.truststore.TrustStoreProfile; -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation.ValidationProfileImpl; -import at.gv.egovernment.moa.spss.server.iaik.pki.revocation.RevocationProfileImpl; -import at.gv.egovernment.moa.spss.server.iaik.pki.store.truststore.TrustStoreProfileImpl; - -/** - * Implementation of the PKIProfile interface containing - * information needed for certificate path validation. It uses configuration - * data from the MOA configuration. - * - * @author Patrick Peck - * @version $Id$ - */ -public class PKIProfileImpl implements PKIProfile { - - /** Profile information for revocation checking. */ - private RevocationProfile revocationProfile; - /** Profile information about the trust profile to use. */ - private TrustStoreProfile trustStoreProfile; - /** Profile information about the certificate validation. */ - private ValidationProfile validationProfile; - /** The ConfigurationProvider to read the MOA configuration data - * from. */ - private ConfigurationProvider config; - - /** - * Create a new PKIProfileImpl. - * - * @param config The MOA configuration providing configuration data about - * certificate path validation. - * @param trustProfileID The trust profile ID denoting the location of the - * trust store. - * @throws MOAApplicationException An error occurred building the profile. - */ - public PKIProfileImpl(ConfigurationProvider config, String trustProfileID) - throws MOAApplicationException { - - this.config = config; - setRevocationProfile(new RevocationProfileImpl(config)); - setTrustStoreProfile(new TrustStoreProfileImpl(config, trustProfileID)); - setValidationProfile(new ValidationProfileImpl(config)); - } - - /** - * @see iaik.pki.PKIProfile#autoAddCertificates() - */ - public boolean autoAddCertificates() - { - return useAuthorityInfoAccess() ? true : config.getAutoAddCertificates(); - } - - /** - * @see iaik.pki.PKIProfile#getRevocationProfile() - */ - public RevocationProfile getRevocationProfile() { - return revocationProfile; - } - - /** - * Sets the RevocationProfile. - * - * @param revocationProfile The RevocationProfile used for - * revocation checking. - */ - protected void setRevocationProfile(RevocationProfile revocationProfile) { - this.revocationProfile = revocationProfile; - } - - /** - * @see iaik.pki.PKIProfile#getTrustStoreProfile() - */ - public TrustStoreProfile getTrustStoreProfile() { - return trustStoreProfile; - } - - /** - * Sets the TrustStoreProfile. - * - * @param trustStoreProfile The TrustStoreProfile. - */ - protected void setTrustStoreProfile(TrustStoreProfile trustStoreProfile) { - this.trustStoreProfile = trustStoreProfile; - } - - /** - * @see iaik.pki.PKIProfile#getValidationProfile() - */ - public ValidationProfile getValidationProfile() { - return validationProfile; - } - - /** - * Sets the ValidationProfile. - * - * @param validationProfile The ValidationProfile to set. - */ - protected void setValidationProfile(ValidationProfile validationProfile) { - this.validationProfile = validationProfile; - } - - /** - * @see iaik.pki.PKIProfile#useAuthorityInfoAccess() - */ - public boolean useAuthorityInfoAccess() - { - return config.getUseAuthorityInfoAccess(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java deleted file mode 100644 index a4d7ea7fa..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation; - -import iaik.pki.pathvalidation.ValidationProfile; - -import java.util.Collections; -import java.util.Set; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the ValidationProfile interface providing - * information about certificat path validation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ValidationProfileImpl implements ValidationProfile { - - /** The ConfigurationProvider to read the configuration data - * from. */ - private ConfigurationProvider config; - private boolean initialAnyPolicyInhibit; - private boolean initialExplicitPolicy; - private boolean initialPolicyMappingInhibit; - private Set initialPolicySet; - private boolean nameConstraintsProcessing; - private boolean policyProcessing; - - /** - * Create a new ValidationProfileImpl object. - * - * This objects's fields are preset to the following values: - * - *
    - *
  • initialAnyPolicyInhibit = true
  • - *
  • initialExplicitPoliy = true
  • - *
  • initialPolicyMappingInhibit = true
  • - *
  • initialPolicySet = empty
  • - *
  • policyProcessing = false
  • - *
  • nameConstraintsProcessing = false
  • - *
  • revocationChecking = false
  • - *
- * - * @param config MOA configuration data for additional configuration - * information (currently unused). - */ - public ValidationProfileImpl(ConfigurationProvider config) { - this.config = config; - initialAnyPolicyInhibit = true; - initialExplicitPolicy = true; - initialPolicyMappingInhibit = true; - initialPolicySet = Collections.EMPTY_SET; - policyProcessing = false; - nameConstraintsProcessing = false; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialAnyPolicyInhibit() - */ - public boolean getInitialAnyPolicyInhibit() { - return initialAnyPolicyInhibit; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialExplicitPolicy() - */ - public boolean getInitialExplicitPolicy() { - return initialExplicitPolicy; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicyMappingInhibit() - */ - public boolean getInitialPolicyMappingInhibit() { - return initialPolicyMappingInhibit; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicySet() - */ - public Set getInitialPolicySet() { - return initialPolicySet; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getPolicyProcessing() - */ - public boolean getPolicyProcessing() { - return policyProcessing; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getNameConstraintsProcessing() - */ - public boolean getNameConstraintsProcessing() { - return nameConstraintsProcessing; - } - - /** - * @see iaik.pki.pathvalidation.ValidationProfile#getRevocationChecking() - */ - public boolean getRevocationChecking() - { - return config.getEnableRevocationChecking(); - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java deleted file mode 100644 index c8809b0d8..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.pki.revocation; - -import java.security.cert.X509Certificate; - -import iaik.pki.revocation.RevocationProfile; -import iaik.pki.revocation.RevocationSourceTypes; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * An implementation of the RevocationProfile interface providing - * information about revocation status checking, based on MOA configuration - * data. - * - * @author Patrick Peck - * @version $Id$ - */ -public class RevocationProfileImpl implements RevocationProfile { - /** The default service order. */ - private static final String[] DEFAULT_SERVICE_ORDER = - { RevocationSourceTypes.CRL, RevocationSourceTypes.OCSP }; - /** The ConfigurationProvider to read the MOA configuration data - * from. */ - private ConfigurationProvider config; - /** The OCSP request hash algorithm. Currently only "SHA" is supported. */ - private static final String oCSPRequestHashAlgorithm = "SHA"; - - /** - * Create a new RevocationProfileImpl. - * - * @param config The MOA configuration data. - */ - public RevocationProfileImpl(ConfigurationProvider config) { - this.config = config; - // currently only "SHA" is supported -// this.oCSPRequestHashAlgorithm = ""; - } - - /** - * @see iaik.pki.revocation.RevocationProfile#getMaxRevocationAge(String) - */ - public long getMaxRevocationAge(String distributionPointUri) - { - return config.getMaxRevocationAge(); - } - - /** - * @see iaik.pki.revocation.RevocationProfile#getOCSPRequestHashAlgorithm() - */ - public String getOCSPRequestHashAlgorithm() { - return oCSPRequestHashAlgorithm; - } - - /** - * @see iaik.pki.revocation.RevocationProfile#getPreferredServiceOrder(java.security.cert.X509Certificate) - */ - public String[] getPreferredServiceOrder(X509Certificate cert) - { - String[] serviceOrder = config.getServiceOrder(); - if (serviceOrder == null || serviceOrder.length == 0) return DEFAULT_SERVICE_ORDER; - return serviceOrder; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java deleted file mode 100644 index c49f7fe8c..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.pki.store.truststore; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import iaik.pki.store.truststore.TrustStoreProfile; -import iaik.pki.store.truststore.TrustStoreTypes; -import iaik.pki.store.observer.NotificationData; -import iaik.pki.store.observer.Observer; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.TrustProfile; - -/** - * An implementation of the TrustStoreProfile interface, using data - * from the MOA configuration. - * - * @see iaik.pki.store.truststore.TrustStoreProfile - * @author Patrick Peck - * @version $Id$ - */ -public class TrustStoreProfileImpl implements TrustStoreProfile { - - /** The observers of this profile. */ - private List observers = new ArrayList(); - - /** - * The trust profile identifier. - */ - private String id_; - - /** The type of the trust profile. */ - private String type; - /** The URI of the trust profile.*/ - private String URI; - - /** - * Create a new TrustStoreProfileImpl. - * - * @param config The MOA configuration data, from which trust store - * configuration data is read. - * @param trustProfileId The trust profile id on which this - * TrustStoreProfile is based. - * @throws MOAApplicationException The trustProfileId could not - * be found in the MOA configuration. - */ - public TrustStoreProfileImpl( - ConfigurationProvider config, - String trustProfileId) - throws MOAApplicationException { - - TrustProfile tp = (TrustProfile) config.getTrustProfile(trustProfileId); - if (tp != null) - { - id_ = trustProfileId; - setURI(tp.getUri()); - setType(TrustStoreTypes.DIRECTORY); - } - else - { - throw new MOAApplicationException("2203", new Object[] { trustProfileId }); - } - } - - /** - * @see iaik.pki.store.truststore.TrustStoreProfile#getType() - */ - public String getType() { - return type; - } - - /** - * Sets the the trust store type. - * - * @param type The trust store type to set. - */ - protected void setType(String type) { - this.type = type; - } - - /** - * @see iaik.pki.store.truststore.TrustStoreProfile#getURI() - */ - public String getURI() { - return URI; - } - - /** - * Sets the trust store URI. - * - * @param URI The trust store URI to set. - */ - protected void setURI(String URI) { - this.URI = URI; - } - - // - // Methods of iaik.pki.store.observer.Observable interface - // - - /** - * @see iaik.pki.store.observer.Observable#addObserver(iaik.pki.store.observer.Observer) - */ - public void addObserver(Observer observer) { - observers.add(observer); - } - - /** - * @see iaik.pki.store.observer.Observable#removeObserver(iaik.pki.store.observer.Observer) - */ - public boolean removeObserver(Observer observer) { - return observers.remove(observer); - } - - /** - * @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData) - */ - public void notify(NotificationData notificationData) { - for (Iterator iter = observers.iterator(); iter.hasNext();) { - Observer observer = (Observer) iter.next(); - observer.notify(notificationData); - } - } - - /** - * @see iaik.pki.store.truststore.TrustStoreProfile#getId() - */ - public String getId() - { - return id_; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java deleted file mode 100644 index e076fe1eb..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import iaik.server.modules.xml.Base64Transformation; - -/** - * An implementation of the Base64Transformation - * Transformation type. - * - * @author Patrick Peck - * @version $Id$ - */ -public class Base64TransformationImpl - extends TransformationImpl - implements Base64Transformation { - - /** - * Create a new Base64TransformationImpl. - * - * @see java.lang.Object#Object() - */ - public Base64TransformationImpl() { - setAlgorithmURI(Base64Transformation.BASE64_DECODING); - } - - /** - * Compare this Base64Transformation to another. - * - * @param other The object to compare thisBase64Transformation - * to. - * @return true, if other is a - * Base64Transformation and the algorithm URIs match, otherwise - * false. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof Base64Transformation) { - Base64Transformation transform = (Base64Transformation) other; - return getAlgorithmURI().equals(transform.getAlgorithmURI()); - } - return false; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java deleted file mode 100644 index 921b10cb6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import iaik.server.modules.xml.BinaryDataObject; - -/** - * A BinaryDataObject encapsulating Base64 data. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ByteArrayDataObjectImpl - extends DataObjectImpl - implements BinaryDataObject { - - /** The binary data contained in this BinaryDataObject. */ - private byte[] bytes; - - /** - * Create a new ByteArrayDataObjectImpl. - * - * @param bytes The binary data contained in this - * BinaryDataObject. - */ - public ByteArrayDataObjectImpl(byte[] bytes) { - setBytes(bytes); - } - - /** - * Set the Base64 data. - * - * @param bytes The binary data contained in this - * BinaryDataObject. - */ - public void setBytes(byte[] bytes) { - this.bytes = bytes; - } - - /** - * Return the binary data encoded in the Base64 String as a - * stream. - * - * @return The binary data contained in this object, as a - * InputStream. Repeated calls to this function will return a - * new stream to the Base64 data. - * @see iaik.server.modules.xml.BinaryDataObject#getInputStream() - */ - public InputStream getInputStream() { - return new ByteArrayInputStream(bytes); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java deleted file mode 100644 index ce400e61a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.io.InputStream; - -import iaik.server.modules.xml.BinaryDataObject; - -/** - * A BinaryDataObject encapsulating binary data from a stream. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ByteStreamDataObjectImpl - extends DataObjectImpl - implements BinaryDataObject { - - /** The InputStream containing the binary data. */ - private InputStream inputStream; - - /** - * Create a new ByteStreamDataObjectImpl. - * - * @param inputStream The stream from which to read the binary data. - */ - public ByteStreamDataObjectImpl(InputStream inputStream) { - setInputStream(inputStream); - } - - /** - * Set the input stream from which to read the binary data. - * - * @param inputStream The input stream from which to read the binary data. - */ - public void setInputStream(InputStream inputStream) { - this.inputStream = inputStream; - } - - /** - * Return the binary data from this object as a stream. - * - * @return The stream containing the binary data. Calling this function - * repeatedly will always return the same InputStream. - * @see iaik.server.modules.xml.BinaryDataObject#getInputStream() - */ - public InputStream getInputStream() { - return inputStream; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java deleted file mode 100644 index a597b214d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import iaik.server.modules.xml.Canonicalization; - -/** - * An implementation of the CanonicalizationTransform - * Transformation type. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CanonicalizationImpl - extends TransformationImpl - implements Canonicalization { - - /** - * Create a new CanonicalizationTransformImpl object. - * - * @param algorithmURI The canonicalization algorithm URI. - */ - public CanonicalizationImpl(String algorithmURI) { - setAlgorithmURI(algorithmURI); - } - - /** - * Compare this object to another Canonicalization. - * - * @param other The object to compare this - * Canonicalization to. - * @return true, if other is a - * Canonicalization and the algorithm URIs match, otherwise - * false. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof Canonicalization) { - Canonicalization c14n = (Canonicalization) other; - return getAlgorithmURI().equals(c14n.getAlgorithmURI()); - } - return false; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java deleted file mode 100644 index 875d82613..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import iaik.server.modules.xml.DataObject; - -/** - * Abstract base implementation for the classes derived from - * DataObject. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class DataObjectImpl implements DataObject { - - /** The MIME type of the data object. */ - private String mimeType; - /** The refernce ID. */ - private String referenceID; - /** The URI of the type. */ - private String typeURI; - /** The URI identifying the data. */ - private String URI; - - /** - * @see iaik.server.modules.xml.DataObject#getMimeType() - */ - public String getMimeType() { - return mimeType; - } - - /** - * Set the mime type. - * - * @param mimeType The mime type to set. - */ - public void setMimeType(String mimeType) { - this.mimeType = mimeType; - } - - /** - * @see iaik.server.modules.xml.DataObject#getReferenceID() - */ - public String getReferenceID() { - return referenceID; - } - - /** - * Set the reference ID. - * - * @param referenceID The reference ID. - */ - public void setReferenceID(String referenceID) { - this.referenceID = referenceID; - } - - /** - * @see iaik.server.modules.xml.DataObject#getTypeURI() - */ - public String getTypeURI() { - return typeURI; - } - - /** - * Set the type URI. - * - * @param typeURI The type URI. - */ - public void setTypeURI(String typeURI) { - this.typeURI = typeURI; - } - - /** - * @see iaik.server.modules.xml.DataObject#getURI() - */ - public String getURI() { - return URI; - } - - /** - * Set the URI. - * - * @param URI The URI. - */ - public void setURI(String URI) { - this.URI = URI; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java deleted file mode 100644 index 41a47d0a1..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import iaik.server.modules.xml.EnvelopedSignatureTransformation; - -/** - * An implementation of the EnvelopedSignatureTransformation - * Transformation type. - * - * @author Patrick Peck - * @version $Id$ - */ -public class EnvelopedSignatureTransformationImpl - extends TransformationImpl - implements EnvelopedSignatureTransformation { - - /** - * Create a new EnvelopedSignatureTransformationImpl. - */ - public EnvelopedSignatureTransformationImpl() { - setAlgorithmURI(EnvelopedSignatureTransformation.ENVELOPED_SIGNATURE); - } - - /** - * Compare this object to another EnvelopedSignatureTransformation. - * - * @param other The object to compare this - * EnvelopedSignatureTransformation to. - * @return true, if other is a - * EnvelopedSignatureTransformation, otherwise - * false. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof EnvelopedSignatureTransformation) { - EnvelopedSignatureTransformation transform = - (EnvelopedSignatureTransformation) other; - return getAlgorithmURI().equals(transform.getAlgorithmURI()); - } - return false; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java deleted file mode 100644 index b38fbe128..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.util.List; - -import iaik.server.modules.xml.ExclusiveCanonicalization; - -/** - * An implementation of the ExclusiveCanonicalization type - * of Transformation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ExclusiveCanonicalizationImpl - extends TransformationImpl - implements ExclusiveCanonicalization { - - /** The prefixes of the namespaces to treat according to canonical XML. */ - private List inclusiveNamespacePrefixes; - - /** - * Create a new ExclusiveCanonicalizationImpl object. - * - * @param algorithmURI The exclusive canonicalization algorithm URI. - * @param inclusiveNamespacePrefixes The namespace prefixes to be processed - * according to canonical XML. - */ - public ExclusiveCanonicalizationImpl( - String algorithmURI, - List inclusiveNamespacePrefixes) { - setAlgorithmURI(algorithmURI); - setInclusiveNamespacePrefixes(inclusiveNamespacePrefixes); - } - - /** - * Sets the namespace prefixes to be processed according to canonical XML. - * - * @param inclusiveNamespacePrefixes The prefixes of the namespaces to treat - * according to canonical XML. - */ - protected void setInclusiveNamespacePrefixes(List inclusiveNamespacePrefixes) { - this.inclusiveNamespacePrefixes = inclusiveNamespacePrefixes; - } - - /** - * @see iaik.server.modules.xml.ExclusiveCanonicalization#getInclusiveNamespacePrefixes() - */ - public List getInclusiveNamespacePrefixes() { - return inclusiveNamespacePrefixes; - } - - /** - * Compare this object to another CanonicalizationTransform. - * - * @param other The object to compare this - * ExclusiveCanonicalization to. - * @return true, if other is a - * ExclusiveCanonicalization and the algorithm URIs match, - * otherwise false. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof ExclusiveCanonicalization) { - ExclusiveCanonicalization eC14n = - (ExclusiveCanonicalization) other; - boolean algURIEquals = getAlgorithmURI().equals(eC14n.getAlgorithmURI()); - boolean inclNSPrefs = - (getInclusiveNamespacePrefixes() == null || getInclusiveNamespacePrefixes().isEmpty()) - ? eC14n.getInclusiveNamespacePrefixes() == null || eC14n.getInclusiveNamespacePrefixes().isEmpty() - : getInclusiveNamespacePrefixes().equals(eC14n.getInclusiveNamespacePrefixes()); - return algURIEquals && inclNSPrefs; - } - return false; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java deleted file mode 100644 index 19ca3dadf..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.util.Date; - -import iaik.server.modules.xml.SigningTime; - -/** - * An implementation of the SigningTime Property. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SigningTimeImpl implements SigningTime { - - /** The signing time. */ - private Date signingTime; - - /** - * Create a new SigningTimeImpl. - * - * @param signingTime The signing time. - */ - public SigningTimeImpl(Date signingTime) { - this.signingTime = signingTime; - } - - /** - * @see iaik.server.modules.xml.SigningTime#getSigningTime() - */ - public Date getSigningTime() { - return signingTime; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java deleted file mode 100644 index 59a414b69..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import iaik.server.modules.xml.Transformation; - -/** - * Base implementation class for Transformation derived classes. - * - * @author Patrick Peck - * @version $Id$ - */ -public abstract class TransformationImpl implements Transformation { - - /** The algorithm URI identifying the transformation algorithm. */ - private String algorithmURI; - - /** - * @see iaik.server.modules.xml.Transformation#getAlgorithmURI() - */ - public String getAlgorithmURI() { - return algorithmURI; - } - - /** - * Sets the algorithm URI. - * - * @param algorithmURI The algorithm URI to set. - */ - protected void setAlgorithmURI(String algorithmURI) { - this.algorithmURI = algorithmURI; - } - - /** - * Returns the hash code of the algorithm URI. Should be overridden if a - * transformation distinguishes itself from others by more than just the - * algorithm URI. - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getAlgorithmURI().hashCode(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java deleted file mode 100644 index bc31d694e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import org.w3c.dom.Element; - -import iaik.server.modules.xml.XMLDataObject; - -/** - * A DataObject containing a single DOM element. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLDataObjectImpl - extends DataObjectImpl - implements XMLDataObject { - - /** The XML data contained in this XMLDataObject. */ - private Element element; - - /** - * Create a new XMLDataObjectImpl. - * - * @param element The DOM element contained in this - * XMLDataObject. - */ - public XMLDataObjectImpl(Element element) { - setElement(element); - } - - /** - * @see iaik.server.modules.xml.XMLDataObject#getElement() - */ - public Element getElement() { - return element; - } - - /** - * Set the DOM element contained in this XMLDataObject. - * - * @param element The DOM element to set. - */ - public void setElement(Element element) { - this.element = element; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java deleted file mode 100644 index c855a922a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import org.w3c.dom.NodeList; - -import iaik.server.modules.xml.XMLNodeListDataObject; - -/** - * A DataObject containing a list of DOM nodes. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLNodeListDataObjectImpl - extends DataObjectImpl - implements XMLNodeListDataObject { - - /** The nodes contained in this XMLNodeListDataObject. */ - private NodeList nodeList; - - /** - * Create a new XMLNodeListDataObjectImpl. - * - * @param nodeList The list of DOM nodes contained in this - * XMLNodeListDataObject. - */ - public XMLNodeListDataObjectImpl(NodeList nodeList) { - setNodeList(nodeList); - } - - /** - * Set the list of DOM nodes contained in this - * XMLNodeListDataObject. - * - * @param nodeList The list of DOM nodes to set. - */ - public void setNodeList(NodeList nodeList) { - this.nodeList = nodeList; - } - - /** - * @see iaik.server.modules.xml.XMLNodeListDataObject#getNodeList() - */ - public NodeList getNodeList() { - return nodeList; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java deleted file mode 100644 index 4fca907f3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import org.w3c.dom.Element; - -import iaik.server.modules.xml.XMLSignature; - -/** - * An object containing an XMLDsig signature in the form of a - * dsig:Signature DOM element. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureImpl implements XMLSignature { - /** The signature DOM element. */ - private Element element; - - /** - * Create a new XMLSignatureImpl. - * - * @param element The dsig:Signature DOM element. - */ - public XMLSignatureImpl(Element element) { - setElement(element); - } - - /** - * Set the dsig:Signature DOM element. - * - * @param element The dsig:Signature element to set. - */ - public void setElement(Element element) { - this.element = element; - } - - /** - * @see iaik.server.modules.xml.XMLSignature#getElement() - */ - public Element getElement() { - return element; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java deleted file mode 100644 index 034d4b653..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.util.Map; - -import iaik.server.modules.xml.XPath2Transformation; -import iaik.server.modules.xml.XPath2Transformation.XPath2Filter; - -/** - * An object encapsulating an XPath-Filter2 expression. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XPath2FilterImpl implements XPath2Filter { - - /** The type of this filter. */ - private String filterType; - /** The XPath expression of this filter. */ - private String xPathExpression; - /** The namespace prefix to URI mapping to use for evaluating the XPath. */ - private Map namespaceDeclarations; - - /** - * Create a new XPath2FilterImpl object. - * - * @param filterType The type of filter. Must be one of the filter type - * constants declared in iaik.server.modules.xml.XPath2Transformation.XPath2Filter - * @param xPathExpression The XPath expression belonging to this filter. - * @param namespaceDeclarations The namespace declarations visible for this - * XPath2Filter. - */ - public XPath2FilterImpl( - String filterType, - String xPathExpression, - Map namespaceDeclarations) { - - setFilterType(filterType); - setXPathExpression(xPathExpression); - setNamespaceDeclarations(namespaceDeclarations); - } - - /** - * @see iaik.server.modules.xml.XPath2Transformation.XPath2Filter#getFilterType() - */ - public String getFilterType() { - return filterType; - } - - /** - * Set the filter type. - * - * @param filterType The filter type to set. - */ - protected void setFilterType(String filterType) { - this.filterType = filterType; - } - - /** - * @see iaik.server.modules.xml.XPath2Transformation.XPath2Filter#getXPathExpression() - */ - public String getXPathExpression() { - return xPathExpression; - } - - /** - * Set the XPath expression. - * - * @param xPathExpression The XPath expression to set. - */ - protected void setXPathExpression(String xPathExpression) { - this.xPathExpression = xPathExpression; - } - - /** - * @see iaik.server.modules.xml.XPath2Transformation.XPath2Filter#getNamespaceDeclarations() - */ - public Map getNamespaceDeclarations() { - return namespaceDeclarations; - } - - /** - * Set the namespace declarations. - * - * @param namespaceDeclarations The mapping between namespace prefixes and - * their associated URI. - */ - protected void setNamespaceDeclarations(Map namespaceDeclarations) { - this.namespaceDeclarations = namespaceDeclarations; - } - - /** - * Compare this object to another. - * - * @param other The object to compare this XPath2Filter to. - * @return true, if other is a - * XPath2Filter and the filter types match and the XPath - * expressions match. Otherwise false is returned. - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object other) { - if (other instanceof XPath2Transformation.XPath2Filter) { - XPath2Filter filter = (XPath2Transformation.XPath2Filter) other; - return getFilterType().equals(filter.getFilterType()) - && getXPathExpression().equals(filter.getXPathExpression()); - } - return false; - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getXPathExpression().hashCode() * 31 + getFilterType().hashCode(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java deleted file mode 100644 index c7496c2cd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import iaik.server.modules.xml.XPath2Transformation; - -/** - * An object encapsulating a Transformation containing several - * XPath-Filter2 expressions. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XPath2TransformationImpl - extends TransformationImpl - implements XPath2Transformation { - - /** The filters contained in this XPath2Transformation */ - private List xPathFilters = new ArrayList(); - - /** - * Create a new XPath2TransformationImpl. - * - * The list of XPath-Filter2 expression is initially empty. - */ - public XPath2TransformationImpl() { - setAlgorithmURI(XPath2Transformation.XPATH2); - } - - /** - * @see iaik.server.modules.xml.XPath2Transformation#getXPathFilters() - */ - public List getXPathFilters() { - return xPathFilters; - } - - /** - * Add an XPath-Filter2 expression to the list of filters. - * - * @param filter The filter to add. - */ - public void addXPathFilter(XPath2Filter filter) { - xPathFilters.add(filter); - } - - /** - * Compare this XPath2Transformation to another. - * - * @param other The object to compare this - * XPath2Transformation to. - * @return true, if other is an - * XPath2Transformation and getXPathFilters() equals - * other.getXPathFilters(). Otherwise false is - * returned. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof XPath2Transformation) { - XPath2Transformation transform = (XPath2Transformation) other; - - return getXPathFilters().equals(transform.getXPathFilters()); - } - return false; - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - Iterator iter = getXPathFilters().iterator(); - int hashCode = 0; - - while (iter.hasNext()) { - hashCode ^= iter.next().hashCode(); - } - - return hashCode; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java deleted file mode 100644 index ccedbadb2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.util.Map; - -import iaik.server.modules.xml.XPathTransformation; - -/** - * A Transformation containing an XPath expression. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XPathTransformationImpl - extends TransformationImpl - implements XPathTransformation { - - /** The XPath expression. */ - private String xPathExpression; - /** The namespace prefix to URI mapping to use for XPath evaluation. */ - private Map namespaceDeclarations; - - /** - * Create a new XPathTransformationImpl. - * - * The namespace declarations are initialized empty. - * - * @param xPathExpression The XPath expression this object will contain. - * @param namespaceDeclarations The namespace declarations visible for this - * XPath. - */ - public XPathTransformationImpl( - String xPathExpression, - Map namespaceDeclarations) { - - setAlgorithmURI(XPathTransformation.XPATH); - setXPathExpression(xPathExpression); - setNamespaceDeclarations(namespaceDeclarations); - } - - /** - * Set the XPath expression. - * - * @param xPathExpression The XPath expression. - */ - protected void setXPathExpression(String xPathExpression) { - this.xPathExpression = xPathExpression; - } - - /** - * @see iaik.server.modules.xml.XPathTransformation#getXPathExpression() - */ - public String getXPathExpression() { - return xPathExpression; - } - - /** - * @see iaik.server.modules.xml.XPathTransformation#getNamespaceDeclarations() - */ - public Map getNamespaceDeclarations() { - return namespaceDeclarations; - } - - /** - * Set the namespace declarations. - * - * @param namespaceDeclarations The mapping between namespace prefixes and - * their associated URI. - */ - protected void setNamespaceDeclarations(Map namespaceDeclarations) { - this.namespaceDeclarations = namespaceDeclarations; - } - - /** - * Compare this XPathTransformation to another. - * - * @param other The object to compare this - * XPathTransformation to. - * @return true, if other is an - * XPathTransformation and if this object contains the same XPath - * expression as other. Otherwise false is returned. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof XPathTransformation) { - XPathTransformation transform = (XPathTransformation) other; - return getXPathExpression().equals(transform.getXPathExpression()); - } - return false; - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getXPathExpression().hashCode(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java deleted file mode 100644 index d38da650b..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import iaik.ixsil.algorithms.CanonicalizationAlgorithm; -import iaik.ixsil.algorithms.CanonicalizationAlgorithmImplExclusiveCanonicalXML; -import iaik.ixsil.exceptions.AlgorithmException; -import iaik.server.modules.xml.XSLTTransformation; - -import at.gv.egovernment.moa.util.NodeListAdapter; -import at.gv.egovernment.moa.util.StreamUtils; -import at.gv.egovernment.moa.util.XPathException; -import at.gv.egovernment.moa.util.XPathUtils; - - -/** - * A Transformation containing an XSLT transformation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XSLTTransformationImpl - extends TransformationImpl - implements XSLTTransformation { - - /** The XSLT stylesheet. */ - private Element styleSheetElement; - /** The hash code of the canonicalized stylesheet. If calculated, this value - * should be != 0. */ - private int hashCode; - - /** - * Create a new XSLTTransformationImpl object. - * - * @param styleSheetElement The XSLT stylesheet element. - */ - public XSLTTransformationImpl(Element styleSheetElement) { - setAlgorithmURI(XSLTTransformation.XSLT); - setStyleSheetElement(styleSheetElement); - } - - /** - * Set the XSLT stylesheet element. - * - * @param styleSheetElement The XSLT stylesheet element to set. - */ - protected void setStyleSheetElement(Element styleSheetElement) { - this.styleSheetElement = styleSheetElement; - this.hashCode = 0; - } - - /** - * @see iaik.server.modules.xml.XSLTTransformation#getStylesheetElement() - */ - public Element getStylesheetElement() { - return styleSheetElement; - } - - /** - * Compare this XSLTTransformation to another. - * - * @param other The object to compare this - * XSLTTransformation to. - * @return true, if other is an - * XSLTTransformation and if the canonicalized representations of - * the stylesheets contained in this and other - * match. Otherwise, false is returned. - * @see java.lang.Object#equals(Object) - */ - public boolean equals(Object other) { - if (other instanceof XSLTTransformation) { - XSLTTransformation xslt = (XSLTTransformation) other; - - return compareElements( - getStylesheetElement(), - xslt.getStylesheetElement()); - } - return false; - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - if (hashCode == 0) { - hashCode = calculateHashCode(getStylesheetElement()); - } - return hashCode; - } - - /** - * Calculate the hash code for a DOM element by canonicalizing it. - * - * @param element The DOM element for which the hash code is to be calculated. - * @return int The hash code, or 0, if it could not be - * calculated. - */ - private static int calculateHashCode(Element element) { - try { - InputStream is = canonicalize(element); - byte[] buf = new byte[256]; - int hashCode = 1; - int length; - int i; - - while ((length = is.read(buf)) > 0) { - for (i = 0; i < length; i++) { - hashCode += buf[i] * 31 + i; - } - } - is.close(); - return hashCode; - } catch (AlgorithmException e) { - return 0; - } catch (IOException e) { - return 0; - } - } - - /** - * Compare two DOM elements by canonicalizing their contents and comparing the - * resulting byte stream. - * - * @param elem1 The 1st element to compare. - * @param elem2 The 2nd element to compare. - * @return boolean true, if the elements are considered equal - * after canonicalization. Otherwise false is returned. - */ - private static boolean compareElements(Element elem1, Element elem2) { - try { - InputStream is1 = canonicalize(elem1); - InputStream is2 = canonicalize(elem2); - return StreamUtils.compareStreams(is1, is2); - } catch (AlgorithmException e) { - return false; - } catch (IOException e) { - return false; - } - } - - /** - * Canonicalize a DOM element. - * - * @param element The element to canonicalize. - * @return InputStream A stream with the canonicalized data. - * @throws AlgorithmException An error occurred canonicalizing the element. - */ - private static InputStream canonicalize(Element element) - throws AlgorithmException { - CanonicalizationAlgorithm c14n = - new CanonicalizationAlgorithmImplExclusiveCanonicalXML(); - NodeList nodeList; - - try { - nodeList = XPathUtils.selectNodeList(element, XPathUtils.ALL_NODES_XPATH); - } catch (XPathException e) { - nodeList = new NodeListAdapter(Collections.EMPTY_LIST); - } - c14n.setInput(nodeList); - return c14n.canonicalize(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java deleted file mode 100644 index a14b83b7d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xmlsign; - -import java.util.List; - -import iaik.server.modules.xmlsign.DataObjectTreatment; - -import at.gv.egovernment.moa.spss.server.util.IdGenerator; - -/** - * An object encapsulating how to treat an associated DataObject - * when creating a signature. - * - * @author Patrick Peck - * @version $Id$ - */ -public class DataObjectTreatmentImpl implements DataObjectTreatment { - /** The final content MIME type. */ - private String finalContentType; - /** The name of the hash algorithm. */ - private String hashAlgorithmName; - /** This transformations to apply to the associated data object. */ - private List transformationList; - /** Supplemental information for the transformations. */ - private List transformationSupplements; - /** Whether to include the associated data object in the signature. */ - private boolean includedInSignature; - /** Whether to include the associated data object in the manifest. */ - private boolean referenceInManifest; - /** The object ID generator. */ - private IdGenerator objIdGen; - - /** - * Create a new DataObjectTreatmentImpl. - * - * @param objIdGen The IdGenerator for unique object IDs. - */ - public DataObjectTreatmentImpl(IdGenerator objIdGen) { - this.objIdGen = objIdGen; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#getFinalContentType() - */ - public String getFinalContentType() { - return finalContentType; - } - - /** - * Sets the final content type. - * - * @param finalContentType The final content type to set (a MIME-type type of - * String). - */ - public void setFinalContentType(String finalContentType) { - this.finalContentType = finalContentType; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#getHashAlgorithmName() - */ - public String getHashAlgorithmName() { - return hashAlgorithmName; - } - - /** - * Sets the hash algorithm name. - * - * @param hashAlgorithmName The hash algorithm name to set. - */ - public void setHashAlgorithmName(String hashAlgorithmName) { - this.hashAlgorithmName = hashAlgorithmName; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#isIncludedInSignature() - */ - public boolean isIncludedInSignature() { - return includedInSignature; - } - - /** - * Sets whether the associated DataObject is to be included in - * the signature. - * - * @param includedInSignature If true, the associated - * DataObject will be included in the signature, otherwise not. - */ - public void setIncludedInSignature(boolean includedInSignature) { - this.includedInSignature = includedInSignature; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#isReferenceInManifest() - */ - public boolean isReferenceInManifest() { - return referenceInManifest; - } - - /** - * Sets whether the associated DataObject is - * to be included in the dsig:Manifest. - * - * @param referenceInManifest If true, the associated - * DataObject will be included in the manifest, otherwise not. - */ - public void setReferenceInManifest(boolean referenceInManifest) { - this.referenceInManifest = referenceInManifest; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#getTransformationList() - */ - public List getTransformationList() { - return transformationList; - } - - /** - * Set the list of transformations for the associated DataObject. - * - * @param transformationList The transformations to set. - */ - public void setTransformationList(List transformationList) { - this.transformationList = transformationList; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#getTransformationSupplements() - */ - public List getTransformationSupplements() { - return transformationSupplements; - } - - /** - * Sets the transformation supplements for the associated - * DataObject. - * - * @param transformationSupplements The transformation supplements to set. - */ - public void setTransformationSupplements(List transformationSupplements) { - this.transformationSupplements = transformationSupplements; - } - - /** - * @see iaik.server.modules.xmlsign.DataObjectTreatment#getDsigDataObjectID() - */ - public String getDsigDataObjectID() { - return objIdGen.uniqueId(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java deleted file mode 100644 index fb3ff4931..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java +++ /dev/null @@ -1,279 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xmlsign; - -import java.util.List; -import java.util.Set; - -import iaik.server.modules.algorithms.SignatureAlgorithms; -import iaik.server.modules.keys.AlgorithmUnavailableException; -import iaik.server.modules.keys.KeyEntryID; -import iaik.server.modules.keys.KeyModule; -import iaik.server.modules.keys.KeyModuleFactory; -import iaik.server.modules.keys.UnknownKeyException; -import iaik.server.modules.xml.Canonicalization; -import iaik.server.modules.xmlsign.XMLSignatureCreationProfile; -import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation; - -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.spss.server.util.IdGenerator; - -/** - * An object providing auxiliary information for creating an XML signature. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureCreationProfileImpl - implements XMLSignatureCreationProfile { - - /** The transformations to apply to a data object. */ - private List dataObjectTreatmentList; - /** The set of keys available to the signing process. */ - private Set keySet; - /** The type URI of the signature manifest. */ - private String securityLayerManifestTypeURI; - /** Whether the created signature is to be Security Layer conform. */ - private boolean securityLayerConform; - /** Where to insert the signature into the signature environment. */ - private XMLSignatureInsertionLocation signatureInsertionLocation; - /** The signature structur type. */ - private String signatureStructureType; - /** The type of Canonicalization to use for the signed info. */ - private Canonicalization signedInfoCanonicalization; - /** Properties to be signed during signature creation. */ - private List signedProperties; - /** The ID generator for signature IDs. */ - private IdGenerator signatureIDGenerator; - /** The ID generator for manifst IDs. */ - private IdGenerator manifestIDGenerator; - /** The ID generator for XMLDsig manifest IDs. */ - private IdGenerator dsigManifestIDGenerator; - /** The ID generator for signed property IDs. */ - private IdGenerator propertyIDGenerator; - - /** - * Create a new XMLSignatureCreationProfileImpl. - * - * @param createProfileCount Provides external information about the - * number of calls to the signature creation module, using the same request. - * @param reservedIDs The set of IDs that must not be used while generating - * new IDs. - */ - public XMLSignatureCreationProfileImpl( - int createProfileCount, - Set reservedIDs) { - signatureIDGenerator = - new IdGenerator("signature-" + createProfileCount, reservedIDs); - manifestIDGenerator = - new IdGenerator("manifest-" + createProfileCount, reservedIDs); - dsigManifestIDGenerator = - new IdGenerator("dsig-manifest-" + createProfileCount, reservedIDs); - propertyIDGenerator = - new IdGenerator("etsi-signed-" + createProfileCount, reservedIDs); - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getDataObjectTreatmentList() - */ - public List getDataObjectTreatmentList() { - return dataObjectTreatmentList; - } - - /** - * Sets the list of DataObjectTreatments. - * - * @param dataObjectTreatmentList The DataObjectTreatments to - * set. - */ - public void setDataObjectTreatmentList(List dataObjectTreatmentList) { - this.dataObjectTreatmentList = dataObjectTreatmentList; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getKeySet() - */ - public Set getKeySet() { - return keySet; - } - - /** - * Set the set of KeyEntryIDs which may be used for signature - * creation. - * - * @param keySet The set of KeyEntryIDs to set. - */ - public void setKeySet(Set keySet) { - this.keySet = keySet; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSecurityLayerManifestTypeURI() - */ - public String getSecurityLayerManifestTypeURI() { - return securityLayerManifestTypeURI; - } - - /** - * Set the SecurityLayerManifestTypeURI. - * - * @param securityLayerManifestTypeURI The SecurityLayerManifestTypeURI to - * set. - */ - public void setSecurityLayerManifestTypeURI(String securityLayerManifestTypeURI) { - this.securityLayerManifestTypeURI = securityLayerManifestTypeURI; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureAlgorithmName(KeyEntryID) - */ - public String getSignatureAlgorithmName(KeyEntryID selectedKeyID) - throws AlgorithmUnavailableException { - - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - TransactionId tid = new TransactionId(context.getTransactionID()); - KeyModule module = KeyModuleFactory.getInstance(tid); - Set algorithms; - - try { - algorithms = module.getSupportedSignatureAlgorithms(selectedKeyID); - } catch (UnknownKeyException e) { - throw new AlgorithmUnavailableException( - "Unknown key entry: " + selectedKeyID, - e, - null); - } - - if (algorithms.contains(SignatureAlgorithms.MD2_WITH_RSA) // TODO retournierten Algorithmus abhängig von der Schlüssellänge machen (bei längeren Schlüsseln SHA256 statt SHA1) - || algorithms.contains(SignatureAlgorithms.MD5_WITH_RSA) - || algorithms.contains(SignatureAlgorithms.RIPEMD128_WITH_RSA) - || algorithms.contains(SignatureAlgorithms.RIPEMD160_WITH_RSA) - || algorithms.contains(SignatureAlgorithms.SHA1_WITH_RSA) - || algorithms.contains(SignatureAlgorithms.SHA256_WITH_RSA)) { - - return SignatureAlgorithms.SHA1_WITH_RSA; - } else if ( - algorithms.contains(SignatureAlgorithms.ECDSA)) { - return SignatureAlgorithms.ECDSA; - } else if ( - algorithms.contains(SignatureAlgorithms.DSA)) { - return SignatureAlgorithms.DSA; - } else { - throw new AlgorithmUnavailableException( - "No algorithm for key entry: " + selectedKeyID, - null, - null); - } - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureInsertionLocation() - */ - public XMLSignatureInsertionLocation getSignatureInsertionLocation() { - return signatureInsertionLocation; - } - - /** - * Set the location where the signature is to be inserted into the signature - * parent. - * - * @param signatureInsertionLocation The location to set. - */ - public void setSignatureInsertionLocation(XMLSignatureInsertionLocation signatureInsertionLocation) { - this.signatureInsertionLocation = signatureInsertionLocation; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureStructureType() - */ - public String getSignatureStructureType() { - return signatureStructureType; - } - - /** - * Set the signature structure type. - * @param signatureStructureType The signature structure type to set. - */ - public void setSignatureStructureType(String signatureStructureType) { - this.signatureStructureType = signatureStructureType; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignedInfoCanonicalization() - */ - public Canonicalization getSignedInfoCanonicalization() { - return signedInfoCanonicalization; - } - - /** - * Sets the canonicalization method to use for the SignedInfo object. - * - * @param signedInfoCanonicalization The canonicalization method to set. - */ - public void setSignedInfoCanonicalization(Canonicalization signedInfoCanonicalization) { - this.signedInfoCanonicalization = signedInfoCanonicalization; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignedProperties() - */ - public List getSignedProperties() { - return signedProperties; - } - - /** - * Set the signed properties. - * - * @param signedProperties The signed properties to set. - */ - public void setSignedProperties(List signedProperties) { - this.signedProperties = signedProperties; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#isSecurityLayerConform() - */ - public boolean isSecurityLayerConform() { - return securityLayerConform; - } - - /** - * Sets the security layer conformity. - * - * @param securityLayerConform true, if the created signature - * is to be conform to the Security Layer specification. - */ - public void setSecurityLayerConform(boolean securityLayerConform) { - this.securityLayerConform = securityLayerConform; - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureID() - */ - public String getSignatureID() { - return signatureIDGenerator.uniqueId(); - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSecurityLayerManifestID() - */ - public String getSecurityLayerManifestID() { - return manifestIDGenerator.uniqueId(); - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getDsigManifestID() - */ - public String getDsigManifestID() { - return dsigManifestIDGenerator.uniqueId(); - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignedPropertiesID() - */ - public String getSignedPropertiesID() { - return propertyIDGenerator.uniqueId(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java deleted file mode 100644 index d55f61303..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xmlsign; - -import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation; - -/** - * An object giving the location of where the signature will be - * inserted into the parent element. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureInsertionLocationImpl - implements XMLSignatureInsertionLocation { - - /** Where to put the signature into the signature parent element. */ - private int signatureChildIndex; - - /** - * Create a new XMLSignatureInsertLocationImpl. - * - * @param signatureChildIndex The position index at which to append the - * signature to the parent element. - */ - public XMLSignatureInsertionLocationImpl(int signatureChildIndex) { - setSignatureChildIndex(signatureChildIndex); - } - - /** - * @see iaik.server.modules.xmlsign.XMLSignatureInsertionLocation#getSignatureChildIndex() - */ - public int getSignatureChildIndex() { - return signatureChildIndex; - } - - /** - * Sets the position index at which to append the signature to the parent - * element. - * - * @param signatureChildIndex The position index to set. - */ - public void setSignatureChildIndex(int signatureChildIndex) { - this.signatureChildIndex = signatureChildIndex; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java deleted file mode 100644 index 216596dc3..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java +++ /dev/null @@ -1,131 +0,0 @@ -package at.gv.egovernment.moa.spss.server.iaik.xmlverify; - -import java.util.List; - -import iaik.pki.PKIProfile; -import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; - -/** - * An object providing auxiliary information for verifying an XML signature. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureVerificationProfileImpl - implements XMLSignatureVerificationProfile { - - /** Whether to check the Security Layer manifest. */ - private boolean checkSecurityLayerManifest; - /** Whether to check the XMLDsig manifest. */ - private boolean checkXMLDsigManifests; - /** The profile for validating the signer certificate. */ - private PKIProfile certificateValidationProfile; - /** Supplements for the transformations. */ - private List transformationSupplements; - /** Whether to include hash input data in the response. */ - private boolean includeHashInputData; - /** Whether to include reference input data in the response. */ - private boolean includeReferenceInputData; - - /** - * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#checkSecurityLayerManifest() - */ - public boolean checkSecurityLayerManifest() { - return checkSecurityLayerManifest; - } - - /** - * Set whether to check the references in the Security Layer manifest. - * - * @param checkSecurityLayerManifest true, if the references - * in the Security Layer manifest must be checked. - */ - public void setCheckSecurityLayerManifest(boolean checkSecurityLayerManifest) { - this.checkSecurityLayerManifest = checkSecurityLayerManifest; - } - - /** - * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#checkXMLDsigManifests() - */ - public boolean checkXMLDsigManifests() { - return checkXMLDsigManifests; - } - - /** - * Sets whether to check the references of all XML Dsig manifests. - * - * @param checkXMLDSigManifests true, if the references in the - * XML Dsig manifest must be checked. - */ - public void setCheckXMLDsigManifests(boolean checkXMLDSigManifests) { - this.checkXMLDsigManifests = checkXMLDSigManifests; - } - - /** - * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#getCertificateValidationProfile() - */ - public PKIProfile getCertificateValidationProfile() { - return certificateValidationProfile; - } - - /** - * Sets the profile for validating the signer certificate. - * - * @param certificateValidationProfile The certificate validation profile to - * set. - */ - public void setCertificateValidationProfile(PKIProfile certificateValidationProfile) { - this.certificateValidationProfile = certificateValidationProfile; - } - - /** - * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#getTransformationSupplements() - */ - public List getTransformationSupplements() { - return transformationSupplements; - } - - /** - * Sets the transformation supplements. - * - * @param transformationSupplements The transformation supplements to set. - */ - public void setTransformationSupplements(List transformationSupplements) { - this.transformationSupplements = transformationSupplements; - } - - /** - * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#includeHashInputData() - */ - public boolean includeHashInputData() { - return includeHashInputData; - } - - /** - * Set whether to include the hash input data in the result. - * - * @param includeHashInputData If true, the hash input data - * will be returned in the result. - */ - public void setIncludeHashInputData(boolean includeHashInputData) { - this.includeHashInputData = includeHashInputData; - } - - /** - * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#includeReferenceInputData() - */ - public boolean includeReferenceInputData() { - return includeReferenceInputData; - } - - /** - * Set whether to include the reference input data in the result. - * - * @param includeReferenceInputData If true, the reference - * input data will be included in the result. - */ - public void setIncludeReferenceInputData(boolean includeReferenceInputData) { - this.includeReferenceInputData = includeReferenceInputData; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java deleted file mode 100644 index caf17db66..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package at.gv.egovernment.moa.spss.server.init; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.Configurator; -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; - -/** - * Default implementation of Configurator. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ConfiguratorImpl extends Configurator { - /** whether the configuration has been initialized */ - private boolean initialized = false; - - public void init() throws MOAException { - if (!initialized) { - SystemInitializer.init(); - initialized = true; - } - } - - public void update() throws MOAException { - if (!initialized) { - return; - } - - try { - // reconfigure the system - ConfigurationProvider config = ConfigurationProvider.reload(); - new IaikConfigurator().configure(config); - } catch (MOAException e) { - throw e; - } catch (Throwable t) { - throw new ConfigurationException("", null, t); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java b/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java deleted file mode 100644 index 4871ac4fe..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java +++ /dev/null @@ -1,129 +0,0 @@ -package at.gv.egovernment.moa.spss.server.init; - -import java.io.IOException; -import java.security.Security; - -import javax.net.ssl.SSLSocketFactory; - -import org.apache.axis.AxisProperties; - -import iaik.ixsil.init.IXSILInit; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; -import at.gv.egovernment.moa.spss.server.logging.IaikLog; -import at.gv.egovernment.moa.spss.server.service.RevocationArchiveCleaner; -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * MOA SP/SS web service initialization. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SystemInitializer { - /** Interval between archive cleanups in seconds */ - private static final long ARCHIVE_CLEANUP_INTERVAL = 60 * 60; // 1h - /** The MOA SP/SS logging hierarchy. */ - private static final String LOGGING_HIERARCHY = "moa.spss.server"; - /** Whether XML schema grammars have been initialized. */ - private static boolean grammarsInitialized = false; - - /** - * Initialize the MOA SP/SS webservice. - */ - public static void init() { - MessageProvider msg = MessageProvider.getInstance(); - ClassLoader cl = SystemInitializer.class.getClassLoader(); - Thread archiveCleaner; - - // set up the MOA SPSS logging hierarchy - Logger.setHierarchy(LOGGING_HIERARCHY); - - // set up a logging context for logging the startup - LoggingContextManager.getInstance().setLoggingContext( - new LoggingContext("startup")); - - // load some jsse classes so that the integrity of the jars can be verified - // before the iaik jce is installed as the security provider - // this workaround is only needed when sun jsse is used in conjunction with - // iaik-jce (on jdk1.3) - try { - cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar - } catch (ClassNotFoundException e) { - Logger.warn(msg.getMessage("init.03", null), e); - } - - // set up SUN JSSE SSL - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty( - "java.protocol.handler.pkgs", - "com.sun.net.ssl.internal.www.protocol"); - SSLSocketFactory.getDefault(); - - -// AxisProperties.setProperty("enableNamespacePrefixOptimization","false"); -// AxisProperties.setProperty("disablePrettyXML", "true"); -// AxisProperties.setProperty("axis.doAutoTypes", "true"); - - // initialize preparsed Xerces grammar pool for faster XML - // parsing/validating - try { - if (!grammarsInitialized) { - Class clazz = SystemInitializer.class; - // preparse XML schema - DOMUtils.addSchemaToPool( - clazz.getResourceAsStream(Constants.XML_SCHEMA_LOCATION), - Constants.XML_NS_URI); - // preparse XMLDsig Filter2 schema - DOMUtils.addSchemaToPool( - clazz.getResourceAsStream(Constants.DSIG_FILTER2_SCHEMA_LOCATION), - Constants.DSIG_FILTER2_NS_URI); - // preparse XMLDsig schema - DOMUtils.addSchemaToPool( - clazz.getResourceAsStream(Constants.DSIG_SCHEMA_LOCATION), - Constants.DSIG_NS_URI); - // preparse MOA schema - DOMUtils.addSchemaToPool( - clazz.getResourceAsStream(Constants.MOA_SCHEMA_LOCATION), - Constants.MOA_NS_URI); - grammarsInitialized = true; - } - } catch (IOException e) { - Logger.warn(new LogMsg(msg.getMessage("init.04", null)), e); - } - - // initialize configuration - try { - ConfigurationProvider config = ConfigurationProvider.getInstance(); - new IaikConfigurator().configure(config); - Logger.info(new LogMsg(msg.getMessage("init.01", null))); - } catch (MOAException e) { - Logger.fatal(new LogMsg(msg.getMessage("init.00", null)), e); - } - - // set IXSIL debug output - IXSILInit.setPrintDebugLog( - Logger.isDebugEnabled(IaikLog.IAIK_LOG_HIERARCHY)); - - // start the archive cleanup thread - archiveCleaner = - new Thread(new RevocationArchiveCleaner(ARCHIVE_CLEANUP_INTERVAL)); - archiveCleaner.setName("RevocationArchiveCleaner"); - archiveCleaner.setDaemon(true); - archiveCleaner.setPriority(Thread.MIN_PRIORITY); - archiveCleaner.start(); - - // unset the startup logging context - LoggingContextManager.getInstance().setLoggingContext(null); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java deleted file mode 100644 index f7a322d11..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java +++ /dev/null @@ -1,221 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import iaik.IAIKException; -import iaik.IAIKRuntimeException; -import iaik.server.modules.cmsverify.CMSSignatureVerificationModule; -import iaik.server.modules.cmsverify.CMSSignatureVerificationModuleFactory; -import iaik.server.modules.cmsverify.CMSSignatureVerificationProfile; -import iaik.server.modules.cmsverify.CMSSignatureVerificationResult; - -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentReference; -import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.server.logging.IaikLog; -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * A class providing an interface to the - * CMSSignatureVerificationModule. - * - * This class performs the invocation of the - * iaik.server.modules.cmsverify.CMSSignatureVerificationModule - * from a VerifyCMSSignatureRequest. The result of the invocation - * is integrated into a VerifyCMSSignatureResponse returned. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CMSSignatureVerificationInvoker { - - /** The single instance of this class. */ - private static CMSSignatureVerificationInvoker instance = null; - - /** - * Return the only instance of this class. - * - * @return The only instance of this class. - */ - public static synchronized CMSSignatureVerificationInvoker getInstance() { - if (instance == null) { - instance = new CMSSignatureVerificationInvoker(); - } - return instance; - } - - /** - * Create a new CMSSignatureVerificationInvoker. - * - * Protected to disallow multiple instances. - */ - protected CMSSignatureVerificationInvoker() { - } - - /** - * Verify a CMS signature. - * - * @param request The VerifyCMSSignatureRequest containing the - * CMS signature, as well as additional data needed for verification. - * @return Element A VerifyCMSSignatureResponse containing the - * answer to the VerifyCMSSignatureRequest. - * @throws MOAException An error occurred while processing the request. - */ - public VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) - throws MOAException { - CMSSignatureVerificationProfileFactory profileFactory = - new CMSSignatureVerificationProfileFactory(request); - VerifyCMSSignatureResponseBuilder responseBuilder = - new VerifyCMSSignatureResponseBuilder(); - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - LoggingContext loggingCtx = - LoggingContextManager.getInstance().getLoggingContext(); - InputStream signature; - InputStream signedContent = null; - CMSSignatureVerificationProfile profile; - Date signingTime; - List results; - CMSSignatureVerificationResult result; - int[] signatories; - InputStream input; - byte[] buf = new byte[256]; - - // get the signature - signature = request.getCMSSignature(); - - try { - // get the signed content - signedContent = getSignedContent(request); - - // build the profile - profile = profileFactory.createProfile(); - - // get the signing time - signingTime = request.getDateTime(); - - // verify the signature - CMSSignatureVerificationModule module = - CMSSignatureVerificationModuleFactory.getInstance(); - - module.setLog(new IaikLog(loggingCtx.getNodeID())); - - module.init( - signature, - signedContent, - profile, - new TransactionId(context.getTransactionID())); - input = module.getInputStream(); - - while (input.read(buf) > 0); - results = module.verifySignature(signingTime); - } catch (IAIKException e) { - MOAException moaException = IaikExceptionMapper.getInstance().map(e); - throw moaException; - } catch (IAIKRuntimeException e) { - MOAException moaException = IaikExceptionMapper.getInstance().map(e); - throw moaException; - } catch (IOException e) { - throw new MOAApplicationException("2244", null, e); - } catch (MOAException e) - { - throw e; - } - finally - { - try - { - if (signedContent != null) signedContent.close(); - } - catch (Throwable t) - { - // Intentionally do nothing here - } - } - - // build the response: for each signatory add the result to the response - signatories = request.getSignatories(); - if (signatories == VerifyCMSSignatureRequest.ALL_SIGNATORIES) { - Iterator resultIter; - - for (resultIter = results.iterator(); resultIter.hasNext();) { - result = (CMSSignatureVerificationResult) resultIter.next(); - responseBuilder.addResult(result); - } - } else { - int i; - - for (i = 0; i < signatories.length; i++) { - int sigIndex = signatories[i] - 1; - - try { - result = - (CMSSignatureVerificationResult) results.get(signatories[i] - 1); - responseBuilder.addResult(result); - } catch (IndexOutOfBoundsException e) { - throw new MOAApplicationException( - "2249", - new Object[] { new Integer(sigIndex)}); - } - } - } - - return responseBuilder.getResponse(); - } - - /** - * Get the signed content contained either in the request itself or given as a - * reference to external data. - * - * @param request The VerifyCMSSignatureRequest containing the - * signed content (or the reference to the signed content). - * @return InputStream A stream providing the signed content data, or - * null if no signed content was provided with the request. - * @throws MOAApplicationException An error occurred building the stream. - */ - private InputStream getSignedContent(VerifyCMSSignatureRequest request) - throws MOAApplicationException { - - CMSDataObject dataObj; - CMSContent content; - - // select the Content element - dataObj = request.getDataObject(); - if (dataObj == null) { - return null; - } - content = dataObj.getContent(); - - // build the content data - switch (content.getContentType()) { - case CMSContent.EXPLICIT_CONTENT : - return ((CMSContentExcplicit) content).getBinaryContent(); - case CMSContent.REFERENCE_CONTENT : - String reference = ((CMSContentReference) content).getReference(); - if (!"".equals(reference)) { - ExternalURIResolver resolver = new ExternalURIResolver(); - return resolver.resolve(reference); - } else { - return null; - } - default : - return null; - } - - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java deleted file mode 100644 index 442921850..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import iaik.server.modules.cmsverify.CMSSignatureVerificationProfile; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.cmsverify.CMSSignatureVerificationProfileImpl; -import at.gv.egovernment.moa.spss.server.iaik.pki.PKIProfileImpl; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * A factory to create a CMSSignatureVerificationProfile from a - * VerifyCMSSignatureRequest and the current MOA configuration - * data. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CMSSignatureVerificationProfileFactory { - - /** The VerifyCMSSignatureRequest to draw profile data from. */ - private VerifyCMSSignatureRequest request; - - /** - * Create a new CMSSignatureVerificationProfileFactory. - * - * @param request The VerifyCMSSignatureRequest to draw profile - * data from. - */ - public CMSSignatureVerificationProfileFactory(VerifyCMSSignatureRequest request) { - this.request = request; - } - - /** - * Create a CMSSignatureVerificationProfile from the given - * request and the current MOA configuration. - * - * @return The CMSSignatureVerificationProfile for the - * request, based on the current configuration. - * @throws MOAException An error occurred creating the profile. - */ - public CMSSignatureVerificationProfile createProfile() - throws MOAException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - CMSSignatureVerificationProfileImpl profile = - new CMSSignatureVerificationProfileImpl(); - String trustProfileID; - - // set the certificate validation profile - trustProfileID = request.getTrustProfileId(); - profile.setCertificateValidationProfile( - new PKIProfileImpl(config, trustProfileID)); - - return profile; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java deleted file mode 100644 index 6302cadfd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java +++ /dev/null @@ -1,71 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; - -/** - * A class to build a CreateXMLSignatureResponse. - * - *

The methods addSignature() and addError() may be - * called in any combination to add SignatureEnvironment and - * ErrorResponse elements to the response. One of these functions - * must be called at least once to produce a - * CreateXMLSignatureResponse.

- * - *

The getResponseElement() method then returns the - * CreateXMLSignatureResponse built so far.

- * - * @author Patrick Peck - * @version $Id$ - */ -public class CreateXMLSignatureResponseBuilder { - - /** The SPSSFactory for creating API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - /** The elements to add to the response. */ - private List responseElements = new ArrayList(); - - /** - * Get the CreateXMLSignatureResponse built so far. - * - * @return The CreateXMLSignatureResponse built so far. - */ - public CreateXMLSignatureResponse getResponse() { - return factory.createCreateXMLSignatureResponse(responseElements); - } - - /** - * Add a SignatureEnvironment element to the response. - * - * @param signatureEnvironment The content to put under the - * SignatureEnvironment element. This should either be a - * dsig:Signature element (in case of a detached signature) or - * the signature environment containing the signature (in case of - * an enveloping signature). - */ - public void addSignatureEnvironment(Element signatureEnvironment) { - SignatureEnvironmentResponse responseElement = - factory.createSignatureEnvironmentResponse(signatureEnvironment); - responseElements.add(responseElement); - } - - /** - * Add a ErrorResponse element to the response. - * - * @param errorCode The error code. - * @param info Additional information about the error. - */ - public void addError(String errorCode, String info) { - ErrorResponse errorResponse = - factory.createErrorResponse(Integer.parseInt(errorCode), info); - responseElements.add(errorResponse); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java deleted file mode 100644 index 1386d5c2d..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java +++ /dev/null @@ -1,892 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import org.xml.sax.EntityResolver; -import org.xml.sax.SAXException; - -import iaik.ixsil.util.URI; -import iaik.ixsil.util.XPointerReferenceResolver; -import iaik.server.modules.xml.DataObject; -import iaik.server.modules.xml.XMLDataObject; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.EntityResolverChain; -import at.gv.egovernment.moa.util.MOAEntityResolver; -import at.gv.egovernment.moa.util.MOAErrorHandler; -import at.gv.egovernment.moa.util.StreamEntityResolver; -import at.gv.egovernment.moa.util.StreamUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.ContentBinary; -import at.gv.egovernment.moa.spss.api.common.ContentLocRef; -import at.gv.egovernment.moa.spss.api.common.ContentXML; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterBinary; -import at.gv.egovernment.moa.spss.server.iaik.xml.ByteArrayDataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.ByteStreamDataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.DataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XMLNodeListDataObjectImpl; -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * A class to create DataObjects contained in different - * locations of the MOA XML request format. - * - * @author Patrick Peck - * @author Gregor Karlinger - * @version $Id$ - */ -public class DataObjectFactory { - - /** The single instance of this class. */ - private static DataObjectFactory instance = null; - - /** - * Return the only instance of this class. - * - * @return The only instance of this class. - */ - public static synchronized DataObjectFactory getInstance() { - if (instance == null) { - instance = new DataObjectFactory(); - } - return instance; - } - - /** - * Create a new DataObjectFactory. - * - * Protected to disallow multiple instances. - */ - protected DataObjectFactory() { - } - - /** - * Return the signature environment, i.e., the root element of the - * document, into which the signature will be inserted (if created) or which - * contains the signature (if verified). - * - * @param content The Content object containing the signature - * environment. - * @param supplements Additional schema or DTD information. - * @return The signature environment or null, if no - * signature environment exists. - * @throws MOASystemException A system error occurred building the signature - * environment (see message for details). - * @throws MOAApplicationException An error occurred building the signature - * environment (see message for details). - */ - public XMLDataObject createSignatureEnvironment( - Content content, - List supplements) - throws MOASystemException, MOAApplicationException { - - String reference = content.getReference(); - EntityResolver entityResolver; - byte[] contentBytes; - - // check for content and reference not being set at the same time - checkAllowContentAndReference(content, false); - - // build the EntityResolver for validating parsing - if (supplements == null || supplements.isEmpty()) { - entityResolver = new MOAEntityResolver(); - } else { - EntityResolverChain chain = new EntityResolverChain(); - - chain.addEntityResolver(buildSupplementEntityResolver(supplements)); - chain.addEntityResolver(new MOAEntityResolver()); - entityResolver = chain; - } - - // convert the content into a byte array - try { - switch (content.getContentType()) { - case Content.BINARY_CONTENT : - { - InputStream is = ((ContentBinary) content).getBinaryContent(); - contentBytes = StreamUtils.readStream(is); - break; - } - case Content.LOCREF_CONTENT: - { - ExternalURIResolver uriResolver = new ExternalURIResolver(); - String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); - InputStream is = null; - try - { - is = uriResolver.resolve(locRefURI); - contentBytes = StreamUtils.readStream(is); - } - catch (MOAApplicationException e) - { - throw new MOAApplicationException("3203", new Object[]{reference, locRefURI}, e); - } - finally - { - closeInputStream(is); - } - break; - } - case Content.REFERENCE_CONTENT : - { - ExternalURIResolver uriResolver = new ExternalURIResolver(); - InputStream is = null; - try - { - is = uriResolver.resolve(reference); - contentBytes = StreamUtils.readStream(is); - } - catch (Exception e) - { - throw e; - } - finally - { - closeInputStream(is); - } - break; - } - case Content.XML_CONTENT : - { - Element element = - checkForSingleElement(((ContentXML) content).getXMLContent()); - contentBytes = DOMUtils.serializeNode(element, "UTF-8"); - break; - } - default : - contentBytes = null; // this will not happen - } - } catch (MOAApplicationException e) { - throw e; - } catch (Exception e) { - throw new MOAApplicationException("2219", null); - } - - // try to parse validating - try { - ByteArrayInputStream is = new ByteArrayInputStream(contentBytes); - Document doc = - DOMUtils.parseDocument( - is, - true, - Constants.ALL_SCHEMA_LOCATIONS, - null, - entityResolver, - new MOAErrorHandler()); - - return new XMLDataObjectImpl(doc.getDocumentElement()); - } catch (Exception e) { - // never mind, we'll try non-validating - MessageProvider msg = MessageProvider.getInstance(); - Logger.info(new LogMsg(msg.getMessage("invoker.00", null))); - } - - // try to parse non-validating - try { - ByteArrayInputStream is = new ByteArrayInputStream(contentBytes); - Document doc = DOMUtils.parseDocument(is, false, null, null); - return new XMLDataObjectImpl(doc.getDocumentElement()); - } catch (Exception e) { - throw new MOAApplicationException("2218", null); - } - } - - /** - * Create an XMLDataObject from the given signature environment. - * - * @param signatureEnvironment The signature environment contained in the - * result. - * @param uri The URI identifying the data. This must be either the empty - * URI, an URI starting with "#xpointer", "#xmlns" - * or "#element"; or an URI starting with "#" and - * followed by an element ID. - * @param referenceID The reference ID to set for the data object. - * @return A data object containing the signature environment. - */ - public DataObject createFromSignatureEnvironment( - Element signatureEnvironment, - String uri, - String referenceID) - throws MOAApplicationException { - - DataObjectImpl dataObject = null; - - if ("".equals(uri)) { - dataObject = new XMLDataObjectImpl(signatureEnvironment); - } else if ( - uri.startsWith("#xpointer") - || uri.startsWith("#xmlns") - || uri.startsWith("#element")) { - try { - XPointerReferenceResolver resolver = new XPointerReferenceResolver(); - URI uriObj = new URI(uri); - NodeList nodes = - resolver.resolveForest( - uriObj, - signatureEnvironment.getOwnerDocument(), - null); - dataObject = new XMLNodeListDataObjectImpl(nodes); - } catch (Exception e) { - throw new MOAApplicationException("2237", new Object[] { uri }); - } - } else if (uri.startsWith("#")) { - String id = uri.substring(1); - Element refElem = - signatureEnvironment.getOwnerDocument().getElementById(id); - - if (refElem == null) { - throw new MOAApplicationException("2237", new Object[] { id }); - } - dataObject = new XMLDataObjectImpl(refElem); - } - - dataObject.setReferenceID(referenceID); - dataObject.setURI(uri); - - return dataObject; - } - - /** - * Build a StreamEntityResolver from a List of - * supplements. - * - * @param supplements The supplements, given as - * XMLDataObjectAssociations. - * @return A StreamEntityResolver mapping the supplements by - * their reference URI to an InputStream of their respective - * content. - */ - private static StreamEntityResolver buildSupplementEntityResolver(List supplements) - throws MOAApplicationException - { - Map entities = new HashMap(); - Iterator iter; - - for (iter = supplements.iterator(); iter.hasNext();) { - XMLDataObjectAssociation supplement = - (XMLDataObjectAssociation) iter.next(); - Content content = supplement.getContent(); - String reference = content.getReference(); - - switch (content.getContentType()) { - case Content.BINARY_CONTENT : - { - entities.put(reference, ((ContentBinary) content).getBinaryContent()); - break; - } - case Content.LOCREF_CONTENT: - { - ExternalURIResolver uriResolver = new ExternalURIResolver(); - String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); - InputStream contentIS = null; - InputStream uriStream = null; - try - { - uriStream = uriResolver.resolve(locRefURI); - byte[] contentBytes = StreamUtils.readStream(uriStream); - contentIS = new ByteArrayInputStream(contentBytes); - } - catch (Exception e) - { - throw new MOAApplicationException("3202", new Object[]{reference, locRefURI}, e); - } - finally - { - closeInputStream(uriStream); - } - entities.put(reference, contentIS); - break; - } - case Content.XML_CONTENT : - { - // serialize the first element node that is found in the supplement - // and make it available as a stream - NodeList nodes = ((ContentXML) content).getXMLContent(); - int i = 0; - - // find the first element node - while (i < nodes.getLength() - && nodes.item(i).getNodeType() != Node.ELEMENT_NODE) - i++; - - // serialize the node - if (i < nodes.getLength()) { - try - { - byte[] serialized = DOMUtils.serializeNode(nodes.item(i), "UTF-8"); - entities.put(reference, new ByteArrayInputStream(serialized)); - } - catch (Exception e) - { - throw new MOAApplicationException("2281", new Object[]{reference}, e); - } - } - break; - } - } - } - - return new StreamEntityResolver(entities); - } - - /** - * Create a DataObject from a Content object. - * - * @param content The Content object containing the data. - * @param finalDataMetaInfo The meta information corresponding with content. - * @param referenceID The reference ID to set in the resulting - * DataObject. May be null. - * @param allowContentAndReference If true, then - * content is allowed to contain both a Reference - * attribute and content. Otherwise, either a Reference - * attribute or content must be set. - * @param binaryAsXml If true, a content child given as - * Base64Content must contain XML data. - * @param xmlAsNodeList If true, the children of a - * XMLContent child element are returned as a - * XMLNodeListDataObject. Otherwise, XMLContent may - * only contain a single child node, which must be an element and which is - * returned as an XMLDataObject. - * @param referenceAsXml If true, then content loaded from the - * URI given as the Reference attribute must be XML data. - * If false, an attempt is made to parse the data as XML and - * return an XMLDataObject but if this fails, a - * BinaryDataObject is returned containing a byte stream to the - * data. - * @return A DataObject representing the data in - * content. If base64AsXml==true and - * xmlAsNodeList==false and referenceAsXml==true, - * then the result can safely be cast to an XMLDataObject. - * @throws MOASystemException An error indicating an internal problem. See the - * wrapped exception for details. - * @throws MOAApplicationException An error occurred handling the content - * (probably while opening a reference or parsing the data). See the wrapped - * exception for details. - */ - public DataObject createFromContentOptionalRefType( - Content content, - MetaInfo finalDataMetaInfo, - String referenceID, - boolean allowContentAndReference, - boolean binaryAsXml, - boolean xmlAsNodeList, - boolean referenceAsXml) - throws MOASystemException, MOAApplicationException { - - String reference = content.getReference(); - DataObjectImpl dataObject = null; - - checkAllowContentAndReference(content, allowContentAndReference); - - // ok, build the data object; use content first, if available - switch (content.getContentType()) - { - case Content.XML_CONTENT : - { - ContentXML contentXml = (ContentXML) content; - dataObject = createFromXmlContent(contentXml, xmlAsNodeList); - break; - } - case Content.BINARY_CONTENT : - { - ContentBinary contentBinary = (ContentBinary) content; - dataObject = createFromBinaryContent(contentBinary, binaryAsXml, false); - break; - } - case Content.LOCREF_CONTENT : - { - String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); - try - { - dataObject = createFromURIImpl(locRefURI, referenceAsXml); - } - catch (MOAApplicationException e) - { - throw new MOAApplicationException("3201", new Object[]{reference, locRefURI}, e); - } - break; - } - case Content.REFERENCE_CONTENT : - { - dataObject = createFromURIImpl(reference, referenceAsXml); - break; - } - } - - // set URI and reference ID - dataObject.setURI(reference); - dataObject.setReferenceID(referenceID); - - // set Type gathered from corresponding meta information - dataObject.setTypeURI(finalDataMetaInfo.getType()); - - return dataObject; - } - - /** - * Check, if content and reference URIs are allowed in the content an throw - * an exception if an illegal combination of the two occurs. - * - * @param content The Content to check. - * @param allowContentAndReference Whether explicit content and a reference - * are allowed at the same time. - * @throws MOAApplicationException If allowContentAndRefernece - * is false and both explicit content and reference are set, - * an exception is thrown. - */ - private static void checkAllowContentAndReference( - Content content, - boolean allowContentAndReference) - throws MOAApplicationException { - String reference = content.getReference(); - - // check for content and reference not being set - if (content.getContentType() == Content.REFERENCE_CONTENT - && reference == null) { - String errorCode = allowContentAndReference ? "1111" : "1110"; - throw new MOAApplicationException(errorCode, null); - } - - // if we only allow either content or reference being set at once, check - if (!allowContentAndReference - && (content.getContentType() != Content.REFERENCE_CONTENT) - && (reference != null)) { - throw new MOAApplicationException("1110", null); - } - } - - /** - * Create a DataObject from a - * XMLDataObjectAssociation object. - * - * @param xmlDataObjAssoc The XMLDataObjectAssociation object. - * @param xmlContentAllowed Whether the content contained in the - * xmlDataObjAssoc is allowed to be of type - * XML_CONTENT. - * @param binaryContentRepeatable If binary content must be provided as a - * DataObject that can be read multiple times. - * @return A DataObject representing the data in - * xmlDataObjAssoc. - * @throws MOASystemException An error indicating an internal problem. See the - * wrapped exception for details. - * @throws MOAApplicationException An error occurred handling the content - * (probably while parsing the data). See the wrapped exception for details. - */ - public DataObject createFromXmlDataObjectAssociation( - XMLDataObjectAssociation xmlDataObjAssoc, - boolean xmlContentAllowed, - boolean binaryContentRepeatable) - throws MOASystemException, MOAApplicationException { - - Content content = xmlDataObjAssoc.getContent(); - MetaInfo metaInfo = xmlDataObjAssoc.getMetaInfo(); - String mimeType = metaInfo != null ? metaInfo.getMimeType() : null; - DataObjectImpl dataObject = null; - - switch (content.getContentType()) - { - case Content.XML_CONTENT : - { - if (xmlContentAllowed) - { - dataObject = createFromXmlContent((ContentXML) content, true); - } - else - { - throw new MOAApplicationException("2280", null); - } - break; - } - case Content.BINARY_CONTENT : - { - dataObject = createFromBinaryContent( - (ContentBinary) content, - false, - binaryContentRepeatable); - break; - } - case Content.LOCREF_CONTENT : - { - String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); - try - { - dataObject = createFromURIImpl(locRefURI, false); - } - catch (MOAApplicationException e) - { - throw new MOAApplicationException("3201", new Object[]{content.getReference(), locRefURI}, e); - } - break; - } - } - - dataObject.setURI(content.getReference()); - dataObject.setMimeType(mimeType); - return dataObject; - } - - /** - * Create a DataObject from a TransformParameter - * object. - * - * @param transformParameter The TransformParameter object - * containing the data. - * @return A DataObject representing the data in - * root. - * @throws MOASystemException An error indicating an internal problem. See the - * wrapped exception for details. - * @throws MOAApplicationException An error occurred handling the content - * (probably while opening a reference or parsing the data). See the wrapped - * exception for details. - */ - public DataObject createFromTransformParameter(TransformParameter transformParameter) - throws MOASystemException, MOAApplicationException { - - DataObjectImpl dataObject; - - switch (transformParameter.getTransformParameterType()) { - case TransformParameter.BINARY_TRANSFORMPARAMETER : - TransformParameterBinary tpBinary = - (TransformParameterBinary) transformParameter; - - try { - //dataObject = new ByteArrayDataObjectImpl(Base64Utils.encode(tpBinary.getBinaryContent())); - dataObject = - new ByteArrayDataObjectImpl( - StreamUtils.readStream(tpBinary.getBinaryContent())); - } catch (Exception e) { - return null; - } - //dataObject = new ByteStreamDataObjectImpl(tpBinary.getBinaryContent()); - break; - default : - // resolve uri and build the content - ExternalURIResolver resolver = new ExternalURIResolver(); - InputStream is = resolver.resolve(transformParameter.getURI()); - ByteArrayInputStream bis; - try - { - bis = new ByteArrayInputStream(StreamUtils.readStream(is)); - } - catch (IOException e) - { - throw new MOAApplicationException("2238", new Object[] {transformParameter.getURI()}, e); - } - finally - { - closeInputStream(is); - } - String contentType = resolver.getContentType(); - dataObject = new ByteStreamDataObjectImpl(bis); - dataObject.setMimeType(contentType); - break; - } - - dataObject.setURI(transformParameter.getURI()); - - return dataObject; - } - - /** - * Create a DataObject from data located at the given URI. - * - * @param uri The URI where the data is located. This method uses - * an ExternalURIResolver to resolve URIs. - * @param asXml If true, a DataObject is only - * returned, if the content consists of XML data. If it does not consist of - * XML data, an MOAApplicationException will be thrown. If this - * parameter is false and the content consists of XML data, this - * method will still attempt to parse it. - * @return The DataObject contained at the URI. - * @throws MOASystemException A system error parsing the XML content. - * @throws MOAApplicationException An error occurred on opening, reading or - * parsing the data behind the URI. - */ - public DataObject createFromURI(String uri, boolean asXml) - throws MOASystemException, MOAApplicationException { - return createFromURIImpl(uri, asXml); - } - - /** - * Create a DataObject from data located at the given URI. - * - * @param uri The URI where the data is located. This method uses - * an ExternalURIResolver to resolve URIs. - * @param asXml If true, a DataObject is only - * returned, if the content consists of XML data. If it does not consist of - * XML data, an MOAApplicationException will be thrown. If this - * parameter is false and the content type is detected as being - * XML data, this method will still attemt to parse it. - * @return The DataObject contained at the URI. - * @throws MOASystemException A system error parsing the XML content. - * @throws MOAApplicationException An error occurred on opening, reading or - * parsing the data behind the URI. - */ - private DataObjectImpl createFromURIImpl(String uri, boolean asXml) - throws MOASystemException, MOAApplicationException { - - ExternalURIResolver resolver = new ExternalURIResolver(); - InputStream is = resolver.resolve(uri); - String contentType = resolver.getContentType(); - DataObjectImpl dataObject; - - // read the content - if (contentType != null && contentTypeIsXml(contentType)) { - Document doc; - - if (asXml) { - try { - // try parsing non-validating: this has to succeed or we - // bail out by throwing an exception - is = resolver.resolve(uri); - doc = DOMUtils.parseDocument(is, false, null, null); - dataObject = new XMLDataObjectImpl(doc.getDocumentElement()); - } catch (ParserConfigurationException e) { - throw new MOASystemException("1106", null, e); - } catch (SAXException e) { - throw new MOAApplicationException("2209", null, e); - } catch (IOException e) { - throw new MOAApplicationException("2210", null, e); - } - finally - { - closeInputStream(is); - } - } else { - try { - // try parsing non-validating: need not succeed - is = resolver.resolve(uri); - doc = DOMUtils.parseDocument(is, false, null, null); - closeInputStream(is); - dataObject = new XMLDataObjectImpl(doc.getDocumentElement()); - } catch (Exception e) { - // this is the last chance: return the data as a byte stream - is = resolver.resolve(uri); - ByteArrayInputStream bis; - try - { - bis = new ByteArrayInputStream(StreamUtils.readStream(is)); - dataObject = new ByteStreamDataObjectImpl(bis); - } - catch (IOException e1) - { - throw new MOAApplicationException("2210", new Object[] { uri }, e1); - } - finally - { - closeInputStream(is); - } - } - } - } - else if (asXml) - { - // if we need XML data, we're in the wrong place here - closeInputStream(is); - throw new MOAApplicationException("2211", new Object[] { uri }); - } - else - { - // content is binary: make it available as a binary input stream - ByteArrayInputStream bis; - try - { - bis = new ByteArrayInputStream(StreamUtils.readStream(is)); - } - catch (IOException e) - { - throw new MOAApplicationException("2210", null, e); - } - finally - { - closeInputStream(is); - } - dataObject = new ByteStreamDataObjectImpl(bis); - } - - dataObject.setMimeType(contentType); - dataObject.setURI(uri); - - return dataObject; - } - - /** - * Savely closes the specified input stream. - * - * @param is The input stream to be closed. - */ - private static void closeInputStream(InputStream is) - { - try - { - if (is != null) is.close(); - } - catch (Throwable t) - { - // Intentionally do nothing here - } - } - - /** - * Determine whether the content type is XML. - * - * Content types recognized as XML start with text/xml and - * application/xml. - * - * @param contentType The content MIME type. - * @return boolean If true, the content type is XML, otherwise - * not. - */ - private static boolean contentTypeIsXml(String contentType) { - return contentType.startsWith("text/xml") - || (contentType.startsWith("application/xml")); - } - - /** - * Create a DataObject from a ContentXML object. - * - * @param xmlContent The ContentXML object from - * which the DataObject is to be built. - * @param xmlAsNodeList If true, the children of - * xmlContent are returned as a - * XMLNodeListDataObject. Otherwise, - * xmlContent may only contain a single child node, which must be - * an element and which is returned as an XMLDataObject. - * @return A DataObject representing the XML content in - * xmlContent. - * @throws MOAApplicationException If xmlAsNodeList is - * false and xmlContent does not have a single child - * element. - */ - private DataObjectImpl createFromXmlContent( - ContentXML xmlContent, - boolean xmlAsNodeList) - throws MOAApplicationException { - - DataObjectImpl dataObject; - - if (xmlAsNodeList) { - dataObject = new XMLNodeListDataObjectImpl(xmlContent.getXMLContent()); - } else { - NodeList nodes = xmlContent.getXMLContent(); - Element element = checkForSingleElement(nodes); - - // build the XMLDataObject - dataObject = new XMLDataObjectImpl(element); - } - return dataObject; - } - - /** - * Check, that the given NodeList contains a single DOM element - * node and return it, otherwise throw an exception. - * - * @param nodes The NodeList to check for a single element. - * @return The single element contained in nodes. - * @throws MOAApplicationException Thrown, if nodes does not - * contain exactly 1 element node. - */ - private Element checkForSingleElement(NodeList nodes) - throws MOAApplicationException { - - Element element = null; - int i; - - // check for a single element node - for (i = 0; i < nodes.getLength(); i++) { - if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) { - if (element == null) { - element = (Element) nodes.item(i); - } else { - throw new MOAApplicationException("1109", null); - } - } - } - - // return the element node - if (element == null) { - throw new MOAApplicationException("1107", null); - } else { - return element; - } - } - - /** - * Create a DataObject from a ContentBinary object. - * - * @param binaryContent The ContentBinary object containing the - * data. - * @param asXml If true, binaryContent must - * contain XML data. Otherwise, a BinaryDataObject will be - * returned containing a byte stream to the decoded Base64 data. - * @param repeatable If multiple calls to getInputStream() must - * repeatedly return the content of the data object. - * @return A DataObject representing the content contained in - * binaryContent. - * @throws MOASystemException An error indicating an internal problem. See the - * wrapped exception for details. - * @throws MOAApplicationException An error occurred handling the content - * (probably while parsing the data). See the wrapped exception for details. - */ - private DataObjectImpl createFromBinaryContent( - ContentBinary binaryContent, - boolean asXml, - boolean repeatable) - throws MOASystemException, MOAApplicationException { - - InputStream byteStream = binaryContent.getBinaryContent(); - DataObjectImpl dataObject; - - if (asXml) { - Document doc; - - try { - doc = DOMUtils.parseDocument(byteStream, false, null, null); - dataObject = new XMLDataObjectImpl(doc.getDocumentElement()); - } catch (ParserConfigurationException e) { - throw new MOASystemException("1106", null, e); - } catch (SAXException e) { - throw new MOAApplicationException("2209", null, e); - } catch (IOException e) { - throw new MOAApplicationException("2210", null, e); - } - } else { - if (repeatable) { - try { - dataObject = - new ByteArrayDataObjectImpl(StreamUtils.readStream(byteStream)); - } catch (IOException e) { - throw new MOAApplicationException("2210", null); - } - } else { - dataObject = new ByteStreamDataObjectImpl(byteStream); - } - } - - return dataObject; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java deleted file mode 100644 index 106742067..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java +++ /dev/null @@ -1,162 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import iaik.ixsil.exceptions.URIException; -import iaik.ixsil.util.URI; - -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * Resolve external URIs and provide them as a stream. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ExternalURIResolver { - - /** The MIME type of the content currently resolved. */ - private String contentType; - - /** - * Return a stream to data at the given URI. - * - * This method will try to open an URLConnection to the given - * URI. Access to the file system is disallowed. - * - * @param uriStr The URI to resolve. - * @return InputStream The data contained at the URI. - * @throws MOAApplicationException An error occurred resolving the URI (e.g., - * the URI is syntactically incorrect or the stream could not be opened). - */ - public InputStream resolve(String uriStr) throws MOAApplicationException { - URI uri; - URL url; - URLConnection connection; - InputStream is; - - // build the URI - try { - uri = new URI(uriStr); - } catch (URIException e) { - throw new MOAApplicationException("2207", new Object[] { uriStr }); - } - - // disallow access to local file system - if ("".equals(uri.getScheme()) || "file".equals(uri.getScheme())) { - throw new MOAApplicationException("2213", new Object[] { uriStr }); - } - - // if we have local content (SOAP with attachments) - if ("formdata".equals(uri.getScheme())) { - TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); - if (context==null) { - //no transaction - throw new MOAApplicationException("2282", new Object[] { uri }); - } else { - - InputStream attachmentIs = context.getAttachmentInputStream(uri); - if (attachmentIs != null) { - setContentType(context.getAttachmentContentType(uri.getPath())); - return attachmentIs; - } else { - //maybe attachments provided but no suiting attachment found - throw new MOAApplicationException("2282", new Object[] { uri }); - } -/* - try { - InputStream attachmentIs = context.getAttachment(uri).getInputStream(); - if (attachmentIs != null) { - setContentType(context.getAttachmentContentType(uri.getPath())); - return attachmentIs; - } else { - //maybe attachments provided but no suiting attachment found - throw new MOAApplicationException("2282", new Object[] { uri }); - } - } catch (IOException e) { - throw new MOAApplicationException("2208", new Object[] { uri }, e); - } -*/ - } - } - - // convert URI to URL - try { - // create the URL - url = new URL(uriStr); - } catch (MalformedURLException e) { - throw new MOAApplicationException("2214", new Object[] { uriStr }); - } - - // build the URLConnection - try { - connection = url.openConnection(); - if ("http".equals(url.getProtocol())) { - HttpURLConnection httpConnection = (HttpURLConnection) connection; - - httpConnection.connect(); - if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { - throw new MOAApplicationException("2208", new Object[] { uri }); - } - } else if ("https".equals(url.getProtocol())) { - /* - * this doesn't work because of some interaction between the IAIK - * JCE and Sun JSSE that results in an "Invalid AVA format" exception - */ - - /* - HttpsURLConnection httpsConnection = (HttpsURLConnection) connection; - InputStream trustStore = - getClass().getResourceAsStream(DEFAULT_TRUST_STORE); - SSLSocketFactory factory = - SSLUtils.getSSLSocketFactory("jks", trustStore, "changeit"); - httpsConnection.setSSLSocketFactory(factory); - httpsConnection.connect(); - if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { - throw new MOAApplicationException("2208", new Object[] { uri }); - } - */ - connection.connect(); - } else { - connection.connect(); - } - is = connection.getInputStream(); - } catch (IOException e) { - throw new MOAApplicationException("2208", new Object[] { uri }, e); - } /*catch (GeneralSecurityException e) { - throw new MOAApplicationException("2208", new Object[] { uri }, e); - }*/ - - // set the content type - setContentType(connection.getContentType()); - - return is; - } - - /** - * Set the content type of the data at the URI. - * - * @param contentType The content type to set. - */ - protected void setContentType(String contentType) { - this.contentType = contentType; - } - - /** - * Return the content type of the data detected at the URI from the previous - * call of resolve(). - * - * @return String The content type. - */ - public String getContentType() { - return contentType; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java deleted file mode 100644 index 60f573e5a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java +++ /dev/null @@ -1,267 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.Map; - -import iaik.IAIKException; -import iaik.IAIKRuntimeException; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.MOASystemException; - - -/** - * Map an exception from the iaik namespace to a - * MOAException. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IaikExceptionMapper { - - /** The argument classes for MOAExceptions. */ - private static final Class[] CONSTRUCTOR_ARGS = - new Class[] { String.class, Object[].class, Throwable.class }; - /** The exception mapping, as an array. */ - private static final Object[][] MESSAGES = - { - { iaik.IAIKException.class, "9900", MOASystemException.class }, - { iaik.IAIKRuntimeException.class, "9901", MOASystemException.class }, - { iaik.server.modules.xmlsign.XMLSignatureCreationException.class, "2220", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.XMLSignatureCreationRuntimeException.class, "2220", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.InvalidKeyException.class, "2221", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.ManifestException.class, "2222", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.ReferenceException.class, "2223", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.HashUnavailableException.class, "2224", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.SignatureAlgorithmException.class, "2225", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.SignatureEmbeddingException.class, "2226", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.SignatureValueException.class, "2227", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.SignedPropertyException.class, "2228", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.SignerCertificateUnavailableException.class, "2229", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.SupplementException.class, "2230", MOAApplicationException.class }, - { iaik.server.modules.xmlsign.TransformationException.class, "2233", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.CMSSignatureVerificationException.class, "2240", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.CMSSignatureVerificationRuntimeException.class, "2240", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.AlgorithmNotSupportedException.class, "2241", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.CMSSignatureParsingException.class, "2242", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.SignerCertificateUnavailableException.class, "2243", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.CMSSignatureVerificationRuntimeException.class, "2247", MOAApplicationException.class }, - { iaik.server.modules.cmsverify.InitException.class, "2248", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.XMLSignatureVerificationException.class, "2240", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.XMLSignatureVerificationRuntimeException.class, "2240", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.AlgorithmNotSupportedException.class, "2241", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.ManifestException.class, "2262", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.PropertiesException.class, "2263", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.ReferenceException.class, "2264", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.HashUnavailableException.class, "2224", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.SignerCertificateUnavailableException.class, "2243", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.SupplementException.class, "2230", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.TransformationException.class, "2265", MOAApplicationException.class }, - { iaik.server.modules.xmlverify.TransformationParsingException.class, "2269", MOAApplicationException.class } - }; - - /** The single instance of this class. */ - private static IaikExceptionMapper instance; - /** The exception mapping, as a Map for fast lookup. */ - private Map messages = new HashMap(); - - /** - * Get the single instance of this class. - * - * @return The single instance of this class. - */ - public static synchronized IaikExceptionMapper getInstance() { - if (instance == null) { - instance = new IaikExceptionMapper(); - } - return instance; - } - - /** - * Create a new IaikExceptionMapper. - * - * Protected to disallow multple instances. - */ - protected IaikExceptionMapper() { - registerMessages(); - } - - /** - * Build the complete IAIKException to message code mapping. - */ - protected void registerMessages() { - int i; - - for (i = 0; i < MESSAGES.length; i++) { - registerMessage( - (Class) MESSAGES[i][0], - (String) MESSAGES[i][1], - (Class) MESSAGES[i][2]); - } - } - - /** - * Register a single IAIKException to message mapping. - * - * @param iaikExceptionClass An exception from the iaik package. - * @param messageId The corresponding error message id. - * @param moaExceptionClass The type of MOAException that the - * IAIKException is mapped to (usually - * MOAApplicationException or MOASystemException). - */ - protected void registerMessage( - Class iaikExceptionClass, - String messageId, - Class moaExceptionClass) { - - messages.put( - iaikExceptionClass, - new ExceptionMappingInfo(messageId, moaExceptionClass)); - } - - /** - * Map an IAIKException to a MOAException. - * - * @param iaikException The IAIKException to map. - * @return A MOAException containing the message for the - * given IAIKException. - */ - public MOAException map(IAIKException iaikException) { - return mapImpl(iaikException); - } - - /** - * Map an IAIKRuntimeException to a MOAException. - * - * @param iaikException The IAIKException to map. - * @return A MOAException containing the message for the - * given IAIKRuntimeException. - */ - public MOAException map(IAIKRuntimeException iaikException) { - return mapImpl(iaikException); - } - - /** - * Map an IAIKException or IAIKRuntimeException to a - * MOAException. - * - * @param iaikException The IAIKException or - * IAIKRuntimeException to map. - * @return A MOAException containing the message for the - * given IAIKRuntimeException. - */ - private MOAException mapImpl(Exception iaikException) { - MOAException moaException = createMoaException(iaikException); - - if (moaException == null) { - return new MOASystemException("9999", null, iaikException); - } - return moaException; - } - - /** - * Create a MOAException from a given IAIKException - * by looking it up in the mapping. - * - * @param iaikException The IAIKException to map. - * @return A MOAException with an error code corresponding to - * the given IAIKException. Returns null, if no - * mapping could be found. - */ - protected MOAException createMoaException(Exception iaikException) { - ExceptionMappingInfo info = lookupMessage(iaikException.getClass()); - Constructor constructor; - - if (info == null) { - return null; - } - - // instantiate the proper MOAException and return it - try { - constructor = - info.getMoaExceptionClass().getConstructor(CONSTRUCTOR_ARGS); - return (MOAException) constructor.newInstance( - new Object[] { - info.getMessageId(), - new Object[] { iaikException.getMessage()}, - iaikException }); - } catch (Exception e) { - return null; - } - } - - /** - * Recursively look up the message associated with an - * IAIKException. - * - * This method walks up the exception inheritance hierarchy until it finds a - * mapping. - * - * @param iaikExceptionClass The IAIKException to look up. - * @return Information about the message id and - * MOAException class that the iaikExceptionClass - * maps to. If no mapping could be found, null is returned. - */ - protected ExceptionMappingInfo lookupMessage(Class iaikExceptionClass) { - ExceptionMappingInfo info; - - // break if - if (iaikExceptionClass.equals(Exception.class)) { - return null; - } - - // look up the exception class - info = (ExceptionMappingInfo) messages.get(iaikExceptionClass); - if (info == null) { - return lookupMessage(iaikExceptionClass.getSuperclass()); - } - return info; - } - -} - -/** - * A class containing a mapping from an error message ID to a - * MOAException class. - * - * @author Patrick Peck - * @version $Id$ - */ -class ExceptionMappingInfo { - /** The message ID. */ - private String messageId; - /** The MOAException class. */ - private Class moaExceptionClass; - - /** - * Create a new ExceptionMappingInfo. - * - * @param messageId The message ID. - * @param moaExceptionClass The MOAException class. - */ - public ExceptionMappingInfo(String messageId, Class moaExceptionClass) { - this.messageId = messageId; - this.moaExceptionClass = moaExceptionClass; - } - - /** - * Return the message ID. - * - * @return The message ID. - */ - public String getMessageId() { - return messageId; - } - - /** - * Returns the MOAException class that the message ID maps to. - * - * @return The MOAException class. - */ - public Class getMoaExceptionClass() { - return moaExceptionClass; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java deleted file mode 100644 index 0c3b45539..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java +++ /dev/null @@ -1,63 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.util.XPathException; -import at.gv.egovernment.moa.util.XPathUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.common.ElementSelector; - -/** - * Utility methods for invoking the IAIK MOA modules. - * - * @author Patrick Peck - * @version $Id$ - */ -public class InvokerUtils { - - /** - * Select the signature parent element. - * - * @param root The root DOM element which contains the signature parent - * element somewhere in its subtree. - * @param location The ElementSelector containing the XPath - * expression to select the signature parent element from the document. - * It is also contains the namespace prefix to URI mapping. - * @return Element The signature parent element. - * @throws MOAApplicationException An error occurred evaluating the - * location. - */ - public static Element evaluateSignatureLocation( - Element root, - ElementSelector location) - throws MOAApplicationException { - - NodeList nodes; - - try { - nodes = - XPathUtils.selectNodeList( - root, - location.getNamespaceDeclarations(), - location.getXPathExpression()); - } catch (XPathException e) { - throw new MOAApplicationException( - "2212", - new Object[] { location.getXPathExpression()}, - e); - } - - if (nodes.getLength() != 1 - || !(nodes.item(0).getNodeType() == Node.ELEMENT_NODE)) { - throw new MOAApplicationException( - "2212", - new Object[] { location.getXPathExpression()}); - } - return (Element) nodes.item(0); - } - - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java deleted file mode 100644 index 158a3ddb5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java +++ /dev/null @@ -1,249 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.xmlbind.ProfileParser; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileID; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileID; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileID; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * Map ProfileID objects to their explicit represantation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ProfileMapper { - - /** The parser to parse the profiles. */ - private static ProfileParser profileParser = new ProfileParser(); - - /** - * Map a CreateTransformsInfoProfile to a - * CreateTransformsInfoProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_CREATETRANSFORMSINFOPROFILE, otherwise the profile - * that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static CreateTransformsInfoProfileExplicit mapCreateTransformsInfoProfile( - CreateTransformsInfoProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getCreateTransformsInfoProfileType()) { - case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE : - return (CreateTransformsInfoProfileExplicit) profile; - - case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE : - CreateTransformsInfoProfileID profileIdObj = - (CreateTransformsInfoProfileID) profile; - String profileID = profileIdObj.getCreateTransformsInfoProfileID(); - Element profileElem = config.getCreateTransformsInfoProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2234", new Object[] { profileID }); - } - - return ( - CreateTransformsInfoProfileExplicit) profileParser - .parseCreateTransformsInfoProfile( - profileElem); - } - return null; // this will not happen - } - - /** - * Map a CreateSignatureEnvironmentProfile to a - * CreateSignatureEnvironmentProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static CreateSignatureEnvironmentProfileExplicit mapCreateSignatureEnvironmentProfile( - CreateSignatureEnvironmentProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getCreateSignatureEnvironmentProfileType()) { - case CreateSignatureEnvironmentProfile - .EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE : - - return (CreateSignatureEnvironmentProfileExplicit) profile; - - case CreateSignatureEnvironmentProfile - .ID_CREATESIGNATUREENVIRONMENTPROFILE : - - CreateSignatureEnvironmentProfileID profileIdObj = - (CreateSignatureEnvironmentProfileID) profile; - String profileID = - profileIdObj.getCreateSignatureEnvironmentProfileID(); - Element profileElem = - config.getCreateSignatureEnvironmentProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2236", new Object[] { profileID }); - } - - return ( - CreateSignatureEnvironmentProfileExplicit) profileParser - .parseCreateSignatureEnvironmentProfile( - profileElem); - - } - return null; - - } - - /** - * Map a List of SupplementProfiles to their - * explicit representation. - * - * @param profiles The profiles to map. - * @param config The MOA configuration to use for looking up profiles. - * @return The mapped profiles. - * @throws MOAApplicationException An error occurred mapping one of the - * profiles. - */ - public static List mapSupplementProfiles( - List profiles, - ConfigurationProvider config) - throws MOAApplicationException { - - List mappedProfiles = new ArrayList(); - Iterator iter; - - for (iter = profiles.iterator(); iter.hasNext();) { - SupplementProfile profile = (SupplementProfile) iter.next(); - mappedProfiles.add(mapSupplementProfile(profile, config)); - } - - return mappedProfiles; - } - - /** - * Map a SupplementProfile to a - * SupplementProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_SUPPLEMENTPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static SupplementProfileExplicit mapSupplementProfile( - SupplementProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getSupplementProfileType()) { - case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE : - return (SupplementProfileExplicit) profile; - - case SupplementProfile.ID_SUPPLEMENTPROFILE : - SupplementProfileID profileIdObj = (SupplementProfileID) profile; - String profileID = profileIdObj.getSupplementProfileID(); - Element profileElem = config.getSupplementProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2267", new Object[] { profileID }); - } - - return ( - SupplementProfileExplicit) profileParser.parseSupplementProfile( - profileElem); - } - - return null; - } - - /** - * Map a List of VerifyTransformsInfoProfiles to - * their explicit representation. - * - * @param profiles The profiles to map. - * @param config The MOA configuration to use for looking up profiles. - * @return The mapped profiles. - * @throws MOAApplicationException An error occurred mapping one of the - * profiles. - */ - public static List mapVerifyTransformsInfoProfiles( - List profiles, - ConfigurationProvider config) - throws MOAApplicationException { - - List mappedProfiles = new ArrayList(); - Iterator iter; - - for (iter = profiles.iterator(); iter.hasNext();) { - VerifyTransformsInfoProfile profile = - (VerifyTransformsInfoProfile) iter.next(); - mappedProfiles.add(mapVerifyTransformsInfoProfile(profile, config)); - } - - return mappedProfiles; - } - - /** - * Map a VerifyTransformsInfoProfile to a - * VerifyTransformsInfoProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static VerifyTransformsInfoProfileExplicit mapVerifyTransformsInfoProfile( - VerifyTransformsInfoProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getVerifyTransformsInfoProfileType()) { - case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE : - return (VerifyTransformsInfoProfileExplicit) profile; - - case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE : - VerifyTransformsInfoProfileID profileIdObj = - (VerifyTransformsInfoProfileID) profile; - String profileID = profileIdObj.getVerifyTransformsInfoProfileID(); - Element profileElem = - config.getVerifyTransformsInfoProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2268", new Object[] { profileID }); - } - - return ( - VerifyTransformsInfoProfileExplicit) profileParser - .parseVerifyTransformsInfoProfile( - profileElem); - } - - return null; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java deleted file mode 100644 index 11f05a2f1..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java +++ /dev/null @@ -1,51 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * A utility class for setting up and tearing down thread-local context - * information needed for calling the Invoker classes. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ServiceContextUtils { - - /** - * Set up the thread-local context information needed for calling the various - * Invoker classes. - * - * @throws ConfigurationException An error occurred setting up the - * configuration in the TransactionContext. - */ - public static void setUpContexts() throws ConfigurationException { - TransactionContextManager txMgr = TransactionContextManager.getInstance(); - LoggingContextManager logMgr = LoggingContextManager.getInstance(); - String transactionID = Thread.currentThread().getName(); - - if (txMgr.getTransactionContext() == null) { - TransactionContext ctx = new TransactionContext(transactionID, null, ConfigurationProvider.getInstance()); - txMgr.setTransactionContext(ctx); - } - - if (logMgr.getLoggingContext() == null) { - LoggingContext ctx = new LoggingContext(transactionID); - logMgr.setLoggingContext(ctx); - } - } - - /** - * Tear down thread-local context information. - */ - public static void tearDownContexts() { - TransactionContextManager.getInstance().setTransactionContext(null); - LoggingContextManager.getInstance().setLoggingContext(null); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java deleted file mode 100644 index dc5ceb21e..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.Collections; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.Configurator; -import at.gv.egovernment.moa.spss.api.SignatureCreationService; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; - -/** - * An implementation of the SignatureCreationService, using - * the XMLSignatureCreationInvoker. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SignatureCreationServiceImpl extends SignatureCreationService { - - /** - * Create an XML signature. - * - * @param request The CreateXMLSignatureRequest containing - * information about the signature(s) to create. - * @return The created signature(s). - * @throws MOAException An error occurred creating the signature(s). - */ - public CreateXMLSignatureResponse createXMLSignature(CreateXMLSignatureRequest request) - throws MOAException { - - XMLSignatureCreationInvoker invoker = - XMLSignatureCreationInvoker.getInstance(); - CreateXMLSignatureResponse response; - - try { - Configurator.getInstance().init(); - ServiceContextUtils.setUpContexts(); - response = invoker.createXMLSignature(request, Collections.EMPTY_SET); - return response; - } finally { - ServiceContextUtils.tearDownContexts(); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java deleted file mode 100644 index 94cdea5d9..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.Configurator; -import at.gv.egovernment.moa.spss.api.SignatureVerificationService; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; - -/** - * An implementation of the SignatureVerificationService using - * the XMLSignatureVerificationInvoker and the - * CMSSignatureVerificationInvoker. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SignatureVerificationServiceImpl - extends SignatureVerificationService { - - /** - * Verify a CMS signature. - * - * @param request The VerifyCMSSignatureRequest containing - * information about the signature verification. - * @return The result of the signature verification. - * @throws MOAException An error occurred during signature verification. - */ - public VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) - throws MOAException { - - CMSSignatureVerificationInvoker invoker = - CMSSignatureVerificationInvoker.getInstance(); - VerifyCMSSignatureResponse response; - - try { - Configurator.getInstance().init(); - ServiceContextUtils.setUpContexts(); - response = invoker.verifyCMSSignature(request); - return response; - } finally { - ServiceContextUtils.tearDownContexts(); - } - } - - /** - * Verify an XML signature. - * - * @param request The VerifyXMLSignatureRequest containinig - * information about the signature verification. - * @return The result of the signature verification. - * @throws MOAException An error occurred during signature verification. - */ - public VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) - throws MOAException { - - XMLSignatureVerificationInvoker invoker = - XMLSignatureVerificationInvoker.getInstance(); - VerifyXMLSignatureResponse response; - - try { - Configurator.getInstance().init(); - ServiceContextUtils.setUpContexts(); - response = invoker.verifyXMLSignature(request); - return response; - } finally { - ServiceContextUtils.tearDownContexts(); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java deleted file mode 100644 index 9984a95a5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java +++ /dev/null @@ -1,258 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import iaik.server.modules.xml.Base64Transformation; -import iaik.server.modules.xml.Canonicalization; -import iaik.server.modules.xml.EnvelopedSignatureTransformation; -import iaik.server.modules.xml.Transformation; -import iaik.server.modules.xml.XPath2Transformation; -import iaik.server.modules.xml.XPathTransformation; -import iaik.server.modules.xml.XSLTTransformation; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; -import at.gv.egovernment.moa.spss.api.common.Transform; -import at.gv.egovernment.moa.spss.api.common.XPathFilter; -import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; -import at.gv.egovernment.moa.spss.api.common.XPathTransform; -import at.gv.egovernment.moa.spss.api.common.XSLTTransform; -import at.gv.egovernment.moa.spss.server.iaik.xml.Base64TransformationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.CanonicalizationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.EnvelopedSignatureTransformationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.ExclusiveCanonicalizationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XPath2FilterImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XPath2TransformationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XPathTransformationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XSLTTransformationImpl; - -/** - * A factory to create Transformation objects from - * Transform objects. - * - * @author Patrick Peck - * @version $Id$ - */ -public class TransformationFactory { - - - /** The single instance of this class. */ - private static TransformationFactory instance = null; - - /** Maps XPathFilter filter types to - * XPath2Transformation filter types. */ - private static Map FILTER_TYPE_MAPPING; - - static { - FILTER_TYPE_MAPPING = new HashMap(); - - FILTER_TYPE_MAPPING.put( - XPathFilter.INTERSECT_TYPE, - XPath2Transformation.XPath2Filter.INTERSECTION); - FILTER_TYPE_MAPPING.put( - XPathFilter.SUBTRACT_TYPE, - XPath2Transformation.XPath2Filter.SUBTRACTION); - FILTER_TYPE_MAPPING.put( - XPathFilter.UNION_TYPE, - XPath2Transformation.XPath2Filter.UNION); - } - - /** - * Get the single instance of the factory. - * - * @return TransformationFactory The single instance. - */ - public static synchronized TransformationFactory getInstance() { - if (instance == null) { - instance = new TransformationFactory(); - } - return instance; - } - - /** - * Create a new TransformationFactory. - * - * Protected to disallow multiple instances. - */ - protected TransformationFactory() { - } - - /** - * Create a Transformation based on a - * Transform object. - * - * @param transform The Transform object to extract - * transformation data from. - * @return The transformation contained in the transform - * object. - * @throws MOAApplicationException An error occured creating the - * Transformation. See exception message for details. - */ - public Transformation createTransformation(Transform transform) - throws MOAApplicationException { - String algorithmUri = transform.getAlgorithmURI(); - - if (Canonicalization.CANONICAL_XML.equals(algorithmUri) - || Canonicalization.CANONICAL_XML_WITH_COMMENTS.equals(algorithmUri)) { - return createC14nTransformation(algorithmUri); - } else if ( - Canonicalization.EXCLUSIVE_CANONICAL_XML.equals(algorithmUri) - || Canonicalization.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS.equals( - algorithmUri)) { - - return createExclusiveC14nTransformation( - (ExclusiveCanonicalizationTransform) transform); - - } else if (Base64Transformation.ALL.contains(algorithmUri)) { - return createBase64Transformation(); - } else if (EnvelopedSignatureTransformation.ALL.contains(algorithmUri)) { - return createEnvelopedSignatureTransformation(); - } else if (XPathTransformation.ALL.contains(algorithmUri)) { - return createXPathTransformation((XPathTransform) transform); - } else if (XPath2Transformation.ALL.contains(algorithmUri)) { - return createXPath2Transformation((XPathFilter2Transform) transform); - } else if (XSLTTransformation.ALL.contains(algorithmUri)) { - return createXSLTTransformation((XSLTTransform) transform); - } else { - throw new MOAApplicationException("1108", new Object[] { algorithmUri }); - } - } - - /** - * Create a List of Transformations from a - * List of Transforms. - * - * @param transforms The List containing the - * Transforms. - * @return The List of Transformations corresponding - * to the transforms. - * @throws MOAApplicationException An error occurred building one of the - * transformations. See exception message for details. - */ - public List createTransformationList(List transforms) - throws MOAApplicationException { - List transformationList = new ArrayList(); - Iterator trIter; - - for (trIter = transforms.iterator(); trIter.hasNext();) { - Transform transform = (Transform) trIter.next(); - transformationList.add(createTransformation(transform)); - } - - return transformationList; - } - - /** - * Create a Canonicalization. - * - * @param algorithmUri The algorithm URI of the canonicalization. - * @return The Canonicalization. - */ - private Transformation createC14nTransformation(String algorithmUri) { - return new CanonicalizationImpl(algorithmUri); - } - - /** - * Create a ExclusiveCanonicalization. - * - * @param transform The ExclusiveCanonicalizationTransform - * containing the transformation data. - * @return The ExclusiveCanonicalization. - */ - private Transformation createExclusiveC14nTransformation(ExclusiveCanonicalizationTransform transform) { - return new ExclusiveCanonicalizationImpl( - transform.getAlgorithmURI(), - transform.getInclusiveNamespacePrefixes()); - } - - /** - * Create a Base64Transformation. - * - * @return The - */ - private Transformation createBase64Transformation() { - return new Base64TransformationImpl(); - } - - /** - * Create an EnvelopedSignatureTransformation. - * - * @return An EnvelopedSignatureTransformation. - */ - private Transformation createEnvelopedSignatureTransformation() { - return new EnvelopedSignatureTransformationImpl(); - } - - /** - * Create an XPathTransformation. - * - * @param transform The Transform object containing the - * XPath transformation. - * @return An XPathTransformation corresponding the - * transformation given in transform. - * @throws MOAApplicationException An error occurred creating the - * Transformation. - */ - private Transformation createXPathTransformation(XPathTransform transform) - throws MOAApplicationException { - - return new XPathTransformationImpl( - transform.getXPathExpression(), - transform.getNamespaceDeclarations()); - } - - /** - * Create an XPath2Transformation. - * - * @param transform The Transform object containing the - * XPath filter transformation. - * @return An XPath2Transformation corresponding the - * transformation given in transform. - * @throws MOAApplicationException An error occurred creating the - * Transformation. - */ - private Transformation createXPath2Transformation(XPathFilter2Transform transform) - throws MOAApplicationException { - - XPath2TransformationImpl xpath2 = new XPath2TransformationImpl(); - Iterator iter; - - for (iter = transform.getFilters().iterator(); iter.hasNext();) { - XPathFilter filter = (XPathFilter) iter.next(); - String mappedFilterType = - (String) FILTER_TYPE_MAPPING.get(filter.getFilterType()); - XPath2FilterImpl mappedFilter = - new XPath2FilterImpl( - mappedFilterType, - filter.getXPathExpression(), - filter.getNamespaceDeclarations()); - xpath2.addXPathFilter(mappedFilter); - } - - if (xpath2.getXPathFilters().size() == 0) { - throw new MOAApplicationException("2216", null); - } - - return xpath2; - } - - /** - * Create an XSLTTransformation. - * - * @param transform The Transform containing the XSLT stylesheet. - * @return An XSLTTransformation corresponding the transformation - * given in transform. - * @throws MOAApplicationException An error occurred creating the - * Transformation. - */ - private Transformation createXSLTTransformation(XSLTTransform transform) - throws MOAApplicationException { - - return new XSLTTransformationImpl(transform.getStylesheet()); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java deleted file mode 100644 index 55e2e1505..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; - -import iaik.server.modules.cmsverify.CMSSignatureVerificationResult; -import iaik.server.modules.cmsverify.CertificateValidationResult; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; - -/** - * A class to build a VerifyCMSSignatureResponse object. - * - *

Via subsequent calls to addResult() a number of results from - * a CMS signature verification can be added to the response.

- * - *

The getResponseElement() method then returns the - * VerifyCMSSignatureResponse built so far.

- * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyCMSSignatureResponseBuilder { - /** The SPSSFactory for creating API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - /** The elements making up the response. */ - private List responseElements = new ArrayList(); - - /** - * Get the VerifyCMSSignatureResponse built so far. - * - * @return The VerifyCMSSignatureResponse built so far. - */ - public VerifyCMSSignatureResponse getResponse() { - return factory.createVerifyCMSSignatureResponse(responseElements); - } - - /** - * Add a verification result to the response. - * - * @param result The result to add. - * @throws MOAApplicationException An error occurred adding the result. - */ - public void addResult(CMSSignatureVerificationResult result) - throws MOAApplicationException { - - CertificateValidationResult certResult = - result.getCertificateValidationResult(); - int signatureCheckCode = - result.getSignatureValueVerificationCode().intValue(); - int certificateCheckCode = certResult.getValidationResultCode().intValue(); - VerifyCMSSignatureResponseElement responseElement; - SignerInfo signerInfo; - CheckResult signatureCheck; - CheckResult certificateCheck; - - // add SignerInfo element - signerInfo = - factory.createSignerInfo( - (X509Certificate) certResult.getCertificateChain().get(0), - certResult.isQualifiedCertificate(), - certResult.isPublicAuthorityCertificate(), - certResult.getPublicAuthorityID()); - - // add SignatureCheck element - signatureCheck = factory.createCheckResult(signatureCheckCode, null); - - // add CertificateCheck element - certificateCheck = factory.createCheckResult(certificateCheckCode, null); - - // build the response element - responseElement = - factory.createVerifyCMSSignatureResponseElement( - signerInfo, - signatureCheck, - certificateCheck); - responseElements.add(responseElement); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java deleted file mode 100644 index d6f58a560..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java +++ /dev/null @@ -1,437 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import iaik.ixsil.algorithms.CanonicalizationAlgorithm; -import iaik.ixsil.algorithms.CanonicalizationAlgorithmImplExclusiveCanonicalXMLWithComments; -import iaik.server.modules.xml.BinaryDataObject; -import iaik.server.modules.xml.DataObject; -import iaik.server.modules.xml.XMLDataObject; -import iaik.server.modules.xml.XMLNodeListDataObject; -import iaik.server.modules.xmlverify.CertificateValidationResult; -import iaik.server.modules.xmlverify.DsigManifest; -import iaik.server.modules.xmlverify.HashUnavailableException; -import iaik.server.modules.xmlverify.ReferenceData; -import iaik.server.modules.xmlverify.ReferenceInfo; -import iaik.server.modules.xmlverify.SecurityLayerManifest; -import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; -import iaik.server.modules.xmlverify.XMLSignatureVerificationResult; -import iaik.x509.X509Certificate; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.w3c.dom.DocumentFragment; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.InputData; -import at.gv.egovernment.moa.spss.api.common.SignerInfo; -import at.gv.egovernment.moa.spss.api.impl.InputDataBinaryImpl; -import at.gv.egovernment.moa.spss.api.impl.InputDataXMLImpl; -import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.util.CollectionUtils; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.NodeListAdapter; - -/** - * A class to build a VerifyXMLSignatureResponse object. - * - *

Via a call to addResult() the only result of the - * signature verification must be added.

- * - *

The getResponseElement() method then returns the - * VerifyXMLSignatureResponse built so far.

- * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyXMLSignatureResponseBuilder { - - /** The SPSSFactory for creating API objects. */ - private SPSSFactory factory = SPSSFactory.getInstance(); - - /** Information about the signer certificate. */ - private SignerInfo signerInfo; - /** The hash input data. */ - private List hashInputDatas; - /** The reference input data. */ - private List referenceInputDatas; - /** The result of the signature check. */ - private ReferencesCheckResult signatureCheck; - /** The result of the signature manifest check. */ - private ReferencesCheckResult signatureManifestCheck; - /** The result of the XMLDsig manifest check. */ - private List xmlDsigManifestChecks; - /** The result of the certificate check. */ - private CheckResult certificateCheck; - - /** - * Get the VerifyMLSignatureResponse built so far. - * - * @return The VerifyXMLSignatureResponse built so far. - */ - public VerifyXMLSignatureResponse getResponse() { - return factory.createVerifyXMLSignatureResponse( - signerInfo, - hashInputDatas, - referenceInputDatas, - signatureCheck, - signatureManifestCheck, - xmlDsigManifestChecks, - certificateCheck); - } - - /** - * Sets the verification result to the response. - * - * This method must be called exactly once to ensure a valid - * VerifyXMLSignatureResponse. - * - * @param result The result to set for the response. - * @param profile The profile used for verifying the signature. - * @param transformsSignatureManifestCheck The overall result for the signature - * manifest check. - * @param certificateCheck The overall result for the certificate check. - * @throws MOAApplicationException An error occurred adding the result. - */ - public void setResult( - XMLSignatureVerificationResult result, - XMLSignatureVerificationProfile profile, - ReferencesCheckResult transformsSignatureManifestCheck, - CheckResult certificateCheck) - throws MOAApplicationException { - - CertificateValidationResult certResult = - result.getCertificateValidationResult(); - List referenceDataList; - ReferenceData referenceData; - List dsigManifestList; - ReferencesCheckResultInfo checkResultInfo; - int[] failedReferences; - Iterator iter; - - // create the SignerInfo; - signerInfo = - factory.createSignerInfo( - (X509Certificate) certResult.getCertificateChain().get(0), - certResult.isQualifiedCertificate(), - certResult.isPublicAuthorityCertificate(), - certResult.getPublicAuthorityID()); - - // Create HashInputData Content objects - referenceDataList = result.getReferenceDataList(); - if (profile.includeHashInputData()) { - hashInputDatas = new ArrayList(); - - // Include SignedInfo references - addHashInputDatas( - hashInputDatas, - referenceDataList, - InputData.CONTAINER_SIGNEDINFO_, - InputData.REFERER_NONE_); - - // Include XMLDSIGManifest references - List xMLDSIGManifests = result.getDsigManifestList(); - for (iter = xMLDSIGManifests.iterator(); iter.hasNext();) - { - DsigManifest currentMF = (DsigManifest) iter.next(); - List xMLDSIGMFReferenceDataList = currentMF.getReferenceDataList(); - addHashInputDatas( - hashInputDatas, - xMLDSIGMFReferenceDataList, - InputData.CONTAINER_XMLDSIGMANIFEST_, - currentMF.getReferringReferenceInfo().getReferenceIndex()); - } - } - - // Create the ReferenceInputData Content objects - if (profile.includeReferenceInputData()) { - referenceInputDatas = new ArrayList(); - - // Include SignedInfo references - addReferenceInputDatas( - referenceInputDatas, - referenceDataList, - InputData.CONTAINER_SIGNEDINFO_, - InputData.REFERER_NONE_); - - // Include XMLDSIGManifest references - List xMLDSIGManifests = result.getDsigManifestList(); - for (iter = xMLDSIGManifests.iterator(); iter.hasNext();) - { - DsigManifest currentMF = (DsigManifest) iter.next(); - List xMLDSIGMFReferenceDataList = currentMF.getReferenceDataList(); - addReferenceInputDatas( - referenceInputDatas, - xMLDSIGMFReferenceDataList, - InputData.CONTAINER_XMLDSIGMANIFEST_, - currentMF.getReferringReferenceInfo().getReferenceIndex()); - } - } - - // create the signature check - failedReferences = buildFailedReferences(result.getReferenceDataList()); - checkResultInfo = - failedReferences != null - ? factory.createReferencesCheckResultInfo(null, failedReferences) - : null; - signatureCheck = - factory.createReferencesCheckResult( - result.getSignatureValueVerificationCode().intValue(), - checkResultInfo); - - // create the signature manifest check - if (profile.checkSecurityLayerManifest()) - { - if (transformsSignatureManifestCheck.getCode() == 1) - { - // checking the transforms failed - signatureManifestCheck = transformsSignatureManifestCheck; - } - else if (result.isSecurityLayerManifestRequired()) - { - if (!result.containsSecurityLayerManifest()) - { - // required security layer manifest is missing in signature - signatureManifestCheck = factory.createReferencesCheckResult(2, null); - } - else - { - // security layer manifest exists, so we have to check its validity - SecurityLayerManifest slManifest = result.getSecurityLayerManifest(); - int verificationResult = slManifest.getManifestVerificationResult().intValue(); - - if (SecurityLayerManifest.CODE_MANIFEST_VALID.intValue() == verificationResult) - { - // security layer manifest exists and is free of errors - signatureManifestCheck = factory.createReferencesCheckResult(0, null); - } - else - { - // security layer manifest exists, but has errors - failedReferences = buildFailedReferences(slManifest.getReferenceDataList()); - checkResultInfo = (failedReferences != null) - ? factory.createReferencesCheckResultInfo(null, failedReferences) - : null; - if (SecurityLayerManifest.CODE_MANIFEST_INCOMPLETE.intValue() == verificationResult) - { - signatureManifestCheck = factory.createReferencesCheckResult(3, checkResultInfo); - } - else if (SecurityLayerManifest.CODE_REFERENCE_HASH_INVALID.intValue() == verificationResult) - { - signatureManifestCheck = factory.createReferencesCheckResult(4, checkResultInfo); - } - else - { - // Should not happen - throw new RuntimeException("Unexpected result from security layer manifest verification."); - } - } - } - } - else - { - // no security layer manifest is required, so the signature manifest check is ok - signatureManifestCheck = factory.createReferencesCheckResult(0, null); - } - } - - // create the xmlDsigManifestCheck - if (profile.checkXMLDsigManifests()) { - xmlDsigManifestChecks = new ArrayList(); - dsigManifestList = result.getDsigManifestList(); - for (iter = dsigManifestList.iterator(); iter.hasNext();) { - DsigManifest dsigManifest = (DsigManifest) iter.next(); - int refIndex = - dsigManifest.getReferringReferenceInfo().getReferenceIndex(); - ManifestRefsCheckResultInfo manifestCheckResultInfo; - - failedReferences = - buildFailedReferences(dsigManifest.getReferenceDataList()); - manifestCheckResultInfo = - factory.createManifestRefsCheckResultInfo( - null, - failedReferences, - refIndex); - xmlDsigManifestChecks.add( - factory.createManifestRefsCheckResult( - dsigManifest.getManifestVerificationResult().intValue(), - manifestCheckResultInfo)); - } - } - - // create the certificate check - this.certificateCheck = certificateCheck; - } - - /** - * Adds {@link InputData} entries to the specified inputDatas list. The content of the entry will - * be created from {@link ReferenceData#getHashInputData()}. - * - * @param inputDatas The list to be amended. - * - * @param referenceDataList The list of {@link ReferenceData} objects to be investigated. - * - * @param containerType The type of container of the {@link InputData} objects to be created. - * - * @param refererNumber The number of the referring reference for the {@link InputData} objects to be created. - * - * @throws MOAApplicationException if creating an {@link InputData} fails. - */ - private void addHashInputDatas(List inputDatas, List referenceDataList, String containerType, int refererNumber) - throws MOAApplicationException - { - for (Iterator iter = referenceDataList.iterator(); iter.hasNext();) - { - ReferenceData referenceData = (ReferenceData) iter.next(); - inputDatas.add(buildInputData( - referenceData.getHashInputData(), - containerType, - refererNumber)); - } - } - - /** - * Adds {@link InputData} entries to the specified inputDatas list. The content of the entry will - * be created from {@link ReferenceData#getReferenceInputData()}. - * - * @param inputDatas The list to be amended. - * - * @param referenceDataList The list of {@link ReferenceData} objects to be investigated. - * - * @param containerType The type of container of the {@link InputData} objects to be created. - * - * @param refererNumber The number of the referring reference for the {@link InputData} objects to be created. - * - * @throws MOAApplicationException if creating an {@link InputData} fails. - */ - private void addReferenceInputDatas(List inputDatas, List referenceDataList, String containerType, int refererNumber) - throws MOAApplicationException - { - for (Iterator iter = referenceDataList.iterator(); iter.hasNext();) - { - ReferenceData referenceData = (ReferenceData) iter.next(); - inputDatas.add(buildInputData( - referenceData.getReferenceInputData(), - containerType, - refererNumber)); - } - } - - /** - * Build a InputDataBinaryImpl or an InputDataXMLImpl - * object from the given DataObject and the given attributes. - * - * @param dataObject The DataObject from which to build the result. - * Based on the type of this parameter, the type of the result will either be - * InputDataBinaryImpl or InputDataXMLImpl. - * - * @param partof see {@link InputData} - * - * @param referringReferenceNumber see {@link InputData} - * - * @return The corresponinding input data implementation. - * - * @throws MOAApplicationException An error occurred creating the result. - */ - private Content buildInputData(DataObject dataObject, String partOf, int referringReferenceNumber) - throws MOAApplicationException { - - if (dataObject instanceof BinaryDataObject) { - BinaryDataObject binaryData = (BinaryDataObject) dataObject; - return new InputDataBinaryImpl( - factory.createContent(binaryData.getInputStream(), null), - partOf, - referringReferenceNumber); - } else if (dataObject instanceof XMLDataObject) { - XMLDataObject xmlData = (XMLDataObject) dataObject; - List nodes = new ArrayList(); - - nodes.add(xmlData.getElement()); - return new InputDataXMLImpl( - factory.createContent(new NodeListAdapter(nodes), null), - partOf, - referringReferenceNumber); - } else { // dataObject instanceof XMLNodeListDataObject - // if the data in the NodeList can be converted back to valid XML, - // write it as XMLContent; otherwise, write it as Base64Content - XMLNodeListDataObject nodeData = (XMLNodeListDataObject) dataObject; - NodeList nodes = nodeData.getNodeList(); - - if (DOMUtils.checkAttributeParentsInNodeList(nodes)) { - // insert as XMLContent - try { - DocumentFragment fragment = DOMUtils.nodeList2DocumentFragment(nodes); - - return new InputDataXMLImpl( - factory.createContent(fragment.getChildNodes(), null), - partOf, - referringReferenceNumber); - } catch (Exception e) { - // not successful -> fall through to the Base64Content - } - } - - // insert canonicalized NodeList as binary content - try { - CanonicalizationAlgorithm c14n = - new CanonicalizationAlgorithmImplExclusiveCanonicalXMLWithComments(); - InputStream is; - - c14n.setInput(nodes); - is = c14n.canonicalize(); - return new InputDataBinaryImpl( - factory.createContent(is, null), - partOf, - referringReferenceNumber); - } catch (Exception e) { - throw new MOAApplicationException("2200", null); - } - } - } - - /** - * Build the failed references. - * - * Failed references are references for which the isHashValid() - * method returns false. - * - * @param refInfos A List containing the - * ReferenceInfo objects to be checked. - * @return The indexes of the failed references. - */ - private int[] buildFailedReferences(List refInfos) { - List failedReferencesList = new ArrayList(); - int i; - - // find out the failed references - for (i = 0; i < refInfos.size(); i++) { - ReferenceInfo refInfo = (ReferenceInfo) refInfos.get(i); - - try { - if (refInfo.isHashCalculated() && !refInfo.isHashValid()) { - failedReferencesList.add(new Integer(i + 1)); - } - } catch (HashUnavailableException e) { - // nothing to do here because we called refInfo.isHashCalculated first - } - } - - // convert to an int array - if (failedReferencesList.isEmpty()) { - return null; - } else { - int[] failedReferences = CollectionUtils.toIntArray(failedReferencesList); - - return failedReferences; - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java deleted file mode 100644 index fd207ddea..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java +++ /dev/null @@ -1,545 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import iaik.IAIKException; -import iaik.IAIKRuntimeException; -import iaik.server.modules.xml.DataObject; -import iaik.server.modules.xml.XMLDataObject; -import iaik.server.modules.xml.XMLSignature; -import iaik.server.modules.xmlsign.XMLSignatureCreationModule; -import iaik.server.modules.xmlsign.XMLSignatureCreationModuleFactory; -import iaik.server.modules.xmlsign.XMLSignatureCreationProfile; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl; -import at.gv.egovernment.moa.spss.server.logging.IaikLog; -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.spss.server.util.IdGenerator; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * A class providing an API based interface to the - * XMLSignatureCreationModule. - * - * This class performs the invocation of the - * iaik.server.modules.xmlsign.XMLSignatureCreationModule from a - * CreateXMLSignatureRequest given as an API object. The result of - * the invocation is integrated into a CreateXMLSignatureResponse - * and returned. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureCreationInvoker { - - /** The single instance of this class. */ - private static XMLSignatureCreationInvoker instance = null; - - /** - * Get the only instance of this class. - * - * @return The only instance of this class. - */ - public static synchronized XMLSignatureCreationInvoker getInstance() { - if (instance == null) { - instance = new XMLSignatureCreationInvoker(); - } - return instance; - } - - /** - * Create a new XMLSignatureCreationInvoker. - * - * Protected to disallow multiple instances. - */ - protected XMLSignatureCreationInvoker() { - } - - /** - * Process the CreateXMLSignatureRequest message and invoke the - * XMLSignatureCreationModule for every - * SingleSignatureInfo contained in the request. - * - * @param request A CreateXMLSignatureRequest API object - * containing the information for creating the signature(s). - * @param reserved A Set of reserved object IDs. - * - * @return A CreateXMLSignatureResponse API object containing - * the created signature(s). The response contains either a - * SignatureEnvironment or a ErrorResponse - * for each SingleSignatureInfo in the request. - * @throws MOAException An error occurred during signature creation. - */ - public CreateXMLSignatureResponse createXMLSignature( - CreateXMLSignatureRequest request, - Set reserved) - throws MOAException { - - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - LoggingContext loggingCtx = - LoggingContextManager.getInstance().getLoggingContext(); - reserved = new HashSet(reserved); - XMLSignatureCreationProfileFactory profileFactory = - new XMLSignatureCreationProfileFactory(request, reserved); - CreateXMLSignatureResponseBuilder responseBuilder = - new CreateXMLSignatureResponseBuilder(); - int createCount = 1; - IdGenerator refIdGen; - XMLSignatureCreationModule module; - Iterator singleSignatureInfoIter; - - // create the XMLSignatureCreationModule and configure it - module = XMLSignatureCreationModuleFactory.getInstance(); - module.setLog(new IaikLog(loggingCtx.getNodeID())); - - // select the SingleSignatureInfo elements - singleSignatureInfoIter = request.getSingleSignatureInfos().iterator(); - - // iterate over all the SingleSignatureInfo elements in the request - while (singleSignatureInfoIter.hasNext()) { - SingleSignatureInfo singleSignatureInfo = - (SingleSignatureInfo) singleSignatureInfoIter.next(); - CreateSignatureInfo createSignatureInfo; - List dataObjectList; - XMLSignatureCreationProfile profile; - XMLDataObject signatureEnvironment; - XMLDataObject signatureParent; - XMLSignature signature; - List additionalSignedProperties; - Node signatureEnvironmentParent = null; - Element requestElement = null; - - try { - - // build the signature environment - createSignatureInfo = singleSignatureInfo.getCreateSignatureInfo(); - if (createSignatureInfo != null) { - DataObjectFactory dataObjFactory = DataObjectFactory.getInstance(); - - signatureEnvironment = - dataObjFactory.createSignatureEnvironment( - createSignatureInfo.getCreateSignatureEnvironment(), - getCreateSignatureEnvironmentProfileSupplements(singleSignatureInfo)); - } else { - signatureEnvironment = null; - } - - HashSet sigInfoReservedIDs = new HashSet(); - if (signatureEnvironment != null) - { - // Find Id attributes of existing XML signatures in signature environment - HashMap nSMap = new HashMap(); - String dsp = Constants.DSIG_PREFIX; - nSMap.put(dsp, Constants.DSIG_NS_URI); - String xPathExpr = "//" + dsp + ":Signature/@Id | //" + dsp + ":Reference/@Id | //" - + dsp + ":Object/@Id | //" + dsp + ":Manifest/@Id"; - NodeList idAttrs = XPathUtils.selectNodeList(signatureEnvironment.getElement(), nSMap, xPathExpr); - - // Add found Id attributes to set of reserved IDs - for (int i = 0; i < idAttrs.getLength(); i++) sigInfoReservedIDs.add(idAttrs.item(i).getNodeValue()); - } - - // create the reference id generator - HashSet allReservedIDs = new HashSet(reserved); - allReservedIDs.addAll(sigInfoReservedIDs); - refIdGen = new IdGenerator("reference-" + createCount++, allReservedIDs); - - // build the list of DataObjects - List createTransformsProfiles = profileFactory.getCreateTransformsInfoProfiles(singleSignatureInfo); - dataObjectList = - buildDataObjectList( - singleSignatureInfo, - createTransformsProfiles, - signatureEnvironment, - refIdGen); - - // build the XMLSignatureCreationProfile - profile = profileFactory.createProfile(singleSignatureInfo, sigInfoReservedIDs); - - // build the additionalSignedProperties - additionalSignedProperties = buildAdditionalSignedProperties(); - - // build the signatureParentElement - if (signatureEnvironment != null) { - signatureParent = - buildSignatureParentElement( - signatureEnvironment.getElement(), - singleSignatureInfo); - } else { - signatureParent = null; - } - - // make the signature environment the root of the document, if it is - // not a separate document anyway; this is done to assure that - // canonicalization of the signature environment contains the correct - // namespace declarations - if (signatureEnvironment != null) { - Document requestDoc = - signatureEnvironment.getElement().getOwnerDocument(); - requestElement = requestDoc.getDocumentElement(); - if (requestElement != signatureEnvironment.getElement()) { - signatureEnvironmentParent = - signatureEnvironment.getElement().getParentNode(); - requestElement.getOwnerDocument().replaceChild( - signatureEnvironment.getElement(), - requestElement); - } - } - - try { - // create the signature - signature = - module.createSignature( - dataObjectList, - profile, - additionalSignedProperties, - signatureParent, - new TransactionId(context.getTransactionID())); - - // insert the result into the response - if (signatureParent != null) { - responseBuilder.addSignatureEnvironment( - signatureEnvironment.getElement()); - } else { - responseBuilder.addSignatureEnvironment(signature.getElement()); - } - - } catch (IAIKException e) { - MOAException moaException = IaikExceptionMapper.getInstance().map(e); - - responseBuilder.addError( - moaException.getMessageId(), - moaException.getMessage()); - Logger.warn(moaException.getMessage(), e); - } catch (IAIKRuntimeException e) { - MOAException moaException = IaikExceptionMapper.getInstance().map(e); - - responseBuilder.addError( - moaException.getMessageId(), - moaException.getMessage()); - Logger.warn(moaException.getMessage(), e); - } - - // swap back in the request as root document - if (signatureEnvironment != null) { - if (requestElement != signatureEnvironment.getElement()) { - requestElement.getOwnerDocument().replaceChild( - requestElement, - signatureEnvironment.getElement()); - signatureEnvironmentParent.appendChild( - signatureEnvironment.getElement()); - } - } - - } catch (MOAException e) { - responseBuilder.addError(e.getMessageId(), e.getMessage()); - Logger.warn(e.getMessage(), e); - } - - } - - return responseBuilder.getResponse(); - } - - /** - * Build the list of DataObjects from the given - * SingleSignatureInfo object. - * - *

- * Only the following cases of DataObjects are - * valid in case of an enveloping signature: - * - *

    - *
  • Reference == null && Content != null: The - * Content will be used in the DataObject.
  • - *
  • Reference != null && Content == null: Resolve the - * Reference and use it as DataObject. - * Set the Reference in the DataObject as well.
  • - *
- *

- * - *

- * Only the following cases of DataObjects are valid in case - * of a detached signature: - * - *

    - *
  • Reference != null && Content == null: Resolve the - * Reference and use it as DataObject. - * Set the Reference in the DataObject as well.
  • - *
  • Reference != null && Content != null: The - * Content will be used in the DataObject. - * Set the Reference in the DataObject as well.
  • - *
- *

- * - *

- * All other cases will lead to an error. - *

- * - * @param singleSignatureInfo The SingleSignatureInfo object - * containing the DataObjectInfo objects. - * @param createTransformsProfiles A list of objects of type {@link CreateTransformsInfoProfileExplicit}, - * each representing the transforms info profile information for the corresponding DataObject. - * @param signatureEnvironment The - * @param idGen The ID generator for DataObject references. - * @return The List of DataObjects contained in the - * given singleSignatureInfo. - * @throws MOASystemException A system error occurred building the data - * objects. - * @throws MOAApplicationException An error occurred building the data - * objects. - */ - private List buildDataObjectList( - SingleSignatureInfo singleSignatureInfo, - List createTransformsProfiles, - XMLDataObject signatureEnvironment, - IdGenerator idGen) - throws MOASystemException, MOAApplicationException { - - List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); - List dataObjects = new ArrayList(); - Iterator dtIter; - Iterator ctpIter = createTransformsProfiles.iterator(); - - for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) - { - DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); - String structure = dataObjInfo.getStructure(); - - CreateTransformsInfoProfileExplicit transformsProfile = - (CreateTransformsInfoProfileExplicit) ctpIter.next(); - MetaInfo finalDataMetaInfo = transformsProfile.getCreateTransformsInfo().getFinalDataMetaInfo(); - - if (DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure)) { - dataObjects.add( - buildEnvelopingDataObject( - dataObjInfo.getDataObject(), - finalDataMetaInfo, - idGen.uniqueId())); - } else if (DataObjectInfo.STRUCTURE_DETACHED.equals(structure)) { - dataObjects.add( - buildDetachedDataObject( - dataObjInfo.getDataObject(), - finalDataMetaInfo, - signatureEnvironment, - idGen.uniqueId())); - } else { - throw new MOAApplicationException("1103", new Object[] { structure }); - } - } - - return dataObjects; - - } - - /** - * Build a DataObject to be used in an enveloping - * signature. - * - * @param content The Content object containing the data object. - * ContentOptionalRefType. - * @param finalDataMetaInfo The meta information corresponding with content. - * @param referenceID The reference ID to use in the signature for the - * DataObject created. - * @return The DataObject representing the data contained in - * dataObjectElem. - * @throws MOAApplicationException An error occurred during the creation of - * the DataObject. - * @throws MOASystemException A system error occurred during the creation of - * the DataObject. - */ - private DataObject buildEnvelopingDataObject( - Content content, - MetaInfo finalDataMetaInfo, - String referenceID) - throws MOASystemException, MOAApplicationException { - - DataObjectFactory factory = DataObjectFactory.getInstance(); - DataObject dataObject; - - dataObject = - factory.createFromContentOptionalRefType( - content, - finalDataMetaInfo, - referenceID, - false, - false, - true, - false); - - return dataObject; - } - - /** - * Build a DataObject to be used in a detached signature. - * - * @param content The Content object containing an the data. - * @param finalDataMetaInfo The meta information corresponding with content. - * @param signatureEnvironment The signature environment where the signature - * will be inserted. - * @param referenceID The reference ID to use in the signature for the - * DataObject created. - * @return The DataObject representing the data contained in - * dataObjectElem. - * @throws MOAApplicationException An error occurred during the creation of - * the DataObject. - * @throws MOASystemException A system error occurred during the creation of - * the DataObject. - */ - private DataObject buildDetachedDataObject( - Content content, - MetaInfo finalDataMetaInfo, - XMLDataObject signatureEnvironment, - String referenceID) - throws MOASystemException, MOAApplicationException { - - String reference = content.getReference(); - DataObjectFactory factory = DataObjectFactory.getInstance(); - DataObject dataObject; - - if (reference == null) { - throw new MOAApplicationException("1102", null); - } else if ("".equals(reference) || reference.startsWith("#")) { - dataObject = - factory.createFromSignatureEnvironment( - signatureEnvironment.getElement(), - reference, - referenceID); - } else { - dataObject = - factory.createFromContentOptionalRefType( - content, - finalDataMetaInfo, - referenceID, - true, - false, - true, - false); - } - return dataObject; - } - - /** - * Build the signature parent element. - * - * @param signatureEnvironment The signature environment containing the - * document in which to insert the signature. - * @param singleSignatureInfo The SingleSignatureInfo - * containing the signature parent element. - * @return An XMLDataObject containing the signature parent - * element or null, if the CreateSignatureInfo is - * null. - * @throws MOAApplicationException An error occurred during the creation of - * the signature parent. - */ - private XMLDataObject buildSignatureParentElement( - Element signatureEnvironment, - SingleSignatureInfo singleSignatureInfo) - throws MOAApplicationException { - - CreateSignatureInfo createInfo = - singleSignatureInfo.getCreateSignatureInfo(); - - // evaluate the CreateSignatureLocation - if (createInfo != null) { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - CreateSignatureEnvironmentProfileExplicit createProfile = - ProfileMapper.mapCreateSignatureEnvironmentProfile( - createInfo.getCreateSignatureEnvironmentProfile(), - config); - CreateSignatureLocation location = - createProfile.getCreateSignatureLocation(); - Element signatureParent = - InvokerUtils.evaluateSignatureLocation(signatureEnvironment, location); - - return new XMLDataObjectImpl(signatureParent); - } else { - return null; - } - } - - /** - * Get the supplements contained in the - * CreateSignatureEnvironmentProfile of the given - * SingleSignatureInfo. - * - * @param singleSigInfo The SingleSignatureInfo from which - * to extract the supplements. - * @return A List of XMLDataObjectAssociations - * or null, if the singleSigInfo does not contain - * supplements. - * @throws MOAApplicationException An error occurred parsing the - * CreateSignatureEnvironmentProfile. - */ - private List getCreateSignatureEnvironmentProfileSupplements(SingleSignatureInfo singleSigInfo) - throws MOAApplicationException { - CreateSignatureInfo sigInfo = singleSigInfo.getCreateSignatureInfo(); - - if (sigInfo != null) { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - CreateSignatureEnvironmentProfileExplicit profile = - ProfileMapper.mapCreateSignatureEnvironmentProfile( - sigInfo.getCreateSignatureEnvironmentProfile(), - config); - List supplements = profile.getSupplements(); - - return supplements; - } - return null; - } - - /** - * Build the list of additional signed properties. - * - * Based on the generic configuration setting - * ConfigurationProvider.TEST_SIGNING_TIME_PROPERTY, a - * constant SigningTime will be added to the properties. - * - * @return The List of additional signed properties. - */ - private List buildAdditionalSignedProperties() { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - List additionalSignedProperties = Collections.EMPTY_LIST; - - return additionalSignedProperties; - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java deleted file mode 100644 index 7ac971da8..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java +++ /dev/null @@ -1,455 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import iaik.server.modules.algorithms.HashAlgorithms; -import iaik.server.modules.keys.KeyEntryID; -import iaik.server.modules.keys.KeyModule; -import iaik.server.modules.keys.KeyModuleFactory; -import iaik.server.modules.xmlsign.SignatureStructureTypes; -import iaik.server.modules.xmlsign.XMLSignatureCreationProfile; -import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation; - -import java.math.BigInteger; -import java.security.Principal; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry; -import at.gv.egovernment.moa.spss.server.iaik.xml.CanonicalizationImpl; -import at.gv.egovernment.moa.spss.server.iaik.xmlsign.DataObjectTreatmentImpl; -import at.gv.egovernment.moa.spss.server.iaik.xmlsign.XMLSignatureCreationProfileImpl; -import at.gv.egovernment.moa.spss.server.iaik.xmlsign.XMLSignatureInsertionLocationImpl; -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.spss.server.util.IdGenerator; -import at.gv.egovernment.moa.spss.util.MessageProvider; -import at.gv.egovernment.moa.util.Constants; - -/** - * A factory to create XMLSignatureCreationProfiles from a - * CreateXMLSignatureRequest, based on the current MOA - * configuration. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureCreationProfileFactory { - - private static Map HASH_ALGORITHM_MAPPING; - - static { - HASH_ALGORITHM_MAPPING = new HashMap(); - HASH_ALGORITHM_MAPPING.put(Constants.SHA1_URI, HashAlgorithms.SHA1); - } - - /** The CreateXMLSignatureRequest for which to create the - * profile.*/ - private CreateXMLSignatureRequest request; - /** How many profiles have been created based on the same request. */ - private int createProfileCount; - /** The Set of reserved object IDs.*/ - private Set reserved; - - /** - * Create a new XMLSignatureCreationProfileFactory. - * - * @param request The request for which to create profiles. - * @param reserved The Set of reserved object IDs. IDs will - * be added during signature creation. - */ - public XMLSignatureCreationProfileFactory( - CreateXMLSignatureRequest request, - Set reserved) { - this.request = request; - this.reserved = reserved; - createProfileCount = 1; - } - - /** - * Create a XMLSignatureCreationProfile for the given - * SingleSignatureInfo object.. - * - * @param singleSignatureInfo The SingleSignatureInfo object - * containing information about the creation of a signature. - * @param sigInfoReservedIDs The Set of reserved ID attribue values - * for the particular singleSignatureInfo. - * @return The XMLSignatureCreationProfile containing additional - * information for creating an XML signature. - * @throws MOASystemException A system error occurred during creation of the - * profile. See message for details - * @throws MOAApplicationException An application error occurred during - * creation of the profile. See message for details. - */ - public XMLSignatureCreationProfile createProfile(SingleSignatureInfo singleSignatureInfo, - Set sigInfoReservedIDs) throws MOASystemException, MOAApplicationException { - - HashSet allReservedIDs = new HashSet(reserved); - allReservedIDs.addAll(sigInfoReservedIDs); - - XMLSignatureCreationProfileImpl profile = - new XMLSignatureCreationProfileImpl(createProfileCount, allReservedIDs); - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - CanonicalizationImpl canonicalization; - List dataObjectTreatmentList; - String keyGroupID; - Set keySet; - List transformationSupplements; - List createTransformsProfiles; - - // build the transformation supplements - createTransformsProfiles = - getCreateTransformsInfoProfiles(singleSignatureInfo); - transformationSupplements = - buildTransformationSupplements(createTransformsProfiles); - - // build and set the data object treatment list - dataObjectTreatmentList = - buildDataObjectTreatmentList( - singleSignatureInfo, - createTransformsProfiles, - transformationSupplements, - allReservedIDs); - profile.setDataObjectTreatmentList(dataObjectTreatmentList); - - // set the key set - keyGroupID = request.getKeyIdentifier(); - keySet = buildKeySet(keyGroupID); - if (keySet == null) { - throw new MOAApplicationException("2231", null); - } else if (keySet.size() == 0) { - throw new MOAApplicationException("2232", null); - } - profile.setKeySet(keySet); - - // set the Security Layer manifest algorithm name - profile.setSecurityLayerManifestTypeURI(Constants.SL_MANIFEST_TYPE_URI); - - // set the structure type - if (singleSignatureInfo.getCreateSignatureInfo() != null) { - profile.setSignatureStructureType(SignatureStructureTypes.ENVELOPED); - } else { - profile.setSignatureStructureType(SignatureStructureTypes.DETACHED); - } - - // set insertion location - profile.setSignatureInsertionLocation( - getSignatureInsertionLocationIndex(singleSignatureInfo)); - - // set the canonicalization algorithm - canonicalization = - new CanonicalizationImpl(config.getCanonicalizationAlgorithmName()); - profile.setSignedInfoCanonicalization(canonicalization); - - // set the signed properties - profile.setSignedProperties(Collections.EMPTY_LIST); - - // set security layer conformity - profile.setSecurityLayerConform( - singleSignatureInfo.isSecurityLayerConform()); - - // update the createProfileCount - createProfileCount++; - - return profile; - } - - /** - * Get the List of all CreateTransformsInfoProfiles - * contained in all the DataObjectInfos of the given - * SingleSignatureInfo. - * - * @param singleSignatureInfo The SingleSignatureInfo object from - * which to extract the CreateTransformsInfoProfiles. - * @return All CreateTransformsInfoProfiles of all - * DataObjectInfos of singleSignatureInfo. - * @throws MOAApplicationException An error occurred creating one of the - * profiles. - */ - List getCreateTransformsInfoProfiles(SingleSignatureInfo singleSignatureInfo) - throws MOAApplicationException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); - List profiles = new ArrayList(); - Iterator dtIter; - - for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) { - DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); - CreateTransformsInfoProfileExplicit profile = - ProfileMapper.mapCreateTransformsInfoProfile( - dataObjInfo.getCreateTransformsInfoProfile(), - config); - profiles.add(profile); - } - - return profiles; - } - - /** - * Build the List of transformation supplements contained in a - * SingleSignatureInfo object. - * - * @param createTransformsInfoProfiles The - * CreateTransformsInfoProfile object from which to extract the - * transformation supplements. - * @return A List of DataObjects containing the - * transformation supplements. - * @throws MOASystemException A system error occurred creating one of the - * transformation supplements. - * @throws MOAApplicationException An error occurred creating one of the - * transformation supplements. - */ - private List buildTransformationSupplements(List createTransformsInfoProfiles) - throws MOASystemException, MOAApplicationException { - - List transformationSupplements = new ArrayList(); - DataObjectFactory factory = DataObjectFactory.getInstance(); - Iterator iter; - - for (iter = createTransformsInfoProfiles.iterator(); iter.hasNext();) { - CreateTransformsInfoProfileExplicit profile = - (CreateTransformsInfoProfileExplicit) iter.next(); - List supplements = profile.getSupplements(); - - if (supplements != null) { - Iterator supplIter; - - for (supplIter = supplements.iterator(); supplIter.hasNext();) { - XMLDataObjectAssociation supplement = - (XMLDataObjectAssociation) supplIter.next(); - - transformationSupplements.add( - factory.createFromXmlDataObjectAssociation( - supplement, - false, - true)); - } - } - } - - return transformationSupplements; - } - - /** - * Build the List of DataObjectTreatments for the - * given SingleSignatureInfo object.. - * - * @param singleSignatureInfo The SingleSignatureInfo object - * from which to exctract the CreateTransformsInfoProfiles - * containing the data for the DataObjectTreatments. - * @param createTransformsInfoProfiles The - * CreateTransformsInfoProfiles contained in the - * singleSignatureInfo. - * @param transformationSupplements Additional parameters for - * transformations contained in DataObjectTreatments. - * @param reservedIDs The Set of reserved object IDs. - * @return A List of DataObjectTreatment objects. - * @throws MOAApplicationException An error occurred building one of the - * DataObjectTreatments. - * @throws MOASystemException A system error occurred building one of the - * DataObjectTreatments. - */ - private List buildDataObjectTreatmentList( - SingleSignatureInfo singleSignatureInfo, - List createTransformsInfoProfiles, - List transformationSupplements, - Set reservedIDs) - throws MOASystemException, MOAApplicationException { - - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - List treatments = new ArrayList(); - List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); - int dataObjectTreatmentCount = 1; - String hashAlgorithmName; - Iterator dtIter; - Iterator prIter; - - prIter = createTransformsInfoProfiles.iterator(); - for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) { - CreateTransformsInfoProfileExplicit profile = - (CreateTransformsInfoProfileExplicit) prIter.next(); - DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); - IdGenerator objIdGen = - new IdGenerator( - ("signed-data-" + createProfileCount) - + ("-" + dataObjectTreatmentCount++), - reservedIDs); - DataObjectTreatmentImpl treatment = new DataObjectTreatmentImpl(objIdGen); - - treatment.setFinalContentType( - profile.getCreateTransformsInfo().getFinalDataMetaInfo().getMimeType()); - treatment.setTransformationList(buildTransformationList(profile)); - treatment.setReferenceInManifest(dataObjInfo.isChildOfManifest()); - - hashAlgorithmName = - (String) HASH_ALGORITHM_MAPPING.get( - config.getDigestMethodAlgorithmName()); - if (hashAlgorithmName == null) { - error( - "config.17", - new Object[] { config.getDigestMethodAlgorithmName()}); - throw new MOASystemException("2900", null); - } - - treatment.setHashAlgorithmName(hashAlgorithmName); - treatment.setIncludedInSignature( - DataObjectInfo.STRUCTURE_ENVELOPING.equals(dataObjInfo.getStructure())); - treatment.setTransformationSupplements(transformationSupplements); - - treatments.add(treatment); - - } - - return treatments; - } - - /** - * Build the List of transformations contained in a - * CreateTransformsInfoProfile object. - * - * @param profile The CreateTransformsInfoProfile object - * from which to extract the Transforms. - * @return A List of Transformations contained in - * the given CreateTransformsInfoProfile. - * @throws MOAApplicationException An error occurred building one of the - * Transformations. - */ - private List buildTransformationList(CreateTransformsInfoProfileExplicit profile) - throws MOAApplicationException { - - TransformationFactory factory = TransformationFactory.getInstance(); - List transforms = profile.getCreateTransformsInfo().getTransforms(); - - return transforms != null - ? factory.createTransformationList(transforms) - : Collections.EMPTY_LIST; - } - - /** - * Build the set of KeyEntryIDs available to the given - * keyGroupID. - * - * @param keyGroupID The keygroup ID for which the available keys should be - * returned. - * @return The Set of KeyEntryIDs - * identifying the available keys. - */ - private Set buildKeySet(String keyGroupID) { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - Set keyGroupEntries; - - // get the KeyGroup entries from the configuration - if (context.getClientCertificate() != null) { - X509Certificate cert = context.getClientCertificate()[0]; - Principal issuer = cert.getIssuerDN(); - BigInteger serialNumber = cert.getSerialNumber(); - - keyGroupEntries = - config.getKeyGroupEntries(issuer, serialNumber, keyGroupID); - } else { - keyGroupEntries = config.getKeyGroupEntries(null, null, keyGroupID); - } - - // map the KeyGroup entries to a set of KeyEntryIDs - if (keyGroupEntries == null) { - return null; - } else if (keyGroupEntries.size() == 0) { - return Collections.EMPTY_SET; - } else { - KeyModule module = - KeyModuleFactory.getInstance( - new TransactionId(context.getTransactionID())); - Set keyEntryIDs = module.getPrivateKeyEntryIDs(); - Set keySet = new HashSet(); - Iterator iter; - - // filter out the keys that do not exist in the IAIK configuration - // by walking through the key entries and checking if the exist in the - // keyGroupEntries - for (iter = keyEntryIDs.iterator(); iter.hasNext();) { - KeyEntryID entryID = (KeyEntryID) iter.next(); - KeyGroupEntry entry = - new KeyGroupEntry( - entryID.getModuleID(), - entryID.getCertificateIssuer(), - entryID.getCertificateSerialNumber()); - if (keyGroupEntries.contains(entry)) { - keySet.add(entryID); - } - } - return keySet; - } - } - - /** - * Get the signature location index where the signature will be inserted into - * the signature parent element. - * - * @param singleSignatureInfo The SingleSignatureInfo object - * containing the CreateSignatureLocation. - * @return The index at which to insert the signature into the signature - * environment. - * @throws MOAApplicationException An error occurred parsing the - * CreateSignatureEnvironmentProfile. - */ - private XMLSignatureInsertionLocation getSignatureInsertionLocationIndex(SingleSignatureInfo singleSignatureInfo) - throws MOAApplicationException { - - CreateSignatureInfo createInfo = - singleSignatureInfo.getCreateSignatureInfo(); - - if (createInfo != null) { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - CreateSignatureEnvironmentProfileExplicit profile = - ProfileMapper.mapCreateSignatureEnvironmentProfile( - createInfo.getCreateSignatureEnvironmentProfile(), - config); - int index = profile.getCreateSignatureLocation().getIndex(); - - return new XMLSignatureInsertionLocationImpl(index); - } else { - return new XMLSignatureInsertionLocationImpl(0); - } - } - - /** - * Utility function to issue an error message to the log. - * - * @param messageId The ID of the message to log. - * @param parameters Additional message parameters. - */ - private static void error(String messageId, Object[] parameters) { - MessageProvider msg = MessageProvider.getInstance(); - - Logger.error(new LogMsg(msg.getMessage(messageId, parameters))); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java deleted file mode 100644 index 4642593eb..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java +++ /dev/null @@ -1,675 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import iaik.IAIKException; -import iaik.IAIKRuntimeException; -import iaik.ixsil.exceptions.URIException; -import iaik.ixsil.util.URI; -import iaik.server.modules.xml.DataObject; -import iaik.server.modules.xml.XMLDataObject; -import iaik.server.modules.xml.XMLSignature; -import iaik.server.modules.xmlsign.XMLConstants; -import iaik.server.modules.xmlverify.DsigManifest; -import iaik.server.modules.xmlverify.ReferenceData; -import iaik.server.modules.xmlverify.SecurityLayerManifest; -import iaik.server.modules.xmlverify.XMLSignatureVerificationModule; -import iaik.server.modules.xmlverify.XMLSignatureVerificationModuleFactory; -import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; -import iaik.server.modules.xmlverify.XMLSignatureVerificationResult; -import iaik.x509.X509Certificate; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.CheckResult; -import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterHash; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.TrustProfile; -import at.gv.egovernment.moa.spss.server.iaik.xml.XMLSignatureImpl; -import at.gv.egovernment.moa.spss.server.logging.IaikLog; -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.spss.util.MessageProvider; -import at.gv.egovernment.moa.util.CollectionUtils; -import at.gv.egovernment.moa.util.Constants; - -/** - * A class providing a DOM based interface to the - * XMLSignatureVerificationModule. - * - * This class performs the invocation of the - * iaik.server.modules.xmlverify.XMLSignatureVerificationModule - * from a VerifyXMLSignatureRequest given as a DOM element. The - * result of the invocation is integrated into a - * VerifyXMLSignatureResponse and returned. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureVerificationInvoker { - - /** The single instance of this class. */ - private static XMLSignatureVerificationInvoker instance = null; - - private static Set FILTERED_REF_TYPES; - - static { - FILTERED_REF_TYPES = new HashSet(); - FILTERED_REF_TYPES.add(DsigManifest.XML_DSIG_MANIFEST_TYPE); - FILTERED_REF_TYPES.add(SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE); - FILTERED_REF_TYPES.add( - SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE_OLD); - FILTERED_REF_TYPES.add( - XMLConstants.NAMESPACE_ETSI_STRING + "SignedProperties"); - } - - /** - * Get the single instance of this class. - * - * @return The single instance of this class. - */ - public static synchronized XMLSignatureVerificationInvoker getInstance() { - if (instance == null) { - instance = new XMLSignatureVerificationInvoker(); - } - return instance; - } - - /** - * Create a new XMLSignatureCreationInvoker. - * - * Protected to disallow multiple instances. - */ - protected XMLSignatureVerificationInvoker() { - } - - /** - * Process the VerifyXMLSignatureRequest message and invoke the - * XMLSignatureVerificationModule. - * - * @param request A VerifyXMLSignatureRequest API object - * containing the data for verifying an XML signature. - * @return A VerifyXMLSignatureResponse containing the - * answert to the VerifyXMLSignatureRequest. - * MOA schema definition. - * @throws MOAException An error occurred during signature verification. - */ - public VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) - throws MOAException { - - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - LoggingContext loggingCtx = - LoggingContextManager.getInstance().getLoggingContext(); - XMLSignatureVerificationProfileFactory profileFactory = - new XMLSignatureVerificationProfileFactory(request); - VerifyXMLSignatureResponseBuilder responseBuilder = - new VerifyXMLSignatureResponseBuilder(); - XMLSignatureVerificationResult result; - XMLSignatureVerificationProfile profile; - ReferencesCheckResult signatureManifestCheck; - DataObjectFactory dataObjFactory; - XMLDataObject signatureEnvironment; - Node signatureEnvironmentParent = null; - Element requestElement = null; - XMLSignature xmlSignature; - Date signingTime; - List supplements; - List dataObjectList; - - // get the supplements - supplements = getSupplements(request); - - // build XMLSignature - dataObjFactory = DataObjectFactory.getInstance(); - signatureEnvironment = - dataObjFactory.createSignatureEnvironment( - request.getSignatureInfo().getVerifySignatureEnvironment(), - supplements); - xmlSignature = buildXMLSignature(signatureEnvironment, request); - - // build the list of DataObjects - dataObjectList = buildDataObjectList(supplements); - - // build profile - profile = profileFactory.createProfile(); - - // get the signingTime - signingTime = request.getDateTime(); - - // make the signature environment the root of the document, if it is not a - // separate document anyway; this is done to assure that canonicalization - // of the signature environment contains the correct namespace declarations - requestElement = - signatureEnvironment.getElement().getOwnerDocument().getDocumentElement(); - if (requestElement != signatureEnvironment.getElement()) { - signatureEnvironmentParent = - signatureEnvironment.getElement().getParentNode(); - requestElement.getOwnerDocument().replaceChild( - signatureEnvironment.getElement(), - requestElement); - } - - // verify the signature - try { - XMLSignatureVerificationModule module = - XMLSignatureVerificationModuleFactory.getInstance(); - - module.setLog(new IaikLog(loggingCtx.getNodeID())); - - result = - module.verifySignature( - xmlSignature, - dataObjectList, - profile, - signingTime, - new TransactionId(context.getTransactionID())); - } catch (IAIKException e) { - MOAException moaException = IaikExceptionMapper.getInstance().map(e); - throw moaException; - } catch (IAIKRuntimeException e) { - MOAException moaException = IaikExceptionMapper.getInstance().map(e); - throw moaException; - } - - // swap back in the request as root document - if (requestElement != signatureEnvironment.getElement()) { - requestElement.getOwnerDocument().replaceChild( - requestElement, - signatureEnvironment.getElement()); - signatureEnvironmentParent.appendChild(signatureEnvironment.getElement()); - } - - // check the result - signatureManifestCheck = - validateSignatureManifest(request, result, profile); - - // Check if signer certificate is in trust profile's allowed signer certificates pool - TrustProfile trustProfile = context.getConfiguration().getTrustProfile(request.getTrustProfileId()); - CheckResult certificateCheck = validateSignerCertificate(result, trustProfile); - - // build the response - responseBuilder.setResult(result, profile, signatureManifestCheck, certificateCheck); - - return responseBuilder.getResponse(); - } - - /** - * Checks if the signer certificate matches one of the allowed signer certificates specified - * in the provided trustProfile. - * - * @param result The result produced by the XMLSignatureVerificationModule. - * - * @param trustProfile The trust profile the signer certificate is validated against. - * - * @return The overal result of the certificate validation for the signer certificate. - * - * @throws MOAException if one of the signer certificates specified in the trustProfile - * cannot be read from the file system. - */ - private CheckResult validateSignerCertificate(XMLSignatureVerificationResult result, TrustProfile trustProfile) - throws MOAException - { - MessageProvider msg = MessageProvider.getInstance(); - - int resultCode = result.getCertificateValidationResult().getValidationResultCode().intValue(); - if (resultCode == 0 && trustProfile.getSignerCertsUri() != null) - { - X509Certificate signerCertificate = (X509Certificate) result.getCertificateValidationResult().getCertificateChain().get(0); - - File signerCertsDir = null; - try - { - signerCertsDir = new File(new URI(trustProfile.getSignerCertsUri()).getPath()); - } - catch (URIException e) - { - throw new MOASystemException("2900", null, e); // Should not happen, already checked at loading the MOA configuration - } - - File[] files = signerCertsDir.listFiles(); - if (files == null) resultCode = 1; - int i; - for (i = 0; i < files.length; i++) - { - if (!files[i].isDirectory()) - { - FileInputStream currentFIS = null; - try - { - currentFIS = new FileInputStream(files[i]); - } - catch (FileNotFoundException e) { - throw new MOASystemException("2900", null, e); - } - - try - { - X509Certificate currentCert = new X509Certificate(currentFIS); - currentFIS.close(); - if (currentCert.equals(signerCertificate)) break; - } - catch (Exception e) - { - // Simply ignore file if it cannot be interpreted as certificate - String logMsg = msg.getMessage("invoker.03", new Object[]{trustProfile.getId(), files[i].getName()}); - Logger.warn(logMsg); - try - { - currentFIS.close(); - } - catch (IOException e1) { - // If clean-up fails, do nothing - } - } - } - } - if (i >= files.length) - { - resultCode = 1; // No signer certificate from the trustprofile pool matches the actual signer certificate - } - } - - SPSSFactory factory = SPSSFactory.getInstance(); - return factory.createCheckResult(resultCode, null); - } - - /** - * Select the dsig:Signature DOM element within the signature - * environment. - * - * @param signatureEnvironment The signature environment containing the - * dsig:Signature. - * @param request The VerifyXMLSignatureRequest containing the - * signature environment. - * @return The dsig:Signature element wrapped in a - * XMLSignature object. - * @throws MOAApplicationException An error occurred locating the - * dsig:Signature. - */ - private XMLSignature buildXMLSignature( - XMLDataObject signatureEnvironment, - VerifyXMLSignatureRequest request) - throws MOAApplicationException { - - VerifySignatureLocation signatureLocation = - request.getSignatureInfo().getVerifySignatureLocation(); - Element signatureParent; - - // evaluate the VerifySignatureLocation to get the signature parent - signatureParent = - InvokerUtils.evaluateSignatureLocation( - signatureEnvironment.getElement(), - signatureLocation); - - // check for signatureParent to be a dsig:Signature element - if (!"Signature".equals(signatureParent.getLocalName()) - || !Constants.DSIG_NS_URI.equals(signatureParent.getNamespaceURI())) { - throw new MOAApplicationException("2266", null); - } - - return new XMLSignatureImpl(signatureParent); - } - - /** - * Build the supplemental data objects contained in the - * VerifyXMLSignatureRequest. - * - * @param supplements A List of - * XMLDataObjectAssociations containing the supplement data. - * @return A List of DataObjects representing the - * supplemental data objects. - * @throws MOASystemException A system error occurred building one of the data - * objects. - * @throws MOAApplicationException An error occurred building one of the data - * objects. - */ - private List buildDataObjectList(List supplements) - throws MOASystemException, MOAApplicationException { - List dataObjectList = new ArrayList(); - - DataObjectFactory factory = DataObjectFactory.getInstance(); - DataObject dataObject; - Iterator iter; - - if (supplements != null) { - for (iter = supplements.iterator(); iter.hasNext();) { - XMLDataObjectAssociation supplement = - (XMLDataObjectAssociation) iter.next(); - dataObject = - factory.createFromXmlDataObjectAssociation(supplement, true, false); - dataObjectList.add(dataObject); - } - } - - return dataObjectList; - - } - - /** - * Get the supplemental data contained in the - * VerifyXMLSignatureRequest. - * - * @param request The VerifyXMLSignatureRequest containing the - * supplemental data. - * @return A List of XMLDataObjectAssociation - * objects containing the supplemental data. - * @throws MOAApplicationException An error occurred resolving one of the - * supplement profiles. - */ - private List getSupplements(VerifyXMLSignatureRequest request) - throws MOAApplicationException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - List supplementProfiles = request.getSupplementProfiles(); - - List supplements = new ArrayList(); - - if (supplementProfiles != null) { - - List mappedProfiles = - ProfileMapper.mapSupplementProfiles(supplementProfiles, config); - Iterator iter; - - for (iter = mappedProfiles.iterator(); iter.hasNext();) { - SupplementProfileExplicit profile = - (SupplementProfileExplicit) iter.next(); - supplements.add(profile.getSupplementProfile()); - } - - } - return supplements; - } - - /** - * Perform additional validations of the - * XMLSignatureVerificationResult. - * - *

In particular, it is verified that: - *

    - *
  • Each ReferenceData object contains transformation - * chain that matches one of the Transforms given in the - * corresponding SignatureManifestCheckParams/ReferenceInfo
  • - *
  • The hash values of the TransformParameters are valid. - *
  • - *
- *

- * - * @param request The VerifyXMLSignatureRequest containing the - * signature to verify. - * @param result The result produced by - * XMLSignatureVerificationModule. - * @param profile The profile used for validating the request. - * @return The result of additional validations of the signature manifest. - * @throws MOAApplicationException Post-validation of the - * XMLSignatureVerificaitonResult failed. - */ - private ReferencesCheckResult validateSignatureManifest( - VerifyXMLSignatureRequest request, - XMLSignatureVerificationResult result, - XMLSignatureVerificationProfile profile) - throws MOAApplicationException { - - SPSSFactory factory = SPSSFactory.getInstance(); - MessageProvider msg = MessageProvider.getInstance(); - - // validate that each ReferenceData object contains transforms specified - // in the corresponding SignatureManifestCheckParams/ReferenceInfo - if (request.getSignatureManifestCheckParams() != null) { - List refInfos = - request.getSignatureManifestCheckParams().getReferenceInfos(); - List refDatas = filterReferenceInfos(result.getReferenceDataList()); - List failedReferencesList = new ArrayList(); - Iterator refInfoIter; - Iterator refDataIter; - - if (refInfos.size() != refDatas.size()) { - return factory.createReferencesCheckResult(1, null); - } - - refInfoIter = refInfos.iterator(); - refDataIter = - filterReferenceInfos(result.getReferenceDataList()).iterator(); - - while (refInfoIter.hasNext()) { - ReferenceInfo refInfo = (ReferenceInfo) refInfoIter.next(); - ReferenceData refData = (ReferenceData) refDataIter.next(); - List transforms = buildTransformsList(refInfo); - boolean found = false; - Iterator trIter; - - for (trIter = transforms.iterator(); trIter.hasNext() && !found;) { - found = trIter.next().equals(refData.getTransformationList()); - } - - if (!found) { - Integer refIndex = new Integer(refData.getReferenceIndex()); - String logMsg = - msg.getMessage("invoker.01", new Object[] { refIndex }); - - failedReferencesList.add(refIndex); - Logger.debug(new LogMsg(logMsg)); - } - } - - if (!failedReferencesList.isEmpty()) { - // at least one reference failed - return their indexes and check code 1 - int[] failedReferences = - CollectionUtils.toIntArray(failedReferencesList); - ReferencesCheckResultInfo checkInfo = - factory.createReferencesCheckResultInfo(null, failedReferences); - - return factory.createReferencesCheckResult(1, checkInfo); - } - } - - // validate the hashes contained in all the ReferenceInfo objects of the - // security layer manifest - if (request.getSignatureManifestCheckParams() != null - && result.containsSecurityLayerManifest()) { - Map hashValues = buildTransformParameterHashValues(request); - Set transformParameterURIs = - buildTransformParameterURIs(profile.getTransformationSupplements()); - List referenceInfoList = - result.getSecurityLayerManifest().getReferenceDataList(); - Iterator refIter; - - for (refIter = referenceInfoList.iterator(); refIter.hasNext();) { - iaik.server.modules.xmlverify.ReferenceInfo ref = - (iaik.server.modules.xmlverify.ReferenceInfo) refIter.next(); - byte[] hash = (byte[]) hashValues.get(ref.getURI()); - - if (!transformParameterURIs.contains(ref.getURI()) - || (hash != null && !Arrays.equals(hash, ref.getHashValue()))) { - - // the transform parameter doesn't exist or the hashs do not match - // return the index of the failed reference and check code 1 - int[] failedReferences = new int[] { ref.getReferenceIndex()}; - ReferencesCheckResultInfo checkInfo = - factory.createReferencesCheckResultInfo(null, failedReferences); - String logMsg = - msg.getMessage( - "invoker.02", - new Object[] { new Integer(ref.getReferenceIndex())}); - - Logger.debug(new LogMsg(logMsg)); - - return factory.createReferencesCheckResult(1, checkInfo); - } - } - } - - return factory.createReferencesCheckResult(0, null); - } - - /** - * Get all Transforms contained in all the - * VerifyTransformsInfoProfiles of the given - * ReferenceInfo. - * - * @param refInfo The ReferenceInfo object containing - * the transformations. - * @return A List of Lists. Each of the - * Lists contains Transformation objects. - * @throws MOAApplicationException An error occurred building one of the - * Transformations. - */ - private List buildTransformsList(ReferenceInfo refInfo) - throws MOAApplicationException { - - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - List profiles = refInfo.getVerifyTransformsInfoProfiles(); - List mappedProfiles = - ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config); - List transformsList = new ArrayList(); - TransformationFactory factory = TransformationFactory.getInstance(); - Iterator iter; - - for (iter = mappedProfiles.iterator(); iter.hasNext();) { - VerifyTransformsInfoProfileExplicit profile = - (VerifyTransformsInfoProfileExplicit) iter.next(); - List transforms = profile.getTransforms(); - - if (transforms != null) { - transformsList.add(factory.createTransformationList(transforms)); - } - } - - return transformsList; - } - - /** - * Build the Set of all TransformParameter URIs. - * - * @param transformParameters The List of - * TransformParameters, as provided to the verification. - * @return The Set of all TransformParameter URIs. - */ - private Set buildTransformParameterURIs(List transformParameters) { - Set uris = new HashSet(); - Iterator iter; - - for (iter = transformParameters.iterator(); iter.hasNext();) { - DataObject transformParameter = (DataObject) iter.next(); - uris.add(transformParameter.getURI()); - } - - return uris; - } - - /** - * Build a mapping between TransformParameter URIs (a - * String and dsig:HashValue (a - * byte[]). - * - * @param request The VerifyXMLSignatureRequest. - * @return Map The resulting mapping. - * @throws MOAApplicationException An error occurred accessing one of - * the profiles. - */ - private Map buildTransformParameterHashValues(VerifyXMLSignatureRequest request) - throws MOAApplicationException { - - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - Map hashValues = new HashMap(); - List refInfos = - request.getSignatureManifestCheckParams().getReferenceInfos(); - Iterator refIter; - - for (refIter = refInfos.iterator(); refIter.hasNext();) { - ReferenceInfo refInfo = (ReferenceInfo) refIter.next(); - List profiles = refInfo.getVerifyTransformsInfoProfiles(); - List mappedProfiles = - ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config); - Iterator prIter; - - for (prIter = mappedProfiles.iterator(); prIter.hasNext();) { - VerifyTransformsInfoProfileExplicit profile = - (VerifyTransformsInfoProfileExplicit) prIter.next(); - List trParameters = profile.getTransformParameters(); - Iterator trIter; - - for (trIter = trParameters.iterator(); trIter.hasNext();) { - TransformParameter transformParameter = - (TransformParameter) trIter.next(); - String uri = transformParameter.getURI(); - - if (transformParameter.getTransformParameterType() - == TransformParameter.HASH_TRANSFORMPARAMETER) { - hashValues.put( - uri, - ((TransformParameterHash) transformParameter).getDigestValue()); - } - - } - } - } - return hashValues; - } - - /** - * Filter the ReferenceInfos returned by the - * VerifyXMLSignatureResult for comparison with the - * ReferenceInfo elements in the request. - * - * @param referenceInfos The ReferenceInfos from the - * VerifyXMLSignatureResult. - * @return A List of all ReferenceInfos whose type - * is not a XMLDsig manifest, Security Layer manifest, or ETSI signed - * property. - */ - private List filterReferenceInfos(List referenceInfos) { - List filtered = new ArrayList(); - Iterator iter; - - for (iter = referenceInfos.iterator(); iter.hasNext();) { - iaik.server.modules.xmlverify.ReferenceInfo refInfo = - (iaik.server.modules.xmlverify.ReferenceInfo) iter.next(); - String refType = refInfo.getReferenceType(); - - if (refType == null || !FILTERED_REF_TYPES.contains(refType)) { - filtered.add(refInfo); - } - } - - return filtered; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java deleted file mode 100644 index 5df13a337..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java +++ /dev/null @@ -1,144 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.pki.PKIProfileImpl; -import at.gv.egovernment.moa.spss.server.iaik.xmlverify.XMLSignatureVerificationProfileImpl; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * A factory to create a XMLSignatureVerificationProfile from a - * VerifyXMLSignatureRequest, based on the current MOA - * configuration. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureVerificationProfileFactory { - - /** The VerifyXMLSignatureRequest for which to create profile - * information. */ - private VerifyXMLSignatureRequest request; - - /** - * Create a new XMLSignatureVerificationProfileFactory. - * - * @param request The VerifyXMLSignatureRequest to extract - * profile data from. - */ - public XMLSignatureVerificationProfileFactory(VerifyXMLSignatureRequest request) { - this.request = request; - } - - /** - * Create a XMLSignatureCreationProfile from the - * VerifyXMLSignaturesRequest and the current MOA configuration. - * - * @return The XMLSignatureVerificationProfile containing - * additional information for verifying an XML signature. - * @throws MOASystemException A system error occurred building the profile. - * @throws MOAApplicationException An error occurred building the profile. - */ - public XMLSignatureVerificationProfile createProfile() - throws MOASystemException, MOAApplicationException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - XMLSignatureVerificationProfileImpl profile = - new XMLSignatureVerificationProfileImpl(); - SignatureManifestCheckParams checkParams; - String trustProfileID; - - // set whether to check XMLDsig manifests - profile.setCheckXMLDsigManifests(true); - - // set the certificate validation profile - trustProfileID = request.getTrustProfileId(); - profile.setCertificateValidationProfile( - new PKIProfileImpl(config, trustProfileID)); - - // set whether hash input data is to be included - profile.setIncludeHashInputData(request.getReturnHashInputData()); - - // set the security layer manifest check parameters - // and transformation supplements (if present) - checkParams = request.getSignatureManifestCheckParams(); - profile.setCheckSecurityLayerManifest(true); - profile.setIncludeReferenceInputData(checkParams != null ? checkParams.getReturnReferenceInputData() : false); - if (checkParams != null) { - List transformationSupplements; - transformationSupplements = buildTransformationSupplements(); - profile.setTransformationSupplements(transformationSupplements); - } else { - profile.setTransformationSupplements(Collections.EMPTY_LIST); - } - - return profile; - } - - /** - * Build supplemental data objects used in the transformations. - * - * @return A List of DataObjects providing - * supplemental data to the transformations. - * @throws MOASystemException A system error occurred building one of the - * transformations. - * @throws MOAApplicationException An error occurred building one of the - * transformations. - */ - public List buildTransformationSupplements() - throws MOASystemException, MOAApplicationException { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ConfigurationProvider config = context.getConfiguration(); - SignatureManifestCheckParams checkParams = - request.getSignatureManifestCheckParams(); - List transformsProfiles = new ArrayList(); - List transformationSupplements = new ArrayList(); - DataObjectFactory factory = DataObjectFactory.getInstance(); - List refInfos = checkParams.getReferenceInfos(); - Iterator refIter; - Iterator prIter; - Iterator trIter; - - // build the list of all VerifyTransformsInfoProfiles in all ReferenceInfos - refInfos = checkParams.getReferenceInfos(); - for (refIter = refInfos.iterator(); refIter.hasNext();) { - ReferenceInfo refInfo = (ReferenceInfo) refIter.next(); - List profiles = refInfo.getVerifyTransformsInfoProfiles(); - - transformsProfiles.addAll( - ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config)); - } - - // build the DataObjects - for (prIter = transformsProfiles.iterator(); prIter.hasNext();) { - VerifyTransformsInfoProfileExplicit profile = - (VerifyTransformsInfoProfileExplicit) prIter.next(); - List transformParameters = profile.getTransformParameters(); - - for (trIter = transformParameters.iterator(); trIter.hasNext();) { - TransformParameter trParam = (TransformParameter) trIter.next(); - transformationSupplements.add( - factory.createFromTransformParameter(trParam)); - } - } - - return transformationSupplements; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLog.java b/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLog.java deleted file mode 100644 index 068fab5ca..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLog.java +++ /dev/null @@ -1,126 +0,0 @@ -package at.gv.egovernment.moa.spss.server.logging; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import iaik.logging.TransactionId; - -/** - * An implementation of the iaik.logging.Log - * interface that is based on Jakarta Commons-Logging. - * - * @author Fatemeh Philippi - * @version $Id$ - */ -public class IaikLog implements iaik.logging.Log { - /** The hierarchy to log all IAIK output to. */ - public static final String IAIK_LOG_HIERARCHY = "iaik.server"; - /** The commons-loggin Log to use for logging the messages. */ - private static Log log = LogFactory.getLog(IAIK_LOG_HIERARCHY); - /** The node ID to use. */ - private String nodeId; - - /** - * Create a new IaikLog. - * - * @param nodeId The node ID for this Log object. - */ - public IaikLog(String nodeId) { - this.nodeId = nodeId; - } - - /** - * @see iaik.logging.Log#isDebugEnabled() - */ - public boolean isDebugEnabled() { - return log.isDebugEnabled(); - } - - /** - * @see iaik.logging.Log#debug(TransactionId, Object, Throwable) - */ - public void debug(TransactionId transactionId, Object message, Throwable t) { - IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); - - log.debug(msg, t); - } - - /** - * @see iaik.logging.Log#isInfoEnabled() - */ - public boolean isInfoEnabled() { - return log.isInfoEnabled(); - } - - /** - * @see iaik.logging.Log#info(TransactionId, Object, Throwable) - */ - public void info(TransactionId transactionId, Object message, Throwable t) { - IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); - - log.info(msg, t); - } - - /** - * @see iaik.logging.Log#isWarnEnabled() - */ - public boolean isWarnEnabled() { - return log.isWarnEnabled(); - } - - /** - * @see iaik.logging.Log#warn(TransactionId, Object, Throwable) - */ - public void warn(TransactionId transactionId, Object message, Throwable t) { - IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); - - log.warn(msg, t); - } - - /** - * @see iaik.logging.Log#isErrorEnabled() - */ - public boolean isErrorEnabled() { - return log.isErrorEnabled(); - } - - /** - * @see iaik.logging.Log#error(TransactionId, Object, Throwable) - */ - public void error(TransactionId transactionId, Object message, Throwable t) { - IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); - - log.error(msg, t); - } - - /** - * @see iaik.logging.Log#isFatalEnabled() - */ - public boolean isFatalEnabled() { - return log.isFatalEnabled(); - } - - /** - * @see iaik.logging.Log#fatal(TransactionId, Object, Throwable) - */ - public void fatal(TransactionId transactionId, Object message, Throwable t) { - IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); - - log.fatal(msg, t); - } - - /** - * @see iaik.logging.Log#setNodeId(String) - */ - public void setNodeId(String nodeId) { - this.nodeId = nodeId; - } - - /** - * @see iaik.logging.Log#getNodeId() - */ - public String getNodeId() { - return nodeId; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java deleted file mode 100644 index a0e4def86..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -package at.gv.egovernment.moa.spss.server.logging; - -import iaik.logging.Log; -import iaik.logging.LogConfigurationException; -import iaik.logging.LogFactory; - -import at.gv.egovernment.moa.logging.LoggingContextManager; - -/** - * An implementation of the iaik.logging.LogFactory abstract - * class to log messages to the MOA logging subsystem. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IaikLogFactory extends LogFactory { - - public Log getInstance(Class clazz) throws LogConfigurationException { - return getInstanceImpl(); - } - - public Log getInstance(String name) throws LogConfigurationException { - return getInstanceImpl(); - } - - /** - * Return an instance of iaik.logging.Log. - * - * @return The iaik.logging.Log object to log messages to. - */ - private Log getInstanceImpl() { - String nodeID = - LoggingContextManager.getInstance().getLoggingContext().getNodeID(); - - return new IaikLog(nodeID); - } - - public void release() { - // we do not hold any resources - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java b/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java deleted file mode 100644 index 75fb388a9..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java +++ /dev/null @@ -1,54 +0,0 @@ -package at.gv.egovernment.moa.spss.server.logging; - -import iaik.logging.TransactionId; - -/** - * A unified message type to log messages from the IAIK subsystem. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IaikLogMsg { - - /** The transaction ID of this message. */ - private TransactionId transactionId; - /** The node ID of this message. */ - private String nodeId; - /** The message to log. */ - private Object message; - - /** - * Create a IaikLogMsg object. - * - * @param transactionId The transaction id of the transaction which - * generated this log message. May be null. - * @param nodeId The node id where this message was generated. May be - * null. - * @param message The actual message to log. May be null. - */ - public IaikLogMsg(TransactionId transactionId, String nodeId, Object message) { - this.transactionId = transactionId; - this.nodeId = nodeId; - this.message = message; - } - - - /** - * Convert this log message to a String. - * - * @return The String representation of this log message. - */ - public String toString() { - StringBuffer msg = new StringBuffer(); - - msg.append("TID="); - msg.append(transactionId != null ? transactionId.getLogID() : ""); - msg.append(" NID="); - msg.append(nodeId != null ? nodeId : ""); - msg.append(" MSG="); - msg.append(message != null ? message.toString() : ""); - - return msg.toString(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/TransactionId.java b/spss.server/src/at/gv/egovernment/moa/spss/server/logging/TransactionId.java deleted file mode 100644 index 9e0239464..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/logging/TransactionId.java +++ /dev/null @@ -1,38 +0,0 @@ -package at.gv.egovernment.moa.spss.server.logging; - -/** - * An implementation of the iaik.logging.TransactionId interface. - * - * @author Patrick Peck - * @version $Id$ - */ -public class TransactionId implements iaik.logging.TransactionId { - - /** The String representation for logging the transaction ID. */ - private String logID; - - /** - * Create a TransactionId object. - * - * @param logID The transaction id as it should be presented to the logging - * subsystem. - */ - public TransactionId(String logID) { - this.logID = logID; - } - - /** - * @see iaik.logging.TransactionId#getLogID() - */ - public String getLogID() { - return logID; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return getLogID(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/AxisHandler.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/AxisHandler.java deleted file mode 100644 index befbd58dd..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/AxisHandler.java +++ /dev/null @@ -1,382 +0,0 @@ -package at.gv.egovernment.moa.spss.server.service; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.security.cert.X509Certificate; -import java.util.Iterator; - -import javax.servlet.http.HttpServletRequest; - -import org.apache.axis.AxisFault; -import org.apache.axis.Message; -import org.apache.axis.MessageContext; -import org.apache.axis.attachments.AttachmentPart; -import org.apache.axis.handlers.BasicHandler; -import org.apache.axis.transport.http.HTTPConstants; -import org.apache.axis.utils.Messages; -import org.apache.axis.utils.XMLUtils; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.spss.server.transaction.TransactionIDGenerator; -import at.gv.egovernment.moa.spss.util.MessageProvider; -import at.gv.egovernment.moa.util.DOMUtils; - -/** - * An handler that is invoked on each web service request and performs some - * central message handling. - * - * Mainly sets up the TransactionContext for the current - * transaction (i.e. web service request). - * - * @author Patrick Peck - * @author Stefan Knirsch - * @version $Id$ - */ -public class AxisHandler extends BasicHandler { - - /** The resource names of the messages to load. */ - private static final String MOA_SPSS_WSDL_RESOURCE_ = "/resources/wsdl/MOA-SPSS-1.3.wsdl"; - - /** The property name for accessing the HTTP request. */ - private static final String REQUEST_PROPERTY = HTTPConstants.MC_HTTP_SERVLETREQUEST; - - /** The property name for accessing the X509 client certificate chain. */ - private static final String X509_CERTIFICATE_PROPERTY = "javax.servlet.request.X509Certificate"; - - /** The property name for accessing the SOAP action header. */ - private static final String SOAP_ACTION_HEADER = "soapaction"; - - /** URI of the SOAP XML namespace. */ - public static final String SOAP_NS_URI = "http://schemas.xmlsoap.org/soap/envelope/"; - - /** Prefix used for the SOAP XML namespace */ - public static final String SOAP_PREFIX = "soapenv"; - - /** Simple string contains the front part of the enveloping SOAP wrapping */ - private static final String SOAP_PART_PRE = ""; - - /** Simple string contains the post part of the enveloping SOAP wrapping */ - private static final String SOAP_PART_POST = ""; - - /** - * Handle an invocation of this handler. - * - * @param msgContext Information about this request/response. - * @throws AxisFault An error occurred during processing of the request. - * @see org.apache.axis.Handler#invoke(MessageContext) - */ - public void invoke(MessageContext msgContext) throws AxisFault { - if (!msgContext.getPastPivot()) { - handleRequest(msgContext); - } else { - handleResponse(msgContext); - } - } - - /** - * This method is called by invoke to handle incoming requests. - * - * @param msgContext The context as provided to invoke. - * @throws AxisFault An error occurred during processing of the request. - */ - private void handleRequest(MessageContext msgContext) throws AxisFault { - try { - // generate a unique transaction id and build the TransactionContext - // for this request - HttpServletRequest request = - (HttpServletRequest) msgContext.getProperty(REQUEST_PROPERTY); - - X509Certificate[] clientCert = - (X509Certificate[]) request.getAttribute(X509_CERTIFICATE_PROPERTY); - - //Configure Axis - //msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.FALSE); - - Message soapMessage = msgContext.getCurrentMessage(); - - ConfigurationProvider configuration = - ConfigurationProvider.getInstance(); - - Element xmlRequest = null; - Element soapPart = DOMUtils.parseDocument(new ByteArrayInputStream(soapMessage.getSOAPPartAsBytes()), false, null, null).getDocumentElement(); - if (soapPart!=null) { - NodeList soapBodies = soapPart.getElementsByTagNameNS(SOAP_NS_URI, "Body"); - if (soapBodies!=null && soapBodies.getLength()>0) { - xmlRequest = (Element) soapBodies.item(0).getFirstChild(); - } - //oder TODO: Evaluierung ob XPATH schneller - /* - HashMap nSMap = new HashMap(); - nSMap.put((String)SOAP_PREFIX, SOAP_NS_URI); - Element soapBody = (Element) XPathUtils.selectSingleNode(soapPart, nSMap, "/"+SOAP_PREFIX+":Envelope/"+SOAP_PREFIX+":Body"); - if (soapBody!=null) { - xmlRequest= (Element) soapBody.getFirstChild(); - } - */ - } - - TransactionContext context = - new TransactionContext( - TransactionIDGenerator.nextID(), - clientCert, - configuration, - xmlRequest, - null); - - String soapAction = (String) request.getHeader(SOAP_ACTION_HEADER); - if ("\"\"".equals(soapAction)) { - // if http soap action header is empty - soapAction = msgContext.getTargetService(); - } - context.setRequestName(soapAction); - - int attachmentCount = soapMessage.getAttachmentsImpl().getAttachmentCount(); - if (attachmentCount>0) { - - // add SOAP attachments to transaction context - Iterator iterator = soapMessage.getAttachments(); - while (iterator.hasNext()) { - AttachmentPart attachment = (AttachmentPart)iterator.next(); - String id = attachment.getContentId(); - String type = attachment.getContentType(); - - //Now get the InputStream (note: we could also get the content with Object content = attachment.getContent();) - InputStream is = null; - javax.activation.DataHandler datahandler = attachment.getDataHandler(); - org.apache.axis.attachments.ManagedMemoryDataSource mmds = (org.apache.axis.attachments.ManagedMemoryDataSource)datahandler.getDataSource(); - if (mmds!=null){ - is = mmds.getInputStream(); - } - debug("handler.06", new Object[] {id, type}); - context.addAttachment(id, type, mmds); - } - } - - setUpContexts(context); - - // log some information about the request - info( - "handler.00", - new Object[] { - context.getTransactionID(), - msgContext.getTargetService()}); - info("handler.01", new Object[] { request.getRemoteAddr()}); - if (clientCert != null) { - info( - "handler.02", - new Object[] { - clientCert[0].getSubjectDN(), - clientCert[0].getSerialNumber(), - clientCert[0].getIssuerDN()}); - - } else { - info("handler.03", null); - } - if (Logger.isDebugEnabled()) { - String msg = soapMessage.getSOAPPartAsString(); - Logger.debug(new LogMsg(msg)); - } - } catch (MOASystemException e) { - MOASystemException se = new MOASystemException("2900", null, e); - AxisFault fault = AxisFault.makeFault(se); - fault.setFaultDetail(new Element[] { se.toErrorResponse()}); - throw fault; - } catch (Throwable t) { - t.printStackTrace(); - Logger.info(new LogMsg(t.getStackTrace())); - MOASystemException e = new MOASystemException("2900", null, t); - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - throw fault; - } - } - - /** - * This method is called by invoke to handle outgoing - * responses. - * - * @param msgContext The context as provided to invoke. - * @throws AxisFault An error occurred during processing of the response. - */ - private void handleResponse(MessageContext msgContext) throws AxisFault { - String xmlResponseString = null; - String soapResponseString = null; - - TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); - Element xmlResponse = context.getResponse(); - - if (xmlResponse!=null) { - try { - xmlResponseString = DOMUtils.serializeNode(xmlResponse, true); - /* - Soll die Antwort nur \n enthalten, so gibt es 2 Möglichkeiten: - 1.) höhere Xalan Version und - xmlResponseString = DOMUtils.serializeNode(xmlResponse, true, "\n"); - 2.) - OutputFormat serializerFormat = new OutputFormat((Document) xmlResponse.getOwnerDocument()); - serializerFormat.setLineSeparator("\n"); - serializerFormat.setIndenting(false); - serializerFormat.setPreserveSpace(true); - serializerFormat.setOmitXMLDeclaration(true); - serializerFormat.setEncoding("UTF-8"); - ByteArrayOutputStream serializedBytes = new ByteArrayOutputStream(); - XMLSerializer serializer = new XMLSerializer(serializedBytes, serializerFormat); - serializer.serialize(xmlResponse); - serializedBytes.close(); - xmlResponseString = serializedBytes.toString("UTF-8"); - */ - soapResponseString = SOAP_PART_PRE + xmlResponseString + SOAP_PART_POST; - //override axis response-message - msgContext.setResponseMessage(new Message(soapResponseString)); - } catch (Throwable t) { - t.printStackTrace(); - Logger.info(new LogMsg(t.getStackTrace())); - MOASystemException e = new MOASystemException("2900", null, t); - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - throw fault; - } - - } else { - //Fallback: if functions do not set the resulting response in the transaction, the original one from axis will be used - soapResponseString = msgContext.getCurrentMessage().getSOAPPartAsString(); - } - - info("handler.04", null); - if (Logger.isDebugEnabled()) { - Logger.debug(new LogMsg(soapResponseString)); - } - tearDownContexts(); - } - - /** - * Called, when the processing of the web service fails. - * - * @param msgContext Information about the current request. - * @see org.apache.axis.Handler#onFault(org.apache.axis.MessageContext) - */ - public void onFault(MessageContext msgContext) { - info("handler.05", null); - tearDownContexts(); - } - - /** - * Set up the thread-local contexts (TransactionContext and - * LoggingContext). - * - * @param context The TransactionContext to set for the current - * request. - */ - private void setUpContexts(TransactionContext context) { - // set the transaction context in the TransactionContextManager - TransactionContextManager tcm = TransactionContextManager.getInstance(); - tcm.setTransactionContext(context); - - // set the logging context in the LoggingContextManager - LoggingContextManager lcm = LoggingContextManager.getInstance(); - LoggingContext lc = new LoggingContext(context.getTransactionID()); - lcm.setLoggingContext(lc); - } - - /** - * Tear down the thread-local contexts. - */ - private void tearDownContexts() { - TransactionContextManager tcm = TransactionContextManager.getInstance(); - - //delete temporary files - TransactionContext context = tcm.getTransactionContext(); - context.cleanAttachmentCache(); - - // unset the transaction context - tcm.setTransactionContext(null); - - // unset the logging context - LoggingContextManager lcm = LoggingContextManager.getInstance(); - lcm.setLoggingContext(null); - } - - /** - * Generate the WSDL into the msgContext. - * - * The code of this method is more or less copied from the - * org.apache.axis.handlers.soap.SOAPService class contained in - * the 1.1 release of Axis to allow for a missing wsdlFile (so - * that a resource by the same name is searched for in the classpath). The - * implementation of this method should be obsolete if Axis 1.1 or higher is - * used. - * - * @param msgContext The MessageContext that will contain the - * WSDL description of the current web service. - * @throws AxisFault An error occurred producing the WSDL. - */ - public void generateWSDL(MessageContext msgContext) throws AxisFault { - InputStream instream = null; - - try { - String filename = MOA_SPSS_WSDL_RESOURCE_; - File file = new File(filename); - if (file.exists()) { - //if this resolves to a file, load it - instream = new FileInputStream(filename); - } else { - //else load a named resource in our classloader. - instream = this.getClass().getResourceAsStream(filename); - if (instream == null) { - String errorText = Messages.getMessage("wsdlFileMissing", filename); - throw new AxisFault(errorText); - } - } - Document doc = XMLUtils.newDocument(instream); - msgContext.setProperty("WSDL", doc); - } catch (Exception e) { - throw AxisFault.makeFault(e); - } finally { - if (instream != null) { - try { - instream.close(); - } catch (IOException e) { - // ok to do nothing here - } - } - } - } - - /** - * Utility function to issue an info message to the log. - * - * @param messageId The ID of the message to log. - * @param parameters Additional message parameters. - */ - private static void info(String messageId, Object[] parameters) { - MessageProvider msg = MessageProvider.getInstance(); - - Logger.info(new LogMsg(msg.getMessage(messageId, parameters))); - } - - /** - * Utility function to issue an debug message to the log. - * - * @param messageId The ID of the message to log. - * @param parameters Additional message parameters. - */ - private static void debug(String messageId, Object[] parameters) { - MessageProvider msg = MessageProvider.getInstance(); - - Logger.debug(new LogMsg(msg.getMessage(messageId, parameters))); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java deleted file mode 100644 index 7783ed3f6..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java +++ /dev/null @@ -1,120 +0,0 @@ -package at.gv.egovernment.moa.spss.server.service; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; -import at.gv.egovernment.moa.spss.server.init.*; -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * A servlet to initialize and update the MOA configuration. - * - * @author Fatemeh Philippi - * @author Patrick Peck - * @version $Id$ - */ -public class ConfigurationServlet extends HttpServlet { - /** The document type of the HTML to generate. */ - private static final String DOC_TYPE = - "\n"; - - /** - * Handle a HTTP GET request, used to indicated that the MOA - * configuration needs to be updated (reloaded). - * - * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - - MessageProvider msg = MessageProvider.getInstance(); - PrintWriter out; - - // set up a logging context for logging the reconfiguration - LoggingContextManager.getInstance().setLoggingContext( - new LoggingContext("configuration update")); - - response.setContentType("text/html"); - out = response.getWriter(); - out.println(DOC_TYPE); - out.println("MOA configuration update"); - out.println(""); - try { - // reconfigure the system - ConfigurationProvider config = ConfigurationProvider.reload(); - IaikConfigurator iaikConfigurator = new IaikConfigurator(); - - iaikConfigurator.configure(config); - - // print a status message - out.println("

" + msg.getMessage("config.06", null) + "

"); - Logger.info(new LogMsg(msg.getMessage("config.06", null))); - - if (!config.getWarnings().isEmpty()) { - // print the warnings - List allWarnings = new ArrayList(); - Iterator iter; - - allWarnings.addAll(config.getWarnings()); - allWarnings.addAll(iaikConfigurator.getWarnings()); - - out.println("

" + msg.getMessage("config.29", null) + "

"); - for (iter = allWarnings.iterator(); iter.hasNext();) { - out.println(iter.next() + "
"); - } - out.println("

" + msg.getMessage("config.28", null) + "

"); - } - - } catch (Throwable t) { - out.println("

" + msg.getMessage("config.20", null) + "

"); - out.println("

" + msg.getMessage("config.28", null) + "

"); - Logger.warn(new LogMsg(msg.getMessage("config.20", null)), t); - } - out.println(""); - - out.flush(); - out.close(); - - // tear down the logging context - LoggingContextManager.getInstance().setLoggingContext(null); - } - - /** - * Do the same as doGet. - * - * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - doGet(request, response); - } - - /** - * Perform some initial initialization tasks for the MOA web services - * application. - * - * Does an initial load of the MOA configuration to test if a working web - * service can be provided. - * - * @see javax.servlet.GenericServlet#init() - */ - public void init() throws ServletException { - SystemInitializer.init(); - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java deleted file mode 100644 index 26d79dbd8..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java +++ /dev/null @@ -1,78 +0,0 @@ -package at.gv.egovernment.moa.spss.server.service; - -import iaik.pki.revocation.RevocationSourceTypes; -import iaik.pki.store.revocation.archive.Archive; -import iaik.pki.store.revocation.archive.ArchiveFactory; - -import java.util.Date; - -import at.gv.egovernment.moa.logging.LogMsg; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.logging.TransactionId; -import at.gv.egovernment.moa.spss.util.MessageProvider; - -/** - * A Runnable for periodically cleaning up the revocation archive. - * @author Patrick Peck - * @version $Id$ - */ -public class RevocationArchiveCleaner implements Runnable { - - /** The inverval between two clean-ups of the revocation archive. */ - private long archiveCleanupInterval; - - /** - * Create a new RevocationArchiveCleaner. - * - * @param archiveCleanupInterval The interval between two clean-ups of the - * revocation archive. - */ - public RevocationArchiveCleaner(long archiveCleanupInterval) { - this.archiveCleanupInterval = archiveCleanupInterval; - } - - /** - * Run the RevocationArchiveCleaner in its own - * Thread. - */ - public void run() { - while (true) { - try { - ConfigurationProvider config = ConfigurationProvider.getInstance(); - boolean enableArchiving = config.getEnableRevocationArchiving(); - - if (enableArchiving) - { - Archive archive = ArchiveFactory.getInstance().getArchive(); - long archiveDurationMillis = - (long) config.getCRLArchiveDuration() * 86400000; - - // delete old archive data - if (archiveDurationMillis > 0) { - Date olderThan = - new Date(System.currentTimeMillis() - archiveDurationMillis); - - archive.deleteOldArchiveEntries( - RevocationSourceTypes.CRL, - olderThan, - new TransactionId("RevocationArchiveCleaner")); - } - } - - } catch (Exception e) { - MessageProvider msg = MessageProvider.getInstance(); - Logger.error(new LogMsg(msg.getMessage("init.02", null)), e); - } - - // sleep - try { - Thread.sleep(archiveCleanupInterval * 1000); - } catch (InterruptedException e) { - // ok to do nothing here - } - - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java deleted file mode 100644 index 4224f5665..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java +++ /dev/null @@ -1,72 +0,0 @@ -package at.gv.egovernment.moa.spss.server.service; - -import java.io.ByteArrayInputStream; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; - -import at.gv.egovernment.moa.spss.MOAApplicationException; - -/** - * Helper methods for the Service classes. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ServiceUtils { - - /** - * Schema-validate a request. - * - * @param request The request to validate. - * @throws MOAApplicationException An error occurred validating the requst. - */ - public static void validateRequest(Element[] request) - throws MOAApplicationException { - - // validate the request - try { - DOMUtils.validateElement( - request[0], - Constants.ALL_SCHEMA_LOCATIONS, - null); - } catch (Exception e) { - throw new MOAApplicationException( - "1100", - new Object[] { e.getMessage()}, - e); - } - } - - /** - * Reparse the request with schema-validation turned on so that ID references - * are resolved. - * - * @param request The request to reparse. - * @return The reparsed request. - * @throws MOAApplicationException An error occurred parsing the request. - */ - public static Element reparseRequest(Element request) - throws MOAApplicationException { - - try { - byte[] requestBytes = DOMUtils.serializeNode(request, "UTF-8"); - Document validatedRequest = - DOMUtils.parseDocument( - new ByteArrayInputStream(requestBytes), - true, - Constants.ALL_SCHEMA_LOCATIONS, - null); - return validatedRequest.getDocumentElement(); - } catch (Exception e) { - throw new MOAApplicationException( - "1100", - new Object[] { e.getMessage()}, - e); - } - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java deleted file mode 100644 index 2d548ea3a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java +++ /dev/null @@ -1,104 +0,0 @@ -package at.gv.egovernment.moa.spss.server.service; - -import java.util.Collections; - -import javax.xml.namespace.QName; - -import org.apache.axis.AxisFault; -import org.apache.axis.i18n.Messages; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureCreationInvoker; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.StreamUtils; - -/** - * The service endpoint for the SignatureCreation web service. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SignatureCreationService { - - /** - * Handle a CreateXMLSignatureRequest. - * - * @param request The CreateXMLSignatureRequest to work on - * (contained in the 0th element of the array). - * @return A CreateXMLSignatureResponse as the only element of - * the Element array. - * @throws AxisFault An error occurred during handling of the message. - */ - public Element[] CreateXMLSignatureRequest(Element[] request) - throws AxisFault { - XMLSignatureCreationInvoker invoker = - XMLSignatureCreationInvoker.getInstance(); - Element[] response = new Element[1]; - - // check that we have a CreateXMLSignatureRequest; if not, create an - // AxisFault, just like the org.apache.axis.providers.java.MsgProvider - if (!Constants.MOA_SPSS_CREATE_XML_REQUEST.equals(request[0].getLocalName()) || - !Constants.MOA_NS_URI.equals(request[0].getNamespaceURI())) - { - QName qname = - new QName(request[0].getNamespaceURI(), request[0].getLocalName()); - throw new AxisFault( - Messages.getMessage("noOperationForQName", qname.toString())); // TODO GK Operation name does not make it into the error repsonse - } - - // handle the request - try { - // create a parser and builder for binding API objects to/from XML - CreateXMLSignatureRequestParser requestParser = - new CreateXMLSignatureRequestParser(); - CreateXMLSignatureResponseBuilder responseBuilder = - new CreateXMLSignatureResponseBuilder(); - Element reparsedReq; - CreateXMLSignatureRequest requestObj; - CreateXMLSignatureResponse responseObj; - - //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. - TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); - // validate the request - reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); - - // convert to API objects - requestObj = requestParser.parse(reparsedReq); - - // invoke the core logic - responseObj = - invoker.createXMLSignature(requestObj, Collections.EMPTY_SET); - - // map back to XML - response[0] = responseBuilder.build(responseObj).getDocumentElement(); - - // save response in transaction - context.setResponse(response[0]); - - } catch (MOAException e) { - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - Logger.debug("Anfrage zur Signaturerstellung wurde nicht erfolgreich beendet:" - + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); - throw fault; - } catch (Throwable t) { - MOASystemException e = new MOASystemException("2900", null, t); - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - Logger.debug("Anfrage zur Signaturerstellung wurde nicht erfolgreich beendet:" - + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); - throw fault; - } - - return response; - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java b/spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java deleted file mode 100644 index b335a6e23..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java +++ /dev/null @@ -1,151 +0,0 @@ -package at.gv.egovernment.moa.spss.server.service; - -import org.apache.axis.AxisFault; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.spss.server.invoke.CMSSignatureVerificationInvoker; -import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureVerificationInvoker; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; -import at.gv.egovernment.moa.util.StreamUtils; - -/** - * The service endpoint for the SignatureVerification web service. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SignatureVerificationService { - - /** - * Handle a VerifyCMSSignatureRequest. - * - * @param request The VerifyCMSSignatureRequest to work on - * (contained in the 0th element of the array). - * @return A VerifyCMSSignatureResponse as the only element of - * the Element array. - * @throws AxisFault An error occurred during handling of the message. - */ - public Element[] VerifyCMSSignatureRequest(Element[] request) - throws AxisFault { - CMSSignatureVerificationInvoker invoker = - CMSSignatureVerificationInvoker.getInstance(); - Element[] response = new Element[1]; - - try { - // create a parser and builder for binding API objects to/from XML - VerifyCMSSignatureRequestParser requestParser = - new VerifyCMSSignatureRequestParser(); - VerifyCMSSignatureResponseBuilder responseBuilder = - new VerifyCMSSignatureResponseBuilder(); - Element reparsedReq; - VerifyCMSSignatureRequest requestObj; - VerifyCMSSignatureResponse responseObj; - - //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. - TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); - // validate the request - reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); - - // convert to API objects - requestObj = requestParser.parse(reparsedReq); - - // invoke the core logic - responseObj = invoker.verifyCMSSignature(requestObj); - - // map back to XML - response[0] = responseBuilder.build(responseObj).getDocumentElement(); - - // save response in transaction - context.setResponse(response[0]); - - } catch (MOAException e) { - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" - + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); - throw fault; - } catch (Throwable t) { - MOASystemException e = new MOASystemException("2900", null, t); - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" - + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); - throw fault; - } - - return response; - } - - /** - * Handle a VerifyXMLSignatureRequest. - * - * @param request The VerifyXMLSignatureRequest to work on - * (contained in the 0th element of the array). - * @return A VerifyXMLSignatureResponse as the only element of - * the Element array. - * @throws AxisFault An error occurred during handling of the message. - */ - public Element[] VerifyXMLSignatureRequest(Element[] request) - throws AxisFault { - XMLSignatureVerificationInvoker invoker = - XMLSignatureVerificationInvoker.getInstance(); - Element[] response = new Element[1]; - - try { - // create a parser and builder for binding API objects to/from XML - VerifyXMLSignatureRequestParser requestParser = - new VerifyXMLSignatureRequestParser(); - VerifyXMLSignatureResponseBuilder responseBuilder = - new VerifyXMLSignatureResponseBuilder(); - Element reparsedReq; - VerifyXMLSignatureRequest requestObj; - VerifyXMLSignatureResponse responseObj; - - //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. - TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); - // validate the request - reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); - - // convert to API objects - requestObj = requestParser.parse(reparsedReq); - - // invoke the core logic - responseObj = invoker.verifyXMLSignature(requestObj); - - // map back to XML - response[0] = responseBuilder.build(responseObj).getDocumentElement(); - - // save response in transaction - context.setResponse(response[0]); - - } catch (MOAException e) { - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" - + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); - throw fault; - } catch (Throwable t) { - MOASystemException e = new MOASystemException("2900", null, t); - AxisFault fault = AxisFault.makeFault(e); - fault.setFaultDetail(new Element[] { e.toErrorResponse()}); - Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" - + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); - throw fault; - } - - return response; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/tools/CertTool.java b/spss.server/src/at/gv/egovernment/moa/spss/server/tools/CertTool.java deleted file mode 100644 index 9fe17eae2..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/tools/CertTool.java +++ /dev/null @@ -1,242 +0,0 @@ -package at.gv.egovernment.moa.spss.server.tools; - -import java.io.BufferedInputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; -import java.security.cert.CertificateException; - -import iaik.asn1.structures.Name; -import iaik.pki.store.certstore.CertStoreException; -import iaik.pki.store.certstore.CertStoreTypes; -import iaik.pki.store.certstore.directory.DirectoryCertStore; -import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; -import iaik.pki.store.certstore.directory.DirectoryStoreException; -import iaik.security.ecc.provider.ECCProvider; -import iaik.security.provider.IAIK; -import iaik.utils.RFC2253NameParserException; -import iaik.x509.X509Certificate; - -/** - * A tool to support X509 certificate handling for configuring the MOA SP/SS - * service. - * - * This class provides functions for: - *
    - *
  • printing certificate information
  • - *
  • adding certificates to the cert store
  • - *
- * - * @author Patrick Peck - * @version $Id$ - */ -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"; - - /** - * Main entry point of the tool. - * - * @param args The command line arguments. A single argument is expected, - * which is the file name of the X509 certificate to inspect. - */ - public static void main(String args[]) { - CertTool certTool = new CertTool(); - - if (args.length == 2 && "-info".equals(args[0])) { - initProviders(); - certTool.printCertInfo(args[1], System.out); - } else if (args.length == 3 && "-add".equals(args[0])) { - initProviders(); - certTool.addCertToCertStore(args[1], args[2]); - } else { - certTool.printUsage(System.err); - } - } - - /** - * Init the JCE providers, depending on the JDK used. - * - * Adds the IAIK JCE and IAIK ECC providers. - */ - private static void initProviders() { - if (System.getProperty("java.version").startsWith("1.3")) { - IAIK.addAsProvider(); - } else { - IAIK.addAsJDK14Provider(); - } - ECCProvider.addAsProvider(); - } - - /** - * Print the information about the certificate. - * - * This method will output information about the Subject DN, the Issuer DN and - * the serial number of the certificate. - * - * @param certFile The name of the certificate file to inspect. - * @param out The stream to print the information to. - */ - public void printCertInfo(String certFile, PrintStream out) { - try { - InputStream is = new BufferedInputStream(new FileInputStream(certFile)); - X509Certificate cert = new X509Certificate(is); - String issuerDN; - String serial; - String subjectDN; - - try { - subjectDN = ((Name) (cert.getSubjectDN())).getRFC2253String(); - } catch (RFC2253NameParserException e) { - subjectDN = ILLEGAL_RFC2253_NAME; - } - - try { - issuerDN = ((Name) (cert.getIssuerDN())).getRFC2253String(); - } catch (RFC2253NameParserException e) { - issuerDN = ILLEGAL_RFC2253_NAME; - } - - serial = cert.getSerialNumber().toString(); - - out.println("SubjectDN (RFC2253): " + subjectDN); - out.println("IssuerDN (RFC2253) : " + issuerDN); - out.println("Serial Number : " + serial); - } catch (FileNotFoundException e) { - System.err.println("Zertifikat nicht gefunden: " + certFile); - } catch (IOException e) { - System.err.println( - "I/O Fehler beim Lesen des Zertifikats: " + e.getMessage()); - } catch (CertificateException e) { - System.err.println( - "Fehler beim Lesen des Zertifikats: " + e.getMessage()); - } catch (Throwable t) { - System.err.println("Allgemeiner Fehler: " + t.getMessage()); - } - } - - /** - * Add a certificate to a directory certificate store. - * - * @param certFile The certificate to add. - * @param certStoreRoot The root directory of the certificate store. - */ - public void addCertToCertStore(String certFile, String certStoreRoot) { - try { - // read the certificate - InputStream is = new BufferedInputStream(new FileInputStream(certFile)); - X509Certificate cert = new X509Certificate(is); - - // initialize the DirectoryCertStore - DirectoryCertStore certStore = - new DirectoryCertStore( - new SimpleDirectoryCertStoreParameters(certStoreRoot), - null); - - certStore.storeCertificate(cert, null); - - System.out.println("\nDas Zertifikat wurde erfolreich hinzugefügt.\n"); - - } catch (FileNotFoundException e) { - System.err.println("Zertifikat nicht gefunden: " + certFile); - } catch (IOException e) { - System.err.println( - "I/O Fehler beim Lesen des Zertifikats: " + e.getMessage()); - } catch (CertificateException e) { - System.err.println( - "Fehler beim Lesen des Zertifikats: " + e.getMessage()); - } catch (DirectoryStoreException e) { - System.err.println( - "Fehler beim Öffnen des Zertifikatsspeichers: " + e.getMessage()); - } catch (CertStoreException e) { - System.err.println( - "Fehler beim Hinzufügen des Zertifikats: " + e.getMessage()); - } catch (Throwable t) { - System.err.println("Allgemeiner Fehler: " + t.getMessage()); - t.printStackTrace(); - } - } - - /** - * Print tool usage. - * - * @param out The PrintStream to print to. - */ - private void printUsage(PrintStream out) { - out.println("\nCerttool-Syntax:\n"); - out.println("-info "); - out.println("\n"); - } - -} - -/** - * Simple implementation of the DirectoryCertStoreParameters - * interface intelligent enough for setting up a simple - * DirectoryCertStore in the CertTool. - * - * @author Patrick Peck - * @version $Id$ - */ -class SimpleDirectoryCertStoreParameters - implements DirectoryCertStoreParameters { - - /** The cert store root directory. */ - private String rootDirectory; - - /** - * Create a new SimpleDirectoryCertStoreParameters object. - * - * @param rootDirectory The root directory of the cert store. - */ - public SimpleDirectoryCertStoreParameters(String rootDirectory) { - this.rootDirectory = rootDirectory; - } - - /** - * @return "MOA Directory CertStore" - * @see iaik.pki.store.certstore.CertStoreParameters#getId() - */ - public String getId() { - return "MOA Directory CertStore"; - } - - /** - * @return CertStoreTypes.DIRECTORY - * @see iaik.pki.store.certstore.CertStoreParameters#getType() - */ - public String getType() { - return CertStoreTypes.DIRECTORY; - } - - /** - * @return false - * @see iaik.pki.store.certstore.CertStoreParameters#isReadOnly() - */ - public boolean isReadOnly() { - return false; - } - - /** - * @return false - * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#createNew() - */ - public boolean createNew() { - return false; - } - - /** - * @return The root directory given at construction time. - * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#getRootDirectory() - */ - public String getRootDirectory() { - return rootDirectory; - } - -} \ No newline at end of file diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java b/spss.server/src/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java deleted file mode 100644 index d5c3b48c1..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java +++ /dev/null @@ -1,59 +0,0 @@ -package at.gv.egovernment.moa.spss.server.tools; - -import java.io.FileNotFoundException; -import java.io.FileOutputStream; - -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -/** - * A tool for converting a MOA SPSS Version 1.0 configuration file into - * a Version 1.3 configuration file. - * - * @author Gregor Karlinger - * @version $Id$ - */ -public class ConfigTool -{ - public static void main(String[] args) - { - if (args == null || args.length != 2) - { - System.out.println("Usage: ConfigTool "); - System.out.println(" ... Old config file to be transformed"); - System.out.println(" ... New config file resulting from the transform"); - System.exit(-1); - } - - try - { - TransformerFactory tFactory = TransformerFactory.newInstance(); - Transformer transformer = tFactory.newTransformer(new StreamSource( - ConfigTool.class.getResourceAsStream("/resources/tools/ConfigurationMapper.xsl"))); - transformer.transform(new StreamSource(args[0]), new StreamResult(new FileOutputStream(args[1]))); - - System.out.println("Successfully mapped configuration file."); - } - catch (TransformerConfigurationException e) - { - System.err.println("An error occurred during mapping the configuration file:"); - System.err.println(" Cannot initialize XSLT transform."); - System.err.println(" " + e.getMessage()); - } - catch (FileNotFoundException e) - { - System.err.println("An error occurred during mapping the configuration file:"); - System.err.println(" There is a problem with the filename for the new configuration file."); - System.err.println(" " + e.getMessage()); - } - catch (TransformerException e) - { - System.err.println("An error occurred during mapping the configuration file:"); - System.err.println(" " + e.getMessage()); - } - } -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java b/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java deleted file mode 100644 index 774880d26..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java +++ /dev/null @@ -1,264 +0,0 @@ -package at.gv.egovernment.moa.spss.server.transaction; - -import iaik.ixsil.util.URI; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.security.cert.X509Certificate; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; -import java.util.Map.Entry; - -import org.apache.axis.attachments.ManagedMemoryDataSource; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * Contains information about the current request. - * - * @author Stefan Knirsch - * @author Patrick Peck - */ -public class TransactionContext { - - /** The client certificate. */ - private X509Certificate[] clientCertificate = null; - /** The transaction ID. */ - private String transactionID = null; - /** The name of the request. */ - private String requestName = null; - /** The SOAP embedded request */ - private Element request; - /** The response which is to embed by SOAP */ - private Element response; - /** The map pointing to SOAP attachments needed by the request. */ - private HashMap attachments = null; - /** The configuration to use throughout the request. */ - private ConfigurationProvider configuration = null; - - /** - * Create a TransactionContext object. - * - * @param transactionID A unique ID for this TransactionContext. - * @param clientCertificate The client certificate chain. - * @param configuration The MOA configuration to use for this transaction. - */ - public TransactionContext( - String transactionID, - X509Certificate[] clientCertificate, - ConfigurationProvider configuration) { - - this.transactionID = transactionID; - this.clientCertificate = clientCertificate; - this.configuration = configuration; - } - - /** - * Create a TransactionContext object. - * - * @param transactionID A unique ID for this TransactionContext. - * @param clientCertificate The client certificate chain. - * @param configuration The MOA configuration to use for this transaction. - * @param attachments to use for this transaction. - */ - public TransactionContext( - String transactionID, - X509Certificate[] clientCertificate, - ConfigurationProvider configuration, - Element request, - HashMap attachments) { - - this.transactionID = transactionID; - this.clientCertificate = clientCertificate; - this.configuration = configuration; - this.request = request; - this.attachments = attachments; - } - - /** - * Returns the client certificate. - * - * @return The client certificate chain, if SSL client authentication has been - * configured in the web server and has been used by the client. The 0th - * element of the array contains the client certificate. null - * otherwise. - */ - public X509Certificate[] getClientCertificate() { - return clientCertificate; - } - - /** - * Returns the unique transaction ID. - * - * @return The transaction ID. - */ - public String getTransactionID() { - return transactionID; - } - - /** - * Returns the name of the request. - * - * @return The name of the request. - */ - public String getRequestName() { - return requestName; - } - - /** - * Sets the name of the request. - * - * @param requestName The request name to set. - */ - public void setRequestName(String requestName) { - this.requestName = requestName; - } - - /** - * Sets the the request. - * - * @param request The request to set. - */ - public void setRequest(Element request) { - this.request = request; - } - - /** - * Returns the request. - * - * @return The request. - */ - public Element getRequest() { - return request; - } - - /** - * Sets the the response. - * - * @param response The response to set. - */ - public void setResponse(Element response) { - this.response = response; - } - - /** - * Returns the response. - * - * @return The response. - */ - public Element getResponse() { - return response; - } - - /** - * Adds an attachment to the transactions list of SOAP attachments. - * - * @param referenceId Identification value for the SOAP attachment. - * @param contentType MIME type of the SOAP attachment. - * @param is Handle to the ManagedMemoryDataSource of the SOAP attachment. - */ - public void addAttachment(String referenceId, String contentType, ManagedMemoryDataSource is) { - if (this.attachments == null) this.attachments = new HashMap(); - Vector entry = new Vector(2); - entry.add(contentType); - entry.add(is); - this.attachments.put(referenceId, entry); - } - - /** - * Returns the ManagedMemoryDataSource to a specific SOAP attachment identified by referenceId. - * - * @param referenceId Identification value for the SOAP attachment. - */ - public ManagedMemoryDataSource getAttachment(String referenceId) { - if (attachments==null) { - return null; - } - Vector entry = (Vector) attachments.get(referenceId); - if (entry==null) { - return null; - } - //return (InputStream) ( ((ManagedMemoryDataSource)entry.get(1)).getInputStream()); - return (ManagedMemoryDataSource) entry.get(1); - } - - /** - * Returns the InputStream to a specific SOAP attachment identified by uri. - * - * @param uri Identification value for the SOAP attachment. - */ - public InputStream getAttachmentInputStream(URI uri) throws MOAApplicationException { - if (attachments==null) { - return null; - } - String referenceId = uri.getPath(); - Vector entry = (Vector) attachments.get(referenceId); - if (entry==null) { - return null; - } - - InputStream attachmentIs = null; - try { - attachmentIs = (InputStream) ( ((ManagedMemoryDataSource)entry.get(1)).getInputStream()); - } catch (IOException e) { - throw new MOAApplicationException("2208", new Object[] { uri }, e); - } - - return attachmentIs; - //If we would return the whole mmds: return (ManagedMemoryDataSource) entry.get(1); - } - - /** - * Returns the content type to a specific SOAP attachment identified by referenceId. - * - * @param referenceId Identification value for the SOAP attachment. - */ - public String getAttachmentContentType(String referenceId) { - Vector entry = (Vector) attachments.get(referenceId); - if (entry==null) { - return null; - } - return (String) entry.get(0); - } - - /** - * Delete the temporary attachment files. - */ -public void cleanAttachmentCache() { - if (null==attachments) { - return; - } - Iterator iterator = attachments.entrySet().iterator(); - while (iterator.hasNext()) { - Entry hmEntry = (Entry) iterator.next(); - Vector entry = (Vector)hmEntry.getValue(); - ManagedMemoryDataSource mmds = (ManagedMemoryDataSource)entry.get(1); - try { - if (mmds!=null) { - InputStream is = mmds.getInputStream(); - if (is!=null) is.close(); - File f = mmds.getDiskCacheFile(); - if (f!=null) f.delete(); - mmds.delete(); - } - } catch (IOException e) { - // ok to do nothing here - } - } - } - - /** - * Returns the ConfigurationProvider associated with this - * transaction. - * - * @return The ConfigurationProvider associated with this transaction. - */ - public ConfigurationProvider getConfiguration() { - return configuration; - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java b/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java deleted file mode 100644 index 13127c3ae..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java +++ /dev/null @@ -1,62 +0,0 @@ -package at.gv.egovernment.moa.spss.server.transaction; - -/** - * Provides each thread with an instance of TransactionContext. - * - * The single instance of the TransactionContextManager should be - * used to access contextual information for each web service transaction, e.g. - * the transaction ID, MOA configuration, client certificate, etc. - * - * @author Stefan Knirsch - * @author Patrick Peck - */ -public class TransactionContextManager { - - /** The single instance of TransactionContextManager */ - private static TransactionContextManager instance = null; - - /** Contains a single TransactionContext for each thread. */ - private ThreadLocal context = null; - - /** - * Get the single instance of TransactionContextManager. - * - * @return The single instanc of TransactionContextManager. - */ - public static synchronized TransactionContextManager getInstance() { - if (instance == null) { - instance = new TransactionContextManager(); - } - return instance; - } - - /** - * Creates a new TransactionContextManager. - * - * Protected to disallow direct instantiation. - */ - protected TransactionContextManager() { - context = new ThreadLocal(); - } - - /** - * Set the TransactionContext for the current thread. - * - * @param txContext The TransactionContext for this thread. - */ - public void setTransactionContext(TransactionContext txContext) { - context.set(txContext); - } - - /** - * Get the TransactionContext for the current thread. - * - * @return The TransactionContext for the current thread or - * null, if none has been set (or if this method is being invoked - * outside the bounds of a transaction). - */ - public TransactionContext getTransactionContext() { - return (TransactionContext) context.get(); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java b/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java deleted file mode 100644 index 6eb07defe..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java +++ /dev/null @@ -1,51 +0,0 @@ -package at.gv.egovernment.moa.spss.server.transaction; - - -/** - * A generator for unique transaction IDs. - * - *

The transaction IDs are of the form "-", where: - *

    - *
  • base is initialized with the system time when this class is - * being loaded
  • - *
  • counter is incremented sequentially on each call to - * nextID()
  • - *
- *

- * - *

Assuming that it is highly unlikely that MOA servers are started at - * exactly the same time instant, the mechanism provided by this class should - * guarantee unique transaction IDs across multiple restarts and/or instances of - * the server.

- * - * @author Patrick Peck - * @author Stefan Knirsch - */ -public class TransactionIDGenerator { - - /** Request sequence number. */ - private static long counter = 0; - /** The base value to which to append the sequence number. */ - private static String base = null; - - /** - * Set up the initial base value. - */ - static { - synchronized (TransactionIDGenerator.class) { - base = Long.toString(System.currentTimeMillis()); - } - } - - /** - * Returns the next transaction ID. - * - * @return The next transaction ID. - */ - public static synchronized String nextID() { - counter++; - - return (base + "-" + counter); - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/util/IdGenerator.java b/spss.server/src/at/gv/egovernment/moa/spss/server/util/IdGenerator.java deleted file mode 100644 index 2dfd22140..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/util/IdGenerator.java +++ /dev/null @@ -1,61 +0,0 @@ -package at.gv.egovernment.moa.spss.server.util; - -import java.util.Set; - -/** - * Generate unique ID values for various objects in the response. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IdGenerator { - /** The base value to append the counter to. */ - private String base; - /** The Set of reserved ID values. */ - private Set reserved; - /** The sequence number. */ - private int count; - - /** - * Create a new IdGenerator. - * - * @param base A base value to append the IDs to. The creator of this object - * should provide a base value, so that appending the counter leads to unique - * IDs. - * @param reserved The Set of reserved IDs. A call to - * uniqueId() will respect the reserved IDs. - */ - public IdGenerator(String base, Set reserved) { - this.base = base; - this.reserved = reserved; - count = 1; - } - - /** - * Create the next ID value in the sequence. - * - * @return The next ID value in the sequence. - */ - protected String nextId() { - return base + "-" + count++; - } - - /** - * Create the next unique ID value which is unique in the reserved ID set. - * - * The created ID is added to the set of reserved IDs. - * - * @return The next ID value. - */ - public String uniqueId() { - String nextId; - - while (reserved.contains(nextId = nextId())); - - reserved.add(nextId); - - return nextId; - - } - -} diff --git a/spss.server/src/at/gv/egovernment/moa/spss/util/MessageProvider.java b/spss.server/src/at/gv/egovernment/moa/spss/util/MessageProvider.java deleted file mode 100644 index a6f6c1d4a..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/util/MessageProvider.java +++ /dev/null @@ -1,65 +0,0 @@ -package at.gv.egovernment.moa.spss.util; - -import java.util.Locale; - -import at.gv.egovernment.moa.util.Messages; - -/** - * Singleton wrapper around a Messages object. - * - * @author Patrick Peck - * @version $Id$ - */ -public class MessageProvider { - - /** The resource names of the messages to load. */ - private static final String[] DEFAULT_MESSAGE_RESOURCES = - { "resources/properties/spss_messages" }; - /** The corresponding message locales. */ - private static final Locale[] DEFAULT_MESSAGE_LOCALES = - new Locale[] { new Locale("de", "AT") }; - /** The single instance of this class. */ - private static MessageProvider instance; - - /** The messages provided by the MessageProvider. */ - private Messages messages; - - /** - * Return the single instance of the MessageProvider. - * - * Intialilizes the MessageProvider with the default message - * locations: /resources/properties/spss_messages. - * - * @return The single MessageProvider. - */ - public static synchronized MessageProvider getInstance() { - if (instance == null) { - instance = - new MessageProvider(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); - } - return instance; - } - - /** - * Create a MessageProvider. - * - * @param resourceNames The names of the resources containing the messages. - * @param locales The corresponding locales. - */ - protected MessageProvider(String[] resourceNames, Locale[] locales) { - this.messages = new Messages(resourceNames, locales); - } - - /** - * Get the message corresponding to a given message ID. - * - * @param messageId The ID of the message. - * @param parameters The parameters to fill in into the message arguments. - * @return The formatted message. - */ - public String getMessage(String messageId, Object[] parameters) { - return messages.getMessage(messageId, parameters); - } - - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/AllTests.java b/spss.server/src/test/at/gv/egovernment/moa/spss/AllTests.java deleted file mode 100644 index c670b5e55..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/AllTests.java +++ /dev/null @@ -1,40 +0,0 @@ -package test.at.gv.egovernment.moa.spss; - -import test.at.gv.egovernment.moa.spss.server.iaik.config.ConfigurationDataImplTest; -import test.at.gv.egovernment.moa.spss.server.iaik.config.IaikConfiguratorTest; -import test.at.gv.egovernment.moa.spss.server.tools.CertToolTest; - -import junit.awtui.TestRunner; -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * Test suite for all unit tests. - * - * @author Patrick Peck - * @version $Id$ - */ -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(test.at.gv.egovernment.moa.spss.server.config.AllTests.class); - suite.addTestSuite(ConfigurationDataImplTest.class); - suite.addTestSuite(IaikConfiguratorTest.class); - suite.addTest( - test.at.gv.egovernment.moa.spss.server.invoke.AllTests.suite()); - suite.addTest(test.at.gv.egovernment.moa.spss.api.xmlbind.AllTests.suite()); - suite.addTestSuite(CertToolTest.class); - - return suite; - } - - public static void main(String[] args) { - try { - TestRunner.run(AllTests.class); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java b/spss.server/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java deleted file mode 100644 index a585e30a0..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java +++ /dev/null @@ -1,82 +0,0 @@ -package test.at.gv.egovernment.moa.spss; - -import java.security.Security; - -import test.at.gv.egovernment.moa.MOATestCase; - -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.logging.LoggingContext; -import at.gv.egovernment.moa.logging.LoggingContextManager; -import at.gv.egovernment.moa.util.MessageProvider; - -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * Base class for MOA test cases. - * - * Provides some utility functions. - * - * @author Patrick Peck - * @version $Id$ - */ -public class SPSSTestCase extends MOATestCase { - - protected static final String TESTDATA_ROOT = "data/test/"; - - /** - * Constructor for MOATestCase. - * @param arg0 - */ - public SPSSTestCase(String name) { - super(name); - } - - /** - * Set up a transaction context with a test configuration. - */ - protected void setUpTransactionContext() throws Exception { - System.setProperty( - ConfigurationProvider.CONFIG_PROPERTY_NAME, - "data/test/conf/moa-spss/MOA-SPSSConfiguration.xml"); - ConfigurationProvider config = ConfigurationProvider.getInstance(); - TransactionContext context = new TransactionContext("test", null, config); - TransactionContextManager.getInstance().setTransactionContext(context); - } - - protected void setUpLoggingContext() throws Exception { - LoggingContext context = new LoggingContext("test"); - LoggingContextManager.getInstance().setLoggingContext(context); - } - - /** - * Configure the IAIK modules with the current configuration. - * - * A TransactionContext must have been set up before. - */ - protected void setUpIaikConfiguration() throws Exception { - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - ClassLoader cl = getClass().getClassLoader(); - MessageProvider msg = MessageProvider.getInstance(); - - try { - cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar - } catch (ClassNotFoundException e) { - Logger.warn(msg.getMessage("init.03", null), e); - } - - new IaikConfigurator().configure(context.getConfiguration()); - } - - protected void setUpSSL() throws Exception { - //System.setProperty("javax.net.debug", "all"); - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty( - "java.protocol.handler.pkgs", - "com.sun.net.ssl.internal.www.protocol"); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java b/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java deleted file mode 100644 index 28f79729e..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -package test.at.gv.egovernment.moa.spss.api.xmlbind; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * Runs all tests in this package. - * - * @author Patrick Peck - * @version $Id$ - */ -public class AllTests { - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(CreateXMLSignatureRequestParserTest.class); - suite.addTestSuite(TransformParserTest.class); - suite.addTestSuite(VerifyCMSSignatureRequestParserTest.class); - suite.addTestSuite(VerifyXMLSignatureRequestParserTest.class); - - return suite; - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java deleted file mode 100644 index 7ce705b01..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package test.at.gv.egovernment.moa.spss.api.xmlbind; - -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; -import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; - -/** - * Test the CreateXMLSignatureRequestParser. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CreateXMLSignatureRequestParserTest extends SPSSTestCase { - private static final String TESTDATA_BASE = - TESTDATA_ROOT + "xml/CreateXMLSignature/"; - - private CreateXMLSignatureRequestParser requestParser; - - public CreateXMLSignatureRequestParserTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - requestParser = new CreateXMLSignatureRequestParser(); - } - - public void testParse() throws Exception { - Element requestElem = - parseXml(TESTDATA_BASE + "TestGeneratorCX2.001.Req.xml") - .getDocumentElement(); - CreateXMLSignatureRequest request = requestParser.parse(requestElem); - SingleSignatureInfo sigInfo; - DataObjectInfo dataObjInfo; - CreateTransformsInfoProfileExplicit transProfile; - CreateSignatureEnvironmentProfileExplicit envProfile; - - assertNotNull(request); - assertEquals("PKCS12RSAKey1", request.getKeyIdentifier()); - assertEquals(1, request.getSingleSignatureInfos().size()); - - sigInfo = (SingleSignatureInfo) request.getSingleSignatureInfos().get(0); - assertEquals(1, sigInfo.getDataObjectInfos().size()); - assertFalse(sigInfo.isSecurityLayerConform()); - - dataObjInfo = (DataObjectInfo) sigInfo.getDataObjectInfos().get(0); - assertNotNull(dataObjInfo.getDataObject()); - - transProfile = - (CreateTransformsInfoProfileExplicit) dataObjInfo - .getCreateTransformsInfoProfile(); - assertNotNull( - transProfile.getCreateTransformsInfo().getFinalDataMetaInfo()); - - envProfile = - (CreateSignatureEnvironmentProfileExplicit) sigInfo - .getCreateSignatureInfo() - .getCreateSignatureEnvironmentProfile(); - assertEquals( - "//data:Document", - envProfile.getCreateSignatureLocation().getXPathExpression()); - assertEquals(0, envProfile.getCreateSignatureLocation().getIndex()); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java deleted file mode 100644 index f580f86bc..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package test.at.gv.egovernment.moa.spss.api.xmlbind; - -import java.util.List; - -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; -import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; -import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; -import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; -import at.gv.egovernment.moa.spss.api.common.XPathTransform; -import at.gv.egovernment.moa.spss.api.common.XSLTTransform; -import at.gv.egovernment.moa.spss.api.xmlbind.TransformParser; - -/** - * Test the TransformParser. - * - * @author Patrick Peck - * @version $Id$ - */ -public class TransformParserTest extends SPSSTestCase { - private static String TESTDATA_BASE = TESTDATA_ROOT + "xml/dsigTransform/"; - - private TransformParser transformParser; - - public TransformParserTest(String name) { - super(name); - } - - protected void setUp() { - transformParser = new TransformParser(); - } - - public void testParseTransforms() throws Exception { - Element transformsElem = - parseXml(TESTDATA_BASE + "transforms.xml").getDocumentElement(); - List transforms = transformParser.parseTransforms(transformsElem); - - assertNotNull(transforms); - assertEquals(3, transforms.size()); - - } - - public void testParseCanonicalizationTransform() throws Exception { - Element transformElem = - parseXml(TESTDATA_BASE + "canonicalization.xml").getDocumentElement(); - CanonicalizationTransform transform = - (CanonicalizationTransform) transformParser.parseTransform(transformElem); - - assertNotNull(transform); - assertEquals( - CanonicalizationTransform.CANONICAL_XML, - transform.getAlgorithmURI()); - } - - public void testParseExclCanonicalizationTransform() throws Exception { - Element transformElem = - parseXml(TESTDATA_BASE + "exclusiveCanonicalization.xml") - .getDocumentElement(); - ExclusiveCanonicalizationTransform transform = - (ExclusiveCanonicalizationTransform) transformParser.parseTransform( - transformElem); - - assertNotNull(transform); - assertEquals( - ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML, - transform.getAlgorithmURI()); - assertEquals(3, transform.getInclusiveNamespacePrefixes().size()); - } - - public void testParseEnvelopedTransform() throws Exception { - Element transformElem = - parseXml(TESTDATA_BASE + "enveloped.xml").getDocumentElement(); - EnvelopedSignatureTransform transform = - (EnvelopedSignatureTransform) transformParser.parseTransform( - transformElem); - - assertNotNull(transform); - } - - public void testParseXPathTransform() throws Exception { - Element transformElem = - parseXml(TESTDATA_BASE + "xpath.xml").getDocumentElement(); - XPathTransform transform = - (XPathTransform) transformParser.parseTransform(transformElem); - - assertNotNull(transform); - assertEquals("//ToBeSigned/Data", transform.getXPathExpression()); - assertEquals(1, transform.getNamespaceDeclarations().size()); - } - - public void testParseXPathFilter2Transform() throws Exception { - Element transformElem = - parseXml(TESTDATA_BASE + "xpath2.xml").getDocumentElement(); - XPathFilter2Transform transform = - (XPathFilter2Transform) transformParser.parseTransform(transformElem); - - assertNotNull(transform); - assertEquals(3, transform.getFilters().size()); - } - - public void testParseXSLTTransform() throws Exception { - Element transformElem = - parseXml(TESTDATA_BASE + "xslt.xml").getDocumentElement(); - XSLTTransform transform = - (XSLTTransform) transformParser.parseTransform(transformElem); - - assertNotNull(transform); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java deleted file mode 100644 index 4be7667eb..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package test.at.gv.egovernment.moa.spss.api.xmlbind; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.util.DateTimeUtils; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.common.MetaInfo; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureRequestParser; - -/** - * Test the VerifyCMSSignatureRequestParserTest. - * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyCMSSignatureRequestParserTest extends SPSSTestCase { - private static String TESTDATA_BASE = - TESTDATA_ROOT + "xml/VerifyCMSSignature/"; - - private VerifyCMSSignatureRequestParser requestParser; - - public VerifyCMSSignatureRequestParserTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - requestParser = new VerifyCMSSignatureRequestParser(); - } - - public void testParse() throws Exception { - Element requestElem = - parseXml(TESTDATA_BASE + "TestGeneratorVC0.001.Req.xml") - .getDocumentElement(); - VerifyCMSSignatureRequest request = requestParser.parse(requestElem); - MetaInfo metaInfo; - CMSContentExcplicit content; - - assertNotNull(request); - assertEquals(1, request.getSignatories()[0]); - assertEquals( - DateTimeUtils.parseDateTime("2003-04-04T09:30:47-05:00"), - request.getDateTime()); - assertNotNull(request.getCMSSignature()); - assertNotNull(request.getDataObject()); - assertEquals("TrustProfile1", request.getTrustProfileId()); - - metaInfo = request.getDataObject().getMetaInfo(); - assertNotNull(metaInfo); - assertEquals("text/plain", metaInfo.getMimeType()); - assertEquals("http://10.16.46.109/TestDatenGenerator/resources/testDaten.txt", metaInfo.getDescription()); - - content = (CMSContentExcplicit) request.getDataObject().getContent(); - assertNotNull(content.getBinaryContent()); - - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java deleted file mode 100644 index 3b8e8b00e..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java +++ /dev/null @@ -1,81 +0,0 @@ -package test.at.gv.egovernment.moa.spss.api.xmlbind; - -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.util.DateTimeUtils; - -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; - -/** - * Test the VerifyXMLSignatureRequestParserTest. - * - * @author Patrick Peck - * @version $Id$ - */ -public class VerifyXMLSignatureRequestParserTest extends SPSSTestCase { - private static String TESTDATA_BASE = - TESTDATA_ROOT + "xml/VerifyXMLSignature/"; - - private VerifyXMLSignatureRequestParser parser; - - public VerifyXMLSignatureRequestParserTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - parser = new VerifyXMLSignatureRequestParser(); - } - - public void testParse() throws Exception { - Element requestElem = - parseXml(TESTDATA_BASE + "TestGeneratorVX.201.Req.xml") - .getDocumentElement(); - VerifyXMLSignatureRequest request = parser.parse(requestElem); - VerifySignatureInfo verifySignatureInfo; - VerifySignatureLocation verifyLocation; - SignatureManifestCheckParams checkParams; - ReferenceInfo refInfo; - VerifyTransformsInfoProfileExplicit transformsProfile; - - assertNotNull(request); - assertEquals( - DateTimeUtils.parseDateTime("2003-04-01T12:53:57+01:00"), - request.getDateTime()); - assertFalse(request.getReturnHashInputData()); - assertEquals("TrustProfile1", request.getTrustProfileId()); - - verifySignatureInfo = request.getSignatureInfo(); - assertNotNull(verifySignatureInfo); - assertNotNull(verifySignatureInfo.getVerifySignatureEnvironment()); - - verifyLocation = verifySignatureInfo.getVerifySignatureLocation(); - assertNotNull(verifyLocation); - assertEquals("//dsig:Signature", verifyLocation.getXPathExpression()); - assertEquals(3, verifyLocation.getNamespaceDeclarations().size()); - - checkParams = request.getSignatureManifestCheckParams(); - assertNotNull(checkParams); - assertEquals(true, checkParams.getReturnReferenceInputData()); - assertEquals(1, checkParams.getReferenceInfos().size()); - - refInfo = (ReferenceInfo) checkParams.getReferenceInfos().get(0); - assertEquals(1, refInfo.getVerifyTransformsInfoProfiles().size()); - - transformsProfile = - (VerifyTransformsInfoProfileExplicit) refInfo - .getVerifyTransformsInfoProfiles() - .get(0); - assertEquals(1, transformsProfile.getTransforms().size()); - assertEquals(1, transformsProfile.getTransformParameters().size()); - - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java deleted file mode 100644 index 131f38c19..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java +++ /dev/null @@ -1,20 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.config; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * @author Gregor Karlinger - * @version $Id$ - */ -public class AllTests -{ - public static Test suite() - { - TestSuite suite = new TestSuite(); - suite.addTestSuite(ConfigurationProviderTest1.class); - suite.addTestSuite(ConfigurationProviderTest2.class); - suite.addTestSuite(ConfigurationProviderTest3.class); - return suite; - } -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java deleted file mode 100644 index 474a387ad..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java +++ /dev/null @@ -1,377 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.config; - -import iaik.asn1.structures.Name; -import iaik.pki.pathvalidation.ChainingModes; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; -import iaik.x509.X509Certificate; - -import java.math.BigInteger; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import junit.framework.TestCase; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.server.config.CRLDistributionPoint; -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.HardwareCryptoModule; -import at.gv.egovernment.moa.spss.server.config.HardwareKeyModule; -import at.gv.egovernment.moa.spss.server.config.KeyGroup; -import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry; -import at.gv.egovernment.moa.spss.server.config.OCSPDistributionPoint; -import at.gv.egovernment.moa.spss.server.config.SoftwareKeyModule; -import at.gv.egovernment.moa.spss.server.config.TrustProfile; -import at.gv.egovernment.moa.util.Constants; - -/** - * @author Gregor Karlinger - * @version $Id$ - */ -public class ConfigurationProviderTest1 extends TestCase -{ - private static final String CONFIG_BASE_ = - "e:/cio/projekte/basismodule/wartung/projekt/spss.server/res/test/resources/config/"; - - static at.gv.egovernment.moa.spss.server.config.ConfigurationProvider provider_; - - static - { - System.setProperty( - "log4j.configuration", - "file:/" + CONFIG_BASE_ + "log4j.properties"); - System.setProperty( - at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.CONFIG_PROPERTY_NAME, - CONFIG_BASE_ + "moa.spss.complete-config.xml"); - try - { - ConfigurationProvider.reload(); - provider_ = at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.getInstance(); - } - catch (ConfigurationException e) - { - throw new RuntimeException("Fehler beim Setup des Tests: " + e.getMessage()); - } - } - - /** - * Constructor for ConfigurationProvider. - * @param arg0 - */ - public ConfigurationProviderTest1() throws MOAException - { - super("ConfigurationProvider"); - } - - public void testGetWarnings() - { - assertEquals(0, provider_.getWarnings().size()); - } - - public void testGetDigestMethodAlgorithmName() - { - assertEquals( - Constants.SHA1_URI, - provider_.getDigestMethodAlgorithmName()); - } - - public void testGetCanonicalizationAlgorithmName() - { - assertEquals( - Constants.C14N_WITH_COMMENTS_URI, - provider_.getCanonicalizationAlgorithmName()); - } - - public void testGetHardwareCryptoModules() - { - List hwcms = provider_.getHardwareCryptoModules(); - assertEquals(2, hwcms.size()); - - HardwareCryptoModule hwc1 = (HardwareCryptoModule) hwcms.get(0); - assertEquals("HWC1_Name", hwc1.getName()); - assertEquals("HWC1_SlotId", hwc1.getSlotID()); - assertEquals("HWC1_UserPIN", hwc1.getUserPIN()); - - HardwareCryptoModule hwc2 = (HardwareCryptoModule) hwcms.get(1); - assertEquals("HWC2_Name", hwc2.getName()); - assertNull(hwc2.getSlotID()); - assertEquals("HWC2_UserPIN", hwc2.getUserPIN()); - } - - public void testGetHardwareKeyModules() - { - List hwkms = provider_.getHardwareKeyModules(); - assertEquals(2, hwkms.size()); - - HardwareKeyModule hwk1 = (HardwareKeyModule) hwkms.get(0); - assertEquals("HWK1_Id", hwk1.getId()); - assertEquals("HWK1_Name", hwk1.getName()); - assertEquals("HWK1_SlotId", hwk1.getSlotID()); - assertEquals("HWK1_UserPIN", hwk1.getUserPIN()); - - HardwareKeyModule hwk2 = (HardwareKeyModule) hwkms.get(1); - assertEquals("HWK2_Id", hwk2.getId()); - assertEquals("HWK2_Name", hwk2.getName()); - assertNull(hwk2.getSlotID()); - assertEquals("HWK2_UserPIN", hwk2.getUserPIN()); - } - - public void testGetSoftwareKeyModules() - { - List swkms = provider_.getSoftwareKeyModules(); - assertEquals(2, swkms.size()); - - SoftwareKeyModule swk1 = (SoftwareKeyModule) swkms.get(0); - assertEquals("SWK1_Id", swk1.getId()); - assertEquals(CONFIG_BASE_ + "swk/SWK1_FileName.txt", swk1.getFileName().replace('\\', '/')); - assertEquals("SWK1_Password", swk1.getPassWord()); - - SoftwareKeyModule swk2 = (SoftwareKeyModule) swkms.get(1); - assertEquals("SWK2_Id", swk2.getId()); - assertEquals(CONFIG_BASE_ + "swk/SWK2_FileName.txt", swk2.getFileName().replace('\\', '/')); - assertNull(swk2.getPassWord()); - } - - public void testGetKeyGroups() - { - Map keyGroups = provider_.getKeyGroups(); - assertEquals(2, keyGroups.size()); - - KeyGroup kg1 = (KeyGroup) keyGroups.get("KG1_Id"); - assertNotNull(kg1); - assertEquals("KG1_Id", kg1.getId()); - - Set kg1Entries = kg1.getKeyGroupEntries(); - assertEquals(2, kg1Entries.size()); - - Iterator kg1EntriesIt = kg1Entries.iterator(); - while(kg1EntriesIt.hasNext()) - { - KeyGroupEntry currentEntry = (KeyGroupEntry)kg1EntriesIt.next(); - if ("HWK1_Id".equals(currentEntry.getModuleID())) - { - assertEquals("CN=HWK1_Issuer", currentEntry.getIssuerDN()); - assertEquals(0, currentEntry.getSerialNumber().intValue()); - } - else if ("HWK2_Id".equals(currentEntry.getModuleID())) - { - assertEquals("CN=HWK2_Issuer", currentEntry.getIssuerDN()); - assertEquals(1, currentEntry.getSerialNumber().intValue()); - } - else fail("Invalid module identifer found."); - } - - KeyGroup kg2 = (KeyGroup) keyGroups.get("KG2_Id"); - assertNotNull(kg2); - assertEquals("KG2_Id", kg2.getId()); - - Set kg2Entries = kg2.getKeyGroupEntries(); - assertEquals(2, kg2Entries.size()); - - Iterator kg2EntriesIt = kg1Entries.iterator(); - while(kg1EntriesIt.hasNext()) - { - KeyGroupEntry currentEntry = (KeyGroupEntry)kg2EntriesIt.next(); - if ("SWK1_Id".equals(currentEntry.getModuleID())) - { - assertEquals("CN=CN=SWK1_Issuer", currentEntry.getIssuerDN()); - assertEquals(2, currentEntry.getSerialNumber().intValue()); - } - else if ("SWK2_Id".equals(currentEntry.getModuleID())) - { - assertEquals("CN=SWK2_Issuer", currentEntry.getIssuerDN()); - assertEquals(3, currentEntry.getSerialNumber().intValue()); - } - else fail("Invalid module identifer found."); - } - } - - public void testGetKeyGroupEntries() throws RFC2253NameParserException - { - RFC2253NameParser parser = new RFC2253NameParser("CN=Customer1_Issuer"); - Name name = parser.parse(); - Set kgEntries = provider_.getKeyGroupEntries(name, BigInteger.valueOf(4), "KG1_Id"); - assertEquals(2, kgEntries.size()); - - Iterator kgEntriesIt = kgEntries.iterator(); - while (kgEntriesIt.hasNext()) - { - KeyGroupEntry currentEntry = (KeyGroupEntry) kgEntriesIt.next(); - if (!"HWK1_Id".equals(currentEntry.getModuleID()) && !"HWK2_Id".equals(currentEntry.getModuleID())) - { - fail("Invalid module identifier found."); - } - } - } - - public void testGetChainingMode() throws RFC2253NameParserException - { - X509Certificate cert = new X509Certificate(); - RFC2253NameParser parser = new RFC2253NameParser("CN=Unknown"); - Name name = parser.parse(); - cert.setIssuerDN(name); - cert.setSerialNumber(BigInteger.valueOf(0)); - assertEquals(ChainingModes.PKIX_MODE, provider_.getChainingMode(cert)); // Default chaining mode - - parser = new RFC2253NameParser("CN=TA1_Issuer"); - name = parser.parse(); - cert.setIssuerDN(name); - cert.setSerialNumber(BigInteger.valueOf(5)); - assertEquals(ChainingModes.CHAIN_MODE, provider_.getChainingMode(cert)); - } - - public void testGetDistributionPoints() throws RFC2253NameParserException - { - X509Certificate cert = new X509Certificate(); - RFC2253NameParser parser = new RFC2253NameParser("CN=DP1_Issuer"); - Name name = parser.parse(); - cert.setIssuerDN(name); - - Set dps = provider_.getDistributionPoints(cert); - assertEquals(2, dps.size()); - - Iterator dpIt = dps.iterator(); - while (dpIt.hasNext()) - { - CRLDistributionPoint currentDP = (CRLDistributionPoint)dpIt.next(); - if ("http://crl.myca.org".equals(currentDP.getUri())) - { - int reasonCodes = - iaik.asn1.structures.DistributionPoint.unused | - iaik.asn1.structures.DistributionPoint.keyCompromise | - iaik.asn1.structures.DistributionPoint.cACompromise | - iaik.asn1.structures.DistributionPoint.affiliationChanged | - iaik.asn1.structures.DistributionPoint.superseded | - iaik.asn1.structures.DistributionPoint.cessationOfOperation | - iaik.asn1.structures.DistributionPoint.certificateHold | - iaik.asn1.structures.DistributionPoint.privilegeWithdrawn | - iaik.asn1.structures.DistributionPoint.aACompromise; - assertEquals(reasonCodes, currentDP.getReasonCodes()); - } - else if ("http://crl.myotherca.org".equals(currentDP.getUri())) - { - int reasonCodes = - iaik.asn1.structures.DistributionPoint.aACompromise | - iaik.asn1.structures.DistributionPoint.affiliationChanged; - assertEquals(reasonCodes, currentDP.getReasonCodes()); - } - else fail("Invalid CRL DP URI found: " + currentDP.getUri()); - } - - parser = new RFC2253NameParser("CN=DP2_Issuer"); - name = parser.parse(); - cert.setIssuerDN(name); - - dps = provider_.getDistributionPoints(cert); - assertEquals(1, dps.size()); - - OCSPDistributionPoint dpo = (OCSPDistributionPoint) dps.toArray()[0]; - assertEquals("http://crl.yetanotherca.org", dpo.getUri()); - } - - public void testGetCRLArchiveDuration() - { - assertEquals(730, provider_.getCRLArchiveDuration()); - } - - public void testGetEnableRevocationArchiving() - { - assertFalse(provider_.getEnableRevocationArchiving()); - } - - public void testGetCertStoreLocation() - { - assertEquals( - CONFIG_BASE_ + "certstore_test", - provider_.getCertStoreLocation().replace('\\', '/')); - } - - public void testGetCreateTransformsInfoProfile() - { - Element ctip1 = provider_.getCreateTransformsInfoProfile("CTIP_1"); - assertEquals("CreateTransformsInfoProfile", ctip1.getLocalName()); - - Element ctip2 = provider_.getCreateTransformsInfoProfile("CTIP_2"); - assertEquals("CreateTransformsInfoProfile", ctip2.getLocalName()); - } - - public void testGetCreateSignatureEnvironmentProfile() - { - Element csep = provider_.getCreateSignatureEnvironmentProfile("CSEP_1"); - assertEquals("CreateSignatureEnvironmentProfile", csep.getLocalName()); - } - - public void testGetVerifyTransformsInfoProfile() - { - Element vtip = provider_.getVerifyTransformsInfoProfile("VTIP_1"); - assertEquals("VerifyTransformsInfoProfile", vtip.getLocalName()); - } - - public void testGetSupplementProfile() - { - Element sp = provider_.getSupplementProfile("SP_1"); - assertEquals("SupplementProfile", sp.getLocalName()); - } - - public void testGetTrustProfile() - { - TrustProfile tp1 = provider_.getTrustProfile("TP1_Id"); - assertEquals( - "file:/" + CONFIG_BASE_ + "trustprofiles/tp1/anchors", - tp1.getUri()); - assertEquals( - "file:/" + CONFIG_BASE_ + "trustprofiles/tp1/signercerts", - tp1.getSignerCertsUri()); - - TrustProfile tp2 = provider_.getTrustProfile("TP2_Id"); - assertEquals( - "file:" + CONFIG_BASE_ + "trustprofiles/tp2/anchors", - tp2.getUri()); - assertEquals( - "file:" + CONFIG_BASE_ + "trustprofiles/tp2/signercerts", - tp2.getSignerCertsUri()); - } - - public void testGetRevocationArchiveJDBCURL() - { - assertEquals("jdbc://dummy", provider_.getRevocationArchiveJDBCURL()); - } - - public void testGetRevocationArchiveJDBCDriverClass() - { - assertEquals("fully.qualified.classname", provider_.getRevocationArchiveJDBCDriverClass()); - } - - public void testGetEnableRevocationChecking() - { - assertFalse(provider_.getEnableRevocationChecking()); - } - - public void testGetMaxRevocationAge() - { - assertEquals(10000, provider_.getMaxRevocationAge()); - } - - public void testGetServiceOrder() - { - String[] serviceOrder = provider_.getServiceOrder(); - assertEquals(2, serviceOrder.length); - assertEquals("crl", serviceOrder[0]); - assertEquals("ocsp", serviceOrder[1]); - } - - public void testGetAutoAddCertificates() - { - assertFalse(provider_.getAutoAddCertificates()); - } - - public void testGetUseAuthorityInfoAccess() - { - assertFalse(provider_.getUseAuthorityInfoAccess()); - } -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java deleted file mode 100644 index adf02809b..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java +++ /dev/null @@ -1,225 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.config; - -import iaik.asn1.structures.Name; -import iaik.pki.pathvalidation.ChainingModes; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; -import iaik.x509.X509Certificate; - -import java.math.BigInteger; -import java.util.List; -import java.util.Set; - -import junit.framework.TestCase; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.spss.server.config.TrustProfile; -import at.gv.egovernment.moa.util.Constants; - -/** - * @author Gregor Karlinger - * @version $Id$ - */ -public class ConfigurationProviderTest2 extends TestCase -{ - private static final String CONFIG_BASE_ = - "e:/cio/projekte/basismodule/wartung/projekt/spss.server/res/test/resources/config/"; - - static at.gv.egovernment.moa.spss.server.config.ConfigurationProvider provider_; - - static - { - System.setProperty( - "log4j.configuration", - "file:/" + CONFIG_BASE_ + "log4j.properties"); - System.setProperty( - at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.CONFIG_PROPERTY_NAME, - CONFIG_BASE_ + "moa.ss.noopts-config.xml"); - try - { - ConfigurationProvider.reload(); - provider_ = at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.getInstance(); - } - catch (ConfigurationException e) - { - throw new RuntimeException("Fehler beim Setup des Tests: " + e.getMessage()); - } - } - - - /** - * Constructor for ConfigurationProvider. - * @param arg0 - */ - public ConfigurationProviderTest2() throws MOAException - { - super("ConfigurationProvider"); - } - - public void testGetWarnings() - { - // 3 Warnings should be collected: C14N not found, DigestMethod not found, ArchiveDuration not found - assertEquals(3, provider_.getWarnings().size()); - } - - public void testGetDigestMethodAlgorithmName() - { - // Element is missing in config file, check if default value is returned - assertEquals( - Constants.SHA1_URI, - provider_.getDigestMethodAlgorithmName()); - } - - public void testGetCanonicalizationAlgorithmName() - { - // Element is missing in config file, check if default value is returned - assertEquals( - Constants.C14N_URI, - provider_.getCanonicalizationAlgorithmName()); - } - - public void testGetHardwareCryptoModules() - { - // No hardware crypto modules in config file, check for empty list - List hwcms = provider_.getHardwareCryptoModules(); - assertEquals(0, hwcms.size()); - } - - public void testGetHardwareKeyModules() - { - List hwkms = provider_.getHardwareKeyModules(); - assertEquals(1, hwkms.size()); - } - - public void testGetSoftwareKeyModules() - { - // No software key modules in config file, check for empty list - List swkms = provider_.getSoftwareKeyModules(); - assertEquals(0, swkms.size()); - } - - public void testGetChainingMode() throws RFC2253NameParserException - { - // Default Chaining Mode not set in configuration, check for default value - X509Certificate cert = new X509Certificate(); - RFC2253NameParser parser = new RFC2253NameParser("CN=Unknown"); - Name name = parser.parse(); - cert.setIssuerDN(name); - cert.setSerialNumber(BigInteger.valueOf(0)); - assertEquals(ChainingModes.PKIX_MODE, provider_.getChainingMode(cert)); - } - - public void testGetDistributionPoints() throws RFC2253NameParserException - { - // Element is missing in config file, check if emty list is returned - X509Certificate cert = new X509Certificate(); - RFC2253NameParser parser = new RFC2253NameParser("CN=DP1_Issuer"); - Name name = parser.parse(); - cert.setIssuerDN(name); - - Set dps = provider_.getDistributionPoints(cert); - assertEquals(0, dps.size()); - } - - public void testGetCRLArchiveDuration() - { - // Element is missing in config file, check if default value is returned - assertEquals(0, provider_.getCRLArchiveDuration()); - } - - public void testGetEnableRevocationArchiving() - { - // Element is missing in config file, check if default value is returned - assertFalse(provider_.getEnableRevocationArchiving()); - } - - public void testGetCertStoreLocation() - { - // Element is missing in config file, check if default value is returned - assertEquals( - CONFIG_BASE_ + "certstore", - provider_.getCertStoreLocation().replace('\\', '/')); - } - - public void testGetCreateTransformsInfoProfile() - { - // No profile in config file, check for null - Element ctip1 = provider_.getCreateTransformsInfoProfile("CTIP_1"); - assertNull(ctip1); - } - - public void testGetCreateSignatureEnvironmentProfile() - { - // No profile in config file, check for null - Element csep = provider_.getCreateSignatureEnvironmentProfile("CSEP_1"); - assertNull(csep); - } - - public void testGetVerifyTransformsInfoProfile() - { - // No profile in config file, check for null - Element vtip = provider_.getVerifyTransformsInfoProfile("VTIP_1"); - assertNull(vtip); - } - - public void testGetSupplementProfile() - { - // No profile in config file, check for null - Element sp = provider_.getSupplementProfile("SP_1"); - assertNull(sp); - } - - public void testGetTrustProfile() - { - // No trust profiles config file, check for null - TrustProfile tp1 = provider_.getTrustProfile("TP1_Id"); - assertNull(tp1); - } - - public void testGetRevocationArchiveJDBCURL() - { - // Element is missing in config file, check for null - assertNull(provider_.getRevocationArchiveJDBCURL()); - } - - public void testGetRevocationArchiveJDBCDriverClass() - { - // Element is missing in config file, check for null - assertNull(provider_.getRevocationArchiveJDBCDriverClass()); - } - - public void testGetEnableRevocationChecking() - { - // Element is missing in config file, check for default value - assertFalse(provider_.getEnableRevocationChecking()); - } - - public void testGetMaxRevocationAge() - { - // Element is missing in config file, check for default value - assertEquals(0, provider_.getMaxRevocationAge()); - } - - public void testGetServiceOrder() - { - // Element is missing in config file, check for empty array - String[] serviceOrder = provider_.getServiceOrder(); - assertEquals(0, serviceOrder.length); - } - - public void testGetAutoAddCertificates() - { - // Element is missing in config file, check for default value - assertFalse(provider_.getAutoAddCertificates()); - } - - public void testGetUseAuthorityInfoAccess() - { - // Element is missing in config file, check for default value - assertFalse(provider_.getUseAuthorityInfoAccess()); - } -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java deleted file mode 100644 index 7da2165cb..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java +++ /dev/null @@ -1,166 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.config; - -import iaik.asn1.structures.Name; -import iaik.utils.RFC2253NameParser; -import iaik.utils.RFC2253NameParserException; -import iaik.x509.X509Certificate; - -import java.util.List; -import java.util.Set; - -import junit.framework.TestCase; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationException; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; -import at.gv.egovernment.moa.util.Constants; - -/** - * @author Gregor Karlinger - * @version $Id$ - */ -public class ConfigurationProviderTest3 extends TestCase -{ - private static final String CONFIG_BASE_ = - "e:/cio/projekte/basismodule/wartung/projekt/spss.server/res/test/resources/config/"; - - static at.gv.egovernment.moa.spss.server.config.ConfigurationProvider provider_; - - static - { - System.setProperty( - "log4j.configuration", - "file:/" + CONFIG_BASE_ + "log4j.properties"); - System.setProperty( - at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.CONFIG_PROPERTY_NAME, - CONFIG_BASE_ + "moa.sp.noopts-config.xml"); - try - { - ConfigurationProvider.reload(); - provider_ = at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.getInstance(); - } - catch (ConfigurationException e) - { - throw new RuntimeException("Fehler beim Setup des Tests: " + e.getMessage()); - } - } - - /** - * Constructor for ConfigurationProvider. - * @param arg0 - */ - public ConfigurationProviderTest3() throws MOAException - { - super("ConfigurationProvider"); - } - - public void testGetWarnings() - { - // 3 Warnings should be collected: C14N not found, DigestMethod not found, ArchiveDuration not found - assertEquals(3, provider_.getWarnings().size()); - } - - public void testGetDigestMethodAlgorithmName() - { - // Element is missing in config file, check if default value is returned - assertEquals( - Constants.SHA1_URI, - provider_.getDigestMethodAlgorithmName()); - } - - public void testGetCanonicalizationAlgorithmName() - { - // Element is missing in config file, check if default value is returned - assertEquals( - Constants.C14N_URI, - provider_.getCanonicalizationAlgorithmName()); - } - - public void testGetHardwareCryptoModules() - { - // No hardware crypto modules in config file, check for empty list - List hwcms = provider_.getHardwareCryptoModules(); - assertEquals(0, hwcms.size()); - } - - public void testGetHardwareKeyModules() - { - // No hardware key modules in config file, check for empty list - List hwkms = provider_.getHardwareKeyModules(); - assertEquals(0, hwkms.size()); - } - - public void testGetSoftwareKeyModules() - { - // No software key modules in config file, check for empty list - List swkms = provider_.getSoftwareKeyModules(); - assertEquals(0, swkms.size()); - } - - public void testGetDistributionPoints() throws RFC2253NameParserException - { - // No distribution points in config file, check for emtpy set - X509Certificate cert = new X509Certificate(); - RFC2253NameParser parser = new RFC2253NameParser("CN=DP1_Issuer"); - Name name = parser.parse(); - cert.setIssuerDN(name); - - Set dps = provider_.getDistributionPoints(cert); - assertEquals(0, dps.size()); - } - - public void testGetCRLArchiveDuration() - { - // No archive duration in config file, check for default value - assertEquals(0, provider_.getCRLArchiveDuration()); - } - - public void testGetCreateTransformsInfoProfile() - { - // No profile in config file, check for null - Element ctip1 = provider_.getCreateTransformsInfoProfile("CTIP_1"); - assertNull(ctip1); - } - - public void testGetCreateSignatureEnvironmentProfile() - { - // No profile in config file, check for null - Element csep = provider_.getCreateSignatureEnvironmentProfile("CSEP_1"); - assertNull(csep); - } - - public void testGetVerifyTransformsInfoProfile() - { - // No profile in config file, check for null - Element vtip = provider_.getVerifyTransformsInfoProfile("VTIP_1"); - assertNull(vtip); - } - - public void testGetSupplementProfile() - { - // No profile in config file, check for null - Element sp = provider_.getSupplementProfile("SP_1"); - assertNull(sp); - } - - public void testGetRevocationArchiveJDBCURL() - { - // No archive in config file, check for null - assertNull(provider_.getRevocationArchiveJDBCURL()); - } - - public void testGetRevocationArchiveJDBCDriverClass() - { - // No archive in config file, check for null - assertNull(provider_.getRevocationArchiveJDBCDriverClass()); - } - - public void testGetServiceOrder() - { - // Element is missing in config file, check for empty array - String[] serviceOrder = provider_.getServiceOrder(); - assertEquals(0, serviceOrder.length); - } -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java deleted file mode 100644 index be1090e4a..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java +++ /dev/null @@ -1,149 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.iaik.config; - -import java.io.FileInputStream; -import java.security.KeyStore; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import iaik.asn1.structures.DistributionPoint; -import iaik.pki.PKIConfiguration; -import iaik.pki.pathvalidation.ChainingModes; -import iaik.pki.pathvalidation.ValidationConfiguration; -import iaik.pki.revocation.CRLDistributionPoint; -import iaik.pki.revocation.RevocationConfiguration; -import iaik.pki.store.certstore.CertStoreConfiguration; -import iaik.pki.store.certstore.CertStoreTypes; -import iaik.pki.store.revocation.archive.ArchiveConfiguration; -import iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter; -import iaik.server.ConfigurationData; -import iaik.server.modules.keys.HardwareKeyModuleConfiguration; -import iaik.server.modules.keys.SoftwareKeyModuleConfiguration; - -import at.gv.egovernment.moa.spss.server.iaik.config.ConfigurationDataImpl; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * Tests the ConfigurationDataImpl. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ConfigurationDataImplTest extends SPSSTestCase { - - private ConfigurationData config; - private X509Certificate iaikCert; - - public ConfigurationDataImplTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - TransactionContext context; - - setUpTransactionContext(); - context = TransactionContextManager.getInstance().getTransactionContext(); - - config = new ConfigurationDataImpl(context.getConfiguration()); - - KeyStore ks = KeyStore.getInstance("JKS", "SUN"); - ks.load( - new FileInputStream(TESTDATA_ROOT + "security/server.keystore"), - "changeit".toCharArray()); - - CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); - Collection certs = - certFactory.generateCertificates( - new FileInputStream( - TESTDATA_ROOT - + "conf/moa-spss/trustprofiles/TrustProfile1/IAIKRoot.cer")); - iaikCert = (X509Certificate) certs.toArray()[0]; - - } - - public void testGetPKIConfiguration() { - PKIConfiguration pkiConfig = config.getPKIConfiguration(); - ArchiveConfiguration archiveConfig = pkiConfig.getArchiveConfiguration(); - CertStoreConfiguration certStoreConfig = - pkiConfig.getCertStoreConfiguration(); - RevocationConfiguration revocationConfig = - pkiConfig.getRevocationConfiguration(); - ValidationConfiguration validationConfig = - pkiConfig.getValidationConfiguration(); - DataBaseArchiveParameter archiveParam; - Set distributionPoints; - Iterator iter; - boolean found; - - // test archive parameters - archiveParam = - (DataBaseArchiveParameter) archiveConfig.getArchiveParameters(); - assertEquals( - archiveParam.getJDBCUrl(), - "jdbc:postgresql://10.16.46.108/moa?user=moa&password=moatest"); - - // test cert store configuration - assertEquals(1, certStoreConfig.getParameters().length); - assertEquals( - CertStoreTypes.DIRECTORY, - certStoreConfig.getParameters()[0].getType()); - - // test revocation configuration - distributionPoints = - revocationConfig.getAlternativeDistributionPoints(iaikCert, null, new Date()); - assertEquals(3, distributionPoints.size()); - found = false; - for (iter = distributionPoints.iterator(); iter.hasNext();) { - CRLDistributionPoint dp = (CRLDistributionPoint) iter.next(); - if (dp.getUri().equals("http://www.iaik.at/testCA/iaik_test_sig.crl")) { - found = - dp.getReasonCodes() - == (DistributionPoint.keyCompromise - | DistributionPoint.affiliationChanged); - } - } - assertTrue(found); - - // test validation configuration - assertEquals( - ChainingModes.PKIX_MODE, - validationConfig.getChainingMode(iaikCert)); - } - - /* - public void testGetCryptoModuleConfigurations() { - List cryptoConfigs = config.getCryptoModuleConfigurations(); - HardwareCryptoModuleConfiguration moduleConfig; - - assertEquals(2, cryptoConfigs.size()); - moduleConfig = (HardwareCryptoModuleConfiguration) cryptoConfigs.get(0); - assertEquals("Module1", moduleConfig.getModuleName()); - assertEquals("Slot1", moduleConfig.getSlotID()); - assertEquals("PIN1", new String(moduleConfig.getUserPIN())); - } - */ - - public void testGetKeyModuleConfigurations() { - List keyConfigs = config.getKeyModuleConfigurations(); - HardwareKeyModuleConfiguration hwKey; - SoftwareKeyModuleConfiguration swKey; - - assertEquals(7, keyConfigs.size()); - hwKey = (HardwareKeyModuleConfiguration) keyConfigs.get(0); - assertEquals("cryptoki.dll", hwKey.getModuleName()); - assertEquals("0", hwKey.getSlotID()); - assertEquals("0000", new String(hwKey.getUserPIN())); - swKey = (SoftwareKeyModuleConfiguration) keyConfigs.get(1); - assertEquals( - "buergerkarte", - new String(swKey.getKeyStoreAuthenticationData())); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java deleted file mode 100644 index 3b403dc19..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.iaik.config; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; -import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; - -/** - * Tests the IaikConfigurator. - * - * @author Patrick Peck - * @version $Id$ - */ -public class IaikConfiguratorTest extends SPSSTestCase { - - public IaikConfiguratorTest(String name) { - super(name); - } - - /** - * @see TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUpTransactionContext(); - } - - public void testConfigure() throws Exception { - IaikConfigurator configurator = new IaikConfigurator(); - TransactionContext context = - TransactionContextManager.getInstance().getTransactionContext(); - - configurator.configure(context.getConfiguration()); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java deleted file mode 100644 index 65fa2bf72..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java +++ /dev/null @@ -1,25 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.invoke; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * Runs all tests in this package. - * - * @author Patrick Peck - * @version $Id$ - */ -public class AllTests { - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTestSuite(DataObjectFactoryTest.class); - suite.addTestSuite(TransformationFactoryTest.class); - suite.addTestSuite(XMLSignatureCreationInvokerTest.class); - suite.addTestSuite(CMSSignatureVerificationInvokerTest.class); - suite.addTestSuite(XMLSignatureVerificationInvokerTest.class); - - return suite; - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java deleted file mode 100644 index 3024730f4..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.invoke; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.util.DOMUtils; - -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; -import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.server.invoke.CMSSignatureVerificationInvoker; - -/** - * Mainly a smoke test for debugging the CMSSignatureVerificationInvoker. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CMSSignatureVerificationInvokerTest extends SPSSTestCase { - private static final String TESTDATA_BASE = - TESTDATA_ROOT + "xml/VerifyCMSSignature/"; - - /** - * Constructor for CMSSignatureVerificationInvokerTest. - * @param name - */ - public CMSSignatureVerificationInvokerTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - setUpTransactionContext(); - setUpLoggingContext(); - setUpIaikConfiguration(); - } - - public void testVerifyCMSSignature() throws Exception { - try { - CMSSignatureVerificationInvoker invoker = - CMSSignatureVerificationInvoker.getInstance(); - VerifyCMSSignatureRequestParser requestParser = - new VerifyCMSSignatureRequestParser(); - Document doc = - SPSSTestCase.parseXmlValidating( - TESTDATA_BASE + "TestGeneratorVC0.001.Req.xml"); - VerifyCMSSignatureRequest request = - requestParser.parse(doc.getDocumentElement()); - VerifyCMSSignatureResponse response = invoker.verifyCMSSignature(request); - VerifyCMSSignatureResponseBuilder responseBuilder = - new VerifyCMSSignatureResponseBuilder(); - Element result = responseBuilder.build(response).getDocumentElement(); - - System.out.println(DOMUtils.serializeNode(result)); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java deleted file mode 100644 index 7de2add33..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java +++ /dev/null @@ -1,180 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.invoke; - -import java.io.InputStream; -import java.security.Security; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import iaik.server.modules.xml.BinaryDataObject; -import iaik.server.modules.xml.DataObject; -import iaik.server.modules.xml.XMLDataObject; - -import at.gv.egovernment.moa.util.Base64Utils; - -import at.gv.egovernment.moa.spss.MOAException; -import at.gv.egovernment.moa.spss.api.SPSSFactory; -import at.gv.egovernment.moa.spss.api.common.Content; -import at.gv.egovernment.moa.spss.server.iaik.xml.ByteArrayDataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.ByteStreamDataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl; -import at.gv.egovernment.moa.spss.server.iaik.xml.XMLNodeListDataObjectImpl; -import at.gv.egovernment.moa.spss.server.invoke.DataObjectFactory; - -/** - * Test cases for the DataObjectFactory class. - * - * @author Patrick Peck - * @version $Id$ - */ -public class DataObjectFactoryTest extends SPSSTestCase { - - private static final String HTTP_BINARY_CONTENT_URL = "http://www.google.com"; - private static final String HTTP_XML_CONTENT_URL = - "http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"; - private static final String HTTPS_BINARY_CONTENT_URL = - "https://businessnet.ba-ca.com"; - private static final String HTTPS_UNTRUSTED_URL = - "https://heribert.anecon.com"; - private static final String HTTP_UNKNOWN_HOST_URL = "http://uurjmjmruuw.com"; - private static final String MALFORMED_URL = "//hsld///ddd"; - private static final String FILE_BINARY_CONTENT_URL = "file:/C:/boot.ini"; - private static final String XML_CONTENT = - "" - + " " - + " " - + ""; - private static final String BASE64_CONTENT = "U3Zlbg=="; - - private SPSSFactory spssFactory = SPSSFactory.getInstance(); - private DataObjectFactory factory; - - /** - * Constructor for DataObjectFactoryTest. - * @param name - */ - public DataObjectFactoryTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - factory = DataObjectFactory.getInstance(); - - // set up SSL - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); - System.setProperty( - "java.protocol.handler.pkgs", - "com.sun.net.ssl.internal.www.protocol"); - /* - System.setProperty( - "javax.net.ssl.keyStore", - "data/test/security/client.keystore"); - System.setProperty("javax.net.ssl.keyStorePassword", "changeit"); - System.setProperty( - "javax.net.ssl.trustStore", - "data/test/security/client.keystore"); - System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); - */ - } - - public void testCreateFromURIWithBinaryHttp() throws Exception { - DataObject dataObject = - factory.createFromURI(HTTP_BINARY_CONTENT_URL, false); - - assertNotNull(dataObject); - assertTrue(dataObject instanceof ByteStreamDataObjectImpl); - assertNotNull(((BinaryDataObject) dataObject).getInputStream()); - } - - public void testCreateFromURIWithXmlHttp() throws Exception { - DataObject dataObject = factory.createFromURI(HTTP_XML_CONTENT_URL, false); - Element element; - - assertNotNull(dataObject); - assertTrue(dataObject instanceof XMLDataObjectImpl); - element = ((XMLDataObject) dataObject).getElement(); - assertNotNull(element); - assertEquals("schema", element.getTagName()); - } - - public void testCreateFromURIWithMalformedURI() throws Exception { - try { - factory.createFromURI(MALFORMED_URL, false); - fail(); - } catch (MOAException e) { - } - } - - public void testCreateFromURIWithNonExistingHttpURL() throws Exception { - try { - factory.createFromURI(HTTP_UNKNOWN_HOST_URL, false); - fail(); - } catch (MOAException e) { - } - } - - public void testCreateFromURIWithHttps() throws Exception { - DataObject dataObject = - factory.createFromURI(HTTPS_BINARY_CONTENT_URL, false); - assertNotNull(dataObject); - assertTrue(dataObject instanceof BinaryDataObject); - } - - public void testCreateFromURIWithUntrustedHttps() throws Exception { - try { - factory.createFromURI(HTTPS_UNTRUSTED_URL, false); - fail(); - } catch (MOAException e) { - - } - } - - public void testCreateFromURIWithFile() throws Exception { - try { - factory.createFromURI(FILE_BINARY_CONTENT_URL, false); - fail(); - } catch (MOAException e) { - } - } - - public void testCreateFromContentOptionalRefTypeWithXmlContent() - throws Exception { - Document doc = parseXmlString(XML_CONTENT); - Content content = - spssFactory.createContent( - doc.getDocumentElement().getChildNodes(), - "http://data"); - DataObject dataObject = - factory.createFromContentOptionalRefType( - content, - null, - null, - true, - false, - true, - false); - - assertTrue(dataObject instanceof XMLNodeListDataObjectImpl); - } - - public void testCreateFromContentOptionalRefTypeWithBase64Content() - throws Exception { - InputStream is = Base64Utils.decodeToStream(BASE64_CONTENT, true); - Content content = spssFactory.createContent(is, "http://data"); - DataObject dataObject = - factory.createFromContentOptionalRefType( - content, - null, - null, - false, - false, - true, - false); - - assertNotNull(dataObject); - assertTrue(dataObject instanceof ByteArrayDataObjectImpl); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java deleted file mode 100644 index 13a80cbf1..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.invoke; - -import java.util.List; -import java.util.Map; - -import org.w3c.dom.Document; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import iaik.ixsil.init.IXSILInit; -import iaik.ixsil.util.URI; -import iaik.server.modules.xml.Base64Transformation; -import iaik.server.modules.xml.Canonicalization; -import iaik.server.modules.xml.EnvelopedSignatureTransformation; -import iaik.server.modules.xml.Transformation; -import iaik.server.modules.xml.XPath2Transformation; -import iaik.server.modules.xml.XPathTransformation; -import iaik.server.modules.xml.XSLTTransformation; - -import at.gv.egovernment.moa.util.Constants; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.common.Transform; -import at.gv.egovernment.moa.spss.api.xmlbind.TransformParser; -import at.gv.egovernment.moa.spss.server.invoke.TransformationFactory; - -/** - * Test cases for the TransformationFactory class. - * - * @author Patrick Peck - * @version $Id$ - */ -public class TransformationFactoryTest extends SPSSTestCase { - - private static final String TESTDATA_BASE = - TESTDATA_ROOT + "xml/dsigTransform/"; - private TransformationFactory factory = TransformationFactory.getInstance(); - private TransformParser transformParser = new TransformParser(); - - /** - * Constructor for TransformationFactoryTest. - * @param name - */ - public TransformationFactoryTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - IXSILInit.init(new URI("init/properties/init.properties")); - //IXSILInit.init(new URI("file:data/deploy/ixsil/init/properties/init.properties")); - - } - - public void testCreateCanonicalization() throws Exception { - Document transform = parseXml(TESTDATA_BASE + "canonicalization.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - Transformation t = factory.createTransformation(tr); - - assertTrue(t instanceof Canonicalization); - assertEquals( - "http://www.w3.org/TR/2001/REC-xml-c14n-20010315", - t.getAlgorithmURI()); - } - - public void testCreateCanonicalizationWithComments() throws Exception { - Document transform = - parseXml(TESTDATA_BASE + "canonicalizationWithComments.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - Transformation t = factory.createTransformation(tr); - - assertTrue(t instanceof Canonicalization); - assertEquals( - "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments", - t.getAlgorithmURI()); - } - - public void testCreateBase64Decode() throws Exception { - Document transform = parseXml(TESTDATA_BASE + "base64.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - Transformation t = factory.createTransformation(tr); - assertTrue(t instanceof Base64Transformation); - } - - public void testCreateEnvelopedSignature() throws Exception { - Document transform = parseXml(TESTDATA_BASE + "enveloped.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - Transformation t = factory.createTransformation(tr); - assertTrue(t instanceof EnvelopedSignatureTransformation); - } - - public void testXPathTransformation() throws Exception { - Document transform = parseXml(TESTDATA_BASE + "xpath.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - Transformation t = factory.createTransformation(tr); - Map nsDecls; - - assertTrue(t instanceof XPathTransformation); - nsDecls = ((XPathTransformation) t).getNamespaceDeclarations(); - assertEquals(1, nsDecls.size()); - assertEquals(Constants.DSIG_NS_URI, nsDecls.get("dsig")); - } - - public void testCreateXPath2Transformation() throws Exception { - Document transform = parseXml(TESTDATA_BASE + "xpath2.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - Transformation t = factory.createTransformation(tr); - assertTrue(t instanceof XPath2Transformation); - } - - public void testCreateXSLTTransformation() throws Exception { - Document transform = parseXml(TESTDATA_BASE + "xslt.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - XSLTTransformation t = - (XSLTTransformation) factory.createTransformation(tr); - assertNotNull(t.getStylesheetElement()); - } - - public void testCreateWithIllegalAlgorithm() throws Exception { - try { - Document transform = parseXml(TESTDATA_BASE + "illegalAlgorithm.xml"); - Transform tr = - transformParser.parseTransform(transform.getDocumentElement()); - factory.createTransformation(tr); - fail(); - } catch (MOAApplicationException e) { - } - } - - public void testEqualsXslt() throws Exception { - Document xslt = parseXml(TESTDATA_BASE + "xslt.xml"); - Transform tr = transformParser.parseTransform(xslt.getDocumentElement()); - Transformation trXslt = factory.createTransformation(tr); - - Document xsltEqu = parseXml(TESTDATA_BASE + "xsltEqual.xml"); - tr = transformParser.parseTransform(xsltEqu.getDocumentElement()); - Transformation trXsltEqu = factory.createTransformation(tr); - - Document xsltDiff = parseXml(TESTDATA_BASE + "xsltDifferent.xml"); - tr = transformParser.parseTransform(xsltDiff.getDocumentElement()); - Transformation trXsltDiff = factory.createTransformation(tr); - - Document canonicalization = - parseXml(TESTDATA_BASE + "canonicalization.xml"); - - assertTrue(trXslt.equals(trXsltEqu)); - assertFalse(trXslt.equals(trXsltDiff)); - assertFalse(trXsltEqu.equals(trXsltDiff)); - assertEquals(trXslt.hashCode(), trXsltEqu.hashCode()); - assertFalse(trXslt.hashCode() == trXsltDiff.hashCode()); - assertFalse(trXsltEqu.hashCode() == trXsltDiff.hashCode()); - assertFalse(trXslt.equals(canonicalization)); - } - - public void testEqualsXPath() throws Exception { - Document xpath = parseXml(TESTDATA_BASE + "xpath.xml"); - Transform tr = transformParser.parseTransform(xpath.getDocumentElement()); - Transformation trXpath = factory.createTransformation(tr); - Transformation trXpathEqu = factory.createTransformation(tr); - - Document xpathDiff = parseXml(TESTDATA_BASE + "xpathDifferent.xml"); - tr = transformParser.parseTransform(xpathDiff.getDocumentElement()); - Transformation trXpathDiff = factory.createTransformation(tr); - - assertTrue(trXpath.equals(trXpathEqu)); - assertEquals(trXpath.hashCode(), trXpathEqu.hashCode()); - assertFalse(trXpath.equals(trXpathDiff)); - assertFalse(trXpath.hashCode() == trXpathDiff.hashCode()); - } - - public void testEqualsXPath2() throws Exception { - Document xpath2 = parseXml(TESTDATA_BASE + "xpath2.xml"); - Transform tr = transformParser.parseTransform(xpath2.getDocumentElement()); - Transformation trXpath2 = factory.createTransformation(tr); - Transformation trXpath2Equ = factory.createTransformation(tr); - - Document xpath2Diff = parseXml(TESTDATA_BASE + "xpath2Different.xml"); - tr = transformParser.parseTransform(xpath2Diff.getDocumentElement()); - Transformation trXpath2Diff = factory.createTransformation(tr); - - assertTrue(trXpath2.equals(trXpath2Equ)); - assertEquals(trXpath2.hashCode(), trXpath2Equ.hashCode()); - assertFalse(trXpath2.equals(trXpath2Diff)); - assertFalse(trXpath2.hashCode() == trXpath2Diff.hashCode()); - } - - public void testCreateTransformationList() throws Exception { - Document transforms = parseXml(TESTDATA_BASE + "transforms.xml"); - List trs = transformParser.parseTransforms(transforms.getDocumentElement()); - List transformationList = factory.createTransformationList(trs); - - assertEquals(3, transformationList.size()); - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java deleted file mode 100644 index 28cd3805a..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.invoke; - -import java.util.Collections; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.util.DOMUtils; - -import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; -import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureCreationInvoker; - -/** - * Mainly a smoke test for debugging the XMLSignatureCreationInvoker. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureCreationInvokerTest extends SPSSTestCase { - private static final String TESTDATA_BASE = - TESTDATA_ROOT + "xml/CreateXMLSignature/"; - - public XMLSignatureCreationInvokerTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - setUpTransactionContext(); - setUpLoggingContext(); - setUpIaikConfiguration(); - setUpSSL(); - } - - public void testCreateXMLSignature() throws Exception { - try { - XMLSignatureCreationInvoker invoker = - XMLSignatureCreationInvoker.getInstance(); - CreateXMLSignatureRequestParser requestParser = - new CreateXMLSignatureRequestParser(); - Document doc = - SPSSTestCase.parseXmlValidating( - TESTDATA_BASE + "TestGeneratorCX2.004.Req.xml"); - CreateXMLSignatureRequest request = - requestParser.parse(doc.getDocumentElement()); - CreateXMLSignatureResponse response = - invoker.createXMLSignature(request, Collections.EMPTY_SET); - CreateXMLSignatureResponseBuilder responseBuilder = - new CreateXMLSignatureResponseBuilder(); - Element result = responseBuilder.build(response).getDocumentElement(); - - System.out.println(DOMUtils.serializeNode(result)); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java deleted file mode 100644 index 56e3d541b..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.invoke; - -import org.w3c.dom.Document; - -import test.at.gv.egovernment.moa.spss.SPSSTestCase; - -import at.gv.egovernment.moa.util.DOMUtils; - -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; -import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; -import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureVerificationInvoker; - -/** - * Mainly a smoke test for debugging the XMLSignatureVerificationInvoker. - * - * @author Patrick Peck - * @version $Id$ - */ -public class XMLSignatureVerificationInvokerTest extends SPSSTestCase { - private static final String TESTDATA_BASE = - TESTDATA_ROOT + "xml/VerifyXMLSignature/"; - - public XMLSignatureVerificationInvokerTest(String name) { - super(name); - } - - protected void setUp() throws Exception { - setUpTransactionContext(); - setUpLoggingContext(); - setUpIaikConfiguration(); - } - - public void testVerifyXMLSignature() throws Exception { - try { - XMLSignatureVerificationInvoker invoker = - XMLSignatureVerificationInvoker.getInstance(); - VerifyXMLSignatureRequestParser requestParser = - new VerifyXMLSignatureRequestParser(); - VerifyXMLSignatureResponseBuilder responseBuilder = - new VerifyXMLSignatureResponseBuilder(); - Document doc = - SPSSTestCase.parseXmlValidating( - TESTDATA_BASE + "TestGeneratorVX.201.Req.xml"); - - VerifyXMLSignatureRequest request = - requestParser.parse(doc.getDocumentElement()); - VerifyXMLSignatureResponse response; - - response = invoker.verifyXMLSignature(request); - System.out.println( - DOMUtils.serializeNode(responseBuilder.build(response))); - } catch (Exception e) { - e.printStackTrace(); - fail(); - } - } - - -} diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java deleted file mode 100644 index b46c20086..000000000 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package test.at.gv.egovernment.moa.spss.server.tools; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -import at.gv.egovernment.moa.spss.server.tools.CertTool; - -import test.at.gv.egovernment.moa.MOATestCase; - -/** - * Tests for the CertTool. - * - * @author Patrick Peck - * @version $Id$ - */ -public class CertToolTest extends MOATestCase { - - private static final String EXPECTED_RESULT = - "SubjectDN (RFC2253):" - + " CN=Patrick Peck,OU=MOA Team,O=BRZ,L=Vienna,ST=Vienna,C=AT\r\n" - + "IssuerDN (RFC2253) :" - + " CN=Patrick Peck,OU=MOA Team,O=BRZ,L=Vienna,ST=Vienna,C=AT\r\n" - + "Serial Number :" - + " 1047548672\r\n"; - private CertTool certTool; - - /** - * Constructor for CertToolTest. - * @param name - */ - public CertToolTest(String name) { - super(name); - } - - protected void setUp() { - certTool = new CertTool(); - } - - public void testPrintCertInfo() { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(bos); - String result; - - certTool.printCertInfo(TESTDATA_ROOT + "security/server.cer", ps); - result = new String(bos.toByteArray()); - System.out.println(result); - assertEquals(EXPECTED_RESULT, result); - } - -} diff --git a/spss.server/web.xml b/spss.server/web.xml deleted file mode 100644 index b68ee850e..000000000 --- a/spss.server/web.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - MOA SP-SS - MOA Signature Creation and Verification Services - - ConfigurationServlet - MOA Configuration Servlet - - at.gv.egovernment.moa.spss.server.service.ConfigurationServlet - - 0 - - - AxisServlet - Apache-Axis Servlet - - org.apache.axis.transport.http.AxisServlet - - - - AxisServlet - /services/* - - - ConfigurationServlet - /ConfigurationUpdate - - - - - ConfigurationUpdate - /ConfigurationUpdate - - - moa-admin - - - - - BASIC - UserDatabase - - - - - The role that is required to log in to the moa Application - - moa-admin - - diff --git a/spss/handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 b/spss/handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 new file mode 100644 index 000000000..592c96230 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/01540E2704537AA810D671E1C4106FD8821EB52A/C2556DADDF68A9EEF7F5C14A24CA33BCA930B201 differ diff --git a/spss/handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 b/spss/handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 new file mode 100644 index 000000000..a7948e488 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/032F2123890A879585CE96674CA4C37B55986729/E1201A308CC10323C27D9084B048996E44B8F710 differ diff --git a/spss/handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 b/spss/handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 new file mode 100644 index 000000000..73434134e Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/04462EF01783744F9F4CDE3705FD86D488697C9F/D44EED7580C7792242D73E267A89C7DB25E4BD08 differ diff --git a/spss/handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 b/spss/handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 new file mode 100644 index 000000000..8c434777e Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/083E1A0528C48475951A6610360D813E2713DCC7/7E691392F741B7E4B4AA9A76D75851BDE18BE5A7 differ diff --git a/spss/handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 b/spss/handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 new file mode 100644 index 000000000..3af27c013 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/0889EBEC55D9E34E782E6D3C250840EB932EEA2F/9CD9ADF04626E7E8C9A1C8DACE3B0B8A2979C726 differ diff --git a/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 b/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 new file mode 100644 index 000000000..29d93550e Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/0F843FB1E0C626540BE638B79A2987E2611CE630 differ diff --git a/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F b/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F new file mode 100644 index 000000000..2a88295a7 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/69F21C82DC9A7A940ACEC414593E59C9E61E522F differ diff --git a/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 b/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 new file mode 100644 index 000000000..84a1690d2 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/0AF04E7099C9829BD1F8437362BA0036E0705C4D/FC72939DC06EDDF8C51549ECF00AC92BF2B39F35 differ diff --git a/spss/handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A b/spss/handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A new file mode 100644 index 000000000..04c6ea363 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/0FE419AB943E7E5C6A7190CC6BBE8E3F914C658A/FB356CEF4406D1F135E3FC59026B338D3F518F9A differ diff --git a/spss/handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 b/spss/handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 new file mode 100644 index 000000000..fd23a38d6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/10F17BDACD8DEAA1E8F23FBEAE7B3EC3D9773D1D/E7340D1FB627D8917A9C0D23F21515C441BF1214 differ diff --git a/spss/handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D b/spss/handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D new file mode 100644 index 000000000..1a3106742 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/125E4AC6B38C1E0BF34BF7D927CBB947E35141E8/2CA36B76BC6CCDC29296111A4EFCAFC0553BBC7D differ diff --git a/spss/handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 b/spss/handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 new file mode 100644 index 000000000..28cb48bb0 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/1607988A938D3D339F40AFB567384BC5B7540935/9FDCFE5A082FD69BF5D9E73C25FBE9EA1AC0ACF2 differ diff --git a/spss/handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 b/spss/handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 new file mode 100644 index 000000000..bdfcb7ab1 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/1A283D1183DB82A548427B4F19E99E7A8EA728D7/49969819654C230ECDF779ABB9629A211FCC43D6 differ diff --git a/spss/handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 b/spss/handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 new file mode 100644 index 000000000..eaac3518b Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/1BF3C1D2767F5C333AD5531531FEE3A712935B73/D0AF386E182F00983637F97C0A5F4708F9F641A7 differ diff --git a/spss/handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C b/spss/handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C new file mode 100644 index 000000000..4dd2c49bf Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/20DD04B052D2D364E5FF851A3FD314F0FD91253E/6814C7316CEA7191C9CB3BE58199B4A957210D9C differ diff --git a/spss/handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 b/spss/handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 new file mode 100644 index 000000000..13abede5c Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/22973CFC20EA68162A0B2E837D45FB8266ACDBCF/C529469053D9F95810A8F7F2DB9A6596A7655732 differ diff --git a/spss/handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 b/spss/handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 new file mode 100644 index 000000000..33e776369 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/238ACC1D03DA5A2E7E580D760FB3EE218FDC5A97/D3C063F219ED073E34AD5D750B327629FFD59AF2 differ diff --git a/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 new file mode 100644 index 000000000..d2e7db667 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/1C43C0BA36CC8DE659180B2FAC9A6F54430D5941 differ diff --git a/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 new file mode 100644 index 000000000..f2f1c6562 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/AC36A78C66FEC87CC0FD2C32B49214C65676E0C5 differ diff --git a/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 new file mode 100644 index 000000000..476a3efb2 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/C92238A7178A6C61F8BACA22D6CF7E50772BA9F0 differ diff --git a/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 new file mode 100644 index 000000000..5c88b668a Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/23A16796B3D718035F1E0DB209A42938767631DA/DFAE695342AC81A521025904406884399822B233 differ diff --git a/spss/handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F b/spss/handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F new file mode 100644 index 000000000..4d1852203 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/2962CDAADFA0BF8EE53B80870C53E551A43EA72A/12B06E039F1A36D8238AFC508009E1ADF88BF66F differ diff --git a/spss/handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 b/spss/handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 new file mode 100644 index 000000000..69a8e4872 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/2C976220B378E08DF5E68CBC54C05CE41224FD29/0CC37CC35E18F9909E43E4E9894D0CDF06EE9A38 differ diff --git a/spss/handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D b/spss/handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D new file mode 100644 index 000000000..807fa786c Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/2F5DA022AAFF668F34C35A80049D690F3CFE3040/D62327E6B19B7968A8BE6588DEAB0BC0DB684D8D differ diff --git a/spss/handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 b/spss/handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/31B5BA02D476873C5220CDCFA0C095C4A31DEFDF/88D6151358A5E3C81D7AE1A536121DC03011BC03 differ diff --git a/spss/handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 b/spss/handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 new file mode 100644 index 000000000..5171276f4 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3314CE3E42175EACC28D57C35F192430BBADAC1A/B1D0BC027906A3B7E7518C93ACB26D978233ED27 differ diff --git a/spss/handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 b/spss/handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 new file mode 100644 index 000000000..f8a8957ac Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/337F895A0435AA7E2629C5282B5A0DBBE19EE1C7/75F792DE2CF544007F470F1B924961C2BD2EF517 differ diff --git a/spss/handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA b/spss/handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA new file mode 100644 index 000000000..836ba3767 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3A095C38EB5D5824FE61BE43F9CDF6515DC94805/65698A39E03FF00FD552D4AD99FB290C2B9D4BEA differ diff --git a/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F new file mode 100644 index 000000000..69de75609 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/0F5A0342F5CD448799C3C6D178607E3F2B5BCB8F differ diff --git a/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE new file mode 100644 index 000000000..efa28178e Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/51A44C28F313E3F9CB5E7C0A1E0E0DD2843758AE differ diff --git a/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/9E0512DD61DA5949D1D8631C3F19D75F496C3733 differ diff --git a/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 new file mode 100644 index 000000000..b7d4b08a6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3B2F8C424AA88CA305C519FDEFCF29DDB7E96AE2/E6E6FC88719177C9B7421825757C5E47BCAC85F6 differ diff --git a/spss/handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E b/spss/handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E new file mode 100644 index 000000000..b2beddaa5 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3B76D7A5CE7EC6022D7990CFEA534C908717DF54/C0C699EFE6E837CB5E4CFC3A61077617A22C1A9E differ diff --git a/spss/handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 b/spss/handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 new file mode 100644 index 000000000..54893c9d6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3C627C9D89A5BFB5E4E385982DF33B7E7F6E8D2D/C5AC86EC5B771BEBDF8B6E040F109A1186E229B9 differ diff --git a/spss/handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C b/spss/handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C new file mode 100644 index 000000000..8588ce58a Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/3C7CE93947421CB66603DC7DBAB0F04C4788382F/23E594945195F2414803B4D564D2A3A3F5D88B8C differ diff --git a/spss/handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 b/spss/handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 new file mode 100644 index 000000000..6e17b9db5 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/4224231A54F64581FBA2AB6ED82ADE467F144BDC/65EF37033859C2F709A64086D3A5BD1B8F1A85A4 differ diff --git a/spss/handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 b/spss/handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 new file mode 100644 index 000000000..55707d69f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/45E2F3F807C6EAB9EDC1B3250F7558CA12A063DE/3A77E9B577661D99F9BBA5A352B29C7FF58A3D26 differ diff --git a/spss/handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E b/spss/handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/47ED4C584F9DCD54A6C2925252C5603ADAC93F49/84E4E75DBB2FD6397E6ABBD27FBE16D5BA71923E differ diff --git a/spss/handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA b/spss/handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA new file mode 100644 index 000000000..4e18de8d7 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/487F4DEE9E63DADEB4CAAB07E0E166ACC9F584B6/9891BBEA9FDA665EEEC31C403A00A5CA5628D0FA differ diff --git a/spss/handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 b/spss/handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 new file mode 100644 index 000000000..9b2ee0fc6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/52B42552A440A54C21A39D46D7F176AF28BEB5AA/51AC8CFF36818AA25498A293DF48EBCFFFF6D0B4 differ diff --git a/spss/handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F b/spss/handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F new file mode 100644 index 000000000..5dd9558d0 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/550E9627E9094A2D1BB6385821334D02122BCF26/B7BCA7BC3C41FD0DC835175486FAB3FB4626EC0F differ diff --git a/spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 b/spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/620127A8E5886A4805403977C3EF7D5EAF881526 differ diff --git a/spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 b/spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/562428A359B1CC3A820ABCC9C8F625CBB6A6A510/FCD9E881BCCCB9352EEF337C8D4EAAD65C4EC830 differ diff --git a/spss/handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B b/spss/handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B new file mode 100644 index 000000000..b15880c29 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/58090A698038FEDAD56B4B976F23C29950D1D5A5/6BDA1FF41EEBC5DA66912F3C69B60C2A41C6E25B differ diff --git a/spss/handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 b/spss/handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 new file mode 100644 index 000000000..6da18c620 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/59484253C7D4C5BEAB7D2BABFAC13DDD1CA53FCC/341EA32E448659125A67DD04177FD17468FCFCB1 differ diff --git a/spss/handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD b/spss/handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD new file mode 100644 index 000000000..c19647ad8 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/60EF765436B4F314F2285BE2D89A511073AC0D58/334710B9169BCD20687A6302EEB16AEB97F288CD differ diff --git a/spss/handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 b/spss/handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 new file mode 100644 index 000000000..39f88d881 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/6144BFC0CBE85C63DEFB6F208D80385B89F68046/D031945D982820B92FADBC7F71F6D1D9DFFDA2C9 differ diff --git a/spss/handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B b/spss/handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B new file mode 100644 index 000000000..d361d919f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/6F5F08A3A5D59CA877CB146F00BB0264369B2304/ADEC5673B57A18F16EFAF75EEFBFAD4841E2CD2B differ diff --git a/spss/handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 b/spss/handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 new file mode 100644 index 000000000..89cfe44fd Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/6F86F897C45679B45F03C67D44B6447EFF43B758/53CB69CF933C2D28FB9DF91F2852A99EC3352EA0 differ diff --git a/spss/handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C b/spss/handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C new file mode 100644 index 000000000..cc8b505ec Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/728C819D737EE42627F96F839C33BB6E68E85F68/00845B74CA13FE0A9056E6C0B5126FECF73B0D8C differ diff --git a/spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E b/spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E new file mode 100644 index 000000000..c9da41583 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/474BC41135FB88BF58B5A8D976A1D5583378D85E differ diff --git a/spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 b/spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 new file mode 100644 index 000000000..28fbdf42f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/738B34854780955AE8FAF12349F2C9C52105A52C/6B618820CE6A5EC0B5E63A9170335E5EA9F3BA01 differ diff --git a/spss/handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 b/spss/handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 new file mode 100644 index 000000000..424f849a1 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/76011AE57123CC4E476C094C48C461DC37A0DEDD/FDC348410699803DE7D8276813BC2232EA99A878 differ diff --git a/spss/handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C b/spss/handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C new file mode 100644 index 000000000..4989f3e73 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/7A9DC855647136050A8D75D6571AC64739F36C6C/BF648929E7DAABD8D97B3202F48D6C4A19C78F6C differ diff --git a/spss/handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B b/spss/handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/88D9F0C0EBB72C58516EC96AEED397FA86B40E39/6DCD5118D1542E6C205C580775C5420B7509506B differ diff --git a/spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB b/spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB new file mode 100644 index 000000000..6f97837a2 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/3B8484BF1370941BF03F206B5C4958DA4E1559BB differ diff --git a/spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B b/spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B new file mode 100644 index 000000000..508f7f076 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/8B23D64DBA1572885563DF070BE9C22A39A3BD26/C0EF3E7A54B4C501295F77974B1995E36B25C92B differ diff --git a/spss/handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE b/spss/handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE new file mode 100644 index 000000000..a0e3fdda1 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/8FDB1CB752D82C88C89F9E9DA7AD2F54C6FA6F3B/842B3870A64001CDD90978D0E554DAF94D9ABDFE differ diff --git a/spss/handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 b/spss/handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 new file mode 100644 index 000000000..36a442b89 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9014D44A2072A5D74E12C7FE47F37D68371E1C42/679A4F81FC705DDEC419778DD2EBD875F4C242C6 differ diff --git a/spss/handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 b/spss/handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 new file mode 100644 index 000000000..6c0216239 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/91C4DD783D6D38F0325FE74930BF61F656364EA9/53A6B611F8CEE0315BCCE5D59898931ED390E400 differ diff --git a/spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 b/spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 new file mode 100644 index 000000000..f3cf5e676 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/45B43346251FDF9E95DCB7F36928785D46D63913 differ diff --git a/spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC b/spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC new file mode 100644 index 000000000..fc5bd433b Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/96107213A757FFB88DECEE469373162636D7146C/E33619C88426E4FE956041E6751ADDEC9C10F0BC differ diff --git a/spss/handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F b/spss/handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F new file mode 100644 index 000000000..3beb4529a Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/975729FFAF7EB667BCF68E9B886EA876E44F46D0/35202B14F69409EAA51CD8AB547AC0CD5E993F3F differ diff --git a/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 b/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 new file mode 100644 index 000000000..781d1e4f2 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/3F4E01DF7547CDD38DCCFCCD76170C299ECEB9F6 differ diff --git a/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B b/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B new file mode 100644 index 000000000..8286cabbc Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/9D4CB7E3DBF24AE596972D59C375DD6384BB5E8B differ diff --git a/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B b/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B new file mode 100644 index 000000000..a0148f63b Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9D3E6FACCD6AF894CDD2B91D1B9E3C2E310EAB93/A562C4B99E2847251CB4A1F05DA1FF43E7296F0B differ diff --git a/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C b/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C new file mode 100644 index 000000000..61d346a8f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9039DBD29DB8AD0F8E2015F05FCD40582CCCBE8C differ diff --git a/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 b/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 new file mode 100644 index 000000000..9ae7ffa0c Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/9F0E0FBB25F66FF88C8E033EFF358923C84A2926 differ diff --git a/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 b/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 new file mode 100644 index 000000000..a68ae2db7 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/9F5A9B8D0F919C96B9472442BFBBDD34232A627D/C87D1855227D995C332C4C9072A2E2053F2CC623 differ diff --git a/spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B b/spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B new file mode 100644 index 000000000..f1d7b6a28 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/42AD1897A4643D2AA634D980F16349E6694F3B1B differ diff --git a/spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD b/spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD new file mode 100644 index 000000000..c1b90c0f4 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A07E912CAA2AB620034B05353E7D4B91807880ED/FE7891B6ED7B178F528A28B21478299F865889BD differ diff --git a/spss/handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B b/spss/handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B new file mode 100644 index 000000000..e27a87038 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A15B5DBE14A19CF859F48E2DA2A29A4C3DB4D680/3AC12E21FFF9ACAB2BCFF52BBD885FB7AAC9A02B differ diff --git a/spss/handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE b/spss/handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE new file mode 100644 index 000000000..cc35ba691 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A24C49B7F1B637E7F72C12CAB35910EC8EF1C6CF/8784ED81F5A22779EB0B081945FD151992557FBE differ diff --git a/spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F b/spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F new file mode 100644 index 000000000..b596d82e3 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/20CAECDCA766243AAD6FA1327618FC81BA65DC0F differ diff --git a/spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D b/spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D new file mode 100644 index 000000000..4adc3b7ec Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A4B140FBD4D5EA2AC3A570299945D8FCBBAD2231/96D5D179016A5A6546973BA63733617EE1F1540D differ diff --git a/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A b/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A new file mode 100644 index 000000000..b6f39e354 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/DFA7DDEF5C212F0F0651E2A9DE1CE4A1AC63AF7A differ diff --git a/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 b/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 new file mode 100644 index 000000000..f9fef65fc Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/E619D25B380B7B13FDA33E8A58CD82D8A88E0515 differ diff --git a/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 b/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 new file mode 100644 index 000000000..f9f27442b Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/A95F0C3FA54CA93E3D5BA61AD23459300FA498D6/F825578F8F5484DFB40F81867C392D6CB0012B92 differ diff --git a/spss/handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 b/spss/handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 new file mode 100644 index 000000000..10a1f7141 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/AAB27F0E98B28AF253454415F6490CB5F43A4B49/A9D28607928FA8615E2615CC9D71B535C5D0D419 differ diff --git a/spss/handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 b/spss/handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 new file mode 100644 index 000000000..61a7ccb15 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/AC1B67D7D5A300767C0944ACE8458DD49960F1BD/4D523730501ADB80A76B0B473A4D21C7D86F8374 differ diff --git a/spss/handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 b/spss/handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 new file mode 100644 index 000000000..ea3512e3d Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/B310CEED301C503EDB15720F94D5D7E76BF423DA/AA94FD422AEB8F5B6E8508314CE0DC68BCD53305 differ diff --git a/spss/handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 b/spss/handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 new file mode 100644 index 000000000..46dd968f0 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/B3EB7B59ECFF1E25E16C64BB24993D1B20DCFC28/07A6DEED70213CCF598F278789680DA4C04A0331 differ diff --git a/spss/handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 b/spss/handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 new file mode 100644 index 000000000..63ba5cce5 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/BAA9ADD095E87E0B490B6DD933AA2F450C6B9492/7A430B6E3592BEEDFAA0DD5DD6262C27EB8D26D2 differ diff --git a/spss/handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D b/spss/handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D new file mode 100644 index 000000000..0bab77032 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/BE47A5DA41A35F740D98305DA8FF4096B71492BE/D1474E7D99512D05B98DD37B3FE86496A03D088D differ diff --git a/spss/handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 b/spss/handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 new file mode 100644 index 000000000..0a8de4bb9 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/BED4C70D83B5042F4254459064FDEACD43DD1EDF/7BE0C8E441786C69A3CB35BDBEF235F8B5310E04 differ diff --git a/spss/handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE b/spss/handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE new file mode 100644 index 000000000..6428b8256 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/C15FFFE6EFAD484909C9EFC6CD5C20435E326685/DDBAE68B1FF60FFBB2854C78727B76C95EC83BBE differ diff --git a/spss/handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 b/spss/handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 new file mode 100644 index 000000000..f11bd6247 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/C2A7CAE9E68EB7945828D193CB22CDD246BC7F95/6955D95F6B0799F7D96F4FC28E6E6C64758C1240 differ diff --git a/spss/handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C b/spss/handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C new file mode 100644 index 000000000..348257122 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/C52E4A04A22D98C70E19F1969AD71C838E4371B3/F96FE4F59166EFA9000B21A16EF22CF14468890C differ diff --git a/spss/handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED b/spss/handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED new file mode 100644 index 000000000..a3f8a7409 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/C7E1D3604D2A960201D70F29B8A80EDA11475EEB/C18ECC8FD712ACAFBEAEDC1FA13F5AB19930E3ED differ diff --git a/spss/handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA b/spss/handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA new file mode 100644 index 000000000..3c1f2f8a2 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/C976280EC7FECF169577E31D8CA0BB00967904B1/7666A8BD2C2513DE489C06D08D566F177ECE84AA differ diff --git a/spss/handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 b/spss/handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 new file mode 100644 index 000000000..5026d395f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/CABD2EA6CA438084840DCCAE875F341E2D3A2C43/02A0E6456442E35198532ACFFB6FEE3B606D9FA3 differ diff --git a/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F b/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F new file mode 100644 index 000000000..c34d0f380 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/8AB0A3519AFA7F3C04074522678BAA1CB3DC734F differ diff --git a/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 b/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 new file mode 100644 index 000000000..d894e92ca Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/DF47B3040E7632614464BD2EC4ECD1B8030F53E3 differ diff --git a/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D b/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D new file mode 100644 index 000000000..380486f65 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/CE91CC7CF2DDDEE6623A1A91B3298DCAD2375F2B/E117479B4A41D7F3223FCAE50560B0D57B22217D differ diff --git a/spss/handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 b/spss/handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 new file mode 100644 index 000000000..22d64fb5f Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/D4D40BD33958CD9169A7AB6304AA2BBAD22DC595/07976A2A16EC182670161B46886B05E1FEAC16B1 differ diff --git a/spss/handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C b/spss/handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C new file mode 100644 index 000000000..42a64da07 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/D708C897515970D33EF7CD0C2474449D3AB6AA83/52ED0FAFBD38A868C678174D7EB03D266ADB221C differ diff --git a/spss/handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 b/spss/handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 new file mode 100644 index 000000000..010c5d5b6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/DD29E76659D18371B78E61E7DF4D4B8FEDCAF8E7/8BA5C0847597612C7E16970EAE55EF58D32E9CF3 differ diff --git a/spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE b/spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE new file mode 100644 index 000000000..5375c57c3 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/27337257493B86B9BFF78D569F938D692A430EAE differ diff --git a/spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 b/spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 new file mode 100644 index 000000000..7085c5ac9 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/DF5F53FDADAFC93F4789141B5A7627EB9F3BD29F/4832F0A28C3724A92F6CB3314F747D0E74FC7344 differ diff --git a/spss/handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 b/spss/handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 new file mode 100644 index 000000000..6225c0ca7 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/E6A4C843059A6043B4DC967F9EF892B695990777/B4B77C83465979E3679E3A33F972F48EE3730A18 differ diff --git a/spss/handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C b/spss/handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C new file mode 100644 index 000000000..a3aa0000d Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/EA7E6D37E678C1BCA5060F97DAF09F559DFD04B7/3AAD23B00CA10E54E6368DF7952E3F4B5108B65C differ diff --git a/spss/handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 b/spss/handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 new file mode 100644 index 000000000..332aa817a Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/EEE6351C5C6EBD8644AB88E7648D44FA07C72A80/14E59C02A6877B0EBD2C4203886BA25959C1D267 differ diff --git a/spss/handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 b/spss/handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 new file mode 100644 index 000000000..069640ffc Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/F1B84756A1EAB09C171B2783DD163B42A9BD0BBB/ED5608CE67EA5CB79AC024CEA7445F9BCBE48703 differ diff --git a/spss/handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE b/spss/handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE new file mode 100644 index 000000000..c3fc91352 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/F3DA7C495789E656FA27E611CCAFA05F232ADEA0/F3AE9FEA4DECEE5330770A2520BD86909929E7BE differ diff --git a/spss/handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 b/spss/handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 new file mode 100644 index 000000000..83aeb1fce Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/F48B57F89BACD8687EBB12223A5B8E5EF3774583/CAF84A42305615AC2C582F6412BDA3E36DAC3D25 differ diff --git a/spss/handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 b/spss/handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 new file mode 100644 index 000000000..5631441a9 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/F613568C1D7A1300B32609998288211959DBDFB0/D7EDAF7381F7FC93B4C28FA372190D7A59CFA696 differ diff --git a/spss/handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C b/spss/handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C new file mode 100644 index 000000000..585047fa2 Binary files /dev/null and b/spss/handbook/conf/moa-spss/certstore/F7D331850EC13D22284909E0FC3493A65FFA7F30/EC988340526163D5B7AC80481B2AC76828EDDC6C differ diff --git a/spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der b/spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der new file mode 100644 index 000000000..332aa817a Binary files /dev/null and b/spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden.der differ diff --git a/spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 b/spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 new file mode 100644 index 000000000..8827ed99c Binary files /dev/null and b/spss/handbook/conf/moa-spss/keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 differ diff --git a/spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der b/spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der new file mode 100644 index 000000000..63ba5cce5 Binary files /dev/null and b/spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1.der differ diff --git a/spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 b/spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 new file mode 100644 index 000000000..4499ab52b Binary files /dev/null and b/spss/handbook/conf/moa-spss/keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 differ diff --git a/spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der b/spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der new file mode 100644 index 000000000..4f87134e7 Binary files /dev/null and b/spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2.der differ diff --git a/spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 b/spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 new file mode 100644 index 000000000..5b7631133 Binary files /dev/null and b/spss/handbook/conf/moa-spss/keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 differ diff --git a/spss/handbook/conf/moa-spss/log4j.properties b/spss/handbook/conf/moa-spss/log4j.properties new file mode 100644 index 000000000..f6abfd495 --- /dev/null +++ b/spss/handbook/conf/moa-spss/log4j.properties @@ -0,0 +1,37 @@ +# +# Sample log4j configuration for the MOA-SPSS web service +# + +# commons-logging setup +org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory + +# 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 + +# Configure the 'stdout' appender to write logging output to the console +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n + +# Configure the 'moaspss' appender to write moa-spss related logging output +# to the file '${catalina.home}/logs/moa-spss.log'. The file is rolled over every 1000KB, +# and a maximum history of 10 log files is being kept. +log4j.appender.moaspss=org.apache.log4j.RollingFileAppender +log4j.appender.moaspss.File=${catalina.home}/logs/moa-spss.log +log4j.appender.moaspss.MaxFileSize=1000KB +log4j.appender.moaspss.MaxBackupIndex=10 +log4j.appender.moaspss.layout=org.apache.log4j.PatternLayout +log4j.appender.moaspss.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n + +# Configure the jdbc appender 'JDBC' to write logging output +# to the given PostgreSQL database +# a suitable table called 'spss_log' must have been created in the +# database using the command: +# create table spss_log (log_time timestamp, log_level char(5), log_msg text) +#log4j.appender.JDBC=org.apache.log4j.jdbc.JDBCAppender +#log4j.appender.JDBC.driver=org.postgresql.Driver +#log4j.appender.JDBC.URL=jdbc:postgresql://10.16.46.108/moa?user=moa&password=moatest +#log4j.appender.JDBC.layout=org.apache.log4j.PatternLayout +#log4j.appender.JDBC.sql=INSERT INTO spss_log (log_time, log_level, log_msg) VALUES ('%d{ yyyy-MM-dd HH:mm:ss.SSS}', '%5p', '%m') diff --git a/spss/handbook/conf/moa-spss/sp.minimum.config.xml b/spss/handbook/conf/moa-spss/sp.minimum.config.xml new file mode 100644 index 000000000..e2a556677 --- /dev/null +++ b/spss/handbook/conf/moa-spss/sp.minimum.config.xml @@ -0,0 +1,44 @@ + + + + + + +true +true + + +certstore + + + + + +pkix + + +Test-Signaturdienste +trustProfiles/test + + + +true +0 + +CRL +OCSP + + +false +365 + + +jdbc:url +fully.qualified.classname + + + + + + + diff --git a/spss/handbook/conf/moa-spss/spss.config.xml b/spss/handbook/conf/moa-spss/spss.config.xml new file mode 100644 index 000000000..d792f9478 --- /dev/null +++ b/spss/handbook/conf/moa-spss/spss.config.xml @@ -0,0 +1,149 @@ + + + + + + + SKM_Kunde1 + keys/customer1/moa-signaturdienst-kunde1[pwd=kunde1].p12 + kunde1 + + + SKM_Kunde2 + keys/customer2/moa-signaturdienst-kunde2[pwd=kunde2].p12 + kunde2 + + + SKM_allgemein + keys/common/moa-signaturdienst-allekunden[pwd=allekunden].p12 + allekunden + + + + KG_Kunde1 + + SKM_Kunde1 + + CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT + 7 + + + + + KG_Kunde2 + + SKM_Kunde2 + + CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT + 8 + + + + + KG_allgemein + + SKM_allgemein + + CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT + 9 + + + + + KG_allgemein + + + + CN=Test CA - Verschl\C3\BCsselung B\C3\BCrger,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT + 0 + + KG_Kunde1 + + + + CN=Test CA - Verschl\C3\BCsselung B\C3\BCrger,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT + 1 + + KG_Kunde2 + + + http://www.w3.org/TR/2001/REC-xml-c14n-20010315 + http://www.w3.org/2000/09/xmldsig#sha1 + + + + + + true + true + + + certstore + + + + + + pkix + + + CN=A-Trust-nQual-0,OU=A-Trust-nQual-0,O=A-Trust,C=AT + 536 + + chaining + + + + Test-Signaturdienste + trustProfiles/test + + + CertifiedSignature + trustProfiles/certifiedSignature + + + CertifiedSignature+Test + trustProfiles/certifiedSignature+Test + + + SecureSignature + trustProfiles/secureSignature + + + SecureSignature-Qual-Only + trustProfiles/secureSignature-qual-only + + + SecureSignature+Test + trustProfiles/secureSignature+Test + + + IdentityLink + trustProfiles/identityLink + + + IdentityLink+Test + trustProfiles/identityLink+Test + + + + true + 0 + + CRL + OCSP + + + false + 365 + + + jdbc:url + fully.qualified.classname + + + + + + + diff --git a/spss/handbook/conf/moa-spss/ss.minimum.config.xml b/spss/handbook/conf/moa-spss/ss.minimum.config.xml new file mode 100644 index 000000000..8ab10a994 --- /dev/null +++ b/spss/handbook/conf/moa-spss/ss.minimum.config.xml @@ -0,0 +1,34 @@ + + + + + + +SKM_Kunde1 +keys/customer1/moa-signaturdienst-kunde1(pwd=kunde1).p12 +kunde1 + + + +KG_Kunde1 + +SKM_Kunde1 + +CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT +7 + + + + + +CN=Test CA - Verschl\C3\BCsselung B\C3\BCrger,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT +0 + +KG_Kunde1 + + +http://www.w3.org/TR/2001/REC-xml-c14n-20010315 +http://www.w3.org/2000/09/xmldsig#sha1 + + + diff --git a/spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der b/spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der new file mode 100644 index 000000000..c3b3003d9 Binary files /dev/null and b/spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server.der differ diff --git a/spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 b/spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 new file mode 100644 index 000000000..af524d060 Binary files /dev/null and b/spss/handbook/conf/moa-spss/sslKeys/server/moa-ssl-server[pwd=server].p12 differ diff --git a/spss/handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore b/spss/handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore new file mode 100644 index 000000000..780e58934 Binary files /dev/null and b/spss/handbook/conf/moa-spss/sslKeys/tomcat/tomcat[pwd=server].keystore differ diff --git a/spss/handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore b/spss/handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore new file mode 100644 index 000000000..b3673b45d Binary files /dev/null and b/spss/handbook/conf/moa-spss/sslKeys/tomcat/trustedClients[pwd=clients].keystore differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer new file mode 100644 index 000000000..8c434777e Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer new file mode 100644 index 000000000..efa28178e Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer new file mode 100644 index 000000000..33e776369 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer new file mode 100644 index 000000000..b7d4b08a6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer new file mode 100644 index 000000000..69de75609 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer new file mode 100644 index 000000000..836ba3767 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.TrustSignTest-Enc-01.20011206-20041206.SerNo0450[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer new file mode 100644 index 000000000..fc5bd433b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20021120-20051120.SerNo16f8[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer new file mode 100644 index 000000000..f3cf5e676 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/A-Trust.a-sign-TEST-Premium-Enc-01.20030903-20060903.SerNo4848[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der new file mode 100644 index 000000000..d3c213711 --- /dev/null +++ b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/Stabsstelle.TestCA-Verschluesselung-Buerger.20040518-20100101.SerNo0004[CertifiedKeypair].der @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDljCCAwOgAwIBAgIBBDAJBgUrDgMCHQUAMHQxCzAJBgNVBAYTAkFUMSwwKgYD +VQQKEyNTdGFic3RlbGxlIElLVC1TdHJhdGVnaWUgZGVzIEJ1bmRlczEeMBwGA1UE +CxMVVGVjaG5payB1bmQgU3RhbmRhcmRzMRcwFQYDVQQDEw5UZXN0IENBIC0gUm9v +dDAeFw0wNDA1MTgxMzQ1NTdaFw0wOTEyMzEyMjU5MzBaMIGGMQswCQYDVQQGEwJB +VDEsMCoGA1UEChMjU3RhYnN0ZWxsZSBJS1QtU3RyYXRlZ2llIGRlcyBCdW5kZXMx +HjAcBgNVBAsTFVRlY2huaWsgdW5kIFN0YW5kYXJkczEpMCcGA1UEAxQgVGVzdCBD +QSAtIFZlcnNjaGz8c3NlbHVuZyBC/HJnZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0A +MIGJAoGBALmykoSgYUpJiaK5NlC5jTcMQikEIB6kOdS7e82DBbT5G13zQeuiNBA2 +KzLMPMBK62Go+ZV8w94N5cSm2auuempVAHNF80ao9G3wYgK0xOVZXvf/145o8TIw +StPPckmVPL2OPa8/DIB8tqNjblFxy+XcBnTQMLKaxYSzwA/zULoNAgMBAAGjggEr +MIIBJzAOBgNVHQ8BAf8EBAMCAcYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4E +FgQUjRMKvtgH3PngerFS/Rt+vuEDbLMwXQYDVR0gBFYwVDBSBgwrBgEEAZUSAQID +AQEwQjBABggrBgEFBQcCAjA0GjJEaWVzZXMgWmVydGlmaWthdCBpc3QgbnVyIGb8 +ciBUZXN0endlY2tlIGdlZWlnbmV0LjA5BgNVHR8EMjAwMC6gLKAqhihodHRwOi8v +bGFicy5jaW8uZ3YuYXQvdGVtcC9jcmxzL3Jvb3QuY3JsMBQGByooAAoBAQEECQwH +QktBLUlLVDARBglghkgBhvhCAQEEBAMCAQIwHwYDVR0jBBgwFoAUZWxSwiqQLpxu +4vk3Op4dYHG46XswCQYFKw4DAh0FAAOBgQAnuY7RPFXLpO2hb3h1B0cy5p861j6E +eD+c/ZKAGqIh4kh3A65D8Zl90GSv9vV4L03dnN5hc7rm/bwKzDI57/PI2dL0H/S4 +OOl4tt4fZmjN8Xrv3oJxNEa+6AJ8TGCcouc/Eqxnpc0SxkP6UQrA8J8RM/8fk05U +DAyTZbTQ5wPIhA== +-----END CERTIFICATE----- diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer new file mode 100644 index 000000000..8c434777e Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20040326-20070326.SerNo6632(CertifiedKeypair).cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer new file mode 100644 index 000000000..efa28178e Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-01.20041201-20141201.SerNoe242.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer new file mode 100644 index 000000000..33e776369 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust-nQual-03.20050817-20150817.SerNo016c1e.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer new file mode 100644 index 000000000..b7d4b08a6 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20010427-20040427.SerNo006f[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer new file mode 100644 index 000000000..289fc2198 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0213[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer new file mode 100644 index 000000000..69de75609 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/A-Trust.A-Trust-nQual-01.20011212-20041212.SerNo0218[CertifiedKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/certifiedSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer new file mode 100644 index 000000000..592c96230 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Dr. Waltraut Kotschy.20070119-20120119.SerNo02de1c.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer new file mode 100644 index 000000000..424f849a1 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/MOA-Test-CA-Signaturdienste.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der new file mode 100644 index 000000000..5171276f4 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink+Test/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der b/spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der new file mode 100644 index 000000000..592c96230 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Dr. Waltraut Kotschy-20070119-20120119.SerNo02de1c.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer b/spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink-signerCerts/Nikolaus_Schwab.20040219-20070219.SerNo5C39.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der b/spss/handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der new file mode 100644 index 000000000..376d0753f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink/Nikolaus-Schwab-BM-f-Inneres-20040219-20070219.SerNo5c39.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der b/spss/handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der new file mode 100644 index 000000000..5171276f4 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/identityLink/a-sign-corporate-light-03-20051114-20151114.SerNo01aaed.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer new file mode 100644 index 000000000..f9fef65fc Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer new file mode 100644 index 000000000..36a442b89 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer new file mode 100644 index 000000000..d361d919f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer new file mode 100644 index 000000000..ad13d7b28 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer new file mode 100644 index 000000000..f9f27442b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer new file mode 100644 index 000000000..b6f39e354 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer new file mode 100644 index 000000000..28cb48bb0 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.TrustSignTest-Sig-01.20011206-20041206.SerNo0588[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer new file mode 100644 index 000000000..28fbdf42f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20021120-20051120.SerNo16f9[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer new file mode 100644 index 000000000..c9da41583 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/A-Trust.a-sign-TEST-Premium-Sig-01.20030903-20060903.SerNo484a[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der new file mode 100644 index 000000000..807fa786c Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/Stabsstelle.TestCA_Signatur_Buerger.20040518-20100101.SerNo0003[CertifiedKeypair].der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature+Test/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer new file mode 100644 index 000000000..f9fef65fc Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-01.20041201-20141201.SerNoE243[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer new file mode 100644 index 000000000..36a442b89 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust-Qual-02.20041203-20141203.SerNoE248[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer new file mode 100644 index 000000000..d361d919f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer new file mode 100644 index 000000000..ad13d7b28 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer new file mode 100644 index 000000000..f9f27442b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer new file mode 100644 index 000000000..b6f39e354 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature-qual-only/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer new file mode 100644 index 000000000..f9fef65fc Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-01.20041201-20141201.SerNoE243.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer new file mode 100644 index 000000000..36a442b89 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust-Qual-02.20041203-20141203.SerNoE248.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer new file mode 100644 index 000000000..d361d919f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011130-20041130.SerNo01f6[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer new file mode 100644 index 000000000..ad13d7b28 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20011215-20041215.SerNo021e[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer new file mode 100644 index 000000000..f9f27442b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo0291[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer new file mode 100644 index 000000000..b6f39e354 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/A-Trust.A-Trust-Qual-01.20020207-20050207.SerNo210d[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der new file mode 100644 index 000000000..3be7b6a06 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/C=AT,O=Hauptverband oesterr. Sozialvers.,CN=Root-CA 1-2045.der differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer new file mode 100644 index 000000000..06b40aa67 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom.A1-Signatur.20040326-20140326.SerNo6646[SecureSignatureKeypair].cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer new file mode 100644 index 000000000..7e9fd5b0b Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20060912-20110912_SerNo027866.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer new file mode 100644 index 000000000..da38ce028 Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/secureSignature/mobilkom_A1-Signatur_20070501-20120501_SerNo6650.cer differ diff --git a/spss/handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der b/spss/handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der new file mode 100644 index 000000000..55707d69f Binary files /dev/null and b/spss/handbook/conf/moa-spss/trustProfiles/test/signaturdienst.der differ diff --git a/spss/handbook/handbook.html b/spss/handbook/handbook.html new file mode 100644 index 000000000..2497d7f70 --- /dev/null +++ b/spss/handbook/handbook.html @@ -0,0 +1,6 @@ + + + + +

Zum Handbuch ...

+ \ No newline at end of file diff --git a/spss/handbook/handbook/common/LogoBKA.png b/spss/handbook/handbook/common/LogoBKA.png new file mode 100644 index 000000000..6a92647fd Binary files /dev/null and b/spss/handbook/handbook/common/LogoBKA.png differ diff --git a/spss/handbook/handbook/common/LogoMoa4c.3148x3545.jpg b/spss/handbook/handbook/common/LogoMoa4c.3148x3545.jpg new file mode 100644 index 000000000..a5ba135ef Binary files /dev/null and b/spss/handbook/handbook/common/LogoMoa4c.3148x3545.jpg differ diff --git a/spss/handbook/handbook/common/LogoMoa4c.jpg b/spss/handbook/handbook/common/LogoMoa4c.jpg new file mode 100644 index 000000000..a1102090b Binary files /dev/null and b/spss/handbook/handbook/common/LogoMoa4c.jpg differ diff --git a/spss/handbook/handbook/common/LogoMoaBw.jpg b/spss/handbook/handbook/common/LogoMoaBw.jpg new file mode 100644 index 000000000..5a31e3e15 Binary files /dev/null and b/spss/handbook/handbook/common/LogoMoaBw.jpg differ diff --git a/spss/handbook/handbook/common/MOA.css b/spss/handbook/handbook/common/MOA.css new file mode 100644 index 000000000..81e0a3f8d --- /dev/null +++ b/spss/handbook/handbook/common/MOA.css @@ -0,0 +1,300 @@ +body +{ + font-family: "Times New Roman", Times, serif; + font-size: medium; + font-weight: normal; + margin-left: 2.5em; + margin-right: 2.5em; +} + +p +{ + margin-top: 0pt; + margin-bottom: 0.5em; + text-align: justify +} + +pre +{ + font-family: "Courier New", monospace; + font-size: 90%; + background-color: #cccccc; + color: #000000; + margin-left:1.5%; + margin-right:1.5%; + margin-top: 1em; + margin-bottom: 1em; + border: #008000 none; +} + +hr +{ + color: #000080; + background-color: #000080; + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +table.fixedWidth +{ + width: 97%; + margin-left:1.5%; + margin-right:1.5%; + margin-top: 1em; + margin-bottom: 1em; +} + + +table.varWidth +{ + margin-left:1.5%; + margin-top: 1em; + margin-bottom: 1em; +} + +th +{ + text-align: left; +} + +h1 +{ + color: #000080; + text-align: left; + font-size: 167%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal +} + +h2 +{ + color: #000080; + font-size: 150%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal +} + +h3 +{ + color: #000080; + font-size: 133%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal +} + +h4 +{ + color: #000080; + font-size: 116%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal +} + +h5 +{ + color: #000080; + font-size: 100%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal +} + +h6 +{ + color: #000080; + font-size: 83%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal +} + +code +{ + font-family: "Courier New", Courier, monospace; + font-size: 90%; + color: #000000 +} + +dd +{ + margin-top: 0.8em; + margin-bottom: 0.8em; + text-align: justify + +} + +dt +{ + margin-top: 0.8em; + font-family: Arial, Helvetica, sans-serif; + color: #000080 +} + +ol +{ + margin-top: 0.5em; + margin-bottom: 0.5em +} + +ol.alpha +{ + list-style-type: lower-alpha +} + +li +{ + margin-top: 0.25em; + margin-bottom: 0.25em; + text-align: justify +} + +a:hover +{ + color: #990000 +} + + +.title +{ + text-align: left; + font-size: 167%; + color: #000080; + font-family: Arial, Helvetica, sans-serif; + margin-top: 0.4em; + margin-bottom: 0.4em +} + +.subtitle +{ + text-align: left; + font-size: 133%; + color: #000080; + font-family: Arial, Helvetica, sans-serif; + margin-top: 0.4em; + margin-bottom: 0.4em +} + +.glossaryTerm +{ + font-style: italic; + color: #006699 +} + +.example +{ + font-family: "Courier New", monospace; + background-color: #CCFFFF; + color: #000000; + margin: 0pt 0pt; + border: #008000 none +} + +.schema +{ + font-family: "Courier New", monospace; + background-color: #FFFFCC; + color: #000000; + margin: 0pt 0pt; + border: #008000 none +} + +.documentinfo +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 100%; +} + +.ol-contents +{ + font-size: 100%; + margin-top: 0.0em; + margin-bottom: 0.0em; +} + +.li-contents +{ + font-size: 100%; + margin-top: 0.0em; + margin-bottom: 0.0em; +} + +.logoTitle +{ + text-align: center; + font-size: 133%; + color: #000080; + font-family: Arial, Helvetica, sans-serif; +} + +.logoTable +{ + margin-bottom: 0px; + margin-left: 0px +} + +.superscript +{ + vertical-align: super; + font-size: 66%; +} + +.term +{ + font-style: italic; +} + +.comment +{ + color: #000000; + background: #ffff00; + font-style: italic +} + +.addedErrata12 +{ + color: #FF0000; + background-color: #FFEEEE; + text-decoration: underline +} + +.deletedErrata12 +{ + color: #999999; + background-color: #EEEEEE; + text-decoration: line-through +} + +.added12 +{ + color: #FF0000; + text-decoration: underline +; background-color: #F8F0FF +} + +.deleted12 +{ + color: #999999; + text-decoration: line-through +; background-color: #f8f0ff +} + +.rfc2119Keyword +{ + font-variant: small-caps; + font-style: normal; +} + +.remark { font-style: italic} + +li.faq +{ + margin-top: 1.5em; + margin-bottom: 1.5em; +} + +.faq-question +{ + color: #000080; + font-size: 100%; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal; + margin-bottom: 0.4em; +} diff --git a/spss/handbook/handbook/config/MOA-SPSS-config-1.3.xsd b/spss/handbook/handbook/config/MOA-SPSS-config-1.3.xsd new file mode 100644 index 000000000..1521b4f1b --- /dev/null +++ b/spss/handbook/handbook/config/MOA-SPSS-config-1.3.xsd @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spss/handbook/handbook/config/config.html b/spss/handbook/handbook/config/config.html new file mode 100644 index 000000000..f1097e55a --- /dev/null +++ b/spss/handbook/handbook/config/config.html @@ -0,0 +1,1014 @@ + + + + + MOA SS und SP - Konfiguration + + + + + + + + + +
Logo BKAOpen Source
+ für das E-Government
Logo MOA
+
+

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

+

Konfiguration

+
+

Inhalt

+
    +
  1. +

    Übersicht

    +
      +
    1. Allgemeines +
        +
      1. Namenskonventionen
      2. +
      +
    2. +
    3. Zentrale Konfigurationsdatei +
        +
      1. Aktualisierung auf das Format von MOA SP/SS 1.3
      2. +
      +
    4. +
    5. Bekanntmachung der Konfigurationsdatei + +
        +
      1. Aktualisierung der Konfiguration im laufenden Betrieb
      2. +
      +
    6. +
    7. Konfiguration des Loggings
    8. +
    +
  2. +
  3. Konfigurationsparameter +
      +
    1. Allgemeines Parameter
        +
      1. Hardwarebasiertes Kryptographiemodul
      2. +
      +
    2. +
    3. Parameter für MOA SS
        +
      1. Schlüsselspeicher
          +
        1. Hardware-Schlüsselspeicher
        2. +
        3. Software-Schlüsselspeicher
        4. +
        +
      2. +
      3. Schlüsselgruppe
      4. +
      5. Zuordnung von Schlüsselgruppen zu einem + Kunden
      6. +
      7. Parameter für XML-Signaturen
      8. +
      9. Profil für Transformationen
      10. +
      11. Profil für Signaturumgebung
      12. +
      +
    4. +
    5. Parameter für MOA SP
        +
      1. Zertifikatsvalidierung
          +
        1. Konstruktion des Zertifikatspfads +
            +
          1. Cachen von Zertifikaten
          2. +
          3. Auswertung der Zertifikatserweiterung Authority Information Access
          4. +
          5. Lokalisierung des Zertifikatsspeichers
          6. +
          +
        2. +
        3. Valdierung des Zertifikatspfads +
            +
          1. Gültigkeitsmodell für die Zertifikatskettenprüfung
          2. +
          3. Vertrauensprofile
          4. +
          +
        4. +
        5. Widerrufsprüfung +
            +
          1. Aktivieren + der Widerrufsprüfung
          2. +
          3. Maximales Alter der Widerrufsinformation
          4. +
          5. Reihenfolge der Widerrufsdienste
          6. +
          7. Archivierung von Widerrufsinformationen
          8. +
          9. Manuelle + Konfiguration von Verteilungspunkten für Widerrufsinformationen
          10. +
          +
        6. +
        +
      2. +
      3. Profil für Transformationen
      4. +
      5. Profil für Ergänzungsobjekte
      6. +
      +
    6. +
    +
  4. +
  5. Beispielkonfigurationen +
      +
    1. Minimale Konfiguration für MOA SS
    2. +
    3. Minimale Konfiguration für MOA SP
    4. +
    5. Typische Konfiguration für MOA SP/SS
    6. +
    +
  6. +
+
+

1 Übersicht

+

Dieses Handbuch beschreibt detailliert die Konfigurationsmöglichkeiten für MOA SP/SS. Wenn nicht anders angegeben, beziehen sich die Erläuterungen sowohl auf die Konfiguration des Webservices als auch auf die Konfiguration von MOA SP/SS für den Einsatz als Klassenbibliothek.

+

1.1 Allgemeines

+

1.1.1 Namenskonventionen

+

Folgende Namenraum-Präfixe werden in diesem Handbuch zur Kennzeichnung der Namenräume + von XML-Elementen verwendet:

+ + + + + + + + + + + + + + + + + + + + + +
PräfixNamenraum
cfghttp://reference.e-government.gv.at/namespace/moaconfig/20021122#
dsighttp://www.w3.org/2000/09/xmldsig#
moahttp://reference.e-government.gv.at/namespace/moa/20020822#
xshttp://www.w3.org/2001/XMLSchema
+

1.2 Zentrale Konfigurationsdatei

+

Die Konfiguration von MOA SP/SS erfolgt zentral über eine einzige Konfigurationsdatei. Das Format der Konfigurationsdatei ist XML und muss dem Schema MOA-SPSS-config-1.3.xsd entsprechen. Abschnitt 2 erläutert die Konfigurationsmöglichkeiten im Einzelnen.

+

1.2.1 + Aktualisierung auf das Format von MOA SP/SS 1.3

+

Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues, übersichtlicheres Format für die + XML-Konfigurationsdatei.

+

Wenn Sie von einer ä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ügung, mit dem + Sie Ihre Konfigurationsdatei vom bisherigen auf das neue Format migrieren können.

+

Dieses Werkzeug können Sie durch Ausführen des Scripts configtool aus dem Verzeichnis + tools im MOA-Installationsverzeichnis verwenden:

+
configtool c:\pfad\zur\konfiguration\config.alt.xml c:\pfad\zur\konfiguration\config.neu.xml
+

Der erste Parameter für das Script gibt also Pfad und Dateiname der bestehenden, alten Konfigurationsdatei + an, der zweite Parameter Pfad und Dateiname für die zu erzeugende Konfigurationsdatei im neuen Format (Hinweis: + Die Beispielpfade beziehen sich auf Windows-Betriebssysteme; für Unix-Betriebssysteme wählen Sie bitte sinngemäße + Pfade.).

+

1.3 Bekanntmachung der Konfigurationsdatei

+

Die zentrale Konfigurationsdatei von MOA SP/SS wird der Java Virtual Machine, in der MOA SP/SS läuft, durch eine System Property mitgeteilt (wird beim Starten der Java Virtual Machine in der Form -D<name>=<wert> gemacht). Der Name der System Property lautet moa.spss.server.configuration; als Wert der System Property ist der Pfad sowie der Name der Konfigurationsdatei im Dateisystem anzugeben, z.B.

+
moa.spss.server.configuration=C:/Programme/apache/tomcat-4.1.30/conf/moa-spss/moa-spss.config.xml 
+
+

Weitere Informationen zum Bekanntmachen der zentralen Konfigurationsdatei für MOA SP/SS erhalten Sie in Abschnitt 2.1.2.3 des Installationshandbuchs.

+

1.3.1 + Aktualisierung der Konfiguration im laufenden Betrieb

+

Wird MOA SP/SS als Webservice eingesetzt, kann durch Aufrufen einer speziellen URL des Webservice ein erneutes Einlesen der Konfigurationsdatei erzwungen werden. Damit ist es möglich, Änderungen an der Konfigurationsdatei vorzunehmen, und diese Änderungen ohne Neustart des zu Grunde liegenden Servlet Containers in den Betrieb zu übernehmen.

+

Weitere Informationen zum erneuten Einlesen der Konfigurationsdatei im Webservice-Betrieb erhalten Sie in Abschnitt 2.1.2.5 des Installationshandbuchs.

+

1.4 Konfiguration des Loggings

+

MOA SP/SS verwendet als Framework für Logging-Information die Open Source Software log4j. Die Konfiguration der Logging-Information erfolgt nicht direkt durch MOA SP/SS, sondern über eine eigene Konfigurationsdatei, die der Java Virtual Machine durch eine System Property mitgeteilt wird. Der Name der System Property lautet log4j.configuration; als Wert der System Property ist eine URL anzugeben, die auf die log4j-Konfigurationsdatei verweist, z.B.

+

+

log4j.configuration=file:/C:/Programme/apache/tomcat-4.1.30/conf/moa-spss/log4j.properties
+ Weitere Informationen zur Konfiguration des Loggings erhalten Sie in Abschnitt 2.1.3 des Installationshandbuchs. +

+

2 Konfigurationsparameter

+

Nachfolgend werden die verfügbaren Konfigurationsparameter der zentralen Konfigurationsdatei im Detail erläutert. Die Reihenfolge der Abhandlung entspricht der Reihenfolge des vorgeschriebenen Auftretens in der Konfigurationsdatei. Für beispielhafte Konfigurationsdateien siehe Abschnitt 3.

+

Muss der Wert eines Konfigurationsparameters eine URL oder eine Pfadangabe sein, und wird als konkreter Wert eine relative URL bzw. ein relativer Pfad angegeben, so wird diese Angabe relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist.

+

2.1 + Allgemeine Parameter

+

2.1.1 Hardwarebasiertes Kryptographiemodul

+ + + + + + + + + + + + + +
Namecfg:Common/cfg:HardwareCryptoModule
GebrauchNull mal bis unbeschränkt oft
Erläuterung

Mit diesem Element wird MOA SP bzw. SS die Verfügbarkeit eines Hardware-Kryptographiemoduls + mitgeteilt. Wird ein solches Hardware-Kryptographiemodul konfiguriert, versucht MOA SP/SS das + Hardware-Kryptographiemodul für die Verifikation des Signaturwerts (MOA SP) bzw. für die Berechnung + von Hashwerten (MOA SP und MOA SS) anstatt des standardmäßig konfigurierten Software-Kryptographiemoduls + zu verwenden.

+

Werden mehrere Hardware-Kryptographiemodule konfiguriert, prüft MOA SP/SS entsprechend + der Konfigurationsreihenfolge der Hardware-Kryptographiemodule, ob eines der Module die benötigte + Funktion (Hashwertberechnung, Siganturprüfung) zur Verfügung stellt. Verwendet wird das erste Hardware-Kryptographiemodul, + das ide benötigte Funktion zur Verfügung stellen kann.

+

Das Element weist bis zu drei Kindelemente auf:

+
    +
  • Element cfg:Name: Dieses obligatorische Element vom Typ xs:string enthält + den Dateinamen der DLL (Windows) oder der Shared-Library (Unix), welche die PKCS#11-Schnittstelle + zum Hardware-Kryptographiemodul implementiert; der Wert enthält entweder einen Dateinamen + mit absoluter Pfadangabe oder einen Dateinamen ohne Pfadangabe. Im letzteren Fall wird der Dateiname + relativ zum Suchpfad des Betriebssystems interpretiert.
  • +
  • Element cfg:SlotId: Dieses optionale Element vom Typ xs:string gibt + des Slot der PKCS#11-Schnittstelle an, über den das Hardware-Kryptographiemodul von MOA + SP/SS angesprochen werden soll. Fehlt dieses Attribut, wählt MOA SP/SS selbst einen Slot + aus der Liste der verfügbaren Slots aus.
  • +
  • Element cfg:UserPIN: Dieses obligatorische Element vom Typ xs:string enthält + den PIN-Code zur Freischaltung der Kryptographiefunktionen über die PKCS#11-Schnittstelle + des Hardware-Kryptographiemoduls.
  • +
+

2.2 Parameter für MOA SS

+

2.2.1 Schlüsselspeicher

+

2.2.1.1 Hardware-Schlüsselspeicher

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule
GebrauchNull mal bis unbeschränkt oft; zumindest ein Hardware- (cfg:HardwareKeyModule) oder + Software-Schlüsselspeicher (cfg:SoftwareKeyModule) muss + jedoch vorhanden sein
Erläuterung

Mit diesem Element wird MOA SS die Verfügbarkeit eines Hardware-Schlüsselspeichers mitgeteilt.

+

Das Element weist bis zu vier Kindelemente auf:

+
    +
  • Element cfg:Id: Dieses obligatorische Element vom Typ xs:token enthält + einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der + XML-Konfigurationsdatei eindeutig sein muss. Mit Hilfe dieses Identifikators wird im Konfigurationselement cfg:SignatureCreation/cfg:KeyGroup auf + dieses Konfigurationselement referenziert.
  • +
  • Element cfg:Name: Dieses obligatorische Element vom Typ xs:string enthält + den Dateinamen der DLL (Windows) oder der Shared-Library (Unix), welche die PKCS#11-Schnittstelle + zum Hardware-Schlüsselspeicher implementiert; der Wert enthält entweder einen Dateinamen + mit absoluter Pfadangabe oder einen Dateinamen ohne Pfadangabe. Im letzteren Fall wird der Dateiname + relativ zum Suchpfad des Betriebssystems interpretiert.
  • +
  • Element cfg:SlotId: Dieses optionale Element vom Typ xs:string gibt des + Slot der PKCS#11-Schnittstelle an, über den der Hardware-Schlüsselspeicher von MOA SS + angesprochen werden soll. Fehlt dieses Attribut, wählt MOA SS selbst einen Slot aus der Liste + der verfügbaren Slots aus.
  • +
  • Element cfg:UserPIN: Dieses obligatorische Element vom Typ xs:string enthält + den PIN-Code zur Freischaltung der Schlüsselverwendung über die PKCS#11-Schnittstelle + des Hardware-Schlüsselspeichers.
  • +
+

2.2.1.2 + Software-Schlüsselspeicher

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule
GebrauchNull mal bis unbeschränkt oft; zumindest ein Hardware- (cfg:HardwareKeyModule) oder + Software-Schlüsselspeicher (cfg:SoftwareKeyModule) muss jedoch vorhanden sein
Erläuterung

Mit diesem Element wird MOA SS die Verfügbarkeit eines Software-Schlüsselspeichers in + Form einer PKCS#12-Datei mitgeteilt.

+

Das Element weist drei obligatorische Kindelemente auf:

+
    +
  • Element cfg:Id: Dieses Element vom Typ xs:token enthält einen + frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der XML-Konfigurationsdatei + eindeutig sein muss. Mit Hilfe dieses Identifikators wird im Konfigurationselement cfg:SignatureCreation/cfg:KeyGroup auf + dieses Konfigurationselement referenziert.
  • +
  • Element cfg:Filename: Dieses Element vom Typ xs:string enthält + den Dateinamen der PKCS#12-Datei, die den Software-Schlüsselspeicher repräsentiert. Der + Wert enthält einen Dateinamen mit absoluter oder relativer Pfadangabe. Eine relative Pfadangabe + wird von MOA SS relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale Konfigurationsdatei + gespeichert ist.
  • +
  • Element cfg:Password: Dieses Element vom Typ xs:string enthält + das Passwort zum Entschlüsseln der Inhalte der PKCS#12-Datei.
  • +
+

2.2.2 Schlüsselgruppe

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:KeyGroup
Gebraucheinmal bis unbeschränkt oft
Erläuterung

Mit diesem Element wird in MOA SS eine Schlüsselgruppe definiert. Eine Schlüsselgruppe + ist eine Zusammenfassung von einem oder mehreren privaten Schlüsseln, die in Hardware- bzw. Softwareschlüsselspeichern + (vergleiche Abschnitte 2.2.1.1 bzw. 2.2.1.2) + verwaltet werden. Die Schlüsselgruppe wird vom Kunden von MOA SS über einen eindeutigen Bezeichner + im Request zur Signaturerstellung angesprochen.

+

Sinn der Zusammenfassung von mehreren privaten Schlüsseln zu einer Schlüsselgruppe ist + es, dass MOA SS selbst entscheidet, welcher konkrete Schlüssel aus der Schlüsselgruppe + zur Erstellung der Signatur verwendet wird. Durch die somit mögliche Parallelisierung (mehrere + private Schlüssel werden parallel für Anfragen, die auf die gleiche Schlüsselgruppe + referenzieren) lässt sich der Durchsatz der erstellten Signaturen verbessern.

+

Das Element cfg:SignatureCreation/cfg:KeyGroup hat folgenden Element-Inhalt:

+
    +
  • Element cfg:Id: Dieses obligatorische Element vom Typ xs:token enthält + einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der + XML-Konfigurationsdatei eindeutig sein muss. Mit Hilfe dieses Identifikators wird im Konfigurationselement cfg:SignatureCreation/cfg:KeyGroupMapping auf + dieses Konfigurationselement referenziert. Weiters wird dieser Identifikator im Request zur Erstellung + der Signatur verwendet, um die zu verwendende Schlüsselgruppe anzugeben.
  • +
  • Element cfg:Key: Dieses Element muss zumindest einmal vorkommen. Jedes Element beschreibt + einen der privaten Schlüssel, aus denen sich die Schlüsselgruppe zusammensetzt. Das Element + hat folgenden Element-Inhalt: +
      +
    • Element cfg:KeyModuleId: Dieses Element kommt genau einmal vor. Mit ihm wird + auf einen der konfigurierten Hardware- oder Software-Schlüsselspeicher referenziert. + Sein Textinhalt vom Typ xs:token enthält den Identifikator des Hardware- + oder Software-Schlüsselspeichers, so wie er in cfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule/cfg:Id bzw. cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule/cfg:Id festgelegt + wurde.
    • +
    • Element cfg:KeyCertIssuerSerial: Dieses Element kommt ebenfalls genau einmal + vor. Mit ihm wird ein privater Schlüssel innerhalb des mit cfg:KeyModuleId ausgewählten + Schlüsselspeichers ausgewählt (sowohl Hardware- als auch Softwareschlüsselspeicher + können ja prinzipiell mehr als nur einen einzigen privaten Schlüssel verwalten). + Das Element hat folgenden Element-Inhalt: +
        +
      • Element dsig:X509IssuerName: Dieses Element kommt genau einmal vor. + Sein Textinhalt vom Typ xs:string enthält den Namen des Ausstellers + des Zertifikats für den ausgewählten privaten Schlüssel.
      • +
      • Element dsig:X509SerialNumber: Dieses Element kommt genau einmal vor. + Sein Textinhalt vom Typ xs:integer enthält die Seriennummer des Zertifikats + für den ausgewählten privaten Schlüssel.
      • +
      +
    • +
    +
  • +
+

Um auf einfache Weise für alle in Ihren Schlüsselspeichern enthaltenen privaten Schlüssel + die jeweiligen Werte für dsig:X509IssuerName und dsig:X509SerialNumber zu + erhalten, gehen Sie am besten wie folgt vor:

+
    +
  1. Erfassen Sie in der zentralen Konfigurationsdatei alle Ihre Schlüsselspeicher mit Hilfe + der Konfigurationselemente cfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule bzw. cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule.
  2. +
  3. Starten Sie nun - mit bewusst fehlenden cfg:SignatureCreation/cfg:KeyGroup Elementen - den MOA SP/SS Server. + Stellen Sie dabei sicher, dass das Log-Level für den Logger moa.spss.server zumindest + auf das Niveau info eingestellt ist (Informationen zur Konfiguration des Loggings + von MOA SP/SS finden Sie in Abschnitt + 2.1.3 des Installationshandbuchs). Im Log-File werden dann alle verfügbaren privaten Schlüssel + an Hand der Werte dsig:X509IssuerName und dsig:X509SerialNumber aufgelistet. + Vergleichen Sie den folgenden beispielhaften Auszug:
    +
    INFO | 15 15:10:14,737 | moa.spss.server | TID=startup NID=node1 MSG=Key 
    ID=SKM_Kunde1;CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT;7 +INFO | 15 15:10:14,737 | moa.spss.server | TID=startup NID=node1 MSG=Key + ID=SKM_allgemein;CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT;9
    INFO | 15 15:10:14,737 | moa.spss.server | TID=startup NID=node1 MSG=Key
    ID=SKM_Kunde2;CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT;8
    + Der Wert der Eigenschaft ID des Logging-Eintrags gliedert sich in drei Teile: +
      +
    1. Der erste Teil enthält den Identifikator des Hardware- bzw. Softwareschlüsselspeichers, + so wie er im entsprechenden Konfigurationselement cfg:SignatureCreation/cfg:KeyModules/cfg:HardwareKeyModule bzw. cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule erfasst + wurde.
    2. +
    3. Der zweite Teil enthält nach dem ersten Semikolon den Namen des Ausstellers des Zertifikats + für den privaten Schlüssel, so wie er in dsig:X509IssuerName benötigt + wird.
    4. +
    5. Der dritte Teil enthält nach dem zweiten Semikolon die Seriennummer des Zertifikats für + den privaten Schlüssel, so wie er in dsig:X509SerialNumber benötigt wird.
    6. +
    +
  4. +
  5. Erfassen Sie nun mit Hilfe der neu gewonnenen Informationen die Schlüsselgruppen, die in + MOA SS zur Verfügung stehen sollen.
  6. +
+

Wenn Ihnen für einen privaten Schlüssel, den Sie in eine Schlüsselgruppe aufnehmen + wollen, das Zertifikat bekannt ist und es in Form einer DER-kodierten Datei vorliegt, können + Sie alternativ das Script certtool aus dem Verzeichnis tools im MOA-Installationsverzeichnis + verwenden, um zu den Werten für dsig:X509IssuerName und dsig:X509SerialNumber zu + kommen:

+
certtool -info <certfilename>

<certfilename> enthält den Namen der DER-kodierten Zertifikatsdatei, für + die die beiden Werte dsig:X509IssuerName und dsig:X509SerialNumber geliefert + werden sollen. Eine beispielhafte Ausgabe des Scripts sieht wie folgt aus:

+
SubjectDN (RFC2253): 
+  CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,O=Stabsstelle IKT-Strategie des Bundes,C=AT
+IssuerDN (RFC2253) : 
+  CN=Test CA - Signaturdienste,OU=Technik und Standards,O=Stabstelle IKT-Strategie des Bundes,C=AT
Serial Number : + 9

Die Werte für IssuerDN (RFC2253) sowie Serial Number entsprechen + den Werten für dsig:X509IssuerName und dsig:X509SerialNumber.

+

2.2.3 + Zuordnung von Schlüsselgruppen zu Kunden

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:KeyGroupMapping
Gebraucheinmal bis unbeschränkt oft
Erläuterung

Das Element cfg:SignatureCreation/cfg:KeyGroupMapping ordnet einem Kunden von MOA SS die ihm zur Verfügung + stehenden Schlüsselgruppen zu, indem das den Kunden repräsentierende SSL-Clientzertifikat + mit einer oder mehreren Schlüsselgruppen assoziiert wird.

+

Das Element hat folgenden Element-Inhalt:

+
    +
  • Element cfg:CustomerId: Dieses Element bezeichnet auf eindeutige + Weise das den Kunden repräsentierende SSL-Clientzertifikat. Der Aufbau des Elements enspricht + dem Aufbau des Elements cfg:KeyCertIssuerSerial in Abschnitt 2.2.2. + Um zu den Werten für Ausstellername und Seriennummer des SSL-Clientzertifikats zu kommen, + können Sie auch hier das Script certtool (vergleiche Abschnitt 2.2.2) + verwenden.
  • +
  • Element cfg:KeyGroupId: Dieses Element vom Typ xs:token kommt so oft + vor, wie Schlüsselgruppen + einem bestimmten SSL-Clientzertifikat zugeordnet werden sollen, mindestens jedoch einmal. Sein + Wert repräsentiert dem Identifikator der Schlüsselgruppe, so wie er in cfg:SignatureCreation/cfg:KeyGroup/cfg:Id festgelegt + wurde.
  • +
+

Bitte beachten Sie: Für maximal ein Konfigurationselement cfg:SignatureCreation/cfg:KeyGroupMapping kann cfg:CustomerId auch + weggelassen werden. Die darin enthaltenen Schlüsselgruppen stehen dann allen Kunden von MOA + SS gleichermaßen zur Verfügung.

+

2.2.4 Parameter + für XML-Signaturen

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:XMLDSig/cfg:CanonicalizationAlgorithm
GebrauchNull mal oder einmal
Erläuterung

Als Inhalt des Elements kann der Kanonisierungs-Algorithmus, der für das Erstellen von XML-Signaturen verwendet werden soll und in der Signatur als Inhalt von dsig:Signature/dsig:SignedInfo/dsig:CanonicalizationMethod aufscheint, spezifiziert werden. Folgende Werte dürfen verwendet werden:

+

+

http://www.w3.org/TR/2001/REC-xml-c14n-20010315 
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
http://www.w3.org/2001/10/xml-exc-c14n#
http://www.w3.org/2001/10/xml-exc-c14n#WithComments
+

Wird das Element nicht angegeben, wird folgender Wert als Default-Wert verwendet:

+
http://www.w3.org/TR/2001/REC-xml-c14n-20010315  

Für die genaue Bedeutung der Werte siehe die Spezifikation für XML-Signaturen.

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:XMLDSig/cfg:DigestMethodAlgorithm
GebrauchNull mal oder einmal
Erläuterung

Als Inhalt des Elements kann der Digest-Algorithmus, der für das Erstellen von XML-Signaturen verwendet werden soll und in der Signatur als Inhalt von dsig:Signature/dsig:SignedInfo/dsig:Reference/dsig:DigestMethod aufscheint, spezifiziert werden. Folgende Werte dürfen verwendet werden:

+

+

http://www.w3.org/2000/09/xmldsig#sha1
+
+

+

Wird das Element nicht angegeben, wird folgender Wert als Default-Wert verwendet:

+
http://www.w3.org/2000/09/xmldsig#sha1

Für die genaue Bedeutung der Werte siehe die Spezifikation für XML-Signaturen.

+

2.2.5 Profil für Transformationen

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:CreateTransformsInfoProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SS erlaubt die Hinterlegung von vordefinierten Profilen für Transformationen, die im Rahmen + einer XML-Signaturerstellung zur Anwendung kommen sollen. Im Request zur XML-Signaturerstellung + reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die gesamten Transformationen explizit + anzugeben.

+

cfg:CreateTransformsInfoProfile enthält für ein bestimmtes Datenobjekt + für eine zu erstellende XML-Signatur die auf dieses Datenobjekt anzuwendenden Transformationen, + sowie allenfalls für die Durchführung der Transformationen notwendige Ergänzungsobjekte + (z.B. einen zu importierenden Stylesheet für eine XSL-Transformation).

+

cfg:CreateTransformsInfoProfile weist folgende obligatorische Kindelemene auf:

+
    +
  • Element Id: Dieses Element vom Typ xs:token enthält einen frei + wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der XML-Konfigurationsdatei + eindeutig sein muss. Dieser Identifikator wird im Request zur Erstellung der XML-Signatur verwendet, + um das hinterlegte Profil zu referenzieren (vergleiche Element moa:CreateTransformsInfoProfileID).
  • +
  • Element Location: Dieses Element vom Typ xs:anyURI enthält + den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative + oder absolute URI. Eine relative URI + wird von MOA SS als File-URI relativ zum Lage jenes Verzeichnisses interpretiert, in dem die zentrale + Konfigurationsdatei gespeichert ist. Die XML-Datei muss als Wurzelelement das Element moa:CreateTransformsInfoProfile + enthalten.
  • +
+

2.2.6 Profil für Signaturumgebung

+ + + + + + + + + + + + + +
Namecfg:SignatureCreation/cfg:CreateSignatureEnvironmentProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SS erlaubt die Hinterlegung von vordefinierten Profilen für die Signaturumgebung, + die im Rahmen einer XML-Signaturerstellung zur Anwendung kommen soll. Im Request zur XML-Signaturerstellung + reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die Informationen zur Signaturumgebung + explizit anzugeben.

+

cfg:CreateSignatureEnvironmentProfile enthält für eine zu erstellende XML-Signatur, + die in ein bereits bestehendes XML-Dokument integriert werden soll, die Stelle, an der die XML-Signatur + eingefügt werden soll, sowie allenfalls für die Verarbeitung des bestehenden XML-Dokuments + notwendige Ergänzungsobjekte (z.B. ein XML-Schema für das validierende Parsen des bestehenden + XML-Dokuments).

+

cfg:CreateSignatureEnvironmentProfile weist folgende obligatorische Kindelemene + auf:

+
    +
  • Element Id: Dieses Element vom Typ xs:token enthält + einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der + XML-Konfigurationsdatei eindeutig sein muss. Dieser Identifikator wird im Request zur Erstellung + der XML-Signatur verwendet, um das hinterlegte Profil zu referenzieren (vergleiche Element moa:CreateSignatureEnvironmentProfileID).
  • +
  • Element Location: Dieses Element vom Typ xs:anyURI enthält + den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative + oder absolute URI. Eine relative URI wird von MOA SS als File-URI relativ zum Lage jenes Verzeichnisses + interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist. Die XML-Datei muss als + Wurzelelement das Element moa:CreateSignatureEnvironmentProfile enthalten.
  • +
+

2.3 + Parameter für MOA SP

+

2.3.1 + Zertifikatsvalidierung

+

2.3.1.1 + Konstruktion des Zertifikatspfads

+
2.3.1.1.1 Cachen von Zertifikaten
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction/cfg:AutoAddCertificates
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob Zertifikate, die in einer + zu prüfenden + Signatur enthalten sind bzw. bei der Zertifikatspfaderstellung durch Auswertung der Zertifikatserweiterung Authority + Information Access (siehe + auch Parameter cfg:UseAuthorityInfoAccess) aus dem Internet geladen werden, automatisch + in den lokalen Zertifikatsspeicher (siehe Abschnitt x.y.z) hinzugefügt werden sollen.

+

Zulässige Werte für diesen Parameter sind true oder false.

+
+
2.3.1.1.2 Auswertung + der Zertifikatserweiterung Authority Information Access +
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction/cfg:UseAuthorityInfoAccess
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob die Zertifikatserweiterung Authority + Information Access für die Zertifikatspfaderstellung verwendet werden soll. Wird der + Wert auf true gesetzt, dann setzt MOA auch den Parameter cfg:AutoAddCertificate automatisch + auf true und ignoriert den gegebenenfalls in der Konfigurationsdatei dafür gesetzten + Wert.

+

Zulässige Werte für diesen Parameter sind true oder false.

+
2.3.1.1.3 Lokalisierung + des Zertifikatsspeichers
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction/cfg:CertificateStore/cfg:DirectoryStore/cfg:Location
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:token gibt ein Verzeichnis im lokalen Dateisystem + an, das von MOA als lokaler Zertifikatsspeicher verwendet werden soll. +Zulässige Werte für diesen Parameter sind absolute oder relative Pfadangaben, wobei relative Pfadangaben +als relativ zum Pfad jenes Verzeichnisses interpretiert werden, in dem die zentrale + Konfigurationsdatei gespeichert ist. Beispiele für zulässige Werte lauten:

+
C:/Programme/apache/tomcat-4.1.30/conf/moa-spss/certstore
+
certstore
+

2.3.1.2 + Valdierung des Zertifikatspfads

+
2.3.1.2.1 Gültigkeitsmodell + für die Zertifikatskettenprüfung
+ + + + + + + + + + + + + +
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:PathValidation/cfg:ChainingMode
Gebrauchgenau einmal
Erläuterung

Dieses Element legt fest, ob MOA SP für die Prüfung der Gültigkeit + einer konstruierten Zertifikatskette das Kettenmodell aus ISIS-MTT oder das Schalenmodell aus dem PKIX + RFC 3280 verwenden soll. Es hat folgende Kindelemente:

+
    +
  • cfg:DefaultMode: Dieses obligatorische Element gibt das Default-Modell für die Prüfung + der Gültigkeit einer konstruierten Zertifikatskette an. Gültige Werte sind chaining (Kettenmodell) + oder pkix (Schalenmodell).
  • +
  • cfg:TrustAnchor: Dieses Element kann beliebig oft (auch gar nicht) verwendet + werden, um für bestimmte Vertrauensanker (vergleiche nächsten Parameter cfg:TrustProfile) + Ausnahmen vom Default-Modell vorzugeben. + Das Element weist folgende Kindelemente auf: +
      +
    • cfg:Identification: Dieses obligatorische Element identifiziert den Vertrauensanker, + für den ein bestimmtes Modell konfiguriert werden soll. Es entspricht vom Aufbau jenem + von cfg:KeyCertIssuerSerial in + Abschnitt 2.2.2. Um zu den Werten für + Ausstellername und Seriennummer des Vertrauensankers zu kommen, können Sie auch hier + das Script certtool (vergleiche Abschnitt 2.2.2) + verwenden.
    • +
    • cfg:Mode: Dieses obligatorische Element vom Typ xs:string gibt + jenes Modell an, das von MOA SP für die + Prüfung von konstruierten Zertifikatsketten zu verwenden ist, die im mittels cfg:Identification/dsig:X509IssuerName und cfg:Identification/dsig:X509SerialNumber angegebenen + Vertrauensanker münden. Gültige Werte sind chaining (Kettenmodell) + oder pkix (Schalenmodell).
    • +
    +
  • +
+
2.3.1.2.2 Vertrauensprofile
+ + + + + + + + + + + + + +
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:PathValidation/cfg:TrustProfile
Gebraucheinmal bis unbeschränkt oft (zumindest ein Vertrauensprofil muss vorhanden sein)
Erläuterung

Das Element cfg:TrustProfile wird dazu verwendet, um in MOA SP ein Vertrauensprofil + für die Signaturprüfung einzurichten. Ein Vertrauensprofil besteht aus einer Menge von Vertrauensankern + und einer optionalen Menge von explizit erlaubten Signatorzertifikaten.

+

Ein Vertrauensanker ist ein CA-Zertifikat, das explizit als vertrauenswürdig eingestuft wird. + MOA SP versucht bei der Konstruktion einer Zertifikatskette, einen Pfad vom Signatorzertifikat bis + hin zu einem der konfigurierten Vertrauensanker zu finden. Gelingt dies, wird auch das Signatorzertifikat + als vertrauenswürdig betrachtet, ansonsten nicht.

+

Wird neben der Menge von Vertrauensankern auch noch eine Menge von explizit erlaubten Signatorzertifikaten + angegeben, prüft MOA SP nicht nur, ob sich ein Pfad vom Signatorzertifikat zu einem konfigurierten + Vertrauensanker konstruieren lässt, sondern darüber hinaus auch noch, ob das Signatorzertifikat + aus der zu prüfenden Signatur in der Menge der explizit erlaubten Signatorzertifikate vorkommt. + Explizit erlaubte Signatorzertifikate sollten Sie dann konfigurieren, wenn nicht allen von einer + als Vertrauensanker konfigurierten CA ausgestellten Zertifikaten vertraut werden soll, sondern nur + ganz bestimmten Zertifikaten dieser CA.

+

In MOA SP können beliebig viele solcher Vertrauensprofile konfiguriert werden. Der Kunde von + MOA SP gibt im Request zur Signaturprüfung an, gegen welches Vertrauensprofil MOA SP die Zertifikatsprüfung + vornehmen soll.

+

Das Element cfg:TrustProfile weist folgende Kindelemente + auf:

+
    +
  • Id: Dieses obligatorische Element vom Typ xs:token enthält einen + frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der XML-Konfigurationsdatei + eindeutig sein muss. Dieser Identifikator wird im Request zur Signaturprüfung verwendet, um + das zu verwendende Vertrauensprofil auszuwählen.
  • +
  • Element TrustAnchorsLocation: Dieses obligatorische Element vom Typ xs:anyURI enthält + eine relative oder absolute URL, die ein Verzeichnis im lokalen Dateisystem referenziert. + Eine relative URL wird relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale + Konfigurationsdatei gespeichert ist. Eine absolute URL muss als Protokoll-Teil file verwenden. + Das referenzierte Verzeichnis muss eine oder mehrere DER-kodierte Zertifikatsdateien beinhalten. + Jede Zertifikatsdatei repräsentiert einen Vertrauensanker.
  • +
  • Element SignerCertsLocation: Dieses optionale Element vom Typ xs:anyURI enthält + eine relative oder absolute URL, die ein Verzeichnis im lokalen Dateisystem referenziert. Eine + relative URL wird relativ zum Pfad jenes Verzeichnisses interpretiert, in dem die zentrale Konfigurationsdatei + gespeichert ist. Eine absolute URL muss als Protokoll-Teil file verwenden. Das referenzierte + Verzeichnis muss eine oder mehrere DER-kodierte Zertifikatsdateien beinhalten. Jede Zertifikatsdatei + repräsentiert ein explizit erlaubtes Signatorzertifikat.
  • +
+

2.3.1.3 + Widerrufsprüfung

+
2.3.1.3.1 Aktivieren + der Widerrufsprüfung
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:EnableChecking
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob bei der Zertifikatsüberprüfung im Zuge einer Signaturprüfung auch der + Zertifikatsstatus jedes einzelnen Zertifikats des gebildeten Zertifikatspfads überprüft werden + soll.

+

Bitte beachten Sie: Die Widerrufsprüfung ist ein sehr wichtiger Schritt der + Zertifikatsüberprüfung und somit der Signaturprüfung. Eine Deaktivierung sollte nur + in begründeten Ausnahmefällen in Erwägung gezogen werden, z.B. für Testsituationen.

+

Zulässige Werte für diesen Parameter sind true oder false.

+
2.3.1.3.2 + Maximales Alter der Widerrufsinformation
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:MaxRevocationAge
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:integer gibt an, wie aktuell eine ggf. lokal + gespeicherte Widerrufsinformation sein muss, damit sie von MOA SP als gültig angesehen wird. Ist + die lokal gespeicherte Widerrufsinformation nicht aktuell genug, wird sie von MOA SP erneut aus dem + Internet geladen.

+

Dieser Parameter wird nur ausgewertet, wenn die Widerrufsprüfung aktiviert ist (siehe Parameter cfg:EnableChecking).

+

Zulässige Werte für diesen Parameter sind ganze Zahlen:

+
    +
  • Ein beliebiger negativer Wert bedeutet, dass eine Widerrufsinformation jedes Mal, wenn sie benötigt + wird, neu aus dem Internet geladen wird.
  • +
  • Der Wert 0 bedeutet, dass eine Widerrufsinformation dann neu geladen wird, wenn + das Datum im Feld nextUpdate der entsprechenden Widerrufsliste bereits überschritten + ist.
  • +
  • Ein positiver Wert gibt gibt die Zeitspanne in Millisekunden an, nach der eine ggf. vorhandene + lokale Widerrufsinformation spätestens durch erneutes Laden aus dem Internet aktualisiert + wird.
  • +
+
2.3.1.3.3 + Reihenfolge der Widerrufsdienste
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:ServiceOrder
GebrauchNull mal oder einmal
Erläuterung

Dieses Element gibt an, in welcher Reihenfolge MOA SP die Widerrufsdienste für die Prüfung des + Widerrufs für ein Zertifikat kontaktieren soll, wenn für das Zertifikat mehrere unterschiedliche Widerrufsdienste + (CRL, OCSP) verfügbar sind. Das Element weist folgendes Kindelement auf:

+
    +
  • cfg:Service: Dieses Element vom Typ xs:token muss genau zwei mal vorkommen. Gütlige Werte für den + Textinhalt des Elements sind OCSP und CRL. Damit kann entweder die Reihenfolge (CRL, OCSP) oder (OCSP, + CRL) festgelegt werden.
  • +

Wird das Element nicht angegeben, so lautet die von MOA SP dann verwendete Default-Reihenfolge (CRL, + OCSP).

+
2.3.1.3.4 + Archivierung von Widerrufsinformationen
+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving/cfg:EnableArchiving
Gebrauchgenau einmal
Erläuterung

Der Inhalt dieses Elements vom Typ xs:boolean gibt an, ob mittlerweile ungültig + gewordene (i.e. historische) CRL-Widerrufsinformationen von MOA SP archiviert werden soll.

+

Wird dieser + Parameter auf den Wert true gesetzt, muss auch der Parameter cfg:Archive (siehe + unten) angegeben werden. Zulässige Werte für diesen Parameter sind true oder false.

+ + + + + + + + + + + + + + +
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving/cfg:ArchiveDuration
GebrauchNull mal oder einmal
Erläuterung

Dieses Element vom Typ xs:nonNegativeInteger gibt (in Tagen) an, wie lange Widerrufsinformationen + von MOA SP archiviert werden müssen. Das Element wird von MOA SP nur dann ausgewertet, wenn der + Konfigurationsparameter cfg:EnableArchiving auf + true gesetzt ist.

+

Wird das Element nicht angegeben, so verwendet MOA SP den Default-Wert von 365 Tagen.

+ + + + + + + + + + + + + +
Name cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving/cfg:Archive
GebrauchNull mal oder einmal
Erläuterung

Dieses Element gibt an, welches Archiv MOA SP zur Archivierung von mittlerweile ungültig + gewordene (i.e. historische) CRL-Widerrufsinformationen verwenden soll, falls der Konfigurationsparameter cfg:EnableArchiving auf + true gesetzt ist. Es muss angegeben werden, wenn der + Konfigurationsparameter cfg:EnableArchiving auf true gesetzt ist. Das Element weist folgendes + Kindelement auf:

+
    +
  • cfg:DatabaseArchive: Dieses obligatorische Element dient zur Angabe der notwendigen + Informationen für die Benutzung eines datenbankbasierten CRL-Archivs durch MOA SP. Das Datenbankarchiv + ist die einzige derzeit unterstützte Archivform. Das Element weist folgende Kindelemente auf: +
      +
    • cfg:JDBCURL: Dieses obligatorische Element vom Typ xs:anyURI gibt + die JDBC-URL zu jener Datenbank an, in der MOA historische Widerrufsinformationen archivieren + soll. Der genaue Aufbau der JDBC-URL ist abhängig von der verwendeten Datenbank. Im Fall von + PostgreSQL kann folgende URL verwendet werden: +
      jdbc:postgresql://<host>/<moadb>?user=<moauser>&amp;password=<moapassword>
      +

      Die Platzhalter <host>, <moadb>, <moauser> und <moapassword> müssen + dabei an die tatsächlich verwendete Datenbank angepasst werden.

      +

      Bitte beachten Sie: Die Kodierung des Zeichens "&" als "&amp;" ist + erforderlich, da es andernfalls zu einem Validierungsfehler beim Parsen der XML-Konfigurationsdatei + durch MOA kommen würde.

      +

      Bitte beachten Sie: MOA SP legt eigenständig eine passende Tabelle in der angegebenen + Datenbank an und befüllt diese dann in weiterer Folge. Der in der JDBC-URL angegebene Benutzer + muss mit den dazu passenden Rechten ausgestattet sein.

      +
    • +
    • cfg:JDBCDriverClassName: Dieses obligatorische Element vom Typ xs:token gibt den + vollständig + qualifizierten Java-Klassennamen des JDBC-Treibers an, der von MOA SP zur Ansprache der für + die CRL-Archivierung zu verwendenden Datenbank benützt werden soll.

      +

      Bitte beachten Sie: Informationen zum Anlegen einer Datenbank in postgreSQL finden Sie in Abschnitt + 2.2.2.1 des Installationshandbuchs.

      +
    • +
    +
  • +
+
2.3.1.3.5 + Manuelle Konfiguration von Verteilungspunkten für Widerrufsinformationen
+ + + + + + + + + + + + + +
Namecfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:DistributionPoint
GebrauchNull mal bis unbeschränkt oft
Erläuterung

Das Element cfg:CRLDistributionPoint kann dazu verwendet werden, manuelle + Verteilungspunkte für Widerrufsinformationen einer bestimmten CA zu konfigurieren.

+

Dies macht für veraltete Zertifikate Sinn, die nicht den aktuellen Vorgaben aus dem PKIX RFC 3280 entsprechen und im Zertifikat selbst keine Zertifikatserweiterung mit einem solchen Verteilungspunkt enthalten.

+

Weiters kann diese manuelle Konfiguration verwendet werden, wenn die in einem Zertifikat enthaltenen Verteilungspunkte für eine bestimmte CA durch einen manuellen Eintrag überschrieben werden soll (etwa weil die im Zertifikat enthaltenen Verteilungspunkte in Form von ldap-URLs angegeben sind, MOA SP aber der Zugriff auf ldap-URLs per Firewall-Einstellungen untersagt ist; dann könnte man stattdessen manuell eine (lokale) http-URL als Verteilungspunkt angeben, die von MOA SP dann aufgelöst werden kann).

+

Das Element weist folgende Kind-Elemente auf:

+
    +
  • Element cfg:CAIssuerDN: Dieses Element enthält als Textinhalt vom Typ xs:string den + Namen jener CA, die das Zertifikat ausgestellt hat, dessen Widerruf mit Hilfe des zu konfigurierenden + Verteilungspunktes geprüft werden soll. Um zu diesem Wert zu kommen, können Sie auch + hier das Script certtool (vergleiche Abschnitt 2.2.2) + verwenden, in dem Sie es für das Zertifikat anwenden, dessen Widerruf mit Hilfe des zu konfigurierenden + Verteilungspunktes geprüft werden soll.
  • +
  • Element cfg:CRLDP: Dieses Element verweist auf einen Verteilungspunkt, an dem eine + Widerrufsliste abgeholt werden kann. Es weist folgende Kind-Elemente auf: +
      +
    • Element cfg:Location: Der Wert dieses obligatorischen Elements vom Typ xs:anyURI enthält + die URL für den zu konfigurierenden Verteilungspunkt. Es werden die Protokolle HTTP, HTTPS + und LDAP unterstützt.
    • +
    • Element cfg:ReasonCode: Dieses Element vom Typ xs:token kann + null mal bis unbeschränkt + oft vorkommen und enthält + jeweils einen laut PKIX RFC 3280 möglichen Grund eines Widerrufs, + für + welche die über den zu konfigurierenden Verteilungspunkt zu beziehende Widerrufsliste + ausgestellt ist. Gültige Gründe sind unused, keyCompromise, cACompromise, affiliationChanged, superseded, cessationOfOperation, certificateHold, privilegeWithdrawn und aACompromise. + Wird eine Widerrufsliste für mehrere Gründe ausgestellt, muss also das Element cfg:ReasonCode mehrmals + angegeben werden. Wird das Element null mal angegeben, gilt der Verteilungspunkt für alle möglichen + Widerrufsgründe.
    • +
    +
  • +
  • Element cfg:OCSPDP: Dieses Element verweist auf einen Verteilungspunkt, an dem die + Widerrufsinformation von einem OCSP-Responder bezogen werden kann. Es weist folgendes Kind-Element + auf: +
      +
    • +
    + Element cfg:Location: Der Wert dieses obligatorischen Elements vom Typ xs:anyURI enthält + die URL für den zu konfigurierenden Verteilungspunkt. Es werden die Protokolle HTTP, HTTPS und + LDAP unterstützt.
  • +
+

Hinweis: Die Elemente cfg:CRLDP bzw. cfg:OSCPDP können beliebig oft als Kinder von cfg:CRLDistributionPoint angegeben + werden. Die Reihenfolge spielt dabei keine Rolle. Jedenfalls muss aber eines dieser beiden Elemente + angegeben werden.

+ +

2.3.2 Profil für Transformationen

+ + + + + + + + + + + + + +
Namecfg:SignatureVerification/cfg:VerifyTransformsInfoProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SP erlaubt die Hinterlegung eines vordefinierten Profils für eine erlaubte Transformationsfolge, + deren Einhaltung im Rahmen einer XML-Signaturprüfung kontrolliert wird. Im Request + zur XML-Signaturprüfung reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die + gesamten Transformationen explizit anzugeben.

+

cfg:VerifyTransformsInfoProfile enthält für ein bestimmtes Datenobjekt für + eine zu prüfende XML-Signatur eine + für dieses Datenobjekt erlaubte Transformationsfolge, bestehend aus den anzuwendenden Transformationen, + sowie allenfalls für die Durchführung der Transformationen erlaubte implizite Transformationsparameter + (z.B. einen zu importierenden Stylesheet für eine XSL-Transformation).

+

cfg:VerifyTransformsInfoProfile weist folgende obligatorische Kindelemene + auf:

+
    +
  • Element Id: Dieses Element vom Typ xs:token enthält + einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der + XML-Konfigurationsdatei eindeutig sein muss. Dieser Identifikator wird im Request zur Prüfung + der XML-Signatur verwendet, um das hinterlegte Profil zu referenzieren (vergleiche Element moa:VerifyTransformsInfoProfileID).
  • +
  • Element Location: Dieses Element vom Typ xs:anyURI enthält + den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative + oder absolute URI. Eine relative URI wird von MOA SP als File-URI relativ zum Lage jenes Verzeichnisses + interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist. Die XML-Datei muss als + Wurzelelement das Element moa:VerifyTransformsInfoProfile enthalten.
  • +
+

2.3.3 Profil für Ergänzungsobjekte

+ + + + + + + + + + + + + +
Namecfg:SignatureVerification/cfg:SupplementProfile
GebrauchNull mal bis unbeschränkt oft
Erläuterung

MOA SS erlaubt die Hinterlegung eines vordefinierten Profils für ein Ergänzungsobjekt, + das im Rahmen einer XML-Signaturprüfung verwendet werden soll. Im Request zur XML-Signaturprüfung reicht es dann aus, auf dieses Profil zu referenzieren, anstatt die Informationen zur Signaturumgebung + explizit anzugeben.

+

cfg:SupplementProfile enthält für ein Datenobjekt in der zu prüfenden + XML-Signatur ein allenfalls für die Durchführung der vorgegebenen Transformationen notwendiges + Ergänzungsobjekt (z.B. einen zu importierenden Stylesheet für eine XSL-Transformation).

+

cfg:SupplementProfile weist folgende obligatorische Kindelemene auf:

+
    +
  • Element Id: Dieses Element vom Typ xs:token enthält + einen frei wählbaren Identifikator für dieses Konfigurationselement, der innerhalb der + XML-Konfigurationsdatei eindeutig sein muss. Dieser Identifikator wird im Request zur Prüfung + der XML-Signatur verwendet, um das hinterlegte Profil zu referenzieren (vergleiche Element moa:SupplementProfileID).
  • +
  • Element Location: Dieses Element vom Typ xs:anyURI enthält + den Namen der XML-Datei, die das hinterlegte Profil beinhaltet. Der Wert enthält eine relative + oder absolute URI. Eine relative URI wird von MOA SP als File-URI relativ zum Lage jenes Verzeichnisses + interpretiert, in dem die zentrale Konfigurationsdatei gespeichert ist. Die XML-Datei muss als + Wurzelelement das Element moa:SupplementProfile enthalten.
  • +
+

3 Beispielkonfigurationen

+

3.1 Minimale Konfiguration für MOA SS

+

Nachfolgend finden Sie eine zentrale Konfigurationsdatei mit den minimal notwendigen Einträgen für + den alleinigen Betrieb von MOA SS. Darin sind als Kinder des Wurzelelements cfg:MOAConfiguration folgende + Konfigurationselemente enthalten:

+
    +
  • Ein Software-Schlüsselspeicher (cfg:SignatureCreation/cfg:KeyModules/cfg:SoftwareKeyModule);
  • +
  • Eine Schlüsselgruppe (cfg:SignatureCreation/cfg:KeyGroup);
  • +
  • Eine Zuordnung dieser Schlüsselgruppe für einen bestimmten Kunden (cfg:SignatureCreation/cfg:KeyGroupMapping).
  • +
+

Minimale Konfiguration für MOA SS

+

3.2 Minimale Konfiguration für MOA SP

+

Nachfolgend finden Sie eine zentrale Konfigurationsdatei mit den minimal notwendigen Einträgen für + den alleinigen Betrieb von MOA SP. Darin sind als Kinder des Wurzelelements cfg:MOAConfiguration folgende + Konfigurationselemente enthalten:

+
    +
  • Einstellungen betreffend die Konstruktion des Zertifikatspfades (cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathConstruction);
  • +
  • Einstellungen betreffend die Validierung des Zertifikatspfades (cfg:SignatureVerification/cfg:CertificateValidation/cfg:PathValidation), + unter anderem ein Vertrauensprofil (cfg:TrustProfile);
  • +
  • Einstellungen betreffend die Widerrufsprüfung von Zertifikaten des Zertifikatspfades (cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking) .
  • +
+

Minimale Konfiguration für MOA SP

+

3.3 Typische Konfiguration für MOA SP/SS

+

Nachfolgend finden Sie eine typische zentrale Konfigurationsdatei mit Einträgen für den kombinierten Betrieb von MOA SP und SS. Diese Datei wird auch als Konfiguration von MOA SP und SS verwendet, die für das Ausführen der Beispiele des Anwenderhandbuchs notwendig ist.

+

Typische Konfiguration für MOA SP/SS

+

 

+ + diff --git a/spss/handbook/handbook/faq/faq.html b/spss/handbook/handbook/faq/faq.html new file mode 100644 index 000000000..74f26e70a --- /dev/null +++ b/spss/handbook/handbook/faq/faq.html @@ -0,0 +1,126 @@ + + + + + MOA SS und SP - FAQ + + + + + + + + + +
Logo BKAOpen Source
+ für das E-Government
Logo MOA
+
+

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

+

FAQ

+
+

Inhalt

+
    +
  1. +

    Allgemeines

    +
  2. +
  3. +

    Übersicht der Fragen

    +
  4. +
  5. +

    Antworten

    +
  6. +
+
+

1 Allgemeines

+

Dieses Dokument enthält eine Reihe von häufig gestellten Fragen zu Installation, Konfiguration und Verwendung von MOA Serversignatur (SS) und Signaturprüfung (SP).

+

2 Übersicht der Fragen

+

Installation

+
    +
  1. Beim Starten von MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: iaik.asn1.structures.Name. Was kann der Fehler sein? [Zur Antwort]
  2. +
  3. Ich möchte MOA SS/SP in einer Umgebung betreiben, die einen Internet-Zugang nur über einen Proxy erlaubt. Funktioniert das? [Zur Antwort]
  4. +
+

Konfiguration

+
    +
  1. Ich möchte gerne die CRL-Archivierung von MOA verwenden, möchte aber eine andere als die in der Konfiguration erwähnte postgreSQL-Datenbank verwenden. Geht das? [Zur Antwort]
  2. +
  3. Ich möchte ein Zertifikat (z.B. einer Zwischen-Zertifizierungsstelle) manuell in den internen Zertifikatsspeicher von MOA SP importieren. Wie funktioniert das? [Zur Antwort]
  4. +
  5. Meine bestehende Konfigurationsdatei funktioniert mit MOA SP/SS 1.3 oder höher nicht mehr. Was ist passiert? + [Zur Antwort]
  6. +
+

Verwendung

+
    +
  1. Bei der Prüfung einer Signatur liefert die Prüfung des Zertifikatsstatus den Code 1. Was kann der Fehler sein? [Zur Antwort]
  2. +
+

3 Antworten

+

Installation

+
    +
  1. Beim Starten von MOA SPSS tritt folgende Exception auf: java.lang.ClassCastException: iaik.asn1.structures.Name. Was kann der Fehler sein?
    +

    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ü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ützt, wird PKCS7.getCertificate() verwendet, und es kommt zu einer ClassCastException.

    +

    Wird MOA ü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ö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üssen die Einträge

    +
     security.provider.1=sun.security.provider.Sun
    +   security.provider.2=com.sun.rsajca.Provider 
    +

    durch folgenden Eintrag ergänzt werden:

    +
    security.provider.3=iaik.security.provider.IAIK
    +
  2. +
  3. +
    Ich möchte MOA SS/SP in einer Umgebung betreiben, die einen Internet-Zugang nur über einen Proxy erlaubt. Funktioniert das?
    +

    Ja, zumindest für Zugriffe über HTTP. Sie müssen dazu die nachfolgenden JAVA System-Properties setzen:

    +
    http.proxyHost=<proxyhost>
    +http.proxyPort=<proxyport>
    +http.nonProxyHosts="<exceptionhosts>"
    +

    <proxyhost> gibt den Namen oder die IP-Adresse des Proxies an.

    +

    <proxyport> gibt den Port des Proxies an.

    +

    <exceptionhosts> enthält eine Liste von Rechnernamen, die nicht über den Proxy laufen sollen. Jedenfalls müssen sie hier localhost angeben. Einzelne Namen sind durch eine Pipe (|) zu trennen. Bitte beachten Sie, dass IP-Addressen nicht angegeben werden dürfen, sowie die verpflichtend zu verwendenen Anführungszeichen.
    +

    +
  4. +
+

Konfiguration

+
    +
  1. Ich möchte gerne die CRL-Archivierung von MOA verwenden, möchte aber eine andere als die in der Konfiguration erwähnte postgreSQL-Datenbank verwenden. Geht das?
    +

    Ja, das ist möglich. Wenn Sie eine mySQL-Datenbank verwenden möchten, sind folgende Maßnahmen zu treffen:

    +
      +
    • Laden Sie den mySQL-JDBC-Connector herunter und fügen Sie das im Download enthaltene jar-File mysql-connector-java-3.x.x-stable-bin.jar zum Klassenpfad für MOA SPSS hinzu.
    • +
    • Geben Sie im MOA-Konfigurationsfile mit Hilfe des generischen Konfigurationsparameters DataBaseArchiveParameter.JDBCUrl eine gültige JDBC-URL zu Ihrer mySQL-Datenbank angeben. Hinweise zum Format dieser URL für mySQL finden Sie hier.
    • +
    +

    Wenn Sie eine andere Datenbank verwenden möchten, beispielsweise Oracle, gehen Sie sinngemäß wie oben vor und setzen zusätzlich noch folgenden Schritt:

    +
      +
    • Geben Sie im MOA-Konfigurationsfile mit Hilfe des generischen Konfigurationsparameters DataBaseArchiveParameter.JDBCDriverClass den vollständig qualifizierten Klassennamen des JDBC-Treibers an, der die Verbindung zu Ihrer Datenbank herstellt.
    • +
    +
  2. +
  3. +
    Ich möchte ein Zertifikat (z.B. einer Zwischen-Zertifizierungsstelle) manuell in den internen Zertifikatsspeicher von MOA SP importieren. Wie funktioniert das?
    +

    Sie können für diesen Zweck ein mit MOA SP/SS mitgeliefertes Kommandozeilen-Tool verwenden, das Sie im Verzeichnis $MOA_SPSS_INST/tools finden. Wechseln Sie zu diesem Verzeichnis und rufen Sie die Script-Datei certtools.bat bzw. certtools.sh (je nach Betriebssystem) auf. Achten Sie darauf, dass die Umgebungsvariable $JAVA_HOME korrekt gesetzt ist. Die Syntax für dieses Tool lautet:

    +
    certtool -add <cert> <store>
    +

    <cert> bezeichnet dabei Pfad und Dateiname des zu importierenden X509-Zertifikats. Das Zertifikat muss DER-kodiert vorliegen.

    +

    <store> bezeichnet den Pfad des internen Zertifikatsspeichers von MOA SP. Wenn Sie nach der Installationsanleitung vorgegangen sind, lautet dieser Pfad $CATALINA_HOME/conf/moa-spss/certstore.

    +
  4. +
  5. +
    + Meine bestehende Konfigurationsdatei + funktioniert mit MOA SP/SS 1.3 oder höher nicht mehr. Was ist passiert?
    +

    Mit dem Wechsel auf Version 1.3 verwendet MOA SP/SS ein neues, übersichtlicheres Format für die + XML-Konfigurationsdatei.

    +

    Wenn Sie von einer ä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ügung, mit + dem Sie Ihre Konfigurationsdatei vom bisherigen auf das neue Format migrieren können.

    +

    Informationen zur Verwendung des Werkzeugs finden Sie in Abschnitt 1.2.1 des Konfigurationshandbuchs.

    +
  6. +
+

Verwendung

+
    +
  1. Bei der Prüfung einer Signatur liefert die Prüfung des Zertifikatsstatus den Code 1. Was kann der Fehler sein?
    +

    Dieser Fehlercode bedeutet: Es konnte keine formal korrekte Zertifikatskette vom Signatorzertifikat zu einem vertrauenswürdigen Wurzelzertifikat konstruiert werden. Das kann grundsätzlich eine der beiden folgenden Ursachen haben:

    +
      +
    • Keines der Zertifikate in der Kette vom Signatorzertifikat bis zu einem selbstsignierten Wurzelzertifikat ist im anzuwendenden TrustProfile enthalten.
    • +
    • Die Zertifikatskette konnte nicht bis zu einem im anzuwendenden TrustProfile enthaltenen vertrauenswürdigen Zertifikat gebildet werden.
    • +
    +

    Prüfen Sie also zunächst, ob sie im anzuwendenden TrustProfile ein passendes vertrauenswü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.

    +

    Wenn diese Prüfung das Problem nicht behebt, gelingt des MOA SP vermutlich nicht, ein für die Bildung der Zertifikatskette notwendiges Zertifikat zu lokalisieren. Mögliche Gründe sowie Lösungsmöglichkeiten dafür sind:

    +
      +
    • Das aktuell letzte Zertifikat in der bereits gebildeten Zertifikatskette besitzt zwar die Zertifikatserweiterung AuthorityInformationAccess mit einem Hinweis auf das nächste Zertifikat der zu bildenden Kette, das darin per URL referenzierte Zertifikat kann jedoch nicht geladen werden. Prüfen Sie daher zunächst, ob MOA SP/SS per HTTP oder LDAP Zugriffe nach außen tätigen darf.
    • +
    • Das aktuell letzte Zertifikat in der bereits gebildeten Zertifikatskette besitzt keine Zertifikatserweiterung AuthorityInformationAccess mit einem Hinweis auf das nächste Zertifikat der zu bildenden Kette, und auch im internen Zertifikatsspeicher von MOA SP ist das nächste Zertifikat nicht enthalten. Ist Ihnen das nächste Zertifikat bekannt (z.B. durch manuellen Download von der Webseite des Zertifizierungsdiensteanbieters), können Sie es manuell in den internen Zertifikatsspeicher importieren. Eine Anleitung dazu finden Sie hier.
      +
    • +
    +
  2. +
+ + diff --git a/spss/handbook/handbook/index.html b/spss/handbook/handbook/index.html new file mode 100644 index 000000000..4fa5728f6 --- /dev/null +++ b/spss/handbook/handbook/index.html @@ -0,0 +1,34 @@ + + + + + MOA SS und SP - Übersicht + + + + + + + + + +
Logo BKAOpen Source
+ für das E-Government
Logo MOA
+
+

MOA: Serversignatur (SS) und Signaturprüfung (SP)

+

Übersicht zur Dokumentation der Version 1.2

+
+
+
Einführung
+
Übersicht über die beiden Module.
+
Installation
+
Detaillierte Anleitung für die Installation.
+
Konfiguration
+
Erläuterung aller Konfigurationsoptionen sowie Leitfaden für häufige Konfigurationsaufgaben.
+
Anwendung
+
Beispiele zur Verwendung der beiden Module.
+
FAQ
+
Häufig gestellte Fragen zu Installation, Konfiguration und Anwendung.
+
+ + diff --git a/spss/handbook/handbook/install/install.html b/spss/handbook/handbook/install/install.html new file mode 100644 index 000000000..eb287ee8a --- /dev/null +++ b/spss/handbook/handbook/install/install.html @@ -0,0 +1,486 @@ + + + + + MOA SS und SP - Installation + + + + + + + + + +
Logo BKAOpen Source
+ für das E-Government
Logo MOA
+
+

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

+

Installation

+
+

Inhalt

+
    +
  1. +

    Übersicht

    +
  2. +
  3. +

    Webservice

    +
      +
    1. Basisinstallation +
        +
      1. Einführung
      2. +
      3. Installation +
          +
        1. Vorbereitung
        2. +
        3. Konfiguration von Apache Tomcat +
            +
          1. Konfiguration des HTTP Connectors
          2. +
          3. Konfiguration des HTTPS Connectors
          4. +
          5. Einrichten des MOA SP/SS Administrators
          6. +
          +
        4. +
        5. Einsatz des MOA SP/SS Webservices in Tomcat
        6. +
        7. Starten und Stoppen von Tomcat +
            +
          1. Unter Windows
          2. +
          3. Unter Unix
          4. +
          5. Prüfen des erfolgreichen Starts
          6. +
          +
        8. +
        9. Änderung der Konfiguration im laufenden Betrieb
        10. +
        +
      4. +
      5. Logging +
          +
        1. Format der Log-Meldungen
        2. +
        3. Wichtige Log-Meldungen
        4. +
        +
      6. +
      +
    2. +
    3. Erweiterungsmöglichkeiten
        +
      1. Vorgeschalteter Webserver
          +
        1. Microsoft Internet Information Server (MS IIS)
            +
          1. Konfiguration von Jakarta mod_jk im MS IIS
          2. +
          3. Konfiguration von Tomcat
          4. +
          5. Konfiguration von SSL
          6. +
          +
        2. +
        3. Apache
            +
          1. Konfiguration von Jakarta mod_jk im Apache
          2. +
          3. Konfiguration von Tomcat
          4. +
          5. Konfiguration von SSL mit mod_SSL
          6. +
          +
        4. +
        +
      2. +
      3. Datenbank
          +
        1. PostgreSQL
            +
          1. Anlegen eines Benutzers und einer Datenbank für MOA SP/SS
          2. +
          3. Archivierung von CRLs
          4. +
          5. Logging
          6. +
          +
        2. +
        3. Andere Datenbanken
        4. +
        +
      4. +
      +
    4. +
    +
  4. Klassenbibliothek +
      +
    1. Basisinstallation +
        +
      1. Einführung
      2. +
      3. Vorbereitung
      4. +
      5. Verwendung
      6. +
      7. Logging
      8. +
      +
    2. +
    3. Erweiterungsmöglichkeiten
    4. +
    +
  5. +
+
    +
  1. Referenzierte Software
  2. +
+
+

1 Übersicht

+

Die Module Signaturprüfung (SP) und Serversignatur (SS) sind als plattformunabhängige Module ausgelegt, die entweder als Webservice über HTTP bzw. HTTPS oder als Klassenbibliothek über ein API angesprochen werden können. Dieses Handbuch beschreibt die Installation der beiden Module als Webservice oder als Klassenbibliothek, sowie die Einrichtung der Systemumgebung.

+

2 Webservice

+

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öglichkeiten auf.

+

2.1 Basisinstallation

+

2.1.1 Einführung

+

Die Basisinstallation des Webservices stellt einerseits die minimalen Anforderungen für den Betrieb von MOA SP/SS als Webservices dar, andererseits dient sie als Ausgangspunkt für optionale Erweiterungsmöglichkeiten.

+

Folgende Software ist Voraussetzung für die Basisinstallation des Webservices:

+ +

In diesem Betriebs-Szenario wird das MOA SP/SS Webservice in Tomcat zum Einsatz gebracht. Tomcat fungiert gleichzeitig als HTTP- und HTTPS-Endpunkt für das MOA SP/SS Webservice. Beide Protokolle werden direkt in Tomcat konfiguriert. Das MOA SP/SS Webservice verwendet Log4j als Logging Toolkit.

+

2.1.2 Installation

+

2.1.2.1 Vorbereitung

+

Die folgenden Schritte dienen der Vorbereitung der Installation.

+
+
Installation von J2SE SDK
+
Installieren Sie J2SE 1.3.1 SDK oder J2SE 1.4.2 SDK oder J2SE 5.0 SDK in ein beliebiges Verzeichnis. Wir empfehlen die Installation von J2SE 5.0 SDK. Das Wurzelverzeichnis der J2SE SDK Installation wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
+
Installation von Apache Tomcat 4.1
+
Installieren Sie Apache Tomcat 4.1.18 oder höher in ein Verzeichnis, das keine Leerzeichen im Pfadnamen enthält. Wir empfehlen die Installation von Apache Tomcat 4.1.31. Verwenden Sie bitte die zu Ihrem J2SE SDK passende Distribution von Tomcat. Das Wurzelverzeichnis der Tomcat-Installation wird im weiteren Verlauf als $CATALINA_HOME bezeichnet.
+
Entpacken der MOA SP/SS Webservice Distribution
+
Entpacken Sie die Datei moa-spss-1.2.x.zip in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als $MOA_SPSS_INST bezeichnet.
+
Installation der Krypographiebibliotheken von SIC/IAIK
+
+

Die Installation der Kryptographiebibliotheken von SIC/IAIK ist abhängig vom eingesetzten J2SE SDK:

+
+
J2SE 1.3.1 SDK
+
Kopieren Sie alle Dateien aus dem Verzeichnis + + + $MOA_SPSS_INST/ext13 in das Verzeichnis $JAVA_HOME/jre/lib/ext.
+
J2SE 1.4.2 SDK oder JSE 5.0 SDK
+
Kopieren Sie alle Dateien aus dem Verzeichnis $MOA_SPSS_INST/ext14 in das Verzeichnis $JAVA_HOME/jre/lib/ext. Zusätzlich müssen Sie die Rechtedateien Ihres J2SE 1.4.2 SDK bzw. J2SE 5.0 SDK austauschen. Laden Sie dazu die Unlimited Strength + + + Jurisdiction Policy Files von der J2SE 1.4.2 SDK Downloadseite bzw. J2SE 5.0 SDK Downloadseite und folgen Sie der darin enthaltenen Installationsanweisung.
+
+
+
+

2.1.2.2 Konfiguration von Apache Tomcat

+

Die zentrale Konfigurations-Datei von Tomcat ist $CATALINA_HOME/conf/server.xml. Tomcat wird grundsätzlich mit einer funktionierenden Default-Konfiguration ausgeliefert, die jedoch einiges an Ballast enthält und viele Ports offen lässt.

+
2.1.2.2.1 Konfiguration des HTTP Connectors
+

Die Datei $MOA_SPSS_INST/tomcat/server.xml enthält eine minimale Tomcat-Konfiguration, die ausschließlich den Connector für HTTP auf Port 8080 freischaltet. Durch kopieren dieser Datei nach $CATALINA_HOME/conf/server.xml kann Tomcat mit dieser Konfiguration gestartet werden. Wir empfehlen diese Konfiguration nur für Fälle, in denen das MOA SP/SS Webservice in einer abgeschlossenen Netzwerkumgebung betrieben wird.

+
2.1.2.2.2 Konfiguration des HTTPS Connectors
+

Wird das MOA SP/SS Webservice in einer nicht abgeschlossenen Umgebung (z.B. Erreichbarkeit über das Internet) betrieben, ist die gegenseitige Identitätsfeststellung von Kunde und Webservice essentiell:

+
    +
  • Nutzt ein Kunde MOA SP, ist es für ihn wichtig, die Identität des Webservice eindeutig feststellen zu können, denn er vertraut dem Webservice ja die Prüfung einer elektronischen Signatur an.
  • +
  • Nutzt ein Kunde MOA SS, ist es für ihn wesentlich, dass nur er Zugriff auf die für ihn vom Webservice verwalteten privaten Schlüssel hat, um elektronische Signaturen zu erstellen. Das Webservice muss also die Identität des Kunden prüfen.
  • +
+

Beide Identitätsprüfungen können mit hoher Qualität vorgenommen werden, wenn die Erreichbarkeit des Webservice auf SSL mit Server- (für MOA SP) bzw. Client- und Serverauthentisierung (für MOA SS) eingeschränkt wird.

+

Für die dazu notwendige Konfiguration kann die im vorigen Abschnitt besprochene minimale Tomcat-Konfiguration als Ausgangspunkt verwendet werden: Zunächst ist der HTTP Connector abzuschalten (auszukommentieren). Anschließend ist der HTTPS Connector zu konfigurieren. Das Dokument Tomcat SSL Configuration HOW-TO gibt einen guten Überblick dazu. Grob zusammengefasst sind folgende Schritte durchzuführen:

+
    +
  • Erstellung eines Server-Keystores, der den privaten Schlüssel sowie das zugehörige Zertifikat des Webservices enthält, mit dem es sich bei Aufbau einer SSL-Verbindung gegenüber dem Kunden ausweist.sowie das dazugehörige ZertiServer-Zertifikat enthält. Sie können diesen Keystore z.B. mit keytool erstellen, einem Programm, das Ihrem J2SE SDK beiliegt.
  • +
  • Erstellung eines Client-Keystores, der die Zertifikate aller Kunden des Webservices enthält. Nur Kunden des Webservices, die sich beim Aufbau einer SSL-Verbindung gegenüber dem Webservice mit einem im Client-Keystore enthaltenen Zertifikat ausweisen, erhalten grundsätzlich Zugriff zu den Diensten des Webservices (für die Konfiguration, welcher Kunde welche Schlüssel von MOA SS verwenden darf, siehe Abschnitt 2.2.3 des Konfigurationshandbuchs). Auch dieser Keystore kann z.B. mit keytool erstellt werden. Dieser Keystore ist optional und braucht nur erstellt zu werden, wenn sich die Kunden gegenüber dem Webservice authentisieren müssen.
  • +
  • Konfiguration des HTTPS Connectors in $CATALINA_HOME/conf/server.xml.
  • +
+

Die Konfiguration des HTTPS Connectors kann entfallen, wenn Tomcat ein Webserver vorgeschaltet ist, und dieser die SSL-Kommunikation mit dem Kunden übernimmt (siehe Abschnitt 2.2.1).

+
2.1.2.2.3 Einrichten des MOA SP/SS Administrators
+

Das MOA SP/SS Webservice kann remote durch den Aufruf einer speziellen URL des Webservices dazu veranlasst werden, seine Konfiguration neu einzulesen (vergleiche Abschnitt 2.1.2.5). Der Zugriff auf diese URL ist durch eine Passwort-Abfrage geschützt, und kann nur von Tomcat-Benutzern aufgerufen werden, denen die Tomcat-Benutzer-Rolle moa-admin zugeordnet wurde.

+

Um diese Benutzer-Rolle und einen oder mehrere Benutzer einzurichten, müssen in der Datei $CATALINA_HOME/conf/tomcat-users.xml unter dem Element <tomcat-users> sinngemäß folgende Einträge hinzugefügt werden:

+

+

<role rolename="moa-admin"/> 
+<user username="moa-chief" password="openSesam" roles="moa-admin"/> 
+

Soll der Aufruf dieser URL niemandem ermöglicht werden, sind die oben beschriebenen Einträge einfach nicht vorzunehmen.

+ +

2.1.2.3 Einsatz des MOA SP/SS Webservices in Tomcat

+

Um das MOA SP/SS Webservice in Tomcat für den Einsatz vorzubereiten, sind folgende Schritte notwendig:

+
    +
  • Die Datei $MOA_SPSS_INST/moa-spss.war enthält das einsatzfertige MOA SP/SS Webarchiv und muss ins Verzeichnis $CATALINA_HOME/webapps kopiert werden. Dort wird sie beim ersten Start von Tomcat automatisch ins Verzeichnis $CATALINA_HOME/webapps/ moa-spss entpackt.
  • +
  • Die zentrale Konfigurationsdatei für MOA SP/SS und die zugehörigen Profil-Verzeichnisse müssen in ein beliebiges Verzeichnis im Dateisystem kopiert werden (z.B. $CATALINA_HOME/conf/moa-spss). Eine funktionsfähige Konfiguration, die als Ausgangspunkt für die Konfiguration des MOA SP/SS Webservices dienen kann, finden Sie hier.
  • +
  • Wird Tomcat unter J2SE 1.4.x SDK oder höher betrieben, müssen die Dateien xalan.jar, xercesImpl.jar und xmlParserAPIs.jar aus dem Verzeichnis $MOA_SPSS_INST/endorsed14 in das Tomcat-Verzeichnis $CATALINA_HOME/common/endorsed kopiert werden. Sind gleichnamige Dateien dort bereits vorhanden, müssen sie überschrieben werden. Die ggf. in diesem Verzeichnis vorhandene Datei xml-apis.jar muss gelöscht werden.
  • +
  • Folgende System Properties können gesetzt werden (wird beim Starten von Tomcat der Java Virtual Machine in der Umgebungsvariablen CATALINA_OPTS in der Form -D<name>=<wert> übergeben): +
      +
    • moa.spss.server.configuration: Pfad und Name der zentralen Konfigurationsdatei für MOA SP/SS. Eine beispielhafte Konfigurationsdatei finden Sie hier. Wird ein relativer Pfad angegeben, wird dieser relativ zum Startverzeichnis der Java Virtual Machine interpretiert. Ist diese System Property nicht gesetzt, wird automatisch eine im Webarchiv unter WEB-INF/conf enthaltene Default-Konfiguration herangezogen.
    • +
    • log4j.configuration: URL der Log4j Konfigurationsdatei. Eine beispielhafte Log4j-Konfiguration finden Sie hier. Wird eine relative URL angegeben, wird diese als File-URL relativ zum Startverzeichnis der Java Virtual Machine interpretiert. Ist diese System Property nicht gesetzt, wird automatisch eine im Webarchiv unter WEB-INF/classes enthaltene Default-Konfiguration herangezogen.
    • +
    • moa.node.id: Frei wählbarer Name des Rechner-Knotens, auf dem MOA SP/SS läuft. Der Name des Knotens wird bei Log-Ausgaben von MOA SP/SS angeführt und dient zur Unterscheidung mehrerer gleichzeitig betriebener MOA SP/SS Webservice-Instanzen.
    • +
    • javax.net.ssl.trustStore: Pfad und Dateiname des Truststores für vertrauenswürdige SSL Client-Zertifikate (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll). Ein relativer Pfad werden relativ zum Startverzeichnis der Java Virtual Machine interpretiert.
    • +
    • javax.net.ssl.trustStorePassword: Passwort für den Truststore (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll).
    • +
    • javax.net.ssl.trustStoreType: Truststore-Typ (optional; nur, wenn SSL Client-Authentisierung durchgeführt werden soll). Je nach verwendetem Keystore-Typ muss jks (Java Key Store) oder pkcs12 (PKCS#12-Datei) angegeben werden.
    • +
    +
  • +
+

2.1.2.4 Starten und Stoppen von Tomcat

+
2.1.2.4.1 Unter Windows
+
+

Das Verzeichnis $MOA_SPSS_INST/tomcat/win32 enthält Script-Dateien zum Starten und Stoppen von Tomcat. Vor der erstmaligen Verwendung der Scripts müssen in den ersten Zeilen die Umgebungsvariablen JAVA_HOME (Basisverzeichnis des eingesetzten J2SE SDK) und CATALINA_HOME (Basisverzeichnis der eingesetzten Tomcat-Installation) angepasst werden. Evtl. müssen Sie auch noch die in den Script-Dateien gesetzten, in Abschnitt 2.1.2.3 besprochenen System Properties anpassen.

+
+
2.1.2.4.2 Unter Unix
+

Zunächst müssen die in Abschnitt 2.1.2.3 besprochenen System Properties mit Hilfe der Umgebungsvariablen CATALINA_OPTS gesetzt sein. Die Datei $MOA_SPSS_INST/tomcat/unix/moa-env.sh enthält ein Beispiel dafür. Weiters müssen noch die Umgebungsvariablen JAVA_HOME (Basisverzeichnis des eingesetzten J2SE SDK) und CATALINA_HOME (Basisverzeichnis der eingesetzten Tomcat-Installation) angepasst werden.

+

Nun kann Tomcat aus seinem Basisverzeichnis mit

+
bin/catalina.sh start
+gestartet werden. Das Stoppen von Tomcat erfolgt analog mit +
bin/catalina.sh stop
+
2.1.2.4.3 Prüfen des erfolgreichen Starts
+
+

Ein erfolgreicher Start des MOA SP/SS Webservices ist an folgender Log-Meldung ersichtlich:
+

+
+
INFO | 18 10:09:45,155 | main | TID=startup NID=<null> MSG=MOA Konfiguration erfolgreich geladen
+
+

Bei leichten Fehlern in der Konfiguration geben WARN Log-Meldungen unmittelbar davor Aufschluss über fehlerhafte Konfigurations-Einträge. + Nach dem Starten von Tomcat steht das MOA SP/SS Webservice für die Server-Signatur und Signatur-Prüfung unter den Endpunkten

+
http://<host>:<port>/moa-spss/services/SignatureCreation
+
+

bzw. +

+
http://<host>:<port>/moa-spss/services/SignatureVerification
+
+

zur Verfügung. Die Verfügbarkeit des Services können Sie einfach überprüfen, indem Sie die Endpunkte mit einem Web-Browser aufgerufen; dies sollte nach erfolgreichem Start zur Anzeige einer Informationsseite führen.

+

Konnte das MOA SP/SS Webservice nicht ordnungsgemäß gestartet werden, führt das zu folgender Log-Meldung:

+
FATAL | 18 10:17:03,475 | main | TID=startup NID=<null> 
MSG=Fehler beim Lesen der MOA Konfiguration: das Service steht nicht zur Verfügung +
+In diesem Fall geben die WARN bzw. ERROR Log-Meldungen unmittelbar davor Aufschluss über den genaueren Grund. +

2.1.2.5 Änderung der Konfiguration im laufenden Betrieb

+

Sie können die Konfiguration für MOA SP/SS im laufenden Betrieb aktualisieren, in dem Sie mittels eines Web-Browsers folgende URL aufrufen:

+
 http://<host>:<port>/moa-spss/ConfigurationUpdate 
+

Damit dies funktioniert, muss in der Konfiguration von Tomcat ein spezieller Benutzer sowie eine spezielle Benutzerrolle eingerichtet werden (vergleiche Abschnitt 2.1.2.2.3).

+

2.1.3 Logging

+

Das MOA SP/SS Webservice verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Log4j bietet zahlreiche Konfigurationsmöglichkeiten, die ausführlich im Jakarta Log4j Handbuch beschrieben sind. Unter anderem gibt es die Möglichkeit, folgende Einstellungen vorzunehmen: +

    +
  • +

    Das verwendete Log-Level (DEBUG, INFO, WARN, ERROR, FATAL);

    +
  • +
  • +

    Name und maximale Größe der Log-Datei(en);

    +
  • +
  • +

    Das Aussehen der Log-Einträge.

    +
  • +
+

Das MOA SP/SS Webservice verwendet folgende Log-Hierarchien:

+
    +
  • +

    moa.spss.server für alle Log-Meldungen aus dem MOA/SPSS Webservice;

    +
  • +
  • +

    iaik.server für alle Log-Meldungen aus den SIC/IAIK Kryptographie-Modulen.

    +
  • +
+

Eine für MOA SP/SS passende Konfigurationsdatei für Log4j finden Sie hier. Wird diese Datei als Logging-Konfiguration verwendet, so werden alle Log-Meldungen sowohl in die Konsole, als auch in die Datei moa-spss.log geschrieben.

+

2.1.3.1 Format der Log-Meldungen

+

Anhand einer konkreten Log-Meldung wird das Format der MOA SP/SS Log-Meldungen erläutert:

+
INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=node1 
+  MSG=Starte neue Transaktion: TID=1049225059594-100, Service=SignatureVerification
+
+

Der Wert INFO besagt, dass die Log-Meldung im Log-Level INFO entstanden ist. Folgende Log-Levels existieren:

+
    +
  • +

    DEBUG: Log-Meldungen im Log-Level DEBUG geben Auskunft über die innere Arbeitsweise des Systems. Sie sind hauptsächlich für Entwickler interessant.

    +
  • +
  • +

    INFO: Diese Log-Meldungen geben Status-Informationen über den Ablauf des Webservices, wie z.B. über das Einlangen einer neuen Anfrage.

    +
  • +
  • +

    WARN: Bei der Ausführung einer Anfrage sind leichte Fehler aufgetreten. Der Ablauf des Webservices ist nicht weiter beeinträchtigt.

    +
  • +
  • +

    ERROR: Die Ausführung einer Anfrage musste abgebrochen werden. Das Webservice ist davon nicht beeinträchtigt.

    +
  • +
  • +

    FATAL: Es ist ein Fehler aufgetreten, der den weiteren Betrieb des Webservices nicht mehr erlaubt.

    +
  • +
+

Der nächste Wert 01 21:25:26,540 gibt den Zeitpunkt an, zu dem die Log-Meldung generiert wurde (in diesem Fall den 1. Tag im aktuellen Monat, sowie die genaue Uhrzeit).

+

Der Wert Thread-3 bezeichnet den Thread, von dem die Anfrage bearbeitet wird.

+

Der Wert von TID gibt die für jede Anfrage eindeutige Transaktions-ID an. Log-Meldungen, die bei der Abarbeitung dieser Anfrage geschrieben werden, enthalten alle einen Hinweis auf die entsprechende Transaktions-ID.

+

Der Wert von NID gibt den Rechner-Knoten an, auf dem das MOA SP/SS Webservice läuft (bei NID=<null> ist dieser Wert nicht konfiguriert, vergleiche Abschnitt 2.1.2.3).

+

Der Rest der Zeile einer Log-Meldung ist der eigentliche Text, mit dem das System bestimmte Informationen anzeigt. Im Fehlerfall ist häufig ein Java Stack-Trace angefügt, der eine genauere Ursachen-Forschung ermöglicht.

+

2.1.3.2 Wichtige Log-Meldungen

+

Neben den im Abschnitt 2.1.2.4.3 beschriebenen Log-Meldungen, die anzeigen, ob das Service ordnungsgemäß gestartet wurde, geben nachfolgenden Log-Meldungen Aufschluss über die Abarbeitung von Anfragen.

+

Die Entgegennahme einer Anfrage wird angezeigt durch: + +

+
INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=<null> 
+  MSG=Starte neue Transaktion: TID=1049225059594-100, Service=SignatureVerification
+INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=<null> 
+  MSG=Aufruf von Adresse=127.0.0.1
+INFO | 01 21:25:26,540 | Thread-3 | TID=1049225059594-100 NID=<null> 
+  MSG=Client-Zertifikat nicht verfügbar
+

Die dritte Log-Meldung besagt, dass für die Abarbeitung dieser Anfrage kein Client-Zertifikat verfügbar ist (entweder, weil die Anfrage über HTTP eingelangt ist, oder weil die SSL Client-Authentisierung nicht eingeschaltet ist). Bei erfolgreicher SSL Client-Authentisierung, gibt beispielsweise folgende Log-Meldung Informationen über das Client-Zertifikat aus: +

INFO | 12 13:58:08,772 | Thread-10 | TID=1045054687159-2 NID=<null> 
+  MSG=Client-Zertifikat: Subject=CN=Testuser, OU=MOA, O=BRZ, L=Vienna, ST=Vienna, C=AT, 
+  Serial=1.039.104.204, Issuer=CN=TestCA, OU=MOA, O=BRZ, L=Vienna, ST=Vienna, C=AT
+

Eine erfolgreich abgearbeitete Anfrage wird angezeigt durch: +

+
INFO | 01 21:25:53,168 | Thread-3 | TID=1049225059594-106 NID=<null> 
+  MSG=Anfrage erfolgreich abgearbeitet
+

Ein Fehler beim Abarbeiten der Anfrage wird angezeigt durch:

+
INFO | 01 21:25:27,642 | Thread-3 | TID=1049225059594-100 NID=<null> 
+  MSG=Fehler beim Abarbeiten der Anfrage
+
+

In diesem Fall gibt der mitgeloggte Stacktrace Auskunft über die Art des Fehlers. Der Aufrufer des MOA SP/SS Webservices bekommt einen Fehlercode sowie eine kurze Beschreibung des Fehlers als Antwort zurück.

+

Die Tatsächlich übertragenen Anfragen bzw. Antworten werden aus Effizienzgründen nur im Log-Level DEBUG angezeigt.

+
+

2.2 Erweiterungsmöglichkeiten

+

Ausgehend von der Basisinstallation können die optionalen Erweiterungen, die in den nachfolgenden Abschnitten beschrieben werden, unabhängig und in beliebiger Kombination aufgesetzt werden.

+

2.2.1 Vorgeschalteter Webserver

+

2.2.1.1 Microsoft Internet Information Server (MS IIS)

+

Den MOA SP/SS Webservices kann optional ein MS IIS vorgeschaltet sein. In diesem Fall übernimmt der MS IIS die HTTP- bzw. HTTPS-Kommunikation mit dem Aufrufer des Webservices. Die Kommunikation zwischen MS IIS und dem in Tomcat eingerichteten MOA SP/SS Webservice wird durch Jakarta mod_jk durchgeführt. Die angeführten Konfigurationsschritte gehen von einer MS IIS Standard-Installation aus.

+
2.2.1.1.1 Konfiguration von Jakarta mod_jk im MS IIS
+

Für die Kommunikation des MS IIS mit dem im Tomcat eingerichteten MOA SP/SS Webservice wird das ISAPI-Modul von Jakarta mod_jk im MS IIS installiert und konfiguriert. Eine detaillierte Installations- und Konfigurationsanleitung gibt das mod_jk IIS HowTo. Beispiele für workers.properties und uriworkermap.properties Dateien liegen im Verzeichnis $MOA_SPSS_INST/tomcat bei.

+
2.2.1.1.2 Konfiguration von Tomcat
+

Damit Tomcat die Aufrufe entgegennehmen kann, die von MS IIS mittels Jakarta mod_jk weiterleitet werden, muss in $CATALINA_HOME/conf/server.xml der AJP 1.3 Connector aktiviert werden. Im Gegenzug können die Konnektoren für HTTP und HTTPS deaktiviert werden. Das geschieht am einfachsten durch Ein- bzw. Auskommentieren der entsprechenden Connector Konfigurations-Elemente in dieser Datei. Die Datei $MOA_SPSS_INST/tomcat/server.mod_jk.xml enthält eine Konfiguration, die ausschließlich den Port für den AJP 1.3 Connector offen lässt.

+
2.2.1.1.3 Konfiguration von SSL
+

Die Dokumentation zum Einrichten von SSL auf dem MS IIS steht nach Installation des IIS unter http://localhost/iisHelp/ oder aber auch auf den Websiten vo Mircrosoft zur Verfügung.

+

2.2.1.2 Apache

+

Den MOA SP/SS Webservices kann ein Apache Webserver vorgeschaltet sein. Das Prinzip funktioniert wie bei MS IIS, auch hier wird Jakarta mod_jk für die Kommunikation zwischen Webserver und Tomcat eingesetzt. Die angeführten Konfigurationsschritte gehen von einer Standard-Installation des Apache Webservers aus und sind ident für die Versionen 1.3.x und 2.0.x.

+
2.2.1.2.1 Konfiguration von Jakarta mod_jk im Apache
+

Um das MOA-SPSS Webservice hinter einem Apache Webserver zu betreiben, ist die Konfiguration des Apache-Moduls mod_jk erforderlich. Eine detaillierte Installations- und Konfigurationsanleitung gibt das mod_jk Apache HowTo. Ein Beispiel für eine workers.properties Datei liegt im Verzeichnis $MOA_SPSS_INST/tomcat bei.

+

Um das MOA SP/SS Webservice dem Apache Webserver bekannt zu machen, sind zumindest folgende Einträge im globalen Kontext der Apache-Konfigurationsdatei notwendig:

+
LoadModule jk_module /usr/lib/apache/mod_jk.so
AddModule jk_module
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkWorkersFile conf/workers.properties
JkMount /moa-spss/* moaworker
+

Die Pfad- und Dateinamen können je nach existierender Apache Installation geringfügig variieren.

+
2.2.1.2.2 Konfiguration von Tomcat
+

Die Konfiguration von Tomcat ist analog zu Abschnitt 2.2.1.1.2 durchzuführen.

+
2.2.1.2.2 Konfiguration von SSL mit mod_SSL
+

Apache kann in Verbindung mit mod_SSL als SSL-Endpunkt für das MOA SP/SS Webservice fungieren. In diesem Fall entfä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 enthält die Online-Dokumentation von mod_SSL.

+

Bei der Verwendung von Client-Authentisierung muss darauf geachtet werden, dass mod_ssl die HTTP-Header mit den Informationen über das Client-Zertifikat exportiert. Dies wird durch Angabe der folgenden Option in der Apache-Konfiguration erreicht:

+
SSLOptions +ExportCertData +StdEnvVars
+

Je nach vorhandener SSL-Konfiguration des Apache Webservers kann diese Option im globalen Kontext, im Kontext des Virtual Hosts oder im Kontexts eines Verzeichnisses spezifiziert werden.

+

2.2.2 Datenbank

+

Die MOA SP/SS Module können eine Datenbank zum Archivieren von Certificate Revocation Lists (CRLs), sowie zum Abspeichern von Log-Meldungen verwenden. In beiden Fällen wird eine installierte und konfigurierte Datenbank vorausgesetzt.

+

2.2.2.1 PostgreSQL

+

Eine detaillierte Übersicht über die Installation und Konfiguration von PostgreSQL gibt die Online-Dokumentation.

+

Bitte beachten Sie: Eine Möglichkeit, PostgreSQL unter MS Windows zu installieren, besteht darin, Cygwin mit dem PostgreSQL-Package zu installieren. Alternative Installationsvarianten werden auf dieser Seite angeführt.

+
2.2.2.1.1 Anlegen eines Benutzers und einer Datenbank für MOA SP/SS
+

Damit die MOA SP/SS Module eine Verbindung zu PostgreSQL aufbauen kann, müssen der Name eines PostgreSQL-Benutzers und einer PostgreSQL-Datenbank bekannt sein. Sollten diese nicht vorhanden sein, kann mit folgenden Kommandos ein Benutzer namens moa und eine Datenbank namens moadb angelegt werden:

+
createuser -U postgres -d -A -P moa
createdb -U moa moadb
+

Da die MOA SP/SS Module über JDBC mit der Datenbank kommunizieren, ist in der Folge die Angabe einer JDBC-URL notwendig, welche die Verbindungsparameter enthält. Wurden der Benutzer und die Datenbank wie im obigen Beispiel angelegt, ist folgende JDBC-URL anzugeben (Annahme: als Passwort für den Benutzer moa wurde moapass gewählt):

+
 jdbc:postgresql://host/moadb?user=moa&password=moapass
+

Die Zeichen jdbc:postgresql:// sind unveränderliche Bestandteile einer PostgreSQL JDBC-URL. host gibt den Rechner an, auf dem PostgreSQL läuft. moadb identifiziert den Namen der Datenbank. Über die Parameter user= und pass= werden Benutzername und Passwort für den DB-User bekanntgegeben.

+
2.2.2.1.2 Archivierung von CRLs
+

Zum Archivieren von CRLs müssen in der MOA SP/SS Konfigurationsdatei die Kinder des Elements cfg:MOAConfiguration/cfg:SignatureVerification/cfg:CertificateValidation/cfg:RevocationChecking/cfg:Archiving entsprechend + konfiguriert werden:

+
    +
  • cfg:EnableArchiving muss auf den Wert true gesetzt sein;
  • +
  • cfg:ArchiveDuration muss als nichtnegative Ganzzahl die maximale Archivierungsdauer in Tagen enthalten;
  • +
  • cfg:Archive muss genau ein Element cfg:DatabaseArchive enthalten, das wiederum aus zwei Elementen + bestehen muss: +
      +
    • cfg:JDBCURL muss eine gültige JDBC-URL enthalten, mit der auf die Datenbank zur Archivierung + zugegriffen werden kann (Hinweis: da es sich hierbei um einen Eintrag + in eine XML-Datei handelt, muss das Zeichen & in der in Abschnitt 2.2.2.1.1 gezeigten + JDBC-URL + durch die Zeichenfolge &amp; ersetzt werden.);
    • +
    • cfg:JDBCDriverClassName muss den vollständig qualifizierten Java-Klassennamen des JDBC-Treibers + enthalten.
    • +
    +
  • +
+

Vergleiche auch Abschnitt 2.3.1.3.4 im + Konfigurationshandbuch.

+
2.2.2.1.3 Logging
+

Für das Logging in eine PostgreSQL Datenbank mittels Jakarta Log4j muss zunächst eine Tabelle für die Log-Meldungen angelegt werden. Dies kann mit folgendem SQL-Statement erreicht werden:

+
 create table spss_log (log_time timestamp, log_level varchar(5), log_msg text);
+

Damit Log4j die Log-Meldungen in diese Datenbanktabelle schreibt, muss die Log4j-Konfiguration adaptiert werden. Die mit MOA SP/SS mitgelieferte, beispielhafte Log4j-Konfiguration enthält bereits die notwendigen Einträge für das Logging in eine PostgreSQL Datenbank, die jedoch standardmäßig ausgeschaltet sind.

+

Wie beim Caching von CRLs ist auch hier die Angabe einer JDBC-URL notwendig, damit die MOA SP/SS Module eine Verbindung zur Datenbank aufnehmen können.

+

Bitte beachten Sie: Bei Tests hat sich das Logging in eine Datenbank mit Jakarta Log4j als Performance-Engpass herausgestellt. Es wird deshalb empfohlen, dieses Feature mit Bedacht einzusetzen.

+

2.2.2.2 Andere Datenbanken

+

Über die generische Anbindung JDBC können auch andere Datenbanken für die Archivierung von CRLs bzw. für die Speicherung der Log-Meldungen eingesetzt werden. Hinweise zu bestimmten Datenbanken finden Sie in den FAQ.

+

Die in Abschnitt 2.2.2.1 gemachten Angaben zu Archivierung von CRLs bzw. zur Speicherung von Log-Meldungen gelten sinngemäß.

+

2.2.3 Hardware Security Module (HSM)

+

MOA SS kann für die Erstellung von Signaturen auf die Dienste eines HSM zurückgreifen. Voraussetzung dafür ist, dass für das HSM eine Implementierung der Schnittstelle PCKS#11 (PKCS#11-Bibliothek) angeboten wird.

+

Für die Einbindung des HSM in MOA SS müssen zunächst die Bibliotheken aus $MOA_SPSS_INST/pkcs11 in ein beliebiges Verzeichnis kopiert werden, welches dann in den Libray-Pfad des jeweiligen Betriebssystems aufgenommen werden muss (Windows: Umgebungsvariable PATH; Linux: Umgebungsvariable LD_LIBRARY_PATH).

+

Der Name der für das HSM spezifischen PKCS#11-Bibliothek muss in der Konfigurationsdatei eingetragen werden (vergleiche Abschnitt 2.2.1.1 des Konfigurationshandbuchs).

+

3 Klassenbibliothek

+

Dieser Abschnitt beschreibt die Verwendung von MOA SP/SS als Klassenbibliothek. Im ersten Unterkapitel wird eine minimale Basisinstallation beschrieben. Das zweite Unterkapitel zeigt eine Reihe von optionalen Erweiterungsmöglichkeiten auf.

+

3.1 Basisinstallation

+

3.1.1 Einführung

+

Die Basisinstallation der Klassenbibliothek stellt einerseits die minimalen Anforderungen für den Einsatz von MOA SP/SS als Klassenbibliothek dar, andererseits dient sie als Ausgangspunkt für optionale Erweiterungsmöglichkeiten.

+

Folgende Software ist Voraussetzung für die Basisinstallation der Klassenbibliothek:

+ +

3.1.2 Vorbereitung

+

Die folgenden Schritte dienen der Vorbereitung der Installation.

+
+
Installation von J2SE SDK
+
Installieren Sie J2SE 1.3.1 SDK oder J2SE 1.4.2 SDK oder J2SE 5.0 SDK in ein beliebiges Verzeichnis. Wir empfehlen die Installation von J2SE 5.0 SDK. Das Wurzelverzeichnis der J2SE SDK Installation wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
+
Entpacken der MOA SP/SS Klassenbibliotheks-Distribution
+
Entpacken Sie die Datei moa-spss-1.2.x-lib.zip in ein beliebiges Verzeichnis. Dieses Verzeichnis wird im weiteren Verlauf als $MOA_SPSS_INST bezeichnet.
+
Installation der Krypographiebibliotheken von SIC/IAIK
+
+

Die Installation der Kryptographiebibliotheken von SIC/IAIK ist abhängig vom eingesetzten J2SE SDK:

+
+
J2SE 1.3.1 SDK
+
Kopieren Sie alle Dateien aus dem Verzeichnis $MOA_SPSS_INST/ext13 in das Verzeichnis $JAVA_HOME/jre/lib/ext.
+
J2SE 1.4.2 SDK oder JSE 5.0 SDK
+
Kopieren Sie alle Dateien aus dem Verzeichnis $MOA_SPSS_INST/ext14 in das Verzeichnis $JAVA_HOME/jre/lib/ext. Zusätzlich müssen Sie die Rechtedateien Ihres J2SE 1.4.2 SDK bzw. J2SE 5.0 SDK austauschen. Laden Sie dazu die Unlimited Strength Jurisdiction Policy Files von der J2SE 1.4.2 SDK Downloadseite bzw. J2SE 5.0 SDK Downloadseite und folgen Sie der darin enthaltenen Installationsanweisung.
+
+
+
+

3.1.3 Verwendung

+

Um die MOA SP/SS Klassenbibliothek in einer Applikation verwenden zu können, müssen die mit MOA SP/SS ausgelieferten Bibliotheken in den Java Klassenpfad der Applikation eingebunden werden.

+

Die nachfolgende Tabelle listet diese Klassenbibliotheken auf; die Einträge in der Spalte Dateien sind relativ zum Verzeichnis $MOA_SPSS_INST zu interpretieren.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KlassenbibliothekVersionDateien
MOA SP/SS1.2.x  moa-spss.jar, moa-common.jar
MOA IAIK1.0.7 

lib/iaik_moa_full.jar, lib/iaik_Pkcs11Wrapper.jar, + lib/iaik_cms.jar, lib/iaik_ixsil.jar

+
JAXP1.2_01  lib/jaxp-api.jar, lib/sax.jar, lib/dom.jar
Xerces-J2.4.0  lib/xercesImpl.jar, lib/xmlParserAPIs.jar
Xalan-J2.5.1 

lib/xalan.jar

+

Bitte beachten Sie: Wenn Sie J2SE 1.4.2 JRE oder J2SE 5.0 JRE verwenden, müssen Sie diese Bibliothek der Java VM als endorsed bekanntgeben. Sie können dies tun, indem Sie entweder

+
    +
  • die Bibliothek in das (ggf. vorher anzulegende) Verzeichnis $JAVA_HOME/jre/lib/endorsed/ kopieren; oder
  • +
  • die System Property java.endorsed.dirs verwenden, und als Wert den Pfad zu jenem Verzeichnis angeben, in dem Sie die Bibliothek vorhalten (also z.B. java.endorsed.dirs=c:/mylibdir).
  • +
Jaxen1.0  lib/jaxen-core.jar, lib/jaxen-dom.jar, lib/saxpath.jar
Commons-Logging1.0.4  lib/commons-logging-api.jar, lib/commons-logging.jar
Log4j1.2.7  lib/log4j-1.2.7.jar
Commons-Discovery0.2  lib/commons-discovery.jar
JSSE1.0.3_01 

Diese Bibliotheken benötigen Sie nur, wenn Sie J2SE 1.3.1 verwenden:

+

lib/ext13/jsse.jar, lib/ext13/jcert.jar, lib/ext13/jnet.jar

+

Bitte beachten Sie: Diese Bibliotheken benötigen Sie nur, wenn Sie J2SE 1.3.1 verwenden.

Postgres JDBC27.3 

lib/pg73jdbc2.jar

+

Bitte beachten Sie: Wenn Sie keine Datenbank für MOA SP/SS verwenden (vergleiche 2.2.2), benötigen Sie diese Bibliothek nicht.

+ +

3.1.4 Logging

+

Die MOA SP/SS Klassenbibliothek verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Die im Abschnitt 2.1.3 gemachten Aussagen lassen sich großteils auf den Einsatz der MOA SP/SS Klassenbibliothek übertragen.

+

3.2 Erweiterungsmöglichkeiten

+

Die im Abschnitt 2.2 angeführten Erweiterungsmöglichkeiten für die MOA SP/SS Webservices gelten in analoger Weise auch für die Klassenbibliothek.

+

A Referenzierte Software

+

Auf folgende Software-Pakete wird in diesem Handbuch verwiesen:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameBeschreibung
Apache Tomcat 4.1.x Servlet-Container des Apache Jakarta Projekts in der Version 4.1.x
J2SE 1.3.1 SDK/JRE Java 2 Standard Edition in der Version 1.3.1 (Software Development Kit bzw. Java Runtime Environment)
J2SE 1.4.2 SDK/JREJava 2 Standard Edition in der Version 1.4.2 (Software Development Kit bzw. Java Runtime Environment)
J2SE 5.0 SDK/JRE Java 2 Standard Edition in der Version 5.0 (Software Development Kit bzw. Java Runtime Environment)
Jakarta Log4J Logging Framework des Apache Jakarta Projekts
+ + diff --git a/spss/handbook/handbook/intro/intro.html b/spss/handbook/handbook/intro/intro.html new file mode 100644 index 000000000..8b1bc381f --- /dev/null +++ b/spss/handbook/handbook/intro/intro.html @@ -0,0 +1,44 @@ + + + + + MOA SS und SP - Einführung + + + + + + + + + +
Logo BKAOpen Source
+ für das E-Government
Logo MOA
+
+

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

+

Einführung

+
+

Inhalt

+
    +
  1. +

    Allgemeines

    +
  2. +
  3. +

    Modul Serversignatur (SS)

    +
  4. +
  5. Modul Signaturprüfung (SP)
  6. +
+
+

1 Allgemeines

+

Die Module Serversignatur (SS) und Signaturprüfung (SP) können von Anwendungen verwendet werden, um elektronische Signaturen zu erstellen bzw. vorliegende elektronische Signaturen zu überprüfen.

+

Die Funktionalität und der Aufbau der Schnittstelle zu den beiden Modulen ist in der Spezifikation MOA SP/SS (V1.2) detailliert beschrieben. Da diese Spezifikation auf der Schnittstellenspezifikation des Security-Layers (V 1.1) aufbaut, ist deren Kenntnis zum Verstehen der Schnittstellen zu SS und SP erforderlich.

+

2 Modul Serversignatur (SS)

+

Das Modul Serversignatur (SS) dient zum Erstellen von XML-Signaturen in Anlehnung an die Schnittstellenspezifikation des Security-Layers (V 1.1). Eine Signatur kann entweder rein in Software erstellt werden, oder aber unter Zuhilfenahme eines Hardware Security Modules (HSM), das den privaten Schlüssel geschützt enthält und die Signatur berechnet.

+

Der Zugriff auf einzelne Signaturschlüssel in MOA SS kann basierend auf dem für TLS-Client-Authentisierung verwendeten Zertifikat eingeschränkt werden.

+

Anwendungen können das Modul entweder als Web-Service oder über ein Java-API ansprechen.

+

3 Modul Signaturprüfung (SP)

+

Das Modul Signaturprüfung (SP) dient zum Überprüfen von XML-Signaturen und CMS-Signaturen.

+

Im Zuge der Verifikation einer XML-Signatur werden die Signatur, gegebenenfalls vorhandene XMLDSIG-Manifeste, als auch die Gültigkeit und Anwendbarkeit des Zertifikats überprüft. Bei XML-Signaturen kann zusätzlich überprüft werden, ob sie den speziellen Anforderungen Schnittstellenspezifikation des Security-Layers (V 1.1) entsprechen (vgl. Signaturmanifest).

+

Anwendungen können das Modul entweder als Web-Service oder über ein Java-API ansprechen.

+ + diff --git a/spss/handbook/handbook/spec/MOA-SPSS-1.3.pdf b/spss/handbook/handbook/spec/MOA-SPSS-1.3.pdf new file mode 100644 index 000000000..6709a4081 Binary files /dev/null and b/spss/handbook/handbook/spec/MOA-SPSS-1.3.pdf differ diff --git a/spss/handbook/handbook/spec/MOA-SPSS-1.3.wsdl b/spss/handbook/handbook/spec/MOA-SPSS-1.3.wsdl new file mode 100644 index 000000000..cc7aec4dc --- /dev/null +++ b/spss/handbook/handbook/spec/MOA-SPSS-1.3.wsdl @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spss/handbook/handbook/spec/MOA-SPSS-1.3.xsd b/spss/handbook/handbook/spec/MOA-SPSS-1.3.xsd new file mode 100644 index 000000000..9c40d8153 --- /dev/null +++ b/spss/handbook/handbook/spec/MOA-SPSS-1.3.xsd @@ -0,0 +1,469 @@ + + + + + + + + + + + + + + + + + + + + Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements + + + + + + + + + + + + + + + + + + + Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil + + + + + + + + + + + + + + + + + + Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage + + + + Resultat, falls die Signaturerstellung erfolgreich war + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert + + + + + + + + + + + only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. + + + + + + + + + + mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert + + + + + + + + + + + only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resultat, falls die Signaturerstellung gescheitert ist + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. + + + + + Profilbezeichner für einen Transformationsweg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. + + + + Der Transformationsparameter explizit angegeben. + + + + + Der Hashwert des Transformationsparameters. + + + + + + + + + + + + + + + + + + + + + + Explizite Angabe des Transformationswegs + + + + + + + Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. + + + + + + + + + + + + + + + + diff --git a/spss/handbook/handbook/usage/usage.html b/spss/handbook/handbook/usage/usage.html new file mode 100644 index 000000000..69e21d5f0 --- /dev/null +++ b/spss/handbook/handbook/usage/usage.html @@ -0,0 +1,1236 @@ + + + + + MOA SS und SP - Anwendung + + + + + + + + + +
Logo BKAOpen Source
+ für das E-Government
Logo MOA
+
+

MOA: Serversignatur (SS) und Signaturprüfung (SP), V 1.3

+

Anwendung

+
+

Inhalt

+
    +
  1. +

    Übersicht

    +
  2. +
  3. +

    Verwendung des Webservices

    +
      +
    1. XML-Requests
        +
      1. Erstellung einer XML-Signatur
          +
        1. Einfaches Beispiel
        2. +
        3. Angabe der zu signierenden Daten
        4. +
        5. Transformationen
        6. +
        7. Ergänzungsobjekte
        8. +
        +
      2. +
      3. Prüfung einer CMS-Signatur
          +
        1. Einfaches Beispiel
        2. +
        3. Erweitertes Beispiel
        4. +
        +
      4. +
      5. Prüfung einer XML-Signatur
          +
        1. Einfaches Beispiel
        2. +
        3. Erweitertes Beispiel
        4. +
        5. Prüfung eines XMLDSIG-Manifests
        6. +
        7. Ergänzungsobjekte
        8. +
        9. Signatur-Manifest des Security-Layers
        10. +
        +
      6. +
      +
    2. +
    3. Webservice-Clients +
        +
      1. Übersicht
      2. +
      3. Gemeinsamkeiten
      4. +
      5. Besonderheiten von HTTPSServerAuth.java
      6. +
      7. Besonderheiten von HTTPSClientAuth.java
      8. +
      +
    4. +
    +
  4. +
  5. Verwendung der Klassenbibliothek +
      +
    1. Vorbereitung
    2. +
    3. Allgemeines
    4. +
    5. Beispiele
    6. +
    7. API-Dokumentation
    8. +
    +
  6. +
+
    +
  1. Referenzierte Software
  2. +
+
+

1 Übersicht

+

Die Module Signaturprüfung (SP) und Serversignatur (SS) sind als plattformunabhängige Module ausgelegt, die entweder als Webservice über HTTP bzw. HTTPS oder als Klassenbibliothek über ein API angesprochen werden können. Dieses Handbuch beschreibt die Anwendung der beiden Module auf jede dieser beiden Arten.

+

2 Verwendung des Webservices

+

Dieser Abschnitt beschreibt die Verwendung der Module SP und SS über die Webservice-Schnittstelle. Im ersten Unterabschnitt werden typische XML-Requests zur Signaturerstellung mittels SS bzw. zur Signaturprüfung mittels SP vorgestellt, wie sie an das Webservice gesendet werden können. Der zweite Unterabschnitt stellt beispielhafte Implementierungen eines Webservice-Clients in Java vor, mit dem die Requests aus dem ersten Unterabschnitt an das Webservice gesendet werden können.

+

2.1 XML-Requests

+

Dieser Abschnitt stellt typische XML-Requests für die Erstellung einer XML-Signatur mittels SS bzw. zur Prüfung einer CMS- bzw. XML-Signatur mittels SP vor. Zu jedem Request wird jeweils auch eine typische Response des Services besprochen.

+

Bitte beachten Sie: Einige der vorgestellten Requests referenzieren beispielhafte Daten auf localhost, z.B. http://localhost:8080/referencedData/Text.txt. Wenn Sie diese Beispiele ausprobieren möchten, müssen Sie dafür sorgen, dass MOA SS bzw. SP diese Daten auch tatsächlich auflösen kann. Wenn Sie Ihre Tomcat-Installation auf localhost:8080 betreiben, ist es ausreichend, wenn sie die diesem Handbuch beiliegende Webapplikation referencedData.war in das Verzeichnis webapps Ihrer Tomcat-Installation kopieren. Ansonsten müssen Sie zusätzlich die URLs in den Requests anpassen.

+

2.1.1 Erstellung einer XML-Signatur

+

2.1.1.1 Einfaches Beispiel

+
Request
+

CreateXMLSignatureRequest.Simple.xml ist ein einfacher XML-Request zur Erzeugung einer XML-Signatur. Sein Aufbau wird nachfolgend analysiert:

+
  <KeyIdentifier>KG_allgemein</KeyIdentifier> 
+

KG_allgemein bezeichnet eine Schlüsselgruppe, aus der SS einen Signaturschlüssel selektieren soll und muss einer in der SP/SS-Konfigurationsdatei definierten Schlüsselgruppe entsprechen.

+
  <SingleSignatureInfo SecurityLayerConformity="false">
+

Für jedes SingleSignatureInfoElement wird eine eigene XML-Signatur erzeugt. Wird das Attribut SecurityLayerConformity auf true gesetzt, dann wird eine XML-Signatur gemäß Security-Layer Spezifikation V1.1 erzeugt; d.h. es werden signierte Properties (Zeitpunkt der Signaturerstellung, das für die Signaturüberprüfung zu verwendende Zertifikat, Metainformationen zu den signierten Datenobjekten) und ein Manifest, das alle implizite Transformationsparameter enthält, zur Signatur hinzugefügt.

+
    <DataObjectInfo Structure="enveloping">
+      <DataObject>
+        <XMLContent>Diese Daten werden signiert.<XMLContent>
+      </DataObject>
+

+

Für jedes Daten-Objekt, das in die XML-Signatur als dsig:Reference aufgenommen werden soll, muss ein DataObjectInfo Element spezifiziert werden. Das Attribut Structure gibt an, ob die Daten in die Signatur in ein dsig:Object Element integriert werden sollen (Structure="enveloping"), oder über einen URL referenziert werden sollen (Structure="detached").

+

Im Fall von Structure="enveloping" muss im nachfolgenden DataObject Element entweder das Attribut Reference (enthält eine URL, von der SS die Daten beziehen soll) gesetzt sein, oder aber die zu signierenden Daten werden explizit in einem der Elemente Base64Content (enthält Daten in Base64 kodierter Form) oder XMLContent (enthält Daten als beliebiges XML-Fragment) oder LocRefContent (enthält eine URL, von der SS die Daten beziehen soll; in diesem Fall also gleichwertig wie ein gesetztes Attribut Reference) spezifiziert sein. Die Angabe der zu signierenden Daten über das Attribut Reference und gleichzeitig einem der Elemente Base64Content oder XMLContent oder LocRefContent ist nicht erlaubt.

+

Im Fall von Structure="detached" muss das Attribut Reference im nachfolgenden DataObject Element gesetzt sein. Es enthält jene URL, die zur Referenzierung der Daten als Wert von dsig:Reference/@URI in die XML-Signatur aufgenommen wird. Die Angabe eines der Element Base64Content oder XMLContent oder LocRefContent ist optional. Unterbleibt die Angabe, bezieht SS die Daten von der URL im Attribut Reference. Wird eines der Elemente verwendet, bezieht SS die Daten durch Analyse des angegebenen Elements (siehe obiger Absatz).

+

Im konkreten Beispiel sollen die Daten in ein dsig:Object Element integriert werden (Structure="enveloping"). Die Daten werden mittels XMLContent als XML-Fragment (ein einfacher Textknoten) angegeben.

+

+

    <CreateTransformsInfoProfile>
<CreateTransformsInfo> + <FinalDataMetaInfo> + <MimeType>text/plain<MimeType> + </FinalDataMetaInfo> + </CreateTransformsInfo> + </CreateTransformsInfoProfile>
+ Zu jedem Daten-Objekt können optional Transformationen (z.B. XPath, XSLT, Base64-Decodierung, etc.) angegeben werden. Werden - wie hier im Beispiel - keine Transformationen angegeben, so muss zumindest der MIME-Type der zu signierenden Daten spezifiziert werden.

+
Response
+

CreateXMLSignatureRequest.Simple.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

+

+

<CreateXMLSignatureResponse
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<SignatureEnvironment>
<dsig:Signature Id="signature-1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<dsig:SignedInfo> + ... + <dsig:Reference Id="reference-1-1" URI="#xpointer(id(&apos;signed-data-1-1-1&apos;)/node())"> + ... + </dsig:Reference> + ... + </dsig:SignedInfo> + ... + <dsig:Object Id="signed-data-1-1-1">Diese Daten werden signiert.</dsig:Object> + </dsig:Signature>
</SignatureEnvironment>
</CreateXMLSignatureResponse>
+

+

CreateXMLSignatureResponse enthält je erzeugter Signatur ein Element SignatureEnvironment (in diesem Fall genau ein Element). SignatureEnvironment enthält die von SS erzeugte XML-Signatur, die im obigen Request spezifiziert wurde. Man erkennt, dass die XML-Signatur genau ein Daten-Objekt unterzeichnet (ein dsig:Reference Element ist enthalten). Das unterzeichnete Datenobjekt ist in der Signaturstruktur selbst enthalten (enveloping), und zwar in einem dsig:Object Element.

+

2.1.1.2 Angabe der zu signierenden Daten

+
Request
+

Dieses Beispiel stellt die vielfältigen Möglichkeiten vor, wie MOA SS mitgeteilt werden kann, welche Daten signiert (wenn keine Transformationen angegeben werden) bzw. als Eingangsdaten für die Berechnung der Transformationen verwendet werden sollen (wenn Transformationen angegeben werden).

+

Mit CreateXMLSignatureRequest.Refs.xml sollen insgesamt neun Datenobjekte signiert werden:

+
<CreateXMLSignatureRequest 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<KeyIdentifier>KG_allgemein</KeyIdentifier>
<SingleSignatureInfo SecurityLayerConformity="false">
+

Die Signatur soll mit dem Schlüssel KG_allgemein erstellt werden; jene Elemente, die speziell für eine Security-Layer V1.1 konforme Signatur notwendig sind (vergleiche Einfaches Beispiel), brauchen nicht erstellt zu werden (SecurityLayerConformity="false").

+
    <DataObjectInfo Structure="enveloping" ChildOfManifest="true">
+      <DataObject>
+        <Base64Content>RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</Base64Content>
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+

Die Daten sollen in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Weiters sollen die Daten nicht über über eine dsig:Reference in dsig:SignedInfo, sondern über eine dsig:Reference in einem eigenen dsig:Manifest aufgenommen werden (ChildOfManifest="true").

+

Die Daten selbst werden explizit in base64 kodierter Form als Inhalt des Elements Base64Content angegeben. Das Attribut DataObject/@Reference darf nicht angegeben werden, da die Daten in der Enveloping Form integriert werden sollen, und Base64Content verwendet wird.

+

Es werden - wie in allen übrigen Fällen dieses Beispiels - keine Transformationen angegeben. Der Mime-Type der zu signierenden Daten wird als text/plain angegeben, da der Inhalt von Base64Content die base64-Kodierung des Texts Diese Daten waren base64 kodiert. ist.

+
+    <DataObjectInfo Structure="enveloping" ChildOfManifest="false">
+      <DataObject>
+        <XMLContent><doc:XMLDocument xmlns:doc="urn:document">
+  <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
+  <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
+Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
+</doc:XMLDocument></XMLContent>
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>application/xml</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Die Daten sollen in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Diesmal sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

+

Die Daten selbst werden explizit als XML-Fragment als Inhalt des Elements XMLContent angegeben. Das Attribut DataObject/@Reference darf nicht angegeben werden, da die Daten in der Enveloping Form integriert werden sollen, und XMLContent verwendet wird.

+

Der Mime-Type der zu signierenden Daten wird als application/xml angegeben.

+
+    <DataObjectInfo Structure="enveloping" ChildOfManifest="false">
+      <DataObject Reference="http://localhost:8080/referencedData/Text.txt"/>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Die Daten sollen in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Wiederum sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false"). +

+

Die Daten werden diesmal nicht explizit angegeben, sondern mittels der URL in DataObject/@Reference referenziert. MOA SS versucht diese URL aufzulösen, um zu den zu signierenden Daten zu gelangen. Base64Content oder XMLContent oder LocRefContent dürfen nicht verwendet werden, da die Daten in der Enveloping Form integriert werden sollen, und bereits DataObject/@Reference eingesetzt wird.

+

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

+
+    <DataObjectInfo Structure="enveloping" ChildOfManifest="false">
+      <DataObject>
+        <LocRefContent>http://localhost:8080/referencedData/Text.txt</LocRefContent>
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Die Daten sollen wiederum in der Enveloping Form in die Signatur integriert werden, d. h. die Daten werden in einem dsig:Object als Teil der XML-Struktur der Signatur aufgenommen (Structure="enveloping"). Wiederum sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

+

Die Daten werden wie im vorhergehenden Fall nicht explizit angegeben, sondern referenziert. Diesmal wird die URL jedoch nicht DataObject/@Reference verwendet, sondern als Textinhalt des Elements LocRefContent (LocRef steht für Location Reference). DataObject/@Reference darf in diesem Fall nicht verwendet werden. Diese Methode ist semantisch völlig ident mit dem vorhergehenden Fall.

+

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

+
+    <DataObjectInfo Structure="detached" ChildOfManifest="true">
+      <DataObject Reference="http://localhost:8080/referencedData/Text.b64">
+        <Base64Content>RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</Base64Content>
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Die Daten sollen diesmal in der Detached Form in die Signatur aufgenommen werden, d. h. die Daten werden nicht direkt in die Signaturstruktur integriert, sondern lediglich mittels URI im Attribut URI der anzufertigenden dsig:Reference referenziert (Structure="detached"). Die Daten sollen indirekt über eine dsig:Reference eines dsig:Manifests aufgenommen werden (ChildOfManifest="true").

+

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Die Daten selbst hingegen werden im diesem Beispiel explizit in base64 kodierter Form als Inhalt des Elements Base64Content angegeben. MOA SS löst also keine URL zur Erlangung der Daten auf, sondern verwendet den Inhalt von Base64Content.

+

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

+
+    <DataObjectInfo Structure="detached" ChildOfManifest="false">
+      <DataObject Reference="NichtAufloesbareReferenz1">
+        <XMLContent><doc:XMLDocument xmlns:doc="urn:document">
+  <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
+  <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument. 
+Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
+</doc:XMLDocument></XMLContent>
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>application/xml</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Die Daten sollen auch diesmal in der Detached Form in die Signatur aufgenommen werden, d. h. die Daten werden nicht direkt in die Signaturstruktur integriert, sondern lediglich mittels URI im Attribut URI der anzufertigenden dsig:Reference referenziert (Structure="detached"). Diesmal sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false"). +

+

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Die Daten selbst hingegen werden im diesem Beispiel explizit als XML-Fragment in XMLContent angegeben. MOA SS löst auch hier keine URL zur Erlangung der Daten auf, sondern verwendet den Inhalt von XMLContent. Zur Verdeutlichung dieses Umstandes wurde die URI in DataObject/@Reference auf einen Wert gesetzt, der von MOA SS ganz sicher nicht aufgelöst werden kann (NichtAufloesbareReferenz1).

+

Der Mime-Type der zu signierenden Daten wird als application/xml angegeben.

+
+    <DataObjectInfo Structure="detached" ChildOfManifest="false">
+      <DataObject Reference="http://localhost:8080/referencedData/Text.txt">
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Wiederum sollen die Daten in der Detached Form in die Signatur aufgenommen werden (Structure="detached"). Wie zuvor sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

+

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Nachdem eine explizite Angabe der Daten mittels Base64Content, XMLContent oder LocRefContent unterbleibt, wird MOA SS versuchen, die URI in dsig:Reference/@URI als URL aufzulösen, um so zu den zu signierenden Daten zu gelangen.

+

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

+
+    <DataObjectInfo Structure="detached" ChildOfManifest="false">
+      <DataObject Reference="NichtAufloesbareReferenz2">
+        <LocRefContent>http://localhost:8080/referencedData/Text.txt</LocRefContent>
+      </DataObject>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Wiederum sollen die Daten in der Detached Form in die Signatur aufgenommen werden (Structure="detached"). Wie zuvor sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

+

Die URI in DataObject/@Reference enthält dabei die URI, die zur Referenzierung in dsig:Reference/@URI aufgenommen werden soll. Den Hinweis, wie MOA SS zu den zu signierenden Daten gelangen soll, ist jedoch in LocRefContent enthalten. MOA SS wird also versuchen, die dort enthaltene URL aufzulösen, um zu den zu signierenden Daten zu gelangen. Zur Verdeutlichung dieses Umstandes wurde die URI in DataObject/@Reference auf einen Wert gesetzt, der von MOA SS ganz sicher nicht aufgelöst werden kann (NichtAufloesbareReferenz2). Diese Art der Datenangabe kann eingesetzt werden, wenn die Daten zum Zeitpunkt der Signaturerstellung von einem anderen Ort bezogen werden müssen, als später dann bei der Signaturprüfung.

+

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben.

+
+    <DataObjectInfo Structure="detached" ChildOfManifest="false">
+      <DataObject Reference=""/>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <dsig:Transforms>
+            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+          </dsig:Transforms>
+          <FinalDataMetaInfo>
+            <MimeType>application/xml</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Im letzten Fall schließlich sollen wiederum Daten in der Detached Form in die Signatur aufgenommen werden (Structure="detached"). Wie zuvor sollen die Daten direkt über eine dsig:Reference in dsig:SignedInfo aufgenommen werden (ChildOfManifest="false").

+

Die Referenz auf die zu signierenden Daten ist wiederum in DataObject/@Reference enthalten; sie verweist diesmal jedoch nicht auf ein externes Dokument, sondern auf das gesamte (XML-)Dokument, in das die zu erstellende Signatur integriert werden soll, und zwar, indem DataObject/@Reference den leeren String ("") enthält. Nachdem dadurch zwangsläufig auch die Signatur in den zu signierenden Daten enthalten wäre, wird die Signatur durch die Angabe einer Enveloped Signature Transform aus den zu signierenden Daten herausgenommen, bevor darüber der Hashwert berechnet wird (dsig:Transform).

+

Offen bleibt die Frage, wie MOA SS nun weiß, in welches (XML-)Dokument es die die Signatur integrieren soll. Siehe dazu die Erläuterungen zum nächsten Ausschnitts des Requests.

+

Der Mime-Type der zu signierenden Daten wird als application/xml angegeben.

+
+    <CreateSignatureInfo>
+      <CreateSignatureEnvironment>
+        <LocRefContent>http://localhost:8080/referencedData/XMLDocument.xml</LocRefContent>
+      </CreateSignatureEnvironment>
+      <CreateSignatureEnvironmentProfile>
+        <CreateSignatureLocation Index="4" xmlns:doc="urn:document">/doc:XMLDocument</CreateSignatureLocation>
+      </CreateSignatureEnvironmentProfile>
+    </CreateSignatureInfo>
+
+

Das Element CreateSignatureInfo ist grundsätzlich optional, und muss nur angegeben werden, wenn die zu erstellende Signatur von MOA SS in ein bestehendes XML-Dokument integriert werden soll (was in diesem Beispiel ja der Fall ist).

+

CreateSignatureEnvironment enthält das XML-Dokument, in das die zu erstellende Signatur integriert werden soll. In diesem Beispiel wird dieses Dokument mit Hilfe von LocRefContent referenziert, d. h. MOA SS wird versuchen, die darin enthaltene URL aufzulösen, um das XML-Dokument zu erhalten. Alternativ könnte auch Base64Content (explizite Angabe des XML-Dokuments in base64 kodierter Form) oder XMLContent (direkte Angabe des XML-Dokuments im Request) verwendet werden.

+

CreateSignatureLocation enthält die Angabe jener Stelle, an der die Signatur in das XML-Dokument eingesetzt werden soll. Der Inhalt dieses Elements bezeichnet mittels XPath-Ausdruck das Parent-Element der Signatur, der Wert des Attributs CreateSignatureLocation/@Index enthält den Offset innerhalb dieses Parent-Elements. Betrachten Sie zur Verdeutlichung das XML-Dokument XMLDocument.xml, in das die Signatur integriert werden soll: Die Signatur soll unmittelbar nach dem zweiten doc:Paragraph Element in das XML-Dokument eingefügt werden. Der Inhalt von CreateSignatureLocation (/doc:XMLDocument) selektiert das zukünftige Parent-Element der Signatur, also doc:XMLDocument. Das Attribut Index enthält deshalb den Wert 4 (und nicht etwa 2 oder 3), da erstens bei 0 zu zählen begonnen wird, und zweitens auch die Text-Knoten, die lediglich Whitespace enthalten, für diesen Offset zählen (um diese Textknoten erkennen zu können, müssen Sie das XML-Dokument in einem Text-Editor öffnen). Beachten Sie weiters, dass das im XPath-Ausdruck verwendete Namespace-Prefix doc im Kontext des Elements CreateSignatureLocation bekannt sein muss. Deshalb enthält dieses Element auch die entsprechende Namespace-Deklaration (xmlns:doc="urn:document").

+
Response
+

CreateXMLSignatureRequest.Refs.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

+
+<CreateXMLSignatureResponse 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <SignatureEnvironment>
+    <doc:XMLDocument xmlns:doc="urn:document">
+      <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
+      <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
+Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph><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-sha1"/>
+
+

Die Antwort enthält in SignatureEnvironment das Ergebnis der Signaturerstellung. Nachdem die Signatur in ein bestehendes XML-Dokument integriert werden sollte, enthält SignatureEnvironment das Dokument-Element dieses XML-Dokuments (doc:XMLDocument). Man erkennt auch gut, dass die XML-Signatur als fünfter Kindknoten (Offset 4) von doc:XMLDocument eingefügt wurde.

+
+          <dsig:Reference Id="reference-1-2" URI="#xpointer(id('signed-data-1-2-1')/node())">
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>A8ml6/aZKCmj1hONwvLItIwGHoc=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des zweiten DataObjectInfo Elements im Request erstellt. Man erkennt gut den Verweis in dsig:Reference/@URI auf das dsig:Object, das die signierten Daten enthält (der XPointer verweist auf sämtliche Kindknoten jenes Elements, das ein ID-Attribut mit dem Wert signed-data-1-2-1 aufweist, des ersten vorkommenden dsig:Objects der Signatur).

+
+          <dsig:Reference Id="reference-1-3" URI="#xpointer(id('signed-data-1-3-1')/node())">
+            <dsig:Transforms>
+              <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
+            </dsig:Transforms>
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des dritten DataObjectInfo Elements im Request erstellt. Die Text-Daten wurden von der angegebenen URL (http://localhost:8080/referencedData/Text.txt) aufgelöst und in das dsig:Object mit dem ID-Attribut signed-data-1-3-1 gesteckt. Um Probleme mit nicht in XML darstellbare Zeichen zu vermeiden, wurde der Text nicht direkt signiert, sondern in base64 kodierter Form in das dsig:Object integriert, und eine Transformation zur base64 Dekodierung spezifiziert.

+
+          <dsig:Reference Id="reference-1-4" URI="#xpointer(id('signed-data-1-4-1')/node())">
+            <dsig:Transforms>
+              <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
+            </dsig:Transforms>
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des vierten DataObjectInfo Elements im Request erstellt. Wie schon bei der Beschreibung des Requests angeführt, ist die erstellte dsig:Reference semantisch genau gleich wie die vorhergehende.

+
+          <dsig:Reference Id="reference-1-6" URI="NichtAufloesbareReferenz1">
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>2b83+NbXDFijHzz+sH0T7fM36sA=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des sechsten DataObjectInfo Elements im Request erstellt. Die zu signierenden Daten wurden aus dem XMLContent des Requests entnommen, als Wert von dsig:Reference/@URI wurde der Wert von DataObjectInfo/@Reference übernommen.

+
+          <dsig:Reference Id="reference-1-7" URI="http://localhost:8080/referencedData/Text.txt">
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des siebenten DataObjectInfo Elements im Request erstellt. Um zu den zu signierenden Daten zu gelangen, wurde von MOA SS die URL in DataObjectInfo/@Reference aufgelöst. Gleichermaßen wurde die URL in dsig:Reference/@URI übernommen.

+
+          <dsig:Reference Id="reference-1-8" URI="NichtAufloesbareReferenz2">
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>0P878Dsmtxv5goj+6KgNmj6S/EE=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des achten DataObjectInfo Elements im Request erstellt. Um zu den zu signierenden Daten zu gelangen, wurde von MOA SS die URL in LocRefContent aufgelöst. In dsig:Reference/@URI wurde der Wert aus DataObjectInfo/@Reference übernommen.

+
+          <dsig:Reference Id="reference-1-9" URI="">
+            <dsig:Transforms>
+              <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+            </dsig:Transforms>
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>2b83+NbXDFijHzz+sH0T7fM36sA=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference wurde auf Grund des neunten DataObjectInfo Elements im Request erstellt. Als zu signierende Daten wurde das XML-Dokument ausgewählt, in das die XML-Signatur integriert werden solle. Vor der Berechnung des Hashwerts wurde eine Enveloped Signature Transformation zwischengeschaltet, welche die XML-Struktur der Signatur selbst aus den Hash-Eingangsdaten herausschneidet.

+
+          <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#dsig-manifest-1-1">
+            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+            <dsig:DigestValue>mNsxUkFoF46XZVBivBo4aasFCTQ=</dsig:DigestValue>
+          </dsig:Reference>
+
+

Diese dsig:Reference verweist auf das dsig:Manifest weiter unten in der XML-Struktur der Signatur. Das dsig:Manifest wurde angelegt, weil bei zwei DataObjectInfos im Request das Attribut ChildOfManifest auf den Wert true gesetzt wurde.

+
+        </dsig:SignedInfo>
+        <dsig:SignatureValue>...</dsig:SignatureValue>
+        <dsig:KeyInfo>...</dsig:KeyInfo>
+        <dsig:Object Id="signed-data-1-2-1">
+          <doc:XMLDocument xmlns:doc="urn:document">
+            <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
+            <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
+Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
+          </doc:XMLDocument>
+        </dsig:Object>
+        <dsig:Object Id="signed-data-1-3-1">RGllc2UgRGF0ZW4gc2luZCByZWluZXIgVGV4dC4=</dsig:Object>
+        <dsig:Object Id="signed-data-1-4-1">RGllc2UgRGF0ZW4gc2luZCByZWluZXIgVGV4dC4=</dsig:Object>
+        <dsig:Object Id="signed-data-1-1-1">RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</dsig:Object>
+
+

SignatureValue und KeyInfo werden an dieser Stelle nicht näher betrachtet.

+

Das erste dsig:Object enthält die Daten aus dem zweiten DataObjectInfo; das zweite dsig:Object jene aus dem dritten DataObjectInfo; das dritte dsig:Object jene aus dem vierten DataObjectInfo; das vierte dsig:Object schließlich jene aus dem ersten DataObjectInfo.

+
+        <dsig:Object>
+          <dsig:Manifest Id="dsig-manifest-1-1">
+            <dsig:Reference Id="reference-1-1" URI="#xpointer(id('signed-data-1-1-1')/node())">
+              <dsig:Transforms>
+                <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
+              </dsig:Transforms>
+              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+              <dsig:DigestValue>a53jOsL7KbyltpByAK87FoMZphI=</dsig:DigestValue>
+            </dsig:Reference>
+            <dsig:Reference Id="reference-1-5" URI="http://localhost:8080/referencedData/Text.b64">
+              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+              <dsig:DigestValue>a53jOsL7KbyltpByAK87FoMZphI=</dsig:DigestValue>
+            </dsig:Reference>
+          </dsig:Manifest>
+        </dsig:Object>
+
+

Das fünfte dsig:Object enthält das dsig:Manifest, das von MOA SS auf Grund des ersten bzw. fünften DataObjectInfo des Requests erstellt wurde. Darin enthalten sind die zum ersten und fünten DataObjectInfo korrespondierenden dsig:Reference Elemente. Die Daten für die erste im dsig:Manifest enthaltene dsig:Reference wurden aus dem Base64Content Element des ersten DataObjectInfo entnommen, jene für die zweite dsig:Reference aus dem Base64Content Element des fünften DataObjectInfo. Der Wert des URI Attributs der zweiten dsig:Reference wurde aus dem DataObject/@Reference des fünften DataObjectInfo übernommen.

+

2.1.1.3 Transformationen

+
Request
+

Dieses Beispiel (CreateXMLSignatureRequest.Transforms.xml) stellt die wichtigsten Transformationen vor, die von MOA SS bei der Erstellung einer Signatur verwendet werden können. Eine Transformation bzw. eine Kette mehrerer hintereinandergeschalteter Transformationen werden auf die Referenz-Eingangsdaten (also jene Daten, die in DataObjectInfo/DataObject angegeben werden) angewendet; das Ergebnis fließt dann in die Hashwert-Berechnung ein.

+
<CreateXMLSignatureRequest 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<KeyIdentifier>KG_allgemein</KeyIdentifier>
<SingleSignatureInfo SecurityLayerConformity="false">
+

Die Signatur soll mit dem Schlüssel KG_allgemein erstellt werden; jene Elemente, die speziell für eine Security-Layer V1.1 konforme Signatur notwendig sind (vergleiche Einfaches Beispiel), brauchen nicht erstellt zu werden (SecurityLayerConformity="false").

+
+    <DataObjectInfo Structure="detached">
+      <DataObject Reference="http://localhost:8080/referencedData/Text.b64"/>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <dsig:Transforms>
+            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
+          </dsig:Transforms>
+          <FinalDataMetaInfo>
+            <MimeType>text/plain</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Für das erste zu signierende Datenobjekt werden die Referenz-Eingangsdaten mittels DataObject/@Reference referenziert, d. h. MOA SS löst die darin enthaltene URL auf, um zu den Daten zu gelangen. Es handelt sich dabei um einen base64 kodierten Text.

+

Unterschrieben werden soll nun aber nicht dieser base64 kodierte Text, sondern der entsprechend dekodierte Text. Dies lässt sich elegant durch die Angabe einer Base64 Decoding Transformation bewerkstelligen. Dazu wird als erstes Kindelement von CreateTransformsInfo ein dsig:Transforms Element im Request angegeben. Dieses dsig:Transforms Element nimmt ein oderer mehrere dsig:Transform Elemente auf, wobei jedes dsig:Transform Element für eine Transformation steht. In unserem Fall wird nur eine einzige Transformation benötigt; die Angabe, um welche Transformation es sich handelt, wird durch das Attribut dsig:Transform/@Algorithm angegeben. Für die Base64 Decoding Transformation muss der Wert auf http://www.w3.org/2000/09/xmldsig#base64 gesetzt werden. Sie ist eine parameterlose Transformation, d. h. dsig:Transform hat keine Kindelemente.

+

Der Mime-Type der zu signierenden Daten wird als text/plain angegeben, da ja tatsächlich nach der durchgeführten Transformation dekodierter Text vorliegt, über den dann der Hashwert berechnet wird.

+
+    <DataObjectInfo Structure="detached">
+      <DataObject Reference="http://localhost:8080/referencedData/XMLDocument.xml"/>
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <dsig:Transforms>
+            <dsig:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2">
+              <xp2:XPath 
+                xmlns:xp2="http://www.w3.org/2002/06/xmldsig-filter2" 
+                xmlns:doc="urn:document" 
+                Filter="subtract">/doc:XMLDocument/doc:Paragraph[2]</xp2:XPath>
+            </dsig:Transform>
+            <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:doc="urn:document">
+  <xsl:output encoding="UTF-8" method="xml" indent="yes"/>
+  <xsl:template match="/doc:XMLDocument">
+    <html xmlns="http://www.w3.org/1999/xhtml">
+      <head>
+        <title>HTML-Dokument</title>
+      </head>
+      <body>
+        <xsl:for-each select="doc:Paragraph">
+          <p>
+            <xsl:value-of select="child::text()"/>
+          </p>
+        </xsl:for-each>
+      </body>
+    </html>
+  </xsl:template>
+</xsl:stylesheet></dsig:Transform>
+            <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
+          </dsig:Transforms>
+          <FinalDataMetaInfo>
+            <MimeType>application/xhtml+xml</MimeType>
+          </FinalDataMetaInfo>
+        </CreateTransformsInfo>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Für das zweite zu signierende Datenobjekt werden die Referenz-Eingangsdaten wiederum mittels DataObject/@Reference referenziert, d. h. MOA SS löst die darin enthaltene URL auf, um zu den Daten zu gelangen. Es handelt sich dabei um ein XML-Dokument.

+

Zunächst soll von diesem XML-Dokument jedoch ein Teil weggeschnitten werden, da er nicht mitsigniert werden soll. Für diesen Zweck bietet sich die XPath Filter 2 Transformation an. Das Attribut dsig:Transform/@Algorithm ist dazu auf den Wert http://www.w3.org/2002/06/xmldsig-filter2 zu setzen. Diese Transformation benötigt weiters Transformationsparameter. Diese werden als Kindelement xp2:XPath in dsig:Transform angegeben. Das Attribut Filter selektiert den Filtermodus; für das Bespiel wird den Modus subtract benötigt, da ein Teil weggefiltert werden soll. Der Textinhalt von xp2:XPath ist ein XPath-Ausdruck, der den Wurzelknoten jenes Teilbaums selektiert, der weggefiltert werden soll. Für das Beispiel soll das zweite doc:Paragraph Element des XML-Dokuments weggefiltert werden. Beachten Sie, dass das im XPath-Ausdruck verwendete Namespace-Prefix doc im Kontext des xp2:XPath Elements deklariert sein muss.

+

Als nächstes soll nun das XML-Dokument mit Hilfe eines Stylesheets in ein XHTML-Dokument übergeführt werden. Dazu kann die XSLT Transformation verwendet werden. Das Attribut dsig:Transform/@Algorithm ist dazu auf den Wert http://www.w3.org/TR/1999/REC-xslt-19991116 zu setzen. Auch diese Transformation benötigt Transformationsparameter: Als Kindelement von dsig:Transform wird jener Stylesheet angegeben, mit dem die Stylesheet-Transformation ausgeführt werden soll.

+

Abschließend soll, wie in der Spezifikation der XSLT-Transformation empfohlen, eine Kanonisierungstransformation angewendet werden. Damit können Unterschiede im Output unterschiedlicher XSLT-Engines, wie sie in der Praxis vorkommen, abgefangen werden. Beachten Sie, dass als Voraussetzung dazu die Output-Methode im Stylesheet auf xml festgelegt werden muss (<xsl:output method="xml">), denn nur XML-Output kann anschließend kanonisiert werden. Das Attribut dsig:Transform/@Algorithm ist für die Canonical XML Transformation auf den Wert http://www.w3.org/TR/2001/REC-xml-c14n-20010315 zu setzen. Die Transformation benötigt keine Transformationsparameter.

+

Das Ergebnis der drei hintereinandergeschalteten Transformationen, welches der Hashwert-Berechnung zufließt, finden Sie hier.

+
Response
+

CreateXMLSignatureRequest.Transforms.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass die dargestellte Response zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

+
+<CreateXMLSignatureResponse 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <SignatureEnvironment>
+    <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-sha1"/>
+
+

Die Antwort enthält in SignatureEnvironment das Ergebnis der Signaturerstellung. Nachdem die Signatur in kein bestehendes Dokument eingefügt werden sollte, enhält SignatureEnvironment direkt die erzeugte XML-Signatur (dsig:Signature).

+
+        <dsig:Reference Id="reference-1-1" URI="http://localhost:8080/referencedData/Text.b64">
+          <dsig:Transforms>
+            <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#base64"/>
+          </dsig:Transforms>
+          <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+          <dsig:DigestValue>a53jOsL7KbyltpByAK87FoMZphI=</dsig:DigestValue>
+        </dsig:Reference>
+
+

Die erste dsig:Reference wurde auf Grund des ersten DataObjectInfo im Request erstellt. Man erkennt dass die URL auf die Referenz-Eingangsdaten (Wert des Attributs dsig:Reference/@URI) aus DataObject/@Reference übernommen und eine Base64 Decoding Transformation eingefügt würde. Die im Request spezifizierten Transformationen werden also eins zu eins in die XML-Signatur übernommen.

+
+        <dsig:Reference Id="reference-1-2" URI="http://localhost:8080/referencedData/XMLDocument.xml">
+          <dsig:Transforms>
+            <dsig:Transform Algorithm="http://www.w3.org/2002/06/xmldsig-filter2">
+              <xp2:XPath Filter="subtract" xmlns:doc="urn:document" 
+                xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" 
+                xmlns:xf2="http://www.w3.org/2002/06/xmldsig-filter2" 
+                xmlns:xp2="http://www.w3.org/2002/06/xmldsig-filter2">/doc:XMLDocument/doc:Paragraph[2]</xp2:XPath>
+            </dsig:Transform>
+            <dsig:Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
+              <xsl:stylesheet version="1.0" 
+                xmlns:doc="urn:document" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+                <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
+                <xsl:template match="/doc:XMLDocument">...</xsl:template>
+              </xsl:stylesheet>
+            </dsig:Transform>
+            <dsig:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
+          </dsig:Transforms>
+          <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+          <dsig:DigestValue>fIPwneCpjVqTXwHMN9DFfx6tJIU=</dsig:DigestValue>
+        </dsig:Reference>
+
+

Die zweite dsig:Reference wurde auf Grund des zweiten DataObjectInfo im Request erstellt. Man erkennt auch hier gut, dass die URL auf die Referenz-Eingangsdaten (Wert des Attributs dsig:Reference/@URI) aus DataObject/@Reference übernommen und die drei Transformationen wie im Request angegeben eingefügt wurden.

+

2.1.1.4 Ergänzungsobjekte

+
Request
+

Dieses Beispiel (CreateXMLSignatureRequest.Supplements.xml) stellt die Verwendung von Ergänzungsobjekten vor. Ein Ergänzungsobjekt betrifft entweder ein zu signierendes Datum (Zusammenhang mit einem DataObject) oder jenes Dokument, in das eine zu erzeugende Signatur eingefügt werden soll (Zusammenhang mit CreateSignatureEnvironment). Es muss dann angegeben werden, wenn in einem zu signierenden Datum bzw. im Einfügedokument auf Daten per Referenz verwiesen wird, diese referenzierten Daten aber von MOA SS nicht aufgelöst werden können. Das Ergänzungsobjekt enthält dann genau diese Daten, die nicht von MOA SS aufgelöst werden können.

+
+<CreateXMLSignatureRequest 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <KeyIdentifier>KG_allgemein</KeyIdentifier>
+  <SingleSignatureInfo SecurityLayerConformity="false">
+
+

Die Signatur soll mit dem Schlüssel KG_allgemein erstellt werden; jene Elemente, die speziell für eine Security-Layer V1.1 konforme Signatur notwendig sind (vergleiche Einfaches Beispiel), brauchen nicht erstellt zu werden (SecurityLayerConformity="false").

+
+    <DataObjectInfo Structure="detached">
+      <DataObject Reference="#Para2"/>
+
+

Das zu signierende Datum in diesem Beispiel ist ein Teil des Dokuments, in das die zu erstellende Signatur eingefügt werden soll. Der Wert des Reference Attributs ist #Para2, das bedeutet, dass jenes Element des Einfügedokuments signiert werden soll, das ein ID-Attribut mit dem Wert #Para2 aufweist. Damit MOA SS diesen Hinweis auswerten kann, muss es das Einfügedokument validierend parsen, denn sonst wüsste es ja nicht, welche Attribute überhaupt ID-Attribute sind. Das zum validierenden Parsen notwendige XML-Schema wird MOA SS in diesem Beispiel über ein Ergänzungsobjekt zum Einfügedokument mitgeteilt (siehe weiter unten).

+
+      <CreateTransformsInfoProfile>
+        <CreateTransformsInfo>
+          <dsig:Transforms>
+            <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">
+  <xsl:include href="XMLDocument.Para.xsl"/>
+</xsl:stylesheet>              
+            </dsig:Transform>
+            <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+          </dsig:Transforms>
+          <FinalDataMetaInfo>
+            <MimeType>application/xhtml+xml</MimeType>
+          </FinalDataMetaInfo>
+
+

Das Beispiel enthält als erste Transformation eine XSLT-Transformation. Der als Kindelement von dsig:Transform angegebene Stylesheet verweist dabei mittels xsl:include auf einen weiteren Stylesheet. Dieser weitere Stylesheet kann jedoch von MOA nicht direkt aufgelöst werden, da er als relative Referenz angegeben wird. Deshalb ist es notwendig, diesen weiteren Stylesheet als Ergänzungsobjekt zu den signierenden Daten anzugeben:

+
+        </CreateTransformsInfo>
+        <Supplement>
+          <Content Reference="XMLDocument.Para.xsl">
+            <LocRefContent>http://localhost:8080/referencedData/XMLDocument.Para.xsl</LocRefContent>
+          </Content>
+        </Supplement>
+      </CreateTransformsInfoProfile>
+    </DataObjectInfo>
+
+

Ein Ergänzungsobjekt für zu signierende Daten wird im entsprechenden DataObjectInfo Element angegeben, und zwar als Inhalt des Elements CreateTransformsInfoProfile/Supplement. Das verpflichtend zu verwendende Attribut Content/@Reference enthält dabei die Referenz auf das Ergänzungsobjekt in exakt jener Schreibweise, wie sie in der xsl:include Direktive vorkommt, hier also XMLDocument.Para.xsl. Das Element Content beinhaltet das Ergänzungsobjekt so, wie es MOA SS verwenden soll (Elemente Base64Content oder XMLContent, vergleiche Einfaches Beispiel), bzw. enthält eine von MOA SS auflösbare Referenz auf das Ergänzungsobjekt (Element LocRefContent, vergleiche Einfaches Beispiel). Im konkreten Beispiel wird LocRefContent verwendet.

+
+    <CreateSignatureInfo>
+      <CreateSignatureEnvironment 
+        Reference="http://localhost:8080/referencedData/XMLDocument.withSchemaHint.xml"/>
+      <CreateSignatureEnvironmentProfile>
+        <CreateSignatureLocation 
+          Index="4" xmlns:doc="urn:document">/doc:XMLDocument</CreateSignatureLocation>
+
+

Eingefügt werden soll die zu erzeugende Signatur in ein bestehendes Dokument, das MOA SS durch Auflösen der in CreateSignatureEnvironment/@Reference angegebenen URL erhält. Eingefügt werden soll die Signatur als fünfter Kindknoten des Wurzelelements doc:XMLDocument. Beachten Sie wiederum die Hinweise zur Zählweise für das Attribut Index bzw. zur Deklaration der im XPath-Ausdruck verwendeten Namespace-Deklarationen (hier doc).

+
+        <Supplement>
+          <Content Reference="urn:XMLDocument.xsd">
+            <LocRefContent>http://localhost:8080/referencedData/XMLDocument.xsd</LocRefContent>
+          </Content>
+        </Supplement>
+      </CreateSignatureEnvironmentProfile>
+    </CreateSignatureInfo>
+
+

Wie oben bereits angemerkt, muss MOA SS zur Auflösung der ID-Referenz #Para2 das Einfügedokument validierend parsen. Im Einfügedokument ist zwar nun ein Hinweis auf die dazu notwendige Grammatikinformation in Form eines XML-Schemas enthalten (Attribut xsi:schemaLocation enthält den Wert "urn:document urn:XMLDocument.xsd"). Nachdem die darin angegebene URI urn:XMLDocument.xsd jedoch von MOA nicht direkt aufgelöst werden kann, wird im Request ein Ergänzungsobjekt zum Einfügedokument angegeben (CreateSignatureEnvironmentProfile/Supplement). Das Attribut Content/@Reference enthält die Referenz auf das Ergänzungsobjekt in exakt jener Schreibweise, wie sie im Attribut xsi:schemaLocation angegeben wurde (urn:XMLDocument.xsd). Das Element Content beinhaltet das Ergänzungsobjekt so, wie es MOA SS verwenden soll (Elemente Base64Content oder XMLContent, vergleiche Einfaches Beispiel), bzw. enthält eine von MOA SS auflösbare Referenz auf das Ergänzungsobjekt (Element LocRefContent, vergleiche Einfaches Beispiel). Im konkreten Beispiel wird LocRefContent verwendet.

+

Beachten Sie bitte, dass die Verwendung von Ergänzungsobjekten für die Mitteilung von XML-Schemata nur dann funktioniert, wenn die Referenz auf das XML-Schema in der xsi:schemaLocation eine absolute URI ist (also z.B. wie hier urn:XMLDocument.xsd oder auch http://example.org/XMLDocument.xsd, nicht aber z.B. XMLDocument.xsd oder ../schemas/XMLDocument.xsd).

+

Auch für das Auflösen eines Verweises in einer DTD kann in analoger Weise von Ergänzungsobjekten Gebrauch gemacht werden.

+
Response
+

CreateXMLSignatureRequest.Supplements.resp.xml ist eine typische Response des SS Webservices auf den obigen Request. Er wird an dieser Stelle nicht näher analysiert, da er keine für das Thema des Beispiels relevanten Besonderheiten aufweist.

+

2.1.2 Prüfung einer CMS-Signatur

+

2.1.2.1 Einfaches Beispiel

+
Request
+

Dieses Beispiel (VerifyCMSSignatureRequest.Simple.xml) ist ein einfacher Request zur Prüfung einer CMS-Signatur. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass der nachfolgende Ausschnitt aus dem Request aus Gründen der Übersichtlichkeit gekürzt wurde.

+
+<VerifyCMSSignatureRequest 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
+  <CMSSignature>MIIHsAYJKo...4sLL6kpOPJaLg==</CMSSignature>
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyCMSSignatureRequest>
+
+

Der Request enthält zunächst in CMSSignature die zu prüfende CMS-Signatur, und zwar in base64 kodierter Form. In diesem Beispiel wird davon ausgegangen, dass es sich dabei um eine Enveloping Signature handelt, d. h. dass die signierten Daten als Teil der CMS-Struktur vorhanden sind. Für die Behandlung einer Detached Signature sei auf das nächste Beispiel verwiesen.

+

Abschließend enthält der Request in TrustProfileID die Angabe des Vertrauensprofils, gegen das die Vertrauensprüfung des Zertifikats durchgeführt werden soll. Ein Vertrauensprofil mit dem angegebenen Namen muss in der für die Signaturprüfung verwendeten Instanz von MOA SP eingerichtet sein.

+
Response
+

VerifyCMSSignatureRequest.Simple.resp.xml 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ückt und gekürzt wurde.

+
+<VerifyCMSSignatureResponse 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <SignerInfo>
+    <dsig:X509Data>
+      <dsig:X509SubjectName>serialNumber=615536615920,givenName=Gregor,SN=Karlinger,
+CN=Gregor Karlinger,C=AT</dsig:X509SubjectName>
+      <dsig:X509IssuerSerial>
+        <dsig:X509IssuerName>CN=TrustSignTest-Sig-01,OU=TrustSignTest-Sig-01,
+O=A-Trust Ges. für Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName>
+        <dsig:X509SerialNumber>2892</dsig:X509SerialNumber>
+      </dsig:X509IssuerSerial>
+      <dsig:X509Certificate>...</dsig:X509Certificate>
+      <QualifiedCertificate/>
+    </dsig:X509Data>
+  </SignerInfo>
+
+

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der CMS-Signatur enthaltenen Signatorzertifikat entnommen sind.

+

dsig:X509SubjectName ist immer vorhanden und enthält den Namen des Signators. dsig:X509IssuerSerial ist ebenfalls immer vorhanden und enthält den Namen des Austellers des Signatorzertifikats (dsig:X509IssuerName) sowie die Seriennummer des Zertifikats (dsig:X509SerialNumber). Auch dsig:X509Certificate ist immer vorhanden und enthält das Signatorzertifikat in base64 kodierter Form.

+

Optional vorhanden ist das inhaltslose Element QualifiedCertificate, und zwar dann, wenn es sich beim Signatorzertifikat um ein qualifiziertes Zertifikat handelt. Ebenfalls optional vorhanden ist schließlich - in diesem Beispiel nicht ersichtlich - das Element PublicAuthority, und zwar dann, wenn das Signatorzertifikat die österreichspezifische Zertifikatserweiterung Verwaltungseigenschaft aufweist. Ist in dieser Zertifikatserweiterung das Verwaltungskennzeichen mitkodiert, wird dieses Kennzeichen als Textinhalt des optionalen Elements PublicAuthority/Code geliefert.

+
+  <SignatureCheck>
+    <Code>0</Code>
+  </SignatureCheck>
+
+

Anschließend an SignerInfo enthält die Response mit SignatureCheck/Code das Resultat der kryptographischen Prüfung der Signatur. In unserem Beispiel ist dort der Wert 0 enthalten, d. h. die Signatur konnte erfolgreich validiert werden. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

+
+  <CertificateCheck>
+    <Code>1</Code>
+  </CertificateCheck>
+
+

Abschließend enthält die Response mit CertificateCheck/Code das Resultat der Prüfung des Signatorzertifikats. Zunächst prüft MOA SP, ob ausgehend vom Signatorzertifikat eine Zertifikatskette zu einem im zugehörigen Vertrauensprofil konfigurierten sog. Trust Anchor gebildet werden kann. Gelingt dies, wird die Gültigkeit jedes Zertifikats dieser Kette überprüft. In unserem Beispiel enthält Code den Wert 1, d. h. MOA SP konnte die oben erläuterte Zertifikatskette nicht bilden. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

+

2.1.2.2 Erweitertes Beispiel

+
Request
+

Dieses erweiterte Beispiel zur Prüfung einer CMS-Signatur (VerifyCMSSignatureRequest.Extended.xml) demonstriert die Prüfung mehrerer Signatoren einer CMS-Signatur, die Angabe des Prüfzeitpunkts sowie die Prüfung einer Detached Signature, d. h. einer Signatur, in der die signierten Daten nicht enthalten sind und daher extra angegeben werden müssen.

+
+<VerifyCMSSignatureRequest 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  Signatories="1">
+  <DateTime>2004-08-17T08:00:00+02:00</DateTime>
+  <CMSSignature>MIIHiwYJKoZI...kfiwsvqSk48lou</CMSSignature>
+  <DataObject>
+    <Content>
+      <Base64Content>RGllc2UgRGF0ZW4gd2FyZW4gYmFzZTY0IGtvZGllcnQu</Base64Content>
+    </Content>
+  </DataObject>
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyCMSSignatureRequest>
+
+

Liegt eine zu prüfende CMS-Signatur vor, die von mehreren Unterzeichnenden signiert worden ist, kann das Attribut VerifyCMSSignatureRequest/@Signatories verwendet werden, um jene Unterzeichnenden auszuwählen, deren Unterschriften von MOA SP geprüft werden sollen. Der Default-Wert für dieses optionale Attribut ist 1. Soll nicht die Unterschrift allein des ersten Unterzeichnenden geprüft werden, muss das Attribut explizit angegeben werden. Es enthält dann eine oder mehrere Ganzzahlwerte, getrennt durch Leerzeichen. Jede Ganzzahl bezeichnet einen Unterzeichnenden, wobei die Reihenfolge der Auflistung der Unterzeichner in der CMS-Signatur entspricht. Der Wert "1 3" würde beispielsweise aussagen, dass MOA SP die Unterschrift des ersten sowie des dritten Unterzeichnenden prüfen soll.

+

Mit dem optionalen Element DateTime kann der Zeitpunkt der Signaturprüfung explizit vorgegeben werden. Inhalt dieses Elements ist die Angabe von Datum und Uhrzeit entsprechend dem XML-Schema Datentyp dateTime. Enthält der angegebene Zeitpunkt keinen Zeitzonen-Offset zur UTC, wird der Zeitpunkt als lokale Zeit des Servers interpretiert, auf dem MOA SP läuft. Wird DateTime nicht angegeben, versucht MOA SP, den Zeitpunkt der Signaturerstellung aus der Signatur zu ermitteln (anhand des Signaturattributs SigningTime). Enthält die Signatur keinen Zeitpunkt der Signaturerstellung, verwendet MOA SP die aktuelle Systemzeit des Servers, auf dem es läuft.

+

Das optionale Element DataObject muss dann angegeben werden, wenn eine Detached Signature geprüft werden soll, d. h. wenn in der CMS-Signatur die signierten Daten nicht mitkodiert sind. In DataObject/Content/Base64Content sind in einem solchen Fall diese Daten in base64 kodierter Form bereit zu stellen.

+
Response
+

VerifyCMSSignatureRequest.Extended.resp.xml ist eine typische Response des SP Webservices auf den obigen Request. Er wird an dieser Stelle nicht näher analysiert, da er keine für das Thema des Beispiels relevanten Besonderheiten aufweist.

+

2.1.3 Prüfen einer XML-Signatur

+

2.1.3.1 Einfaches Beispiel

+
Request
+

VerifyXMLSignatureRequest.Simple.xml ist ein einfacher XML-Request zur Prüfung einer XML-Signatur. Sein Aufbau wird nachfolgend analysiert. Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

+
+<VerifyXMLSignatureRequest xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
+  <VerifySignatureInfo>
+    <VerifySignatureEnvironment>
+      <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-sha1"/>
+            <dsig:Reference Id="reference-1-1" URI="#xpointer(id('signed-data-1-1-1')/node())">
+              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+              <dsig:DigestValue>tLODyeiWFbAkQKwhrR23jtcgu4k=</dsig:DigestValue>
+            </dsig:Reference>
+          </dsig:SignedInfo>
+          <dsig:SignatureValue>...</dsig:SignatureValue>
+          <dsig:KeyInfo>...</dsig:KeyInfo>
+          <dsig:Object Id="signed-data-1-1-1">Diese Daten werden signiert.</dsig:Object>
+        </dsig:Signature>
+      </XMLContent>
+    </VerifySignatureEnvironment>
+
+

Das Element VerifySignatureEnvironment enthält jenes XML-Dokument, das die zu prüfende XML-Signatur enthält. Auch hier stehen eine Reihe von Möglichkeiten zur Verfügung, dieses XML-Dokument anzugeben. Im Beispiel wurde das Element XMLContent verwendet; alternativ stehen die Elemente Base64Content und LocRefContent bzw. gleichwertig zu LocRefContent das Attribut Reference zur Verfügung.

+

Im konkreten Beispiel enthält das angegebene XML-Dokument direkt als Root-Element die zu prüfende Signatur (dsig:Signature). Es handelt sich dabei um eine Enveloping Signature, d. h. die signierten Daten sind in einem dsig:Object als Teil der XML-Struktur der Signatur kodiert. Tatsächlich signiert ist hier die Zeichenkette Diese Daten werden signiert.

+
+    <VerifySignatureLocation
+      xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">/dsig:Signature</VerifySignatureLocation>
+  </VerifySignatureInfo>
+
+

Das Element VerifySignatureLocation enthält als Text den XPath-Ausdruck zur Selektion der XML-Signatur innerhalb des zu prüfenden XML-Dokuments. Die Auswertung des XPath-Ausdrucks muss genau ein Element dsig:Signature ergeben. Bitte beachten Sie, dass im Kontext des Elements VerifySignatureLocation alle im XPath-Ausdruck verwendeten Namespace-Präfixe bekannt sein müssen (hier das Präfix dsig).

+
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyXMLSignatureRequest>
+
+

Das Element TrustProfileID schließlich enthält den Bezeichner des Vertrauensprofils, gegen das die Zertifikatsprüfung von MOA SP durchgeführt wird. Ein Vertrauensprofil enthält die Zertifikate jene Zertifizierungsdiensteanbieter, denen als Aussteller von Signatorzertifikaten vertraut wird. Ein Vertrauensprofil mit dem gewählten Namen (hier Test-Signaturdienste) muss in der Konfiguration von MOA SP hinterlegt sein.

+
Response
+

VerifyXMLSignatureRequest.Simple.resp.xml 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ückt und gekürzt wurde.

+
+<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>CN=Test: Signaturdienst aller Kunden: ECDSA (P192v1),OU=Technik und Standards,
+      O=Stabsstelle IKT-Strategie des Bundes,C=AT</dsig:X509SubjectName>
+      <dsig:X509IssuerSerial>
+        <dsig:X509IssuerName>CN=Test CA - Signaturdienste,OU=Technik und Standards,
+        O=Stabstelle IKT-Strategie des Bundes,C=AT</dsig:X509IssuerName>
+        <dsig:X509SerialNumber>9</dsig:X509SerialNumber>
+      </dsig:X509IssuerSerial>
+      <dsig:X509Certificate>...</dsig:X509Certificate>
+      <PublicAuthority>
+        <Code>BKA-IKT</Code>
+      </PublicAuthority>
+    </dsig:X509Data>
+  </SignerInfo>
+
+

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind.

+

dsig:X509SubjectName ist immer vorhanden und enthält den Namen des Signators. dsig:X509IssuerSerial ist ebenfalls immer vorhanden und enthält den Namen des Austellers des Signatorzertifikats (dsig:X509IssuerName) sowie die Seriennummer des Zertifikats (dsig:X509SerialNumber). Auch dsig:X509Certificate ist ist immer vorhanden und enthält das Signatorzertifikat in base64 kodierter Form.

+

Optional vorhanden - in diesem Beispiel nicht ersichtlich - ist das inhaltslose Element QualifiedCertificate, und zwar dann, wenn es sich beim Signatorzertifikat um ein qualifiziertes Zertifikat handelt. Ebenfalls optional vorhanden ist schließlich das Element PublicAuthority, und zwar dann, wenn das Signatorzertifikat die österreichspezifische Zertifikatserweiterung Verwaltungseigenschaft aufweist. Ist in dieser Zertifikatserweiterung das Verwaltungskennzeichen mitkodiert, wird dieses Kennzeichen als Textinhalt des optionalen Elements PublicAuthority/Code geliefert.

+
+  <SignatureCheck>
+    <Code>0</Code>
+  </SignatureCheck>
+
+

Anschließend an SignerInfo enthält die Response mit SignatureCheck/Code das Resultat der kryptographischen Prüfung der Signatur. In unserem Beispiel ist dort der Wert 0 enthalten, d. h. die Signatur konnte erfolgreich validiert werden. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

+
+  <CertificateCheck>
+    <Code>0</Code>
+  </CertificateCheck>
+
+

Abschließend enthält die Response mit CertificateCheck/Code das Resultat der Prüfung des Signatorzertifikats. Zunächst prüft MOA SP, ob ausgehend vom Signatorzertifikat eine Zertifikatskette zu einem im zugehörigen Vertrauensprofil konfigurierten sog. Trust Anchor gebildet werden kann. Gelingt dies, wird die Gültigkeit jedes Zertifikats dieser Kette überprüft. In unserem Beispiel enthält Code den Wert 0, d. h. MOA SP konnte die Kette bilden, und alle Zertifikate der Kette sind gültig. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

+

2.1.3.2 Erweitertes Beispiel

+
Request
+

Dieses erweiterte Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.Enveloped.xml) demonstriert die Prüfung einer Enveloped Signature, d. h. einer Signatur, die in ein XML-Dokument integriert ist, die Angabe des Prüfzeitpunkts sowie die Anweisung an MOA SP, in der Response die von der Signatur abgedeckten Daten zu retournieren.

+
+<VerifyXMLSignatureRequest xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
+  <DateTime>2004-08-18T17:00:00+02:00</DateTime>
+
+

Mit dem optionalen Element DateTime kann der Zeitpunkt der Signaturprüfung explizit vorgegeben werden. Inhalt dieses Elements ist die Angabe von Datum und Uhrzeit entsprechend dem XML-Schema Datentyp dateTime. Enthält der angegebene Zeitpunkt keinen Zeitzonen-Offset zur UTC, wird der Zeitpunkt als lokale Zeit des Servers interpretiert, auf dem MOA SP läuft. Wird DateTime nicht angegeben, versucht MOA SP, den Zeitpunkt der Signaturerstellung aus der Signatur zu ermitteln (anhand des Signaturattributs SigningTime). Enthält die Signatur keinen Zeitpunkt der Signaturerstellung, verwendet MOA SP die aktuelle Systemzeit des Servers, auf dem es läuft.

+
+  <VerifySignatureInfo>
+    <VerifySignatureEnvironment Reference="http://localhost:8080/referencedData/XMLDocument.signed.xml"/>
+    <VerifySignatureLocation xmlns:doc="urn:document"
+      xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">/doc:XMLDocument/dsig:Signature</VerifySignatureLocation>
+  </VerifySignatureInfo>
+
+

Das Element VerifySignatureEnvironment enthält in diesem Fall mit dem Attribut Reference eine Referenz auf das XML-Dokument (XMLDocument.signed.xml), das die zu prüfende Signatur beinhaltet. Als Textinhalt von VerifySignatureLocation ist ein XPath-Ausdruck angegeben, der die zu prüfende Signatur innerhalb des XML-Dokuments auswählt. Bitte beachten Sie, dass im Kontext des Elements VerifySignatureLocation alle im XPath-Ausdruck verwendeten Namespace-Präfixe bekannt sein müssen (hier die Präfixe doc und dsig).

+
+  <ReturnHashInputData/>
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyXMLSignatureRequest>
+
+

Durch Angabe des optionalen, leeren Elements ReturnHashInputData wird MOA SP angewiesen, im Response jene Daten zurückzuliefern, die von der Signatur abgedeckt sind, d. h. tatsächlich signiert wurden (siehe unten). Diese Information ist für die MOA SP verwendende Anwendung essentiell, da sie wissen muss, ob tatsächlich die von ihr geforderten Daten signiert wurden. Wird HashInputData im Request nicht angegeben, muss die Anwendung selbst die Signatur analysieren, um diese Information zu erhalten.

+
Response
+

VerifyXMLSignatureRequest.Enveloped.resp.xml 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ückt und gekürzt wurde.

+
+<VerifyXMLSignatureResponse 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <SignerInfo>
+    <dsig:X509Data>...</dsig:X509Data>
+  </SignerInfo>
+
+

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind (siehe Einfaches Beispiel).

+
+  <HashInputData PartOf="SignedInfo">
+    <Base64Content>PGRvYzp...hNTERvY3VtZW50Pg==</Base64Content>
+  </HashInputData>
+
+

Wurde im Request - so wie in diesem Beispiel - das Element ReturnHashInputData angegeben, enthält + die Response nach SignerInfo für jede dsig:Reference in dsig:SignedInfo der + XML-Signatur (bzw. auch für jede dsig:Reference aus einem dsig:Manifest, auf + das mittels des Attributs Type="http://www.w3.org/2000/09/xmldsig#Manifest" in einer dsig:Reference aus dsig:SignedInfo verwiesen + wird; solche Manifeste kommen aber in diesem Beispiel nicht vor) ein Element HashInputData.

+

Die Reihenfolge der HashInputData-Elemente + entspricht der Reihenfolge der dsig:Reference-Elemente in dsig:SignedInfo der + XML-Signatur (enthält die XML-Signatur auch dsig:Manifest-Elemente, auf die jeweils in einer dsig:Reference aus dsig:SignedInfo verwiesen wird, werden zuerst HashInputData-Elemente für alle dsig:Reference-Elemente + aus dsig:SignedInfo und anschließend HashInputData-Elemente für alle dsig:Reference-Elemente + aus den einzelnen dsig:Manifest-Elementen geliefert).

+

Das Attribut PartOf weist mit dem Wert SignedInfo darauf hin, dass die dsig:Reference, +für welche die Hasheingangsdaten gelten, Teil von dsig:SignedInfo ist (für eine dsig:Reference aus +einem dsig:SignedInfo würde der gelieferte Wert XMLDSIGManifest lauten; weiters +würde HashInputData in einem solchen Fall ein weiteres Attribut + + +ReferringSigReference aufweisen, dessen Wert die Nummer jener dsig:Reference aus dsig:SignedInfo als +positive Ganzzahl repräsentiert, die auf das beinhaltende dsig:Manifest verweist.).

+

Der Inhalt wird dabei stets mittels Base64Content in + base64-kodierter Form geliefert.

+
+  <SignatureCheck>
+    <Code>0</Code>
+  </SignatureCheck>
+  <CertificateCheck>
+    <Code>0</Code>
+  </CertificateCheck>
+</VerifyXMLSignatureResponse>
+
+

Die Elemente SignatureCheck und CertificateCheck enthalten die Resultate der kryptographischen Prüfung der Signatur sowie der Zertifikatsprüfung (siehe Einfaches Beispiel).

+

2.1.3.3 Prüfung eines XMLDSIG-Manifests

+
Request
+

Dieses Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.XMLDSigManifest.xml) demonstriert die Prüfung eines in der XML-Signatur vorhandenden Manifests nach XMLDSig. Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

+
+<VerifyXMLSignatureRequest
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <VerifySignatureInfo>
+    <VerifySignatureEnvironment>
+      <XMLContent>
+        <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="signature-1-1">
+          <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-sha1"/>
+            <dsig:Reference Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#dsig-manifest-1-1">
+              <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+              <dsig:DigestValue>nUUaW6OtcsNvV/QhqmkU2QXT1Mw=</dsig:DigestValue>
+            </dsig:Reference>
+          </dsig:SignedInfo>
+          <dsig:SignatureValue>315gCwZI...OXFwr+</dsig:SignatureValue>
+          <dsig:KeyInfo>...</dsig:KeyInfo>
+          <dsig:Object Id="signed-data-1-1-1">Diese Daten sind signiert.</dsig:Object>
+          <dsig:Object>
+            <dsig:Manifest Id="dsig-manifest-1-1">
+              <dsig:Reference Id="reference-1-1" URI="#xpointer(id('signed-data-1-1-1')/node())">
+                <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
+                <dsig:DigestValue>EYxznGxNRAIcHQeUsj+zsK+uaHA=</dsig:DigestValue>
+              </dsig:Reference>
+            </dsig:Manifest>
+          </dsig:Object>
+        </dsig:Signature>
+      </XMLContent>
+    </VerifySignatureEnvironment>
+
+

Das Element VerifySignatureEnvironment enthält als XMLContent die zu prüfende XML-Signatur. Man erkennt, dass sich die einzige dsig:Reference im dsig:SignedInfo der XML-Signatur auf ein Manifest nach XMLDSig bezieht (erkennbar am Attribut Type, das auf den Wert http://www.w3.org/2000/09/xmldsig#Manifest gesetzt ist). Im Response (siehe unten) werden wir deshalb ein eigenes Resultat für die Manifest-Prüfung erhalten.

+

Das Manifest selbst ist in einem dsig:Object, also innerhalb der XML-Struktur der XML-Signatur kodiert. Es enthält eine dsig:Reference, welche sich auf die Zeichenkette Diese Daten sind signiert. bezieht.

+
+    <VerifySignatureLocation>//dsig:Signature</VerifySignatureLocation>
+  </VerifySignatureInfo>
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyXMLSignatureRequest>
+
+

Das Element VerifySignatureLocation wählt die zu prüfende Signatur innerhalb des in VerifySignatureEnvironment angegebenen XML-Dokuments aus. Das Element TrustProfileID wählt das Vertrauensprofil aus, gegen das die Zertifikatsprüfung durchgeführt werden soll.

+
Response
+

VerifyXMLSignatureRequest.XMLDSigManifest.resp.xml 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ückt und gekürzt wurde.

+
+<VerifyXMLSignatureResponse 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <SignerInfo>
+    <dsig:X509Data>...</dsig:X509Data>
+  </SignerInfo>
+  <SignatureCheck>
+    <Code>0</Code>
+  </SignatureCheck>
+
+

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind (siehe Einfaches Beispiel). Das Element SignatureCheck enthält das Resultat der kryptographischen Prüfung der Signatur (siehe Einfaches Beispiel).

+
+  <XMLDSIGManifestCheck>
+    <Code>0</Code>
+    <Info>
+      <ReferringSigReference>1</ReferringSigReference>
+    </Info>
+  </XMLDSIGManifestCheck>
+
+

Neu ist in dieser Response das an SignatureCheck anschließende Element XMLDSIGManifestCheck. Ein oder mehrere solche Elemente werden immer dann zurückgeliefert, wenn in dsig:SignedInfo der XML-Signatur dsig:Reference Elemente existieren, die sich auf ein Manifest nach XMLDSIG beziehen (siehe oben). Je solcher dsig:Reference enthält die Antwort ein korrespondierendes Element XMLDSIGManifestCheck, im konkreten Beispiel als eines.

+

Das Element Code gibt das Ergebnis der durchgeführten Prüfung des XMLDSIG-Manifests an. In diesem Fall bedeutet 0, dass die Prüfung jeder dsig:Reference im dsig:Manifest (im konkreten Beispiel also genau einer dsig:Reference) erfolgreich durchgeführt werden konnte. Für eine Übersicht der möglichen Kodes siehe Security-Layer 1.2.

+

Das Element Info/ReferringSigReference enthält als Textinhalt die Nummer jenes dsig:Reference Elements in dsig:SignedInfo der XML-Signatur, welches auf das untersuchte Manifest nach XMLDSIG verweist, wobei mit 1 zu zählen begonnen wird.

+
+  <CertificateCheck>
+    <Code>0</Code>
+  </CertificateCheck>
+</VerifyXMLSignatureResponse>
+
+

Das Element CertificateCheck enthält das Resultat der Zertifikatsprüfung (siehe Einfaches Beispiel).

+

2.3.1.4 Ergänzungsobjekte

+

Dieses Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.Supplements.xml) demonstriert die Verwendung von Ergänzungsobjekten. Ein Ergänzungsobjekt betrifft entweder ein signiertes Datum (Zusammenhang mit einem dsig:Reference der XML-Signatur) oder jenes Dokument, in dem sich die zu prüfende XML-Signatur befindet (Zusammenhang mit VerifySignatureEnvironment). Es muss dann angegeben werden, wenn auf ein signiertes Datum bzw. in einem signierten Datum bzw. in dem die XML-Signatur enthaltenden XML-Dokument auf weitere Daten per Referenz verwiesen wird, diese Referenz aber von MOA SP nicht aufgelöst werden kann. Das Ergänzungsobjekt enthält dann genau diese Daten die nicht von MOA SS aufgelöst werden können.

+

Bitte beachten Sie, dass der dargestellte Request zur bessernen Lesbarkeit eingerückt und gekürzt wurde.

+
+<VerifyXMLSignatureRequest xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#">
+  <VerifySignatureInfo>
+    <VerifySignatureEnvironment>
+      <XMLContent>
+        <doc:XMLDocument ... xsi:schemaLocation="urn:document urn:XMLDocument.xsd">
+          <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
+          <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
+Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
+          <dsig:Signature Id="signature-1-1" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+            <dsig:SignedInfo>
+              ...
+              <dsig:Reference Id="reference-1-1" URI="#Para2">
+                <dsig:Transforms>
+                  <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">
+                      <xsl:include href="XMLDocument.Para.xsl"/>
+                    </xsl:stylesheet>
+                  </dsig:Transform>
+                  <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+                </dsig:Transforms>
+                ...
+              </dsig:Reference>
+            </dsig:SignedInfo>
+            <dsig:SignatureValue>5rXIIkbP/djWmTgQEICy...0Sf8jvnz+d</dsig:SignatureValue>
+            <dsig:KeyInfo>...</dsig:KeyInfo>
+          </dsig:Signature>
+        </doc:XMLDocument>
+      </XMLContent>
+    </VerifySignatureEnvironment>
+
+

Das Element VerifySignatureEnvironment enthält das XML-Dokument mit der zu prüfenden XML-Signatur.

+

Man erkennt, dass das Attribut dsig:Reference/@URI das Element doc:Paragraph mit dem auf den Wert Para2 gesetzten ID-Attribut ParaId referenziert. MOA kann jedoch den Umstand, dass es sich bei doc:Paragraph/@ParaId um ein ID-Attribut handelt, nur dann erkennen, wenn es das XML-Dokument validierend parst. Der dazu nötige Verweis auf das passende XML-Schema ist zwar mit dem Attribut xsi:schemaLocation vorhanden, jedoch handelt es sich dabei mit urn:XMLDocument.xsd um eine nicht auflösbare Referenz. Deshalb wird im Request ein passendes Ergänzungsobjekt benötigt (siehe unten).

+

Weiters erkennt man, dass dsig:Reference ein XSLT-Transformation enthält. Im darin kodierten Stylesheet-Parameter (dsig:Transform/xsl:stylesheet) wird ein weiterer Stylesheet inkludiert (XMLDocument.Para.xsl). Diese Referenz ist aber wiederum für MOA SP nicht auflösbar. Auch hier wird also ein passendes Ergänzungsobjekt benötigt (siehe unten).

+
+    <VerifySignatureLocation xmlns:doc="urn:document" 
+      xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">/doc:XMLDocument/dsig:Signature</VerifySignatureLocation>
+  </VerifySignatureInfo>
+
+

Das Element VerifySignatureLocation wählt die zu prüfende Signatur innerhalb des in VerifySignatureEnvironment angegebenen XML-Dokuments aus.

+
+  <SupplementProfile>
+    <Content Reference="XMLDocument.Para.xsl">
+      <LocRefContent>http://localhost:8080/referencedData/XMLDocument.Para.xsl</LocRefContent>
+    </Content>
+  </SupplementProfile>
+
+

Das erste Element SupplementProfile enthält nun das Ergänzungsobjekt für den oben beschriebenen inkludierten Stylesheet. Content/@Reference enthält die Referenz genau so, wie sie oben im Attribut xsl:stylesheet/@href angegeben wurde. Im Inhalt von Content werden entweder explizit jene Daten angegeben, die von MOA statt des Auflösens der Referenz verwendet werden sollen (Base64Content oder XMLContent), oder aber es wird - wie im konkreten Beispiel - mit LocRefContent eine auflösbare Referenz für diese Daten an MOA SP übergeben.

+
+  <SupplementProfile>
+    <Content Reference="urn:XMLDocument.xsd">
+      <XMLContent>
+        <xs:schema targetNamespace="urn:document" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+          xmlns="urn:document" elementFormDefault="qualified" attributeFormDefault="unqualified">
+          ...
+        </xs:schema>
+      </XMLContent>
+    </Content>
+  </SupplementProfile>
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyXMLSignatureRequest>
+
+

Das zweite Element SupplementProfile enthält analog das Ergänzungsobjekt für das oben beschriebene XML-Schema. Content/@Reference enthält die Referenz genau so, wie sie oben im Attribut xsi:schemaLocation angegeben wurde.

+
Response
+

VerifyXMLSignatureRequest.Supplements.resp.xml ist eine typische Response des SP Webservices auf den obigen Request. Er wird an dieser Stelle nicht näher analysiert, da er keine für das Thema des Beispiels relevanten Besonderheiten aufweist.

+

2.1.3.5 Signatur-Manifest des Security-Layers

+
Request
+

Dieses Beispiel zur Prüfung einer XML-Signatur (VerifyXMLSignatureRequest.SigManifest.xml) demonstriert die Überprüfung des Zusammenhangs zwischen den Referenz-Eingangsdaten und den Hash-Eingangsdaten für die dsig:Reference-Elemente einer XML-Signatur. Mit Hilfe dieser Prüfung kann eine Anwendung feststellen, ob bei der Erstellung einer XML-Signatur jene Transformationen bzw. auch jene inkludierten Stylesheets (vgl. Implizite Transformationsparameter) einer XSLT-Transformation angewendet wurden, welche die Anwendung vorgegeben hat. Bei erfolgreicher Prüfung dieses Zusammenhangs kann die Anwendung die Referenz-Eingangsdaten einer dsig:Reference als gesichert ansehen, obwohl eigentlich die Hash-Eingangsdaten durch die Signatur gesichert sind. Dies ist jenen Fällen sinnvoll, in denen die Anwendung grundsätzlich mit XML-Daten arbeitet, diese Daten jedoch für das Signieren durch eine Person in ein für diese Person verständliches Format wie z.B. HTML umgewandelt werden sollen.

+
+<VerifyXMLSignatureRequest 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <VerifySignatureInfo>
+    <VerifySignatureEnvironment>
+      <XMLContent>
+        <doc:XMLDocument xmlns:doc="urn:document" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="urn:document http://localhost:8080/referencedData/XMLDocument.xsd">
+          <doc:Paragraph>Ich bin der erste Absatz in diesem Dokument.</doc:Paragraph>
+          <doc:Paragraph ParaId="Para2">Und ich bin der zweite Absatz in diesem Dokument.
+Ich habe weiters ein eigenens ID-Attribut bekommen.</doc:Paragraph>
+          <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="signature-1-1">
+            <dsig:SignedInfo>
+              ...
+              <dsig:Reference Id="reference-1-1" URI="#Para2">
+                <dsig:Transforms>
+                  <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">
+                      <xsl:include href="http://localhost:8080/referencedData/XMLDocument.Para.xsl"/>
+                    </xsl:stylesheet>
+                  </dsig:Transform>
+                  <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+                </dsig:Transforms>
+                ...
+              </dsig:Reference>
+              <dsig:Reference 
+                Type="http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest" 
+                URI="#manifest-1-1">
+                ...
+              </dsig:Reference>
+              <dsig:Reference Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" ...>...</dsig:Reference>
+            </dsig:SignedInfo>
+            <dsig:SignatureValue>jnXc/X+hUY...uBxo9q</dsig:SignatureValue>
+            <dsig:KeyInfo>...</dsig:KeyInfo>
+            <dsig:Object>
+              <dsig:Manifest Id="manifest-1-1">
+                <dsig:Reference URI="http://localhost:8080/referencedData/XMLDocument.Para.xsl">
+                  ...
+                </dsig:Reference>
+              </dsig:Manifest>
+            </dsig:Object>
+            <dsig:Object Id="etsi-signed-1-1">
+              <etsi:QualifyingProperties Target="#signature-1-1" xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#">
+              ...
+              </etsi:QualifyingProperties>
+            </dsig:Object>
+          </dsig:Signature>
+        </doc:XMLDocument>
+      </XMLContent>
+    </VerifySignatureEnvironment>
+
+

Das Element VerifySignatureEnvironment enthält das XML-Dokument mit der zu prüfenden XML-Signatur. Die XML-Signatur wurde von einer Bürgerkarten-Umgebung erstellt. Man erkennt, dass das Element dsig:SignedInfo der XML-Signatur drei dsig:Reference-Elemente enthält.

+

Die erste dsig:Reference bezieht sich auf die eigentlich signierten Nutzdaten. Das zweite doc:Paragraph-Element stellt die Referenz-Eingangsdaten für diese dsig:Reference dar, welche mit Hilfe einer XSLT-Transformation in ein kleines HTML-Dokument übergeführt wird, worüber dann der Hashwert der dsig:Reference gebildet wird (Hash-Eingangsdaten).

+

Die zweite dsig:Reference bezieht sich auf das von der Bürgerkarten-Umgebung angefertigte Signaturmanifest. Das Signaturmanifest ist vorhanden, weil die XSLT-Transformation der ersten dsig:Reference einen weiteren Stylesheet inkludiert, und die Daten dieses weiteren Stylesheets ansonsten nicht von der XML-Signatur abgedeckt wären (vgl. Implizite Transformationsparameter). Das Signaturmanifest enthält eine einzige dsig:Reference, die den inkludierten Stylesheet referenziert und so in die XML-Signatur einbindet.

+

Die dritte dsig:Reference bezieht sich auf die von der Bürgerkarten-Umgebung angefertigten Signatureigenschaften, die hier nicht näher betrachtet werden.

+
+    <VerifySignatureLocation xmlns:doc="urn:document">/doc:XMLDocument/dsig:Signature</VerifySignatureLocation>
+  </VerifySignatureInfo>
+
+

Das Element VerifySignatureLocation wählt die zu prüfende Signatur innerhalb des in VerifySignatureEnvironment angegebenen XML-Dokuments aus.

+
+  <SignatureManifestCheckParams ReturnReferenceInputData="true">
+    <ReferenceInfo>
+      <VerifyTransformsInfoProfile>
+        <dsig:Transforms>
+          <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">
+              <xsl:include href="http://localhost:8080/referencedData/XMLDocument.Para.xsl"/>
+            </xsl:stylesheet>
+          </dsig:Transform>
+          <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
+        </dsig:Transforms>
+        <TransformParameter URI="http://localhost:8080/referencedData/XMLDocument.Para.xsl"/>
+      </VerifyTransformsInfoProfile>
+      <VerifyTransformsInfoProfile>
+        <dsig:Transforms>
+          <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
+        </dsig:Transforms>
+      </VerifyTransformsInfoProfile>
+    </ReferenceInfo>
+  </SignatureManifestCheckParams>
+  <TrustProfileID>Test-Signaturdienste</TrustProfileID>
+</VerifyXMLSignatureRequest>
+
+

Mit Angabe des optionalen Elements SignatureManifestCheckParams wird MOA SP angewiesen, den oben skizzierten Zusammenhang zwischen Referenz-Eingangsdaten und Hash-Eingangsdaten zu überprüfen. Wird das Attribut ReturnReferenceInputData wie im Beispiel auf den Wert true gesetzt, liefert MOA SP in der Response die Hash-Eingangsdaten für alle Referenzen in dsig:SignedInfo der XML-Signatur an die Anwendung zurück, was in der Regel von der Anwendung wohl gewünscht wird, wenn MOA SP schon den Zusammenhang zwischen Referenz-Eingangsdaten und Hash-Eingangsdaten prüfen soll.

+

Die Prüfung des Zusammenhangs untergliedert sich in zwei Teilprüfungen:

+
    +
  • Überprüfung, ob jede dsig:Reference in dsig:SignedInfo der Signatur eine vorgegebene Transformationskette inkludiert;
  • +
  • Überprüfung, ob die in der vorgegebenen Transformationskette ggf. enthaltenen inkludierten Stylesheets (implizite Transformationsparameter) durch ein Signaturmanifest mitsigniert sind.
  • +
+

Damit MOA SP die erste Teilprüfung durchführen kann, muss in SignatureManifestCheckParams je dsig:Reference Element in dsig:SignedInfo der XML-Signatur ein Element ReferenceInfo angeben. Ausgenommen sind dsig:Reference-Elemente, die auf ein Signaturmanifest (Attribut Type ist gesetzt und hat den Wert http://www.buergerkarte.at/specifications/Security-Layer/20020225#SignatureManifest), auf ein XMLDSIG-Manifest (Attribut Type ist gesetzt und hat den Wert http://www.w3.org/2000/09/xmldsig#Manifest) oder auf Signatureigenschaften (Attribut Type ist gesetzt und hat den Wert http://uri.etsi.org/01903/v1.1.1#SignedProperties) verweisen.

+

Das Element ReferenceInfo enthält eine oder mehrere erlaubte Transformationsketten, die jeweils durch ein Element VerifyTransformsInfoProfile/dsig:Transforms repräsentiert werden. Im konkreten Beispiel werden für die einzige zu prüfende dsig:Reference zwei erlaubte Transformationsketten angegeben. Die Transformationen in der dsig:Reference müssen einer dieser beiden Ketten entsprechen; im konkreten Beispiel entsprechen sie der ersten.

+

Nachdem die erste erlaubte Transformationskette eine XSLT-Transformation mit einem inkludierten Stylesheet enthält, muss MOA SP auch überprüfen, ob dieser inkludierte Stylesheet korrekt durch ein Signaturmanifest mitunterschrieben wurde. Nachdem wichtig ist, dass nicht irgendein beliebiger Stylesheet verwendet und mitunterschrieben wurde, sondern genau jener, den die Anwendung bei der Signaturerstellung vorgegeben hat, muss die Anwendung MOA SP mitteilen, welcher Stylesheet das sein muss. Die Anwendung verwendet dazu das Element VerifyTransformsInfoProfile/TransformParameter. Das Attribut TransformParameter/@URI enthält die Referenz auf den Stylesheet genau so, wie er im Stylesheet-Parameter der zu prüfenden Signatur verwendet wird (dsig:Transform/xsl:stylesheet/xsl:inlcude/@href). Für den Inhalt dieses Elements hat die Anwendung drei Möglichkeiten:

+
    +
  • Die Anwendung lässt den Inhalt leer. Dies wird sie dann machen, wenn sie darauf vertrauen kann, dass die Auflösung der in TransformParameter/@URI angegebenen Referenz bei der Signaturprüfung zum gleichen Resultat führt wie seinerzeit beim Erstellen der Signatur (z.B. weil die Referenz auf einen Webserver unter Kontrolle der Anwendung zeigt);
  • +
  • Die Anwendung gibt im Element TransformParameter/Base64Content explizit den inkludierten Stylesheet an. MOA SP verwendet dann diesen Stylesheet, um den Hashwert der dsig:Reference im Signaturmanifest zu kontrollieren;
  • +
  • Die Anwendung gibt im Element TransformParameter/Hash den Hashwert des inkludierten Stylesheets an. MOA SP löst dann die Referenz in dsig:Transform/xsl:stylesheet/xsl:inlcude/@href auf und stellt sicher, dass der über das Auflösungsergebnis gebildete Hashwert jenem in TransformParameter/Hash entspricht. Diese Möglichkeit wird die Anwendung dann verwenden, wenn es sich um einen sehr umfangreichen Stylesheet handelt, der nicht im Request mitübertragen werden soll.
  • +
+
Response
+

VerifyXMLSignatureRequest.SigManifest.resp.xml 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ückt und gekürzt wurde.

+
+<VerifyXMLSignatureResponse 
+  xmlns="http://reference.e-government.gv.at/namespace/moa/20020822#" 
+  xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
+  <SignerInfo>...</SignerInfo>
+
+

Die Response enthält zunächst in SignerInfo/dsig:X509Data Informationen über den Signator, die aus dem in der XML-Signatur enthaltenen Signatorzertifikat entnommen sind (siehe Einfaches Beispiel).

+
+  <ReferenceInputData PartOf="SignedInfo">
+    <XMLContent xml:space="preserve">
+      <doc:Paragraph ParaId="Para2" xmlns:doc="urn:document" 
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...</doc:Paragraph>
+    </XMLContent>
+  </ReferenceInputData>
+  <ReferenceInputData PartOf="SignedInfo">
+    <XMLContent xml:space="preserve">
+      <dsig:Manifest Id="manifest-1-1" xmlns:doc="urn:document" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        ...
+      </dsig:Manifest>
+    </XMLContent>
+  </ReferenceInputData>
+  <ReferenceInputData PartOf="SignedInfo">
+    <XMLContent xml:space="preserve">
+      <etsi:SignedProperties xmlns:doc="urn:document" 
+        xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        ...
+      </etsi:SignedProperties>
+    </XMLContent>
+  </ReferenceInputData>
+
+

Nachdem im Request spezifiziert wurde, dass in der Response die Referenzeingangsdaten für alle dsig:Reference-Elemente + von dsig:SignedInfo (bzw. auch für jede dsig:Reference aus einem dsig:Manifest, + auf das mittels des Attributs Type="http://www.w3.org/2000/09/xmldsig#Manifest" in einer dsig:Reference aus dsig:SignedInfo verwiesen + wird; solche Manifeste kommen aber in diesem Beispiel nicht vor) der geprüften + XML-Signatur übermittelt + werden sollen, enthält + die Response nach SignerInfo drei ReferenceInputData-Elemente. Das erste ReferenceInputData-Element + enthält das zuvor besprochene doc:Paragraph Element, das zweite das Signaturmanifest, das + dritte die Signatureigenschaften. Das Attribut PartOf jedes Elements weist mit dem Wert SignedInfo darauf hin, + dass die dsig:Reference, für welche die Referenzeingangsdaten gelten, Teil von dsig:SignedInfo ist.

+
+  <SignatureCheck>
+    <Code>0</Code>
+  </SignatureCheck>
+
+

Das Element SignatureCheck enthält das Resultat der kryptographischen Prüfung der Signatur (siehe Einfaches Beispiel).

+
+  <SignatureManifestCheck>
+    <Code>0</Code>
+  </SignatureManifestCheck>
+
+

Das Element SignatureManifestCheck enhält das Resultat der Prüfung des Zusammenhangs zwischen Referenz-Eingangsdaten und Hash-Eingangsdaten. Der Kode 0 im konkreten Beispiel bedeutet, dass alle Referenzen die in der Anfrage zur Überprüfung der XML-Signatur gemachten Einschränkungen bezüglich der erlaubten Transformationskette(n) einhalten, sowie dass die Anforderungen hinsichtlich des Signaturmanifests werden eingehalten. Für eine Übersicht der möglichen Kodes siehe die Spezifikation zu MOA SP/SS, Abschnitt 5.1.3.1.4.

+
+  <CertificateCheck>
+    <Code>0</Code>
+  </CertificateCheck>
+</VerifyXMLSignatureResponse>
+
+

Das Element CertificateCheck enthält das Resultat der Zertifikatsprüfung (siehe Einfaches Beispiel).

+

2.2 Webservice-Clients

+

Abschnitt 2.1 bespricht eine Reihe von typischen XML-Requests, die über die Webservice-Schnittstelle an MOA SP/SS gesendet werden können, um entweder Signaturen zu erstellen (MOA SS) oder Signaturen zu prüfen (MOA SP). Dieser Abschnitt zeigt die Verwendung des prototypischen Webservice-Clients, der mit dieser Dokumentation zu MOA SP/SS ausgeliefert wird.

+

2.2.1 Übersicht

+

Der Webservice-Client existiert in drei Varianten, wobei jede Variante in einer eigenen Java-Klasse implementiert ist:

+
    +
  • Der einfache Client (HTTP.java) arbeitet ohne Authentifikation. Er prüft weder die Authentizität des verwendeten MOA-Webservices, noch identifiziert er sich selbst gegenüber dem MOA-Webservice.
  • +
  • Der Client mit Server-Authentisierung (HTTPSServerAuth.java) prüft die Authentizität des verwendeten MOA-Websservices an Hand dessen SSL-Serverzertifikats, identifiziert sich selbst jedoch nicht gegenüber dem MOA-Webservice.
  • +
  • Der Client mit Client- und Server-Authentisierung (HTTPSClientAuth.java) prüft einerseits die Authentizität des verwendeten MOA-Websservices an Hand dessen SSL-Serverzertifikats; andererseits weist er sich selbst mittels eines SSL-Client-Zertifikats gegenüber dem MOA-Webservice aus.
  • +
+

Welcher der drei Varianten des Webservice-Clients zum Einsatz kommen soll, hängt von der Art ab, wie das MOA-Webservice betrieben wird, d.h. ob es Server- bzw. Client-Authentisierung unterstützt bzw. verlangt. Befinden sich sowohl MOA-Webservice als auch der Webservice-Client im gleichen, abgeschotteten Netzwerk, kann auch eine Kommunikation ohne Authenifikation in Betracht gezogen werden. Ansonsten wird der Standardfall wohl der Betrieb mit Server-Authentisierung (Verwendung von MOA SP) bzw. mit Server- und Client-Authentisierung (Verwendung von MOA SS) sein.

+

Hinweis: Das Wurzelverzeichnis dieses Handbuchs stellt ein komplettes und sofort verwendbares Eclipse Projekt dar.

+

2.2.2 Gemeinsamkeiten

+

Dieser Abschnitt beschreibt die Gemeinsamkeiten aller drei Varianten des Webservice-Clients.

+

Zunächst einmal benötigen alle drei Varianten die folgenden Java-Bibliotheken, die im Ordner clients/webservice/lib/ dieses Handbuchs bereits enthalten sind:

+ + + + + + + + + + + + + + + + + + + + + + +
Java-BibliothekBemerkung
J2SE J2SE 1.3.1 SDK oder J2SE 1.4.2 SDK oder J2SE 5.0 SDK.
Apache XercesXML-Parser, Version 2.0.2 oder höher; nicht nötig wenn JDSE 1.4.2 oder höher verwendet wird.
AXIS FrameworkWebservice-Framework, Version 1.1.
JSSEJava Secure Socket Extension, Version 1.0.3 oder höher; nur notwendig für die Varianten HTTPServerAuth und HTTPClientAuth.
+

Weiters ist allen drei Varianten der folgende Kern-Ablauf gemeinsam:

+
    +
  1. Der Webservice-Client liest einen vorbereiteten MOA-XML-Request (z. B. einen der in Abschnitt 2.1 gezeigten) vom Dateisystem ein.
  2. +
  3. Der Webservice-Client erstellt einen SOAP-Request mit dem vom Dateisystem gelesenen MOA-XML-Request als Nutzlast.
  4. +
  5. Der Webservice-Client sendet den erstellten SOAP-Request über HTTP an MOA SP/SS.
  6. +
  7. Der Webservice-Client empfängt die SOAP-Response von MOA SP/SS.
  8. +
  9. Der Webservice-Client extrahiert die Nutzlast des SOAP-Responses (d. h. die zum MOA-XML-Request aus Schritt 1 passende MOA-XML-Response), gibt diese auf die Konsole aus und speichert sie im Dateisystem.
  10. +
+

Konfiguriert werden können alle drei Varianten mit Hilfe von zwei Kommandozeilen-Parametern:

+
    +
  1. Der erste Kommandozeilenparameter gibt an, ob MOA SS (Wert sign) oder MOA SP (Wert verify) kontaktiert werden soll.
  2. +
  3. Der zweite Kommandozeilenparameter enthält Pfad und Dateiname einer Java-Properties-Datei, die die weiteren Konfigurationsparameter für den Webservice-Client enthält. Ein relativer Pfad wird als relativ zum Arbeitsverzeichnis der Java Virtual Machine interpretiert. Genaue Infos zu den möglichen Konfigurationsparametern entnehmen Sie bitte der Quellcodedokumentation der jeweiligen Variante des Webservice-Clients. http.properties enthält eine auf dieses Handbuch abgestimmte Konfiguration.
  4. +
+

2.2.3 Besonderheiten von HTTPSServerAuth.java

+

Diese Variante des Webservice-Clients verwendet JSSE, um im Schritt 3 des Kernablaufs aus Abschnitt 2.2.2 eine SSL-Verbindung mit Server-Authentifizierung zum MOA SP/SS Server aufzubauen. In dieser SSL-Verbindung sendet der Webservice-Client dann den erstellten SOAP-Request über HTTPS.

+

Die Konfiguration von JSSE (Speicher für die vertrauenswürdigen Serverzertifikate, Typ dieses Speichers, Passwort für diesen Speicher) wird mittels zusätzlicher Parameter in der in Abschnitt 2.2.2 besprochenen Java-Properties-Datei vorgenommen. Genaue Infos zu diesen Konfigurationsparametern entnehmen Sie bitte der Quellcodedokumentation von HTTPSServerAuth.java. http.properties enthält eine auf dieses Handbuch abgestimmte Konfiguration.

+

Falls Sie Probleme beim SSL-Verbindungsaufbau zwischen Webservice-Client und MOA SP/SS Webservice haben, empfiehlt sich die Aktivierung des JSSE Loggings. Das Setzen der dafür notwendigen Java System Property ist im Quellcode von HTTPSServerAuth.java bereits enthalten, jedoch auskommentiert. Suchen Sie einfach nach dem String javax.net.debug, um zur entsprechenden Stelle im Quellcode zu gelangen.

+

2.2.4 Besonderheiten von HTTPSClientAuth.java

+

Diese Variante des Webservice-Clients verwendet JSSE, um im Schritt 3 des Kernablaufs aus Abschnitt 2.2.2 eine SSL-Verbindung mit Server- und Client-Authentifizierung zum MOA SP/SS Server aufzubauen. In dieser SSL-Verbindung sendet der Webservice-Client dann den erstellten SOAP-Request über HTTPS.

+

Die gegenüber Abschnitt 2.2.3 zusätzlich notwendige Konfiguration von JSSE (Speicher für das SSL-Client-Zertifikat sowie den dazugehörigen privaten Schlüssel, Typ dieses Speichers, Passwort für diesen Speicher) wird mittels zusätzlicher Parameter in der in Abschnitt 2.2.2 besprochenen Java-Properties-Datei vorgenommen. Genaue Infos zu diesen Konfigurationsparametern entnehmen Sie bitte der Quellcodedokumentation von HTTPSClientAuth.java. http.properties enthält eine auf dieses Handbuch abgestimmte Konfiguration.

+

Beachten Sie bitte auch den Hinweis zum JSSE Logging aus Abschnitt 2.2.3.

+

3 Verwendung der Klassenbibliothek

+

Neben dem Betrieb von MOA SP/SS als Webservice ist als Alternative auch die Verwendung von MOA SP/SS als Klassenbibliothek möglich, also die direkte Einbindung in ein Java-Programm unter Verwendung des Application Programmers Interface (API) von MOA SP/SS.

+

3.1 Vorbereitung

+

Um das API von MOA SP/SS verwenden zu können, müssen einerseits die MOA-Bibliotheken selbst, andererseits eine Reihe von unterstützenden Bibliotheken in den Klassenpfad aufgenommen werden. Eine Übersicht dazu finden Sie im Installationshandbuch im Abschnitt 3. +

3.2 Allgemeines

+

Der strukturelle Aufbau der API entspricht weitgehend der Struktur eines MOA-XML-Requests. Es werden daher in diesem Abschnitt nur zwei grundlegende Beispiele gebracht; für komplexere Aufgaben können die XML-Beispiele aus Abschnitt 2.1 als Vorlage verwendet und einfach in die "API-Welt" übertragen werden. +

3.3 Beispiele

+

Dieses Handbuch enthält zwei Beispiele für die Verwendung der API von MOA SP/SS: +

    +
  1. CreateXMLSignature.java: Erstellung einer einfachen XML-Signatur; dieses Beispiel entspricht dem MOA-XML-Request aus Abschnitt 2.1.1.1.
    + Die Konfiguration der API erfolgt über Kommandozeilenparameter (Lage der Konfigurationsdatei für MOA SP/SS, Lage der Konfigurationsdatei für das Logging mit Log4j). Detaillierte Informationen dazu finden Sie in der Quellcodedokumentation des Beispiels.
  2. +
  3. VerifyXMLSignature.java: Prüfung einer einfachen XML-Signatur; dieses Beispiel entspricht dem MOA-XML-Request aus Abschnitt 2.1.3.1.
    + Die Konfiguration der API erfolgt über Kommandozeilenparameter (Lage der Konfigurationsdatei für MOA SP/SS, Lage der Konfigurationsdatei für das Logging mit Log4j). Detaillierte Informationen dazu finden Sie in der Quellcodedokumentation des Beispiels.
    + Die Auswahl der zu prüfenden Signatur erfolgt ebenfalls per Kommandozeilenparameter. Detaillierte Informationen dazu finden Sie ebenfalls in der Quellcodedokumentation des Beispiels.
  4. +
+

3.4 API-Dokumentation

+

Für die vollständige Dokumentation des API von MOA SP/SS sei auf die Java Doc der API verwiesen. +

+

A Referenzierte Software

+

Auf folgende Software-Pakete wird in diesem Handbuch verwiesen:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameBeschreibung
Apache Xerces 2 XML-Parser aus dem Apache Project
Apache AxisWebservice-Framework aus dem Apache Project
J2SE 1.3.1 SDK/JRE Java 2 Standard Edition in der Version 1.3.1 (Software Development Kit bzw. Java Runtime Environment)
J2SE 1.4.2 SDK/JREJava 2 Standard Edition in der Version 1.4.2 (Software Development Kit bzw. Java Runtime Environment)
J2SE 5.0 SDK/JRE Java 2 Standard Edition in der Version 5.0 (Software Development Kit bzw. Java Runtime Environment)
JSSEJava Secure Socket Extension
+

 

+ + diff --git a/spss/server/serverlib/resources/data/deploy/tomcat/server.mod_jk.xml b/spss/server/serverlib/resources/data/deploy/tomcat/server.mod_jk.xml new file mode 100644 index 000000000..e6035b8be --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/server.mod_jk.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spss/server/serverlib/resources/data/deploy/tomcat/server.xml b/spss/server/serverlib/resources/data/deploy/tomcat/server.xml new file mode 100644 index 000000000..3e5966ca9 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/server.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spss/server/serverlib/resources/data/deploy/tomcat/unix/moa-env.sh b/spss/server/serverlib/resources/data/deploy/tomcat/unix/moa-env.sh new file mode 100644 index 000000000..49d6723a3 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/unix/moa-env.sh @@ -0,0 +1,12 @@ +MOA_START=`pwd` + +CONFIG_OPT=-Dmoa.spss.server.configuration=$MOA_START/conf/moa-spss/spss.config.xml +LOGGING_OPT=-Dlog4j.configuration=file:$MOA_START/conf/moa-spss/log4j.properties +# NODE_ID_OPT=-Dmoa.node-id=node1 +# 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 $LOGGING_OPT $NODE_ID_OPT $TRUST_STORE_OPT $TRUST_STORE_PASS_OPT $TRUST_STORE_TYPE_OPT" + +echo CATALINA_OPTS=$CATALINA_OPTS diff --git a/spss/server/serverlib/resources/data/deploy/tomcat/uriworkermap.properties b/spss/server/serverlib/resources/data/deploy/tomcat/uriworkermap.properties new file mode 100644 index 000000000..673acf65d --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/uriworkermap.properties @@ -0,0 +1,4 @@ +# a sample mod_jk uriworkermap.properties file for mapping +# MOA SP/SS web service requests to workers + +/moa-spss/*=moaworker \ No newline at end of file diff --git a/spss/server/serverlib/resources/data/deploy/tomcat/win32/startTomcat.bat b/spss/server/serverlib/resources/data/deploy/tomcat/win32/startTomcat.bat new file mode 100644 index 000000000..b7d740d12 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/win32/startTomcat.bat @@ -0,0 +1,27 @@ +rem ---------------------------------------------------------------------------------------------- +rem Modify these entries according to your needs + +rem JDK home directory (no trailing path separator) +set JAVA_HOME= + +rem Tomcat 4.1.x home directory (no trailing path separator) +set CATALINA_HOME= + +rem ---------------------------------------------------------------------------------------------- + +set MOA_SPSS_CFG_HOME=%CATALINA_HOME%\conf\moa-spss + +set PARAM_SPSSCONFIG=-Dmoa.spss.server.configuration=%MOA_SPSS_CFG_HOME%\spss.config.xml +set PARAM_LOGGING=-Dlog4j.configuration=file:%MOA_SPSS_CFG_HOME%\log4j.properties +set PARAM_NODEID=-Dmoa.node-id=Node1 +set PARAMS_MOA=%PARAM_SPSSCONFIG% %PARAM_LOGGING% %PARAM_NODEID% + +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/spss/server/serverlib/resources/data/deploy/tomcat/win32/stopTomcat.bat b/spss/server/serverlib/resources/data/deploy/tomcat/win32/stopTomcat.bat new file mode 100644 index 000000000..09dd83f2d --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/win32/stopTomcat.bat @@ -0,0 +1,13 @@ +rem ---------------------------------------------------------------------------------------------- +rem Modify these entries according to your needs + +rem JDK home directory (no trailing path separator) +set JAVA_HOME= + +rem Tomcat 4.1.x home directory (no trailing path separator) +set CATALINA_HOME= + +rem ---------------------------------------------------------------------------------------------- + +cd %CATALINA_HOME% +bin\catalina.bat stop \ No newline at end of file diff --git a/spss/server/serverlib/resources/data/deploy/tomcat/workers.properties b/spss/server/serverlib/resources/data/deploy/tomcat/workers.properties new file mode 100644 index 000000000..9350ddc77 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tomcat/workers.properties @@ -0,0 +1,6 @@ +# a sample workers.properties file defining a single mod_jk worker + +worker.list=moaworker +worker.moaworker.type=ajp13 +worker.moaworker.host=localhost +worker.moaworker.port=8009 diff --git a/spss/server/serverlib/resources/data/deploy/tools/certtool.bat b/spss/server/serverlib/resources/data/deploy/tools/certtool.bat new file mode 100644 index 000000000..0504211b8 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tools/certtool.bat @@ -0,0 +1,25 @@ +@echo off + +rem +rem Script to invoke the CertTool class +rem +rem Author: Patrick Peck +rem Version: $Id: certtool.bat,v 1.6 2003/05/08 11:46:29 peck Exp $ +rem + + +if %OS%=="Windows_NT" @setlocal + +set CERTTOOL=at.gv.egovernment.moa.spss.server.tools.CertTool +set TOOLSPATH=%~p0 +set CLASSPATH=%TOOLSPATH%tools.jar;%TOOLSPATH%iaik_moa_full.jar;%TOOLSPATH%iaik_jce_full.jar;%TOOLSPATH%iaik_ecc.jar;%TOOLSPATH%log4j-1.2.7.jar + +if "%JAVA_HOME%"=="" goto noJavaHome +%JAVA_HOME%\bin\java.exe -classpath %CLASSPATH% %CERTTOOL% %1 %2 %3 %4 %5 %6 %7 %8 %9 +goto end + +:noJavaHome +echo error: JAVA_HOME not defined + +:end +if %OS%=="Windows_NT" @endlocal \ No newline at end of file diff --git a/spss/server/serverlib/resources/data/deploy/tools/certtool.sh b/spss/server/serverlib/resources/data/deploy/tools/certtool.sh new file mode 100644 index 000000000..c7ff374f4 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tools/certtool.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# +# Script to invoke the CertTool class +# +# Author:Patrick Peck +# Version: $Id: certtool.sh,v 1.9 2003/06/23 16:01:27 peck Exp $ +# + + +if [ -z "$JAVA_HOME" ]; then + echo "error: JAVA_HOME not defined"; + exit; +fi + +CERTOOL=at.gv.egovernment.moa.spss.server.tools.CertTool +TOOLSPATH=`dirname $PWD/$0` +CLASSPATH=$TOOLSPATH/tools.jar:$TOOLSPATH/iaik_moa_full.jar:$TOOLSPATH/iaik_jce_full.jar:$TOOLSPATH/iaik_ecc.jar:$TOOLSPATH/log4j-1.2.7.jar + +$JAVA_HOME/bin/java -classpath $CLASSPATH $CERTOOL $* diff --git a/spss/server/serverlib/resources/data/deploy/tools/configtool.bat b/spss/server/serverlib/resources/data/deploy/tools/configtool.bat new file mode 100644 index 000000000..868df11f0 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tools/configtool.bat @@ -0,0 +1,25 @@ +@echo off + +rem +rem Script to invoke the ConfigTool class +rem +rem Author: Gregor Karlinger +rem Version: $Id: $ +rem + + +if %OS%=="Windows_NT" @setlocal + +set CONFIGTOOL=at.gv.egovernment.moa.spss.server.tools.ConfigTool +set TOOLSPATH=%~p0 +set CLASSPATH=%TOOLSPATH%tools.jar;%TOOLSPATH%xalan.jar; + +if "%JAVA_HOME%"=="" goto noJavaHome +%JAVA_HOME%\bin\java.exe -classpath %CLASSPATH% %CONFIGTOOL% %1 %2 %3 %4 %5 %6 %7 %8 %9 +goto end + +:noJavaHome +echo error: JAVA_HOME not defined + +:end +if %OS%=="Windows_NT" @endlocal \ No newline at end of file diff --git a/spss/server/serverlib/resources/data/deploy/tools/configtool.sh b/spss/server/serverlib/resources/data/deploy/tools/configtool.sh new file mode 100644 index 000000000..f7f29bae1 --- /dev/null +++ b/spss/server/serverlib/resources/data/deploy/tools/configtool.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# +# Script to invoke the ConfigTool class +# +# Author: Gregor Karlinger +# Version: $Id: $ +# + + +if [ -z "$JAVA_HOME" ]; then + echo "error: JAVA_HOME not defined"; + exit; +fi + +CONFIGTOOL=at.gv.egovernment.moa.spss.server.tools.ConfigTool +TOOLSPATH=`dirname $PWD/$0` +CLASSPATH=$TOOLSPATH/tools.jar:$TOOLSPATH/xalan.jar + +$JAVA_HOME/bin/java -classpath $CLASSPATH $CONFIGTOOL $* diff --git a/spss/server/serverlib/resources/licenses/Apache-2.0.txt b/spss/server/serverlib/resources/licenses/Apache-2.0.txt new file mode 100644 index 000000000..57bc88a15 --- /dev/null +++ b/spss/server/serverlib/resources/licenses/Apache-2.0.txt @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/spss/server/serverlib/resources/licenses/IAIK-License.txt b/spss/server/serverlib/resources/licenses/IAIK-License.txt new file mode 100644 index 000000000..c0db63b22 --- /dev/null +++ b/spss/server/serverlib/resources/licenses/IAIK-License.txt @@ -0,0 +1,13 @@ +IAIK MOA Runtime Lizenz + +Stiftung SIC gewährt dem Lizenznehmer eine nicht-exklusive, nicht-übertragbare +Runtime Lizenz für die "IAIK MOA" Module im Kontext von MOA SP/SS und MOA ID. +Alle Versuche, Teile oder die kompletten IAIK Crypto Toolkits, die zusammen +mit dem MOA Produktbündel ausgeliefert werden, für andere Zwecke als jenem +für Applikationen im MOA Kontext zu verwenden, sind nicht erlaubt. Auch weitere +Versuche, die sich auf die Entwicklung von Anwendungen , oder aber darüber hinaus +auf die Schaffung eines eigenen Toolkits, oder die Aufnahme in ein weiters +weiteres Toolkit beziehen, sind nicht erlaubt. +Die hier beschriebene Runtime Lizenz ist nicht übertragbar auf weitere +Vertragspartner des Kunden, Personen, Organisationen oder Unternehmen +außerhalb der Organisation des Lizenznehmers. diff --git a/spss/server/serverlib/resources/licenses/Jaxen.txt b/spss/server/serverlib/resources/licenses/Jaxen.txt new file mode 100644 index 000000000..bef65a520 --- /dev/null +++ b/spss/server/serverlib/resources/licenses/Jaxen.txt @@ -0,0 +1,40 @@ +Copyright 2003 (C) The Werken Company. All Rights Reserved. + + Redistribution and use of this software and associated documentation + ("Software"), with or without modification, are permitted provided + that the following conditions are met: + + 1. Redistributions of source code must retain copyright + statements and notices. Redistributions must also contain a + copy of this document. + + 2. Redistributions in binary form must reproduce the + above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + + 3. The name "jaxen" must not be used to endorse or promote + products derived from this Software without prior written + permission of The Werken Company. For written permission, + please contact bob@werken.com. + + 4. Products derived from this Software may not be called "jaxen" + nor may "jaxen" appear in their names without prior written + permission of The Werken Company. "jaxen" is a registered + trademark of The Werken Company. + + 5. Due credit should be given to The Werken Company. + (http://jaxen.werken.com/). + + THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE WERKEN COMPANY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/spss/server/serverlib/resources/licenses/PostgreSQL-JDBC.txt b/spss/server/serverlib/resources/licenses/PostgreSQL-JDBC.txt new file mode 100644 index 000000000..30d54d778 --- /dev/null +++ b/spss/server/serverlib/resources/licenses/PostgreSQL-JDBC.txt @@ -0,0 +1,26 @@ +Copyright (c) 1997-2005, PostgreSQL Global Development Group +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the PostgreSQL Global Development Group nor the names + of its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAApplicationException.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAApplicationException.java new file mode 100644 index 000000000..0d7abd1d3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAApplicationException.java @@ -0,0 +1,41 @@ +package at.gv.egovernment.moa.spss; +/** + * Base class of application specific MOA exceptions. + * + * Application exceptions are exceptions that originate from application + * code (e.g. inconsistent data provided by the user, no permission to access + * certain resources, etc.) + * + * @author Patrick Peck + * @version $Id$ + */ +public class MOAApplicationException extends MOAException { + + /** + * Create a new MOAApplicationException. + * + * @param messageId The identifier of the message associated with this + * exception. + * @param parameters Additional message parameters. + */ + public MOAApplicationException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Create a new MOAApplicationException. + * + * @param messageId The identifier of the message associated with this + * MOAApplicationException. + * @param parameters Additional message parameters. + * @param wrapped The exception wrapped by this + * MOAApplicationException. + */ + public MOAApplicationException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} 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 new file mode 100644 index 000000000..f9eb12d63 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOAException.java @@ -0,0 +1,161 @@ +package at.gv.egovernment.moa.spss; +import java.io.PrintStream; +import java.io.PrintWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.util.Constants; + +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * Base class of MOA specific exceptions. + * + * This class has the ability to wrap other exceptions which may be seen + * as the root cause for this exception. A similar mechanism is in place + * since JDK1.4 (see the getClause() method) but will not be used + * because of required compatibility with JDK1.3. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class MOAException extends Exception { + /** The message ID. */ + private String messageId; + /** The wrapped Throwable. */ + private Throwable wrapped; + + /** + * Create a MOAException. + * + * @param messageId The message ID of the message contained in the created + * MOAException. + * @param parameters The parameters needed to fill in the message arguments. + */ + public MOAException(String messageId, Object[] parameters) { + super(MessageProvider.getInstance().getMessage(messageId, parameters)); + this.messageId = messageId; + } + + /** + * Create a MOAException. + * + * @param messageId The message ID of the message contained in the created + * MOAException. + * @param parameters The parameters needed to fill in the message arguments. + * @param wrapped The exception wrapped by the created + * MOAException. + */ + public MOAException(String messageId, Object[] parameters, Throwable wrapped) { + + super(MessageProvider.getInstance().getMessage(messageId, parameters)); + this.messageId = messageId; + this.wrapped = wrapped; + } + + /** + * Returns the message ID of this exception. + * + * @return The message ID as provided in the constructor. + */ + public String getMessageId() { + return messageId; + } + + /** + * Returns the exception wrapped by this MOAException. + * + * @return The exception wrapped by this exception. Possibly + * null, if none was provided at construction time. + */ + public Throwable getWrapped() { + return wrapped; + } + + /** + * Convert this MOAException to an ErrorResponse + * element from the MOA namespace. + * + * @return An ErrorResponse element, containing the subelements + * ErrorCode and Info required by the MOA schema. + */ + public Element toErrorResponse() { + DocumentBuilder builder; + DOMImplementation impl; + Document doc; + Element errorResponse; + Element errorCode; + Element info; + + // create a new document + try { + builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + impl = builder.getDOMImplementation(); + } catch (ParserConfigurationException e) { + return null; + } + + // build the ErrorResponse element + doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null); + errorResponse = doc.getDocumentElement(); + + // add MOA namespace declaration + errorResponse.setAttributeNS( + Constants.XMLNS_NS_URI, + "xmlns", + Constants.MOA_NS_URI); + + // build the child elements + errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode"); + errorCode.appendChild(doc.createTextNode(messageId)); + info = doc.createElementNS(Constants.MOA_NS_URI, "Info"); + info.appendChild(doc.createTextNode(getMessage())); + errorResponse.appendChild(errorCode); + errorResponse.appendChild(info); + return errorResponse; + } + + /** + * Print a stack trace of this exception to System.err. + * + * @see java.lang.Throwable#printStackTrace() + */ + public void printStackTrace() { + printStackTrace(System.err); + } + + /** + * Print a stack trace of this exception, including the wrapped exception. + * + * @param s The stream to write the stack trace to. + * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) + */ + public void printStackTrace(PrintStream s) { + super.printStackTrace(s); + if (getWrapped() != null) { + s.print("Caused by: "); + getWrapped().printStackTrace(s); + } + } + + /** + * Print a stack trace of this exception, including the wrapped exception. + * + * @param s The stream to write the stacktrace to. + * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) + */ + public void printStackTrace(PrintWriter s) { + super.printStackTrace(s); + if (getWrapped() != null) { + s.print("Caused by: "); + getWrapped().printStackTrace(s); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOARuntimeException.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOARuntimeException.java new file mode 100644 index 000000000..0ff175b50 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOARuntimeException.java @@ -0,0 +1,163 @@ +package at.gv.egovernment.moa.spss; +import java.io.PrintStream; +import java.io.PrintWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.util.MessageProvider; +import at.gv.egovernment.moa.util.Constants; + +/** + * Base class of MOA specific runtime exceptions. + * + * This class has the ability to wrap other exceptions which may be seen + * as the root cause for this exception. A similar mechanism is in place + * since JDK1.4 (see the getClause() method) but will not be used + * because of required compatibility with JDK1.3. + * + * @author Patrick Peck + * @version $Id$ + */ +public class MOARuntimeException extends RuntimeException { + /** The message ID. */ + private String messageId; + /** The wrapped Throwable. */ + private Throwable wrapped; + + /** + * Create a MOAException. + * + * @param messageId The message ID of the message contained in the created + * MOAException. + * @param parameters The parameters needed to fill in the message arguments. + */ + public MOARuntimeException(String messageId, Object[] parameters) { + super(MessageProvider.getInstance().getMessage(messageId, parameters)); + this.messageId = messageId; + } + + /** + * Create a MOAException. + * + * @param messageId The message ID of the message contained in the created + * MOAException. + * @param parameters The parameters needed to fill in the message arguments. + * @param wrapped The exception wrapped by the created + * MOAException. + */ + public MOARuntimeException( + String messageId, + Object[] parameters, + Throwable wrapped) { + + super(MessageProvider.getInstance().getMessage(messageId, parameters)); + this.messageId = messageId; + this.wrapped = wrapped; + } + + /** + * Returns the message ID of this exception. + * + * @return The message ID as provided in the constructor. + */ + public String getMessageId() { + return messageId; + } + + /** + * Returns the exception wrapped by this MOARuntimeException. + * + * @return The exception wrapped by this exception. Possibly + * null, if none was provided at construction time. + */ + public Throwable getWrapped() { + return wrapped; + } + + /** + * Convert this MOARuntimeException to an ErrorResponse + * element from the MOA namespace. + * + * @return An ErrorResponse element, containing the subelements + * ErrorCode and Info required by the MOA schema. + */ + public Element toErrorResponse() { + DocumentBuilder builder; + DOMImplementation impl; + Document doc; + Element errorResponse; + Element errorCode; + Element info; + + // create a new document + try { + builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + impl = builder.getDOMImplementation(); + } catch (ParserConfigurationException e) { + return null; + } + + // build the ErrorResponse element + doc = impl.createDocument(Constants.MOA_NS_URI, "ErrorResponse", null); + errorResponse = doc.getDocumentElement(); + + // add MOA namespace declaration + errorResponse.setAttributeNS( + Constants.XMLNS_NS_URI, + "xmlns", + Constants.MOA_NS_URI); + + // build the child elements + errorCode = doc.createElementNS(Constants.MOA_NS_URI, "ErrorCode"); + errorCode.appendChild(doc.createTextNode(messageId)); + info = doc.createElementNS(Constants.MOA_NS_URI, "Info"); + info.appendChild(doc.createTextNode(getMessage())); + errorResponse.appendChild(errorCode); + errorResponse.appendChild(info); + return errorResponse; + } + + /** + * Print a stack trace of this exception to System.err. + * + * @see java.lang.Throwable#printStackTrace() + */ + public void printStackTrace() { + printStackTrace(System.err); + } + + /** + * Print a stack trace of this exception, including the wrapped exception. + * + * @param s The stream to write the stack trace to. + * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) + */ + public void printStackTrace(PrintStream s) { + super.printStackTrace(s); + if (getWrapped() != null) { + s.print("Caused by: "); + getWrapped().printStackTrace(s); + } + } + + /** + * Print a stack trace of this exception, including the wrapped exception. + * + * @param s The stream to write the stacktrace to. + * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) + */ + public void printStackTrace(PrintWriter s) { + super.printStackTrace(s); + if (getWrapped() != null) { + s.print("Caused by: "); + getWrapped().printStackTrace(s); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOASystemException.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOASystemException.java new file mode 100644 index 000000000..5a49b6852 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/MOASystemException.java @@ -0,0 +1,40 @@ +package at.gv.egovernment.moa.spss; +/** + * Base class of technical MOA exceptions. + * + * Technical exceptions are exceptions that originate from system failure (e.g., + * a database connection fails, a component is not available, etc.) + * + * @author Patrick Peck + * @version $Id$ + */ +public class MOASystemException extends MOAException { + + /** + * Create a new MOASystemException. + * + * @param messageId The identifier of the message associated with this + * exception. + * @param parameters Additional message parameters. + */ + public MOASystemException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Create a new MOASystemException. + * + * @param messageId The identifier of the message associated with this + * MOASystemException. + * @param parameters Additional message parameters. + * @param wrapped The exception wrapped by this + * MOASystemException. + */ + public MOASystemException( + String messageId, + Object[] parameters, + Throwable wrapped) { + super(messageId, parameters, wrapped); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java new file mode 100644 index 000000000..a0efa8924 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/Configurator.java @@ -0,0 +1,60 @@ +package at.gv.egovernment.moa.spss.api; + +import org.apache.commons.discovery.tools.DiscoverClass; + +import at.gv.egovernment.moa.spss.MOAException; + +/** + * Configures the SP/SS API. + * + * Also handles dynamic configuration updates. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class Configurator { + + /** The default implementation class. */ + private static final String DEFAULT_IMPLEMENTATION = + "at.gv.egovernment.moa.spss.server.init.ConfiguratorImpl"; + + /** The single instance of this class. */ + private static Configurator instance = null; + + public static synchronized Configurator getInstance() { + if (instance == null) { + try { + DiscoverClass discover = new DiscoverClass(); + instance = + (Configurator) discover.newInstance( + Configurator.class, + DEFAULT_IMPLEMENTATION); + } catch (Exception e) { + // this can not happen since we provide a valid default + // implementation + } + } + return instance; + } + + /** + * Initialize the SP/SS configuration. + * + * Only a single call to this method will have an effect. Use + * update() for reflecting changes in the configuration instead. + * + * @throws MOAException An error occurred updating the SP/SS configuration. + */ + public abstract void init() throws MOAException; + + /** + * Update the SP/SS configuration. + * + * This will only have an effect after the system has been initialized once + * using init(). + * + * @throws MOAException An error occurred updating the SP/SS configuration. + */ + public abstract void update() throws MOAException; + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java new file mode 100644 index 000000000..e306127b3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SPSSFactory.java @@ -0,0 +1,1012 @@ +package at.gv.egovernment.moa.spss.api; + +import java.io.InputStream; +import java.math.BigInteger; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import org.apache.commons.discovery.tools.DiscoverClass; + +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; +import at.gv.egovernment.moa.spss.api.common.Transform; +import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.common.XPathFilter; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * An abstract factory for creating MOA SP/SS API objects. + * + * Use getInstance() to get a concrete factory instance. Using + * this instance, concrete MOA SP/SS API object can be created. + * + * @author Patrick Peck + * @author Gregor Karlinger + * @version $Id$ + */ +public abstract class SPSSFactory { + + /** The default implementation of this class. */ + private static final String DEFAULT_IMPLEMENTATION = + "at.gv.egovernment.moa.spss.api.impl.SPSSFactoryImpl"; + + /** The single instance of this class. */ + private static SPSSFactory instance = null; + + /** + * Returns the single instance of this class. + * + * @return The single instance of this class. + */ + public static synchronized SPSSFactory getInstance() { + if (instance == null) { + try { + DiscoverClass discover = new DiscoverClass(); + instance = + (SPSSFactory) discover.newInstance( + SPSSFactory.class, + DEFAULT_IMPLEMENTATION); + } catch (Exception e) { + // this can not happen since we provide a valid default + // implementation + } + } + return instance; + } + + // + // Factory methods for creating XML signatures + // + + /** + * Create a new CreateXMLSignatureRequest object. + * + * @param keyIdentifier The identifier for the key group to use for signing. + * @param singleSignatureInfos A List of + * SingleSignatureInfo objects containing information about a + * single signature to be created. + * @return The CreateXMLSignatureRequest containing the above + * data. + * + * @pre keyIdentifier != null && keyIdentifier.length() > 0 + * @pre singleSignatureInfos != null + * @pre forall Object o in singleSignatureInfos | + * o instanceof at.gv.egovernment.moa.spss.api.common.SingleSignatureInfo + * @post return != null + */ + public abstract CreateXMLSignatureRequest createCreateXMLSignatureRequest( + String keyIdentifier, + List singleSignatureInfos); + + /** + * Create a new SingleSignatureInfo object. + * + * @param dataObjectInfos The data objects that will be signed (including + * transformations). + * @param createSignatureInfo Information about the signature environment. May + * be null. + * @param securityLayerConform If true, a Security Layer conform + * signature manifest is created, otherwise not. + * @return The SingleSignatureInfo containing the above data. + * + * @pre dataObjectInfos != null && dataObjectInfos.size() > 0 + * @pre forall Object o in dataObjectInfos | + * o instanceof at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo + * @post return != null + */ + public abstract SingleSignatureInfo createSingleSignatureInfo( + List dataObjectInfos, + CreateSignatureInfo createSignatureInfo, boolean securityLayerConform); + + /** + * Create a new DataObjectInfo object. + * + * @param structure The type of signature to create. + * @param childOfManifest If true, references will be returned + * as children of an XMLDsig manifest. Otherwise, they will be returned as + * children of the signature itself. + * @param dataObject The data object that will be signed. + * @param createTransformsInfoProfile Additional transformations to apply + * to the data object. + * @return The DataObjectInfo containing the above data. + * + * @pre DataObjectInfo.STRUCTURE_DETACHED.equals(structure) || + * DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure) + * @pre dataObject != null + * @pre createTransformsInfoProfile != null + * @post return != null + */ + public abstract DataObjectInfo createDataObjectInfo( + String structure, + boolean childOfManifest, + Content dataObject, + CreateTransformsInfoProfile createTransformsInfoProfile); + + /** + * Create a new CreateTransformsInfoProfile object containing a + * reference to a locally stored profile. + * + * @param profileID The profile ID to resolve during signature creation. + * @return The CreateTransformsInfoProfile containing the given + * profile ID. + * + * @pre profileID != null && profileID.length() > 0 + * @post return != null + */ + public abstract CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID); + + /** + * Create a new CreateTransformsInfoProfile object by providing + * the profile data explicitly. + * + * @param transformsInfo The transformations to apply to the associated + * data object. + * @param supplements Supplemental information for the transformation. May be + * null. + * @return The CreateTransformsInfoProfile containing the above + * data. + * + * @pre transformsInfo != null + * @pre supplements != null implies + * forall Object o in supplements | + * o instanceof at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation + * @post return != null + */ + public abstract CreateTransformsInfoProfile createCreateTransformsInfoProfile( + CreateTransformsInfo transformsInfo, + List supplements); + + /** + * Create a new CreateTransformsInfo object. + * + * @param transforms The Transforms to apply to the associated + * data object. May be null. + * @param finalDataMetaInfo Information about the type of the transformed + * data. + * @return The CreateTransformsInfo containing the above data. + * + * @pre transforms != null implies transforms.size > 0 + * @pre transforms != null implies + * forall Object o in transforms | + * o instanceof at.gv.egovernment.moa.spss.api.common.Transform + * @pre finalDataMetaInfo != null + * @post return != null + */ + public abstract CreateTransformsInfo createCreateTransformsInfo( + List transforms, + MetaInfo finalDataMetaInfo); + + /** + * Create a new CreateSignatureInfo object. + * + * @param createSignatureEnvironment The signature environment that will + * contain the signature. + * @param createSignatureEnvironmentProfile Additional information about + * the signture environment. + * @return The CreateSignatureInfo containing the above data. + * + * @pre createSignatureEnvironment != null + * @pre createSignatureEnvironmentProfile != null + * @post return != null + */ + public abstract CreateSignatureInfo createCreateSignatureInfo( + Content createSignatureEnvironment, + CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile); + + /** + * Create a new CreateSignatureEnvironmentProfile object + * containing a reference to a locally stored profile. + * + * @param profileID The profile ID to resolve during signature creation. + * @return The CreateSignatureEnvironmentProfile containing + * the given profile ID. + * + * @pre profileID != null && profileID.length() > 0 + * @post return != null + */ + public abstract CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID); + + /** + * Create a new CreateSignatureEnvironmentProfile object by + * providing the profile data explicitly. + * + * @param createSignatureLocation The location where the signature will be + * inserted. + * @param supplements Additional information about the signature environment. + * @return The CreateSignatureEnvironmentProfile containing the + * above data. + * + * @pre createSignatureLocation != null + * @pre supplements != null + * @pre forall Object o in supplements | + * o instanceof at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation + * @post return != null + */ + public abstract CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( + CreateSignatureLocation createSignatureLocation, + List supplements); + + /** + * Create a new CreateSignatureLocation object. + * + * @param xPathExpression The XPath expression to select the signature + * parent element within the signature environment. + * @param index The index of the node, after which the signature will be + * inserted. + * @param namespaceDeclarations The namespace prefix to URI mapping to apply + * while evaluating the XPath expression. + * @return The CreateSignatureLocation containing the above data. + * + * @pre xPathExpression != null + * @pre index >= 0 + * @pre namespaceDeclarations != null + */ + public abstract CreateSignatureLocation createCreateSignatureLocation( + String xPathExpression, + int index, + Map namespaceDeclarations); + + /** + * Create a new CreateXMLSignatureResponse object. + * + * @param responseElements The elements of the response, either + * SignatureEnvironmentResponse objects, or + * ErrorResponse objects. + * @return The new CreateXMLSignatureResponse containing the + * above data. + * + * @pre responseElements != null && responseElements.size() > 0 + * @pre forall Object o in responseElements | + * o instanceof at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureResponseElement + * @post return != null + */ + public abstract CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements); + + /** + * Create a new SignatureEnvironmentResponse object. + * + * @param signatureEnvironment The signature environment containing the + * signature. + * @return The SignatureEnvironmentResponse containing the + * signatureEnvironment. + * + * @pre signatureEnvironment != null + * @post return != null + */ + public abstract SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment); + + /** + * Create a new ErrorResponse object. + * + * @param code The numerical error code. + * @param info Verbose error information. + * @return The new ErrorResponse containing the above data. + * + * @pre code > 0 + * @pre info != null + * @post return != null + */ + public abstract ErrorResponse createErrorResponse(int code, String info); + + // + // Factory methods for verifying CMS signatures + // + + /** + * Create a new VerifyCMSSignatureRequest object. + * + * @param signatories The indexes of the signatories whose signature is to + * be verified. + * @param dateTime The date for which the verification is to be performed. + * May be null. + * @param cmsSignature The CMS signature. + * @param dataObject The signed data. May be null. + * @param trustProfileID The ID of the trust profile containing the trusted + * root certificates. + * @return The VerifyCMSSignatureRequest containing the above + * data. + * + * @pre signatories != null && signatories.length > 0 + * @pre signaturies != VerifyCMSSignatureRequest.ALL_SIGNATORIES implies + * for (int i = 0; i < signatories.length; i++) + * signatories[i] >= 1 + * @pre cmsSignature != null + * @pre trustProfileID != null && trustProfileID.length() > 0 + * @post return != null + */ + public abstract VerifyCMSSignatureRequest createVerifyCMSSignatureRequest( + int[] signatories, + Date dateTime, + InputStream cmsSignature, + CMSDataObject dataObject, + String trustProfileID); + + /** + * Create a new CMSDataObject object from data at a given URI. + * + * @param metaInfo Type information about the CMSDataObject. + * May be null. + * @param content The CMS content containing the data. + * @return The new CMSDataObject containing the data. + * + * @pre referenceURI != null + * @pre content != null + * @post return != null + */ + public abstract CMSDataObject createCMSDataObject( + MetaInfo metaInfo, + CMSContent content); + + /** + * Create a new CMSContent object from the data contained at the + * given URI. + * + * @param referenceURI The URI identifying the data. Must be resolvable. + * @return The CMSContent containing a reference to the signed + * data. + * + * @pre referenceURI != null + * @post return != null + */ + public abstract CMSContent createCMSContent(String referenceURI); + + /** + * Create a new CMSContent object from a byte stream. + * + * @param binaryContent The byte stream containing the signed data. + * @return The new CMSContent containing the data from the + * byte stream. + * + * @pre binaryContent != null + * @post return != null + */ + public abstract CMSContent createCMSContent(InputStream binaryContent); + + /** + * Create a new VerifyCMSSignatureResponse object. + * + * @param responseElements Verification information about each signature. + * @return The new VerifyCMSSignatureResponse containing the + * status of signature verification for each signature contained in the + * request. + * + * @pre responseElements != null && responseElements.size() > 0 + * @pre forall Object o in responseElements | + * o instanceof at.gv.egovernment.moa.spss.api.cmssign.VerifyCMSSignatureResponseElement + * @post return != null + */ + public abstract VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements); + + /** + * Create a new VerifyCMSSignatureResponseElement object. + * + * @param signerInfo Information about the signer certificate. + * @param signatureCheck Result of the singature value check. + * @param certificateCheck Result of the certificate status check. + * @return The new VerifyCMSSignatureResponseElement containing + * the above data. + * + * @pre signerInfo != null && signatureCheck != null && + * certificateCheck != null + * @post return != null + */ + public abstract VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement( + SignerInfo signerInfo, + CheckResult signatureCheck, + CheckResult certificateCheck); + + // + // Factory methods for verifying XML signatures + // + + /** + * Create a new VerifyXMLSignatureRequest object. + * + * @param dateTime The date for which the verification is to be performed. + * May be null. + * @param verifySignatureInfo Information about the signature environment and + * the location of the signature. + * @param supplementProfiles Supplemental information for the signature + * environment. May be null. + * @param signatureManifestParams Additional information for checking the + * signature manifest. May be null. + * @param returnHashInputData If true, hash input data will + * be returned in the response, otherwise not. + * @param trustProfileID The ID of the trust profile containing the trusted + * root certificates. + * @return The new VerifyXMLSignatureRequest containing the + * above data. + * + * @pre verifySignatureInfo != null + * @pre supplementProfiles != null implies + * forall Object o in supplementProfiles | + * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile + * @pre trustProfileID != null && trustProfileID.length() > 0 + * @post return != null + */ + public abstract VerifyXMLSignatureRequest createVerifyXMLSignatureRequest( + Date dateTime, + VerifySignatureInfo verifySignatureInfo, + List supplementProfiles, + SignatureManifestCheckParams signatureManifestParams, + boolean returnHashInputData, + String trustProfileID); + + /** + * Create a new VerifySignatureInfo object. + * + * @param verifySignatureEnvironment The signature environment containing + * the signature to be verified. + * @param verifySignatureLocation The location of the signature within the + * signature environment. + * @return The new VerifySignatureInfo containing the above data. + * + * @pre verifySignatureEnvironment != null + * @pre verifySignatureLocation != null + * @post return != null + */ + public abstract VerifySignatureInfo createVerifySignatureInfo( + Content verifySignatureEnvironment, + VerifySignatureLocation verifySignatureLocation); + + /** + * Create a new VerifySignatureLocation object. + * + * @param xPathExpression The XPath expression to select the signature + * element within the signature environment. + * @param namespaceDeclarations The namespace prefix to URI mapping to apply + * while evaluating the XPath expression. + * @return The new VerifySignatureLocation containing the above + * data. + * + * @pre xPathExpression != null + * @pre namespaceDeclarations != null + * @post return != null + */ + public abstract VerifySignatureLocation createVerifySignatureLocation( + String xPathExpression, + Map namespaceDeclarations); + + /** + * Create a new SupplementProfile object containing a reference + * to a locally stored profile. + * + * @param profileID The profile ID to resolve during signature verification. + * @return The SupplementProfile containing the profile ID. + * + * @pre profileID != null && profileID.length() > 0 + * @post return != null + */ + public abstract SupplementProfile createSupplementProfile(String profileID); + + /** + * Create a new SupplementProfile object by providing the profile + * data explicitly. + * + * @param supplementProfile The profile data. + * @return The SupplementProfile containing the profile data. + */ + public abstract SupplementProfile createSupplementProfile(XMLDataObjectAssociation supplementProfile); + + /** + * Create a new SignatureManifestCheckParams object. + * + * @param referenceInfos Information for checking the validity of a + * a reference. + * @param returnReferenceInputData If true, the input data to + * the calculation of reference digest values will be returned in the + * response, otherwise not. + * @return The SignatureManifestCheckParams containing the + * above data. + * + * @pre referenceInfos != null && referenceInfos.size() > 0 + * @pre forall Object o in referenceInfos | + * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo + * @post return != null + */ + public abstract SignatureManifestCheckParams createSignatureManifestCheckParams( + List referenceInfos, + boolean returnReferenceInputData); + + /** + * Create a new ReferenceInfo object. + * + * @param verifyTransformsInfoProfiles The transformation profiles valid for + * the associated reference. + * @return The ReferenceInfo containing the transformation + * profiles. + * + * @pre verifyTransformsInfoProfiles != null && + * verifyTransformsInfoProfiles.size() > 0 + * @pre forall Object o in verifyTransformsInfoProfiles | + * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile + * @post return != null + */ + public abstract ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles); + + /** + * Create a new VerifyTransformsInfoProfile object containing + * a reference to a locally stored profile. + * + * @param profileID The profile ID to resolve during signature verification. + * @return The VerifyTransformsInfoProfile containing the + * given profile ID. + * + * @pre profileID != null && profileID.length() > 0 + * @post return != null + */ + public abstract VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID); + + /** + * Create a new VerifyTransformsInfoProfile object by providing + * the profile data explicitly. + * + * @param transforms A valid chain of transformations for the reference. + * May be null. + * @param transformParameters Additional transformation information. + * @return The VerifyTransformsInfoProfile containing the above + * data. + * + * @pre transforms != null implies + * (transforms.size() > 0 && + * forall Object o in transforms | o instanceof Transform) + * @pre transformParameters != null implies + * forall Object o in transformParameters | + * o instanceof at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter + * @post return != null + */ + public abstract VerifyTransformsInfoProfile createVerifyTransformsInfoProfile( + List transforms, + List transformParameters); + + /** + * Create a new TransformParameter object with the data + * contained at the given URI. + * + * @param URI The URI identifying the data. The URI will be resolved during + * signature verification. + * @return The TransformParameter containing the URI of the + * data. + * + * @pre URI != null + * @post return != null + */ + public abstract TransformParameter createTransformParameter(String URI); + + /** + * Creata a new TransformParameter object containing the + * binary data. + * + * @param URI The URI identifying the data. + * @param binaryData The binary data. + * @return The TransformParameter containig the binary data. + * + * @pre URI != null + * @pre binary != null + * @post return != null + */ + public abstract TransformParameter createTransformParameter( + String URI, + InputStream binaryData); + + /** + * Create a new TransformParameter object containing the hash + * value of the transformation data. + * + * @param URI The URI identifying the data. It will be resolved during + * signature verification. + * @param digestMethod The digest method used for calculating the digest + * value. + * @param digestValue The hash value of the transformation data. + * @return The TransformParameter containing the above data. + * + * @pre URI != null + * @pre digestMethod != null + * @pre digestValue != null + */ + public abstract TransformParameter createTransformParameter( + String URI, + String digestMethod, + byte[] digestValue); + + /** + * Create a new VerifyXMLSignatureResponse object. + * + * @param signerInfo Information about the signer certificate. + * @param hashInputDatas The signed data objects. May be null. + * @param referenceInputDatas The reference input data objects. + * May be null. + * @param signatureCheck Status information about the signature check. + * @param signatureManifestCheck Status information about the signature + * manifest check. + * @param xmlDsigManifestChecks Status information about each XMLDsig manifest + * check. + * @param certificateCheck Status information about the signer certificate + * check. + * @return The VerifyXMLSignatureResponse containing the above + * data. + * + * @pre signerInfo != null + * @pre hashInputDatas != null implies + * forall Object o in hashInputDatas | + * o instanceof at.gv.egovernment.moa.spss.api.common.Content + * @pre referenceInputDatas != null implies + * forall Object o in referenceInputDatas | + * o instanceof at.gv.egovernment.moa.spss.api.common.Content + * @pre signatureCheck != null + * @pre xmlDsigManifestChecks != null implies + * forall Object o in xmlDsigManifestChecks | + * o instanceof at.gv.egovernment.moa.spss.api.xmlverifyManifestRefsCheckResult + * @pre certificateCheck != null + * @post return != null + */ + public abstract VerifyXMLSignatureResponse createVerifyXMLSignatureResponse( + SignerInfo signerInfo, + List hashInputDatas, + List referenceInputDatas, + ReferencesCheckResult signatureCheck, + ReferencesCheckResult signatureManifestCheck, + List xmlDsigManifestChecks, + CheckResult certificateCheck); + + /** + * Create a new ReferencesCheckResult object. + * + * @param code The status code. + * @param info Additional information about the reference check. + * @return The ReferencesCheckResult containing the above data. + * + * @pre code >= 0 + * @post return != null + */ + public abstract ReferencesCheckResult createReferencesCheckResult( + int code, + ReferencesCheckResultInfo info); + + /** + * Create a new ReferencesCheckResultInfo object. + * + * @param anyOtherInfo Arbitrary XML content describing the check result. + * May be null. + * @param failedReferences The indexes of the failed references. May be + * null. + * @return The ReferencesCheckResultInfo containing the above + * data. + * + * @post return != null + */ + public abstract ReferencesCheckResultInfo createReferencesCheckResultInfo( + NodeList anyOtherInfo, + int[] failedReferences); + + /** + * Create a new ManifestRefsCheckResult object. + * + * @param code The status code. + * @param info Additional information about the manifest check. May be + * null. + * @return The ManifestRefsCheckResult containing the above + * data. + * + * @pre code >= 0 + * @post return != null + */ + public abstract ManifestRefsCheckResult createManifestRefsCheckResult( + int code, + ManifestRefsCheckResultInfo info); + + /** + * Create a new ManifestRefsCheckResultInfo object. + * + * @param anyOtherInfo Arbitrary XML content describing the check result. + * May be null. + * @param failedReferences The indexes of the failed references. May be + * null. + * @param referringSigReference The index of the reference in the signature. + * @return The ManifestRefsCheckResultInfo containing the + * above data. + * + * @pre referringSigReference > 0 + * @post return != null + */ + public abstract ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo( + NodeList anyOtherInfo, + int[] failedReferences, + int referringSigReference); + + // + // Factory methods for common objects + // + + /** + * Create a new Content object referencing data via a URI. + * + * @param referenceURI The URI pointing to the content. + * @return The Content object containing the reference. + * + * @pre referenceURI != null && referenceURI.length() > 0 + * @post return != null + */ + public abstract Content createContent(String referenceURI); + + /** + * Create a new Content object containing binary data. + * + * @param binaryData An InputStream containing the binary data. + * @param referenceURI An URI identifying the data. May be null. + * @return The Content object containing the data. + * + * @pre binaryData != null + * @post return != null + */ + public abstract Content createContent( + InputStream binaryData, + String referenceURI); + + /** + * Create a new Content object containing location reference data. + * + * @param locationReferenceURI a URI pointing to the actual remote location of the content. + * + * @param referenceURI An URI identifying the data. May be null. + * + * @return The Content object containing the data. + * + * @pre locationReferenceURI != null + * @post return != null + */ + public abstract Content createContent( + String locationReferenceURI, + String referenceURI); + + /** + * Create a new Content object containing XML data. + * + * @param xmlData The XML data contained in the new Content. + * @param referenceURI An URI identifying the data. May be null. + * @return The Content object containing the data. + * + * @pre xmlData != null + * @post return != null + */ + public abstract Content createContent(NodeList xmlData, String referenceURI); + + /** + * Create a new XMLDataObjectAssociation object. + * + * @param metaInfo Information about the content type. May be + * null. + * @param content The Content object containing the data. + * @return The XMLDataObjectAssociation containing the above + * data. + * + * @pre content != null + * @pre content.getContentType() == Content.CONTENT_XML || + * content.getContentType() == Contetn.CONTENT_BINARY + * @pre content.getReference() != null + * @post return != null + */ + public abstract XMLDataObjectAssociation createXMLDataObjectAssociation( + MetaInfo metaInfo, + Content content); + + /** + * Create a new MetaInfo object. + * + * @param mimeType The MIME type part of the meta information. + * @param description Descriptive meta information. May be null. + * @param otherInfo XML meta information. May be null. + * @param type Type information for XML signature creation. May be null. + * @return The MetaInfo object containing the above data. + * + * @pre mimeType != null && mimeType.length() > 0 + * @pre otherInfo != null implies + * forall Node n in otherInfo | n.getNodeType() == Node.ELEMENT + */ + public abstract MetaInfo createMetaInfo( + String mimeType, + String description, + NodeList otherInfo, + String type); + + /** + * Create a CanonicalizationTransform type of Transform. + * + * @param algorithmURI The algorithm URI of the canonicalization. + * @return The created CanonicalizationTransform object. + * + * @pre CanonicalizationTransform.CANONICAL_XML.equals(algorithmURI) || + * CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals(algorithmURI) + * @post return != null + */ + public abstract Transform createCanonicalizationTransform(String algorithmURI); + + /** + * Create an ExclusiveCanonicalizationTransform type of + * Transform. + * + * @param algorithmURI The algorithm URI of the exclusive canonicalization. + * @param inclusiveNamespacePrefixes The prefixes of the namespaces to + * treat according to canonical XML. + * @return The new ExclusiveCanonicalizationTransform + * + * @pre ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals(algorithmURI) || + * ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS.equals(algorithmURI) + * @pre inclusiveNamespacePrefixes != null + * @pre forall Object o in inclusiveNamespacePrefixes | o instanceof String + * @post return != null + */ + public abstract Transform createExclusiveCanonicalizationTransform( + String algorithmURI, + List inclusiveNamespacePrefixes); + + /** + * Create a Base64Transform type of Transform. + * + * @return A Transform denoting a Base64 decoding. + * + * @post return != null + */ + public abstract Transform createBase64Transform(); + + /** + * Create a EnvelopedSignatureTransform type of + * Transform. + * + * @return A Transform denoting an enveloped signature. + * + * @post return != null + */ + public abstract Transform createEnvelopedSignatureTransform(); + + /** + * Create an XSLTTransform type of Transform. + * + * @param styleSheet The XSLT stylesheet contained in the + * Transform. + * @return A Transform containing the XSLT stylesheet. + * + * @post return != null + */ + public abstract Transform createXSLTTransform(Element styleSheet); + + /** + * Create an XPathTransform type of Transform. + * + * @param xPathExpression The XPath expression to use in the created + * Transform. + * @param namespaceDeclarations The namespace prefix to URI mapping to + * apply on evaluation of the XPath expression. + * @return The XPathTransform containing the above data. + * + * @pre xPathExpression != null + * @pre namespaceDeclarations != null + * @post return != null + */ + public abstract Transform createXPathTransform( + String xPathExpression, + Map namespaceDeclarations); + + /** + * Create a new XPathFilter2Transform type of + * Transform. + * + * @param xPathFilters The filters contained in the newly created + * XPathFilter2Transform. + * @return The XPathFilter2Transform containing the given + * filters. + * + * @pre xPathFilters != null && + * forall Object o in xPathFilters | + * o instanceof at.gv.egovernment.moa.spss.api.common.XPathFilter + * @post return != null + */ + public abstract Transform createXPathFilter2Transform(List xPathFilters); + + /** + * Create a new XPathFilter object. + * + * @param filterType The type of filter. + * @param xPathExpression The XPath expression contained in this filter. + * @param namespaceDeclarations The namespace prefix to URI mapping to apply + * on evaluation of the XPath expression. + * @return The XPathFilter containing the above data. + * + * @pre XPathFilter.SUBTRACT_TYPE.equals(filterType) || + * XPathFilter.INTERSECT_TYPE.equals(filterType) || + * XPathFilter.UNION_TYPE.equals(filterType) + * @pre xPathExpression != null + * @pre namespaceDeclarations != null + * @post return != null + */ + public abstract XPathFilter createXPathFilter( + String filterType, + String xPathExpression, + Map namespaceDeclarations); + + /** + * Create a new CheckResult object. + * + * @param code The check code. + * @param info Verbose information about the check. May be null. + * @return The CheckResult containing the above data. + * + * @pre code >= 0 + * @post return != null + */ + public abstract CheckResult createCheckResult(int code, NodeList info); + + /** + * Create a new SignerInfo object. + * + * @param signerCertificate The signer certificate in binary form. + * @param qualifiedCertificate true, if the signer certificate is + * a qualified certificate, otherwise false. + * @param publicAuthority true, if the signer certificate is a + * public authority certificate, otherwise false. + * @param publicAuthorityID The identification of the public authority + * (if publicAuthority is true). May be + * null. + * @return The SignerInfo containing the above data. + * + * @pre signerCertSubjectName != null + * @pre signerCertIssuerSerial != null + * @pre signerCertificate != null + */ + public abstract SignerInfo createSignerInfo( + X509Certificate signerCertificate, + boolean qualifiedCertificate, + boolean publicAuthority, + String publicAuthorityID); + + /** + * Create a new X509IssuerSerial object. + * + * @param issuerName The distinguished name of the issuer. + * @param issuerSerial The certificate serial number. + * @return The X509IssuerSerial containing the above data. + * + * @pre issuerName != null + * @pre issuerSerial != null + */ + public abstract X509IssuerSerial createX509IssuerSerial( + String issuerName, + BigInteger issuerSerial); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java new file mode 100644 index 000000000..a84ca2a83 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureCreationService.java @@ -0,0 +1,57 @@ +package at.gv.egovernment.moa.spss.api; + +import at.gv.egovernment.moa.spss.MOAException; + +import org.apache.commons.discovery.tools.DiscoverClass; + + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; + +/** + * Interface providing functions for signature creation. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class SignatureCreationService { + + /** The default implementation class. */ + private static final String DEFAULT_IMPLEMENTATION = + "at.gv.egovernment.moa.spss.server.invoke.SignatureCreationServiceImpl"; + + /** The single instance of this class. */ + private static SignatureCreationService instance = null; + + /** + * Get an instance of the SignatureCreationService. + * + * @return A concrete instance of the SignatureCreationService. + */ + public static synchronized SignatureCreationService getInstance() { + if (instance == null) { + try { + DiscoverClass discover = new DiscoverClass(); + instance = + (SignatureCreationService) discover.newInstance( + SignatureCreationService.class, + DEFAULT_IMPLEMENTATION); + } catch (Exception e) { + // this can not happen since we provide a valid default + // implementation + } + } + return instance; + } + + /** + * Create an XML signature. + * + * @param request Information on how to create the signature. + * @return A CreateXMLSignatureResponse containing the + * signature. + * @throws MOAException Error in server side MOA module. + */ + public abstract CreateXMLSignatureResponse createXMLSignature(CreateXMLSignatureRequest request) + throws MOAException; +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java new file mode 100644 index 000000000..d0fcb029a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/SignatureVerificationService.java @@ -0,0 +1,69 @@ +package at.gv.egovernment.moa.spss.api; + +import org.apache.commons.discovery.tools.DiscoverClass; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * Interface providing functions for verifying signatures. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class SignatureVerificationService { + + /** The default implementation class. */ + private static final String DEFAULT_IMPLEMENTATION = + "at.gv.egovernment.moa.spss.server.invoke.SignatureVerificationServiceImpl"; + + /** The single instance of this class. */ + private static SignatureVerificationService instance = null; + + /** + * Get an instance of the SignatureVerificationService. + * + * @return A concrete instance of the + * SignatureVerificationService. + */ + public static synchronized SignatureVerificationService getInstance() { + if (instance == null) { + try { + DiscoverClass discover = new DiscoverClass(); + instance = + (SignatureVerificationService) discover.newInstance( + SignatureVerificationService.class, + DEFAULT_IMPLEMENTATION); + } catch (Exception e) { + // this can not happen since we provide a valid default + // implementation + } + } + return instance; + } + + /** + * Verify a CMS signature. + * + * @param request Detailed information on the verification that should be + * performed. + * @return A VerifyCMSSignatureResponse object that contains + * information about the performed verification. + * @throws MOAException Error in server side MOA module. + */ + public abstract VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) + throws MOAException; + /** + * Verfiy an XML Signature. + * + * @param request information on the verification that should be performed. + * @return A VerifyXMLSignatureResponse object that contains + * information about the performed verification. + * @throws MOAException Error in server side MOA module. + */ + public abstract VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) + throws MOAException; +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java new file mode 100644 index 000000000..b4ecb3937 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContent.java @@ -0,0 +1,28 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +/** + * Base class for objects containing CMS content. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CMSContent { + /** + * Indicates that this object contains a reference to the CMS content. + */ + public static final int REFERENCE_CONTENT = 0; + /** + * Indicates that this object contains the CMS content explicitly. + */ + public static final int EXPLICIT_CONTENT = 1; + + /** + * Gets the type of the contained content. + * + * @return The type of content, either REFERENCE_CONTENT or + * EXPLICIT_CONTENT. + */ + public int getContentType(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java new file mode 100644 index 000000000..58c2b0259 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentExcplicit.java @@ -0,0 +1,19 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +import java.io.InputStream; + +/** + * Encapsulates binary CMS content. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CMSContentExcplicit extends CMSContent { + /** + * Gets the content as a stream. + * + * @return A stream containing the binary content. + */ + public InputStream getBinaryContent(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java new file mode 100644 index 000000000..7c4e6d913 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSContentReference.java @@ -0,0 +1,17 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +/** + * Encapsulates CMS content that is referenced by an URI. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CMSContentReference extends CMSContent { + /** + * Gets the reference URI from wher the content can be retrieved. + * + * @return The reference URI. + */ + public String getReference(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java new file mode 100644 index 000000000..37f6fd396 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/CMSDataObject.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +import at.gv.egovernment.moa.spss.api.common.MetaInfo; + +/** + * A data object used for verification of CMS signatures. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CMSDataObject { + /** + * Gets the meta information of the content. + * + * @return An object containig the meta information. + */ + public MetaInfo getMetaInfo(); + /** + * Gets the actual content of the data object. + * + * @return The actual content. + */ + public CMSContent getContent(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java new file mode 100644 index 000000000..6d1f389af --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureRequest.java @@ -0,0 +1,52 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +import java.io.InputStream; +import java.util.Date; + +/** + * Object that encapsulates a request to verify a CMS signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyCMSSignatureRequest { + /** + * Indicates, that signature checks for all signatories must be returned. + */ + public static int[] ALL_SIGNATORIES = new int[] { -1 }; + /** + * Gets the positions of signatories whose signature must be verified. + * + * @return The positions of signatories. + */ + public int[] getSignatories(); + /** + * Gets the date and time for which the signature verification has to + * be performed. + * + * @return Date and time for which the signature verification has + * to be performed. + */ + public Date getDateTime(); + /** + * Gets the binary CMS signature. + * + * @return An InputStream from which the binary CMS signature + * can be read. + */ + public InputStream getCMSSignature(); + /** + * Gets the data object necessary for the verification. + * + * @return The data object necessary for verification. + */ + public CMSDataObject getDataObject(); + /** + * Gets the profile ID of trusted certificates to be used for signature + * verification. + * + * @return The profile ID of trusted certificates. + */ + public String getTrustProfileId(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java new file mode 100644 index 000000000..5f2e6d255 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponse.java @@ -0,0 +1,21 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +import java.util.List; + + +/** + * Object that encapsulates the response on a request to verify a CMS + * signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyCMSSignatureResponse { + /** + * Gets the response elements. + * + * @return The response elements. + */ + public List getResponseElements(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java new file mode 100644 index 000000000..49ddb9419 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/cmsverify/VerifyCMSSignatureResponseElement.java @@ -0,0 +1,32 @@ +package at.gv.egovernment.moa.spss.api.cmsverify; + +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; + +/** + * Contains detailed information about the verification of a signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyCMSSignatureResponseElement { + /** + * Gets a SignerInfo element according to CMS. + * + * @return The SignerInfo element according to CMS. + */ + public SignerInfo getSignerInfo(); + /** + * Gets the result of the signature verification. + * + * @return The result of the signature verification. + */ + public CheckResult getSignatureCheck(); + /** + * Gets the result of the certificate verification. + * + * @return The result of the certificate verification. + */ + public CheckResult getCertificateCheck(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java new file mode 100644 index 000000000..94785727d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Base64Transform.java @@ -0,0 +1,13 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * A Transform performing a Base64 decoding. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface Base64Transform extends Transform { + /** Algorithm URI of the Base64 Transform type. */ + public static final String BASE64_DECODING = + "http://www.w3.org/2000/09/xmldsig#base64"; +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java new file mode 100644 index 000000000..352461e52 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CanonicalizationTransform.java @@ -0,0 +1,17 @@ +package at.gv.egovernment.moa.spss.api.common; + +import at.gv.egovernment.moa.util.Constants; + +/** + * A canonicalization type of Transform. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface CanonicalizationTransform extends Transform { + /** Algorithm URI of canonical XML. */ + public static final String CANONICAL_XML = Constants.C14N_URI; + /** Algorithm URI of canonical XML with comments. */ + public static final String CANONICAL_XML_WITH_COMMENTS = + Constants.C14N_WITH_COMMENTS_URI; +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java new file mode 100644 index 000000000..974483d82 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/CheckResult.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.common; + +import org.w3c.dom.NodeList; + +/** + * Object encapsulating the result of a signature verification. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CheckResult { + /** + * Gets the result code. + * + * @return The result code. + */ + public int getCode(); + /** + * Gets descriptive information. + * + * @return Descriptive information. + */ + public NodeList getInfo(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java new file mode 100644 index 000000000..0777c3d65 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Content.java @@ -0,0 +1,47 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * Encapsulates content data. + * + * @author Patrick Peck + * @author Stephan Grill + * @author Gregor Karlinger + * @version $Id$ + */ +public interface Content { + + /** + * Indicates that this object contains a URI reference to some content. + */ + public static final int REFERENCE_CONTENT = 0; + + /** + * Indicates that this object contains binary content. + */ + public static final int BINARY_CONTENT = 1; + + /** + * Indicates that this object contains XML content. + */ + public static final int XML_CONTENT = 2; + + /** + * Indicates that this object contains a location reference content. + */ + public static final int LOCREF_CONTENT = 3; + + /** + * Gets the type of content contained in this object. + * + * @return The type of content, one of BINARY_CONTENT, XML_CONTENT, + * REFERENCE_CONTENT or LOCREF_CONTENT. + */ + public int getContentType(); + + /** + * Gets the reference to the content data (a URI). + * + * @return The reference to the content data. + */ + public String getReference(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java new file mode 100644 index 000000000..664afa406 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentBinary.java @@ -0,0 +1,21 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.io.InputStream; + +/** + * Encapsulates binary content. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface ContentBinary extends Content { + /** + * Get the binary content. + * + * @return An InputStream from which the binary content can + * be read. + */ + public InputStream getBinaryContent(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java new file mode 100644 index 000000000..f640f2b92 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentLocRef.java @@ -0,0 +1,17 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * Encapsulates location reference content. + * + * @author Gregor Karlinger + * @version $Id$ + */ +public interface ContentLocRef extends Content +{ + /** + * Gets the location reference URI pointing to the actual remote location of the content. + * + * @return the location reference URI. + */ + public String getLocationReferenceURI(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java new file mode 100644 index 000000000..c10f0c2f8 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentReference.java @@ -0,0 +1,11 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * Content containing a reference to content data. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface ContentReference extends Content { + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java new file mode 100644 index 000000000..ad5930452 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ContentXML.java @@ -0,0 +1,19 @@ +package at.gv.egovernment.moa.spss.api.common; + +import org.w3c.dom.NodeList; + +/** + * Encapsulates arbitrary XML content. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface ContentXML extends Content { + /** + * Gets the XML content stored in this object. + * + * @return The XML content. + */ + public NodeList getXMLContent(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java new file mode 100644 index 000000000..862cb84da --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ElementSelector.java @@ -0,0 +1,28 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.util.Map; + +/** + * A class containing data for selecting single elements using an XPath + * expression. + * + * Derived classes are used to point to the CreateSignatureLocation + * and the VerifySignatureLocation. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface ElementSelector { + /** + * Gets the XPath expression pointing to a single element. + * + * @return The XPath expression to select the signature parent element. + */ + public String getXPathExpression(); + /** + * Gets the namespace prefix to URI mapping to use when evaluating the XPath. + * + * @return The namespace prefix to URI mapping. + */ + public Map getNamespaceDeclarations(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java new file mode 100644 index 000000000..f951e35c0 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/EnvelopedSignatureTransform.java @@ -0,0 +1,15 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * An enveloped signature type of Transform. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface EnvelopedSignatureTransform extends Transform { + /** + * Algorithm URI of the enveloped signature type of Transform. + */ + public static final String ENVELOPED_SIGNATURE = + "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java new file mode 100644 index 000000000..369270259 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/ExclusiveCanonicalizationTransform.java @@ -0,0 +1,27 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.util.List; + +import at.gv.egovernment.moa.util.Constants; + +/** + * An exclusive canonicalization type of Transform. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface ExclusiveCanonicalizationTransform extends Transform { + /** Algorithm URI of exclusive canonical XML. */ + public static final String EXCLUSIVE_CANONICAL_XML = Constants.EXC_C14N_URI; + /** Algorithm URI of exclusive canonical XML with comments. */ + public static final String EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS = + Constants.EXC_C14N_WITH_COMMENTS_URI; + + /** + * Sets the namespace prefixes that are handled in the same manner as in + * canonical XML. + * + * @return The inclusive namespace prefixes. + */ + public List getInclusiveNamespacePrefixes(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java new file mode 100644 index 000000000..fd2b69c6d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/InputData.java @@ -0,0 +1,47 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * Interface specifying accessors for two attributes needed for returning + * HashInputData and ReferenceInputData information + * as part of VerifyXMLSignatureResponse. + * + * @author Gregor Karlinger + * + * @version $Id$ + */ +public interface InputData extends Content +{ + /** + * Possible value returned by {@link #getPartOf}. + */ + public static String CONTAINER_SIGNEDINFO_ = "SignedInfo"; + + /** + * Possible value returned by {@link #getPartOf}. + */ + public static String CONTAINER_XMLDSIGMANIFEST_ = "XMLDSIGManifest"; + + /** + * Value returned by {link getReferringReferenceNumber}, signalling that the + * attribute is not used. + */ + public static int REFERER_NONE_ = -1; + + /** + * Returns a String signalling what kind of container the + * XMLDSIG Reference this InputData belongs + * to is part of. + * + * @return the kind of container. + */ + public String getPartOf(); + + /** + * If this InputData belongs to an XMLDSIG Reference + * being part of either a XMLDSIGManifest or a SignatureManifest, this method + * returns a positive int value signalling the particular Reference + * of the XMLDSIG SignedInfo referring to the XMLDSIGManifest or + * SignatureManifest respectively. + */ + public int getReferringReferenceNumber(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java new file mode 100644 index 000000000..56a1793af --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/MetaInfo.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.spss.api.common; + +import org.w3c.dom.NodeList; + +/** + * Object encapsulating descriptive meta information. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface MetaInfo { + /** + * Gets the mime type of the associated object. + * + * @return The mimetype of the associated object. + */ + public String getMimeType(); + /** + * Gets the descriptive information (URI). + * + * @return URI referencing the descriptive information. + */ + public String getDescription(); + /** + * Gets the elemental informations. + * + * @return The elemental informations. + */ + public NodeList getAnyElements(); + /** + * Gets the XML signature creation type information of the associated object. + * + * @return the XML signature creation type information of the associated object. + */ + public String getType(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java new file mode 100644 index 000000000..c3b4aaadc --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/SignerInfo.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.security.cert.X509Certificate; + + +/** + * Contains information about the signer. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SignerInfo { + /** + * Gets the signer certificate. + * + * @return The signer certificate. + */ + public X509Certificate getSignerCertificate(); + /** + * Checks, whether the certificate contained in this object is qualified. + * + * @return true, if the certificate is qualified, otherwise + * false. + */ + public boolean isQualifiedCertificate(); + /** + * Checks, whether the certificate contained in this object is a + * public authority certificate. + * + * @return true, if the certificate is a public authority + * certificate, otherwise false. + */ + public boolean isPublicAuthority(); + /** + * Gets the public authority ID, if the certificate contained in this + * object is from a public authority. + * + * @return The public authority ID. + */ + public String getPublicAuhtorityID(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java new file mode 100644 index 000000000..49a4e7c35 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/Transform.java @@ -0,0 +1,16 @@ +package at.gv.egovernment.moa.spss.api.common; + +/** + * Base class for XMLDsig Transform elements. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface Transform { + /** + * Gets the algorithm URI of this Transform. + * + * @return The algorithm URI of this Transform. + */ + public String getAlgorithmURI(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java new file mode 100644 index 000000000..d2ea88968 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/X509IssuerSerial.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.math.BigInteger; + +/** + * Contains an X.509 issuer distinguished name/serial number pair. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface X509IssuerSerial { + /** + * Gets the issuer distinguished name. + * + * @return The issuer distinguished name. + */ + public String getX509IssuerName(); + /** + * Gets the issuer serial number. + * + * @return The issuer serial number. + */ + public BigInteger getX509SerialNumber(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java new file mode 100644 index 000000000..e1e034222 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XMLDataObjectAssociation.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.common; + + +/** + * Object encapsulating arbitrary content and optional descriptive meta + * information. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface XMLDataObjectAssociation { + /** + * Gets descriptive meta information. + * + * @return The descriptive meta information. + */ + public MetaInfo getMetaInfo(); + /** + * Gets the actual content. + * + * @return The content of this association. + */ + public Content getContent(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java new file mode 100644 index 000000000..247776ce0 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.util.Map; + +/** + * An XPath expression set operation. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface XPathFilter { + /** Subtract this filter's node set from the resulting node set. */ + public static final String SUBTRACT_TYPE = "subtract"; + /** Intersect this filter's node set with the resulting node set. */ + public static final String INTERSECT_TYPE = "intersect"; + /** Compute the union of this filter's node set and the resulting node set. */ + public static final String UNION_TYPE = "union"; + + /** + * Gets the type of this XPathFilter. + * + * @return The type of this XPathFilter. + */ + public String getFilterType(); + /** + * Gets the XPath expression for selecting the nodes. + * + * @return The XPath expression for selecting the nodes. + */ + public String getXPathExpression(); + /** + * Gets The namespace prefix to URI mapping used during evaluation of the + * XPath expression. + * + * @return The namespace prefix to URI mapping. + */ + public Map getNamespaceDeclarations(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java new file mode 100644 index 000000000..335d37dbf --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathFilter2Transform.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.util.List; + +/** + * An XPath type of Transform containing multiple filters for + * performing set operations on XPath selections. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface XPathFilter2Transform extends Transform { + /** Algorithm URI for the XPath Filter2 Transform. */ + public static final String XPATH_FILTER2 = + "http://www.w3.org/2002/06/xmldsig-filter2"; + + /** + * Gets the XPathFilters contained in this + * XPathFilter2Transform. + * + * @return The XPathFilters. + */ + public List getFilters(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java new file mode 100644 index 000000000..f1cc1a2bc --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XPathTransform.java @@ -0,0 +1,30 @@ +package at.gv.egovernment.moa.spss.api.common; + +import java.util.Map; + +/** + * A Transform performing an XPath selection. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface XPathTransform extends Transform { + /** Algorithm URI of the XPath Transform. */ + public static final String XPATH = + "http://www.w3.org/TR/1999/REC-xpath-19991116"; + + /** + * Gets the XPath expression used for selection. + * + * @return The XPath expression used for selection. + */ + public String getXPathExpression(); + /** + * Gets The namespace prefix to URI mapping used during evaluation of the + * XPath expression. + * + * @return The namespace prefix to URI mapping. + */ + public Map getNamespaceDeclarations(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java new file mode 100644 index 000000000..7f44bb060 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/common/XSLTTransform.java @@ -0,0 +1,23 @@ +package at.gv.egovernment.moa.spss.api.common; + +import org.w3c.dom.Element; + +/** + * A Transform containing an XSLT stylesheet. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface XSLTTransform extends Transform { + /** Algorithm URI for the XSLT type of Transform. */ + public static final String XSLT = + "http://www.w3.org/TR/1999/REC-xslt-19991116"; + + /** + * Gets the XSLT stylesheet element used for the transformation. + * + * @return The XSLT stylesheet element used for the transformation. + */ + public Element getStylesheet(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java new file mode 100644 index 000000000..4af075da2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/Base64TransformImpl.java @@ -0,0 +1,22 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Base64Transform; + +/** + * Default implementation of Base64Transform. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class Base64TransformImpl + extends TransformImpl + implements Base64Transform { + + /** + * Create a new Base64TransformImpl object. + */ + public Base64TransformImpl() { + setAlgorithmURI(BASE64_DECODING); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java new file mode 100644 index 000000000..dd700cf21 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentExplicitImpl.java @@ -0,0 +1,40 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; + +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; + +/** + * Default implementation of CMSContentExplicit. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CMSContentExplicitImpl implements CMSContentExcplicit { + + /** The binary content, as a stream. */ + private InputStream binaryContent; + + /** + * Sets the binary content as a stream. + * + * @param content The binary content as a stream. + */ + public void setBinaryContent(InputStream content) { + this.binaryContent = content; + } + + public InputStream getBinaryContent() { + return binaryContent; + } + + /** + * Gets the type of content. + * + * @return EXPLICIT_CONTENT + */ + public int getContentType() { + return EXPLICIT_CONTENT; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java new file mode 100644 index 000000000..f9c080a0d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSContentReferenceImpl.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentReference; + +/** + * Default implementation of CMSContentReference. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CMSContentReferenceImpl implements CMSContentReference { + + /** The reference pointing to the actual data. */ + private String reference; + + /** + * Sets the reference URI. + * + * @param referenceURI The URI pointing to the content data. + */ + public void setReference(String referenceURI) { + this.reference = referenceURI; + } + + public String getReference() { + return reference; + } + + /** + * Gets the content type. + * + * @return REFERENCE_CONTENT + */ + public int getContentType() { + return REFERENCE_CONTENT; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java new file mode 100644 index 000000000..6eec4e847 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CMSDataObjectImpl.java @@ -0,0 +1,46 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; + +/** + * Default implementation of CMLSDataObject. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CMSDataObjectImpl implements CMSDataObject { + + /** The MetaInfo associated with the CMS data object. */ + private MetaInfo metaInfo; + /** The CMSContent contained in this data object. */ + private CMSContent cmsContent; + + /** + * Sets the meta information associated with the CMS data object. + * + * @param metaInfo The meta information. + */ + public void setMetaInfo(MetaInfo metaInfo) { + this.metaInfo = metaInfo; + } + + public MetaInfo getMetaInfo() { + return metaInfo; + } + + /** + * Sets the data of this CMSDataObject. + * + * @param cmsContent The actual data of this CMSDataObject. + */ + public void setContent(CMSContent cmsContent) { + this.cmsContent = cmsContent; + } + + public CMSContent getContent() { + return cmsContent; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java new file mode 100644 index 000000000..cf446d1b4 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CanonicalizationTransformImpl.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; + +/** + * Default implementation of CanonicalizationTransform. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CanonicalizationTransformImpl + extends TransformImpl + implements CanonicalizationTransform { + + /** + * Create a new CanonicalizationTransformImpl object. + * + * @param algorithmURI Algorithm URI of the canonicalization + * Transform type. + */ + public CanonicalizationTransformImpl(String algorithmURI) { + setAlgorithmURI(algorithmURI); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java new file mode 100644 index 000000000..2acb12e51 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CheckResultImpl.java @@ -0,0 +1,52 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.api.common.CheckResult; + +/** + * Default implementation of CheckResult. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CheckResultImpl implements CheckResult { + /** The result code. */ + private int code; + + /** Additional information. */ + private NodeList info; + + /** + * Sets a result code. + * + * @param code The result code. + */ + public void setCode(int code) { + this.code = code; + } + + /** + * @see at.gv.egovernment.moa.spss.api.CheckResult#getCode() + */ + public int getCode() { + return code; + } + + /** + * Sets a descriptive information. + * + * @param info The descriptive information. + */ + public void setInfo(NodeList info) { + this.info = info; + } + + /** + * @see at.gv.egovernment.moa.spss.api.CheckResult#getInfo() + */ + public NodeList getInfo() { + return info; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java new file mode 100644 index 000000000..bbed6bf8b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentBinaryImpl.java @@ -0,0 +1,40 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; + +import at.gv.egovernment.moa.spss.api.common.ContentBinary; + +/** + * Default implementation of ContentBinary. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ContentBinaryImpl extends ContentImpl implements ContentBinary { + + /** The binary content as a stream. */ + private InputStream binaryContent; + + /** + * Sets the binary content as a stream. + * + * @param binaryContent The binary content as a stream. + */ + public void setBinaryContent(InputStream binaryContent) { + this.binaryContent = binaryContent; + } + + public InputStream getBinaryContent() { + return binaryContent; + } + + /** + * Gets the type of content. + * + * @return BINARY_CONTENT + */ + public int getContentType() { + return BINARY_CONTENT; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java new file mode 100644 index 000000000..7f331d2cd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentImpl.java @@ -0,0 +1,28 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Content; + +/** + * Default base class for Content implementations. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class ContentImpl implements Content { + /** The reference pointing to the content data. */ + private String reference; + + /** + * Sets the reference pointing to the content data. + * + * @param referenceURI The URI of the content data. + */ + public void setReference(String referenceURI) { + this.reference = referenceURI; + } + + public String getReference() { + return reference; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java new file mode 100644 index 000000000..902f7bd72 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentLocRefImpl.java @@ -0,0 +1,44 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.ContentLocRef; + +/** + * Default implementation of ContentLocRef. + * + * @author Gregor Karlinger + * @version $Id$ + */ +public class ContentLocRefImpl extends ContentImpl implements ContentLocRef +{ + /** + * The location reference URI pointing to the actual remote location of the content. + */ + private String locationReferenceURI_; + + /** + * @see at.gv.egovernment.moa.spss.api.common.ContentLocRef#getLocationReference() + */ + public String getLocationReferenceURI() + { + return locationReferenceURI_; + } + + /** + * Sets the location reference URI pointing to the actual remote location of the content. + * + * @param locationReferenceURI the location reference URI. + */ + public void setLocationReferenceURI(String locationReferenceURI) + { + locationReferenceURI_ = locationReferenceURI; + } + + /** + * Gets the type of content. + * + * @return LOCREF_CONTENT. + */ + public int getContentType() { + return LOCREF_CONTENT; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java new file mode 100644 index 000000000..50609aa0e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentReferenceImpl.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.ContentReference; + +/** + * Default implementation of ContentReference. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ContentReferenceImpl + extends ContentImpl + implements ContentReference { + + /** + * Gets the type of content. + * + * @return REFERENCE_CONTENT + */ + public int getContentType() { + return REFERENCE_CONTENT; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java new file mode 100644 index 000000000..c03f5edde --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ContentXMLImpl.java @@ -0,0 +1,40 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.api.common.ContentXML; + +/** + * Default implementation of ContentXML. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ContentXMLImpl extends ContentImpl implements ContentXML { + + /** The nodes making up the XML content. */ + private NodeList xmlContent; + + /** + * Sets the nodes making up the XML content. + * + * @param xmlContent The XML content. + */ + public void setXMLContent(NodeList xmlContent) { + this.xmlContent = xmlContent; + } + + public NodeList getXMLContent() { + return xmlContent; + } + + /** + * Gets the type of content. + * + * @return XML_CONTENT + */ + public int getContentType() { + return XML_CONTENT; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java new file mode 100644 index 000000000..22e4cd61d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileExplicitImpl.java @@ -0,0 +1,66 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; + +/** + * Default implementation of + * . + * + * @author Patrick Peck + * @version $Id$ + */ +public class CreateSignatureEnvironmentProfileExplicitImpl + implements CreateSignatureEnvironmentProfileExplicit { + + /** The insertion location of the signature to be created. */ + private CreateSignatureLocation createSignatureLocation; + + /** Supplemental information for evaluating the signature environment. */ + private List supplements; + + /** + * Sets the insertion location of the signature to be created. + * + * @param createSignatureLocation The insertion location of the signature to + * be created. + */ + public void setCreateSignatureLocation(CreateSignatureLocation createSignatureLocation) { + this.createSignatureLocation = createSignatureLocation; + } + + public CreateSignatureLocation getCreateSignatureLocation() { + return createSignatureLocation; + } + + /** + * Sets the supplemental information for evaluating the signature + * environment. + * + * @param supplements The supplemental information. + */ + public void setSupplements(List supplements) { + this.supplements = + supplements != null + ? Collections.unmodifiableList(new ArrayList(supplements)) + : null; + } + + public List getSupplements() { + return supplements; + } + + /** + * Gets the type of profile. + * + * @return EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE + */ + public int getCreateSignatureEnvironmentProfileType() { + return EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java new file mode 100644 index 000000000..1c7dc6439 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureEnvironmentProfileIDImpl.java @@ -0,0 +1,39 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileID; + +/** + * Default implementation of CreateSignatureEnvironmentProfileID. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CreateSignatureEnvironmentProfileIDImpl + implements CreateSignatureEnvironmentProfileID { + + /** The profile ID. */ + private String createSignatureEnvironmentProfileID; + + /** + * Sets the profile ID. + * + * @param profileID The profile ID. + */ + public void setCreateSignatureEnvironmentProfileID(String profileID) { + this.createSignatureEnvironmentProfileID = profileID; + } + + public String getCreateSignatureEnvironmentProfileID() { + return createSignatureEnvironmentProfileID; + } + + /** + * Gets the type of profile. + * + * @return ID_CREATESIGNATUREENVIRONMENTPROFILE + */ + public int getCreateSignatureEnvironmentProfileType() { + return ID_CREATESIGNATUREENVIRONMENTPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java new file mode 100644 index 000000000..097af7fff --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureInfoImpl.java @@ -0,0 +1,50 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; + +/** + * Default implementation of CreateSignatureInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateSignatureInfoImpl implements CreateSignatureInfo { + + /** The signature environment that will contain the newly created + * signature. */ + private Content createSignatureEnvironment; + + /** Additional information about the signature environment. */ + private CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile; + + /** + * Sets the signature environment that will contain the newly created + * signature. + * + * @param createSignatureEnvironment The signature environment. + */ + public void setCreateSignatureEnvironment(Content createSignatureEnvironment) { + this.createSignatureEnvironment = createSignatureEnvironment; + } + + public Content getCreateSignatureEnvironment() { + return createSignatureEnvironment; + } + + /** + * Sets the signature environment profile containing additional information + * about the signature environment. + * + * @param profile The signature environment profile. + */ + public void setCreateSignatureEnvironmentProfile(CreateSignatureEnvironmentProfile profile) { + this.createSignatureEnvironmentProfile = profile; + } + + public CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile() { + return createSignatureEnvironmentProfile; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java new file mode 100644 index 000000000..c0b36f505 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateSignatureLocationImpl.java @@ -0,0 +1,31 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; + +/** + * Default implementation of CreateSignatureLocation. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateSignatureLocationImpl + extends ElementSelectorImpl + implements CreateSignatureLocation { + + /** The index of the newly created signature. */ + private int index; + + /** + * Sets the index of the newly created signature. + * + * @param index The index of the newly created signature. + */ + public void setIndex(int index) { + this.index = index; + } + + public int getIndex() { + return index; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java new file mode 100644 index 000000000..ff4108248 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoImpl.java @@ -0,0 +1,51 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; + +/** + * Default implementation of CreateTransformsInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateTransformsInfoImpl implements CreateTransformsInfo { + /** The dsig:Transforms. */ + private List transforms; + /** Meta information about the data resulting from the transforms. */ + private MetaInfo finalDataMetaInfo; + + /** + * Sets the transforms. + * + * @param transforms The transforms. + */ + public void setTransforms(List transforms) { + this.transforms = + transforms != null + ? Collections.unmodifiableList(new ArrayList(transforms)) + : null; + } + + public List getTransforms() { + return transforms; + } + + /** + * Sets the meta information about the data resulting from the transforms. + * + * @param finalDataMetaInfo The meta information. + */ + public void setFinalDataMetaInfo(MetaInfo finalDataMetaInfo) { + this.finalDataMetaInfo = finalDataMetaInfo; + } + + public MetaInfo getFinalDataMetaInfo() { + return finalDataMetaInfo; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java new file mode 100644 index 000000000..508b6c083 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileExplicitImpl.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; + +/** + * Default implementation of CreateTransformsInfoProfileExplicit. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateTransformsInfoProfileExplicitImpl + implements CreateTransformsInfoProfileExplicit { + + /** Transformation information. */ + private CreateTransformsInfo transformsInfo; + /** Additional data for the transformations. */ + private List supplements = new ArrayList(); + + /** + * Sets the transformation information. + * + * @param transformsInfo The transformation information. + */ + public void setCreateTransformsInfo(CreateTransformsInfo transformsInfo) { + this.transformsInfo = transformsInfo; + } + + public CreateTransformsInfo getCreateTransformsInfo() { + return transformsInfo; + } + + /** + * Sets the additional data for the transformations. + * + * @param supplements The additional data. + */ + public void setSupplements(List supplements) { + this.supplements = + supplements != null + ? Collections.unmodifiableList(new ArrayList(supplements)) + : null; + } + + public List getSupplements() { + return supplements; + } + + /** + * Gets the type of profile. + * + * @return EXPLICIT_CREATETRANSFORMSINFOPROFILE + */ + public int getCreateTransformsInfoProfileType() { + return EXPLICIT_CREATETRANSFORMSINFOPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java new file mode 100644 index 000000000..5cd1fcc48 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateTransformsInfoProfileIDImpl.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID; + +/** + * Default implementation of CreateTransformsInfoProfileID. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateTransformsInfoProfileIDImpl + implements CreateTransformsInfoProfileID { + + /** The profile ID. */ + private String createTransformsID; + + /** + * Sets the profile ID. + * @param createTransformsID The profile ID. + */ + public void setCreateTransformsInfoProfileID(String createTransformsID) { + this.createTransformsID = createTransformsID; + } + + public String getCreateTransformsInfoProfileID() { + return createTransformsID; + } + + /** + * Gets the type of profile. + * + * @return ID_CREATETRANSFORMSINFOPROFILE + */ + public int getCreateTransformsInfoProfileType() { + return ID_CREATETRANSFORMSINFOPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java new file mode 100644 index 000000000..08f94cc31 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureRequestImpl.java @@ -0,0 +1,53 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; + +/** + * Default implementation of CreateXMLSignatureRequest. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateXMLSignatureRequestImpl + implements CreateXMLSignatureRequest { + + /** The identifier for selecting the private keys for creating the signature.*/ + private String keyIdentifier; + /** Information for creating a single signature. */ + private List singleSignatureInfos = new ArrayList(); + + /** + * Sets the identifier for selecting the private keys for creating the + * signature. + * + * @param keyIdentifier The identifier for selecting the private keys. + */ + public void setKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + } + + public String getKeyIdentifier() { + return keyIdentifier; + } + + /** + * Sets the information for creating single signatures. + * + * @param singleSignaureInfos The information for creating single signatures. + */ + public void setSingleSignatureInfos(List singleSignaureInfos) { + this.singleSignatureInfos = + singleSignaureInfos != null + ? Collections.unmodifiableList(new ArrayList(singleSignaureInfos)) + : null; + } + + public List getSingleSignatureInfos() { + return singleSignatureInfos; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java new file mode 100644 index 000000000..590258e30 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/CreateXMLSignatureResponseImpl.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; + +/** + * Default implementation of CreateXMLSignatureResponse. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class CreateXMLSignatureResponseImpl + implements CreateXMLSignatureResponse { + + /** The elements contained in the response. */ + private List responseElements = new ArrayList(); + + /** + * Sets the elements contained in the response. + * + * @param responseElements The response elements. + */ + public void setResponseElements(List responseElements) { + this.responseElements = + responseElements != null + ? Collections.unmodifiableList(new ArrayList(responseElements)) + : null; + } + + public List getResponseElements() { + return responseElements; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java new file mode 100644 index 000000000..8ab2241de --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/DataObjectInfoImpl.java @@ -0,0 +1,79 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; + +/** + * Default implementation of DataObjectInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class DataObjectInfoImpl implements DataObjectInfo { + /** The signature structure type. */ + private String stucture; + /** Whether a reference will be placed in the signature itself or in the + * manifest */ + private boolean childOfManifest; + /** The data object to be signed. */ + private Content dataObject; + /** The profile containing additional information for the transformations. */ + private CreateTransformsInfoProfile createTransformsInfoProfile; + + /** + * Sets the signature structure type. + * + * @param structure The signature structure type. + */ + public void setStructure(String structure) { + this.stucture = structure; + } + + public String getStructure() { + return stucture; + } + + /** + * Sets whether a reference will be placed in the signature itself or in the + * manifest. + * + * @param childOfManifest Whether to put the reference in the signature of + * in the manifest. + */ + public void setChildOfManifest(boolean childOfManifest) { + this.childOfManifest = childOfManifest; + } + + public boolean isChildOfManifest() { + return childOfManifest; + } + + /** + * Sets the data object to be signed. + * + * @param dataObject The data object to be signed. + */ + public void setDataObject(Content dataObject) { + this.dataObject = dataObject; + } + + public Content getDataObject() { + return dataObject; + } + + /** + * Sets additional information for the transformations. + * + * @param profile The profile containing additional information for the + * transformations. + */ + public void setCreateTransformsInfoProfile(CreateTransformsInfoProfile profile) { + this.createTransformsInfoProfile = profile; + } + + public CreateTransformsInfoProfile getCreateTransformsInfoProfile() { + return createTransformsInfoProfile; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java new file mode 100644 index 000000000..e460bd584 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ElementSelectorImpl.java @@ -0,0 +1,47 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.HashMap; +import java.util.Map; + +import at.gv.egovernment.moa.spss.api.common.ElementSelector; + +/** + * Default implementation of ElementSelector. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ElementSelectorImpl implements ElementSelector { + /** The XPath expression pointing to the element. */ + private String xPathExpression; + /** The namespace declarations to apply for evaluating the XPath */ + private Map namespaceDeclarations = new HashMap(); + + /** + * Sets the XPath expression pointing to the element. + * + * @param xPathExpression XPath expression pointing to the element. + */ + public void setXPathExpression(String xPathExpression) { + this.xPathExpression = xPathExpression; + } + + public String getXPathExpression() { + return xPathExpression; + } + + /** + * Sets namespace declarations to apply for evaluating the XPath. + * + * @param namespaceDeclarations The namespace declarations to apply for + * evaluating the XPath. + */ + public void setNamespaceDeclarations(Map namespaceDeclarations) { + this.namespaceDeclarations = namespaceDeclarations; + } + + public Map getNamespaceDeclarations() { + return namespaceDeclarations; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java new file mode 100644 index 000000000..a1be3d86a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/EnvelopedSignatureTransformImpl.java @@ -0,0 +1,22 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; + +/** + * Default implementation of EnvelopedSignatureTransform. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class EnvelopedSignatureTransformImpl + extends TransformImpl + implements EnvelopedSignatureTransform { + + /** + * Create a EnvelopedSignatureTransformImpl. + */ + public EnvelopedSignatureTransformImpl() { + setAlgorithmURI(ENVELOPED_SIGNATURE); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java new file mode 100644 index 000000000..d7047ab44 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ErrorResponseImpl.java @@ -0,0 +1,52 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; + +/** + * Default implementation of ErrorResponse. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ErrorResponseImpl implements ErrorResponse { + /** The error code. */ + private int code; + /** Verbose error message. */ + private String info; + + /** + * Sets the error code. + * + * @param code The error code. + */ + public void setErrorCode(int code) { + this.code = code; + } + + public int getErrorCode() { + return code; + } + + /** + * Sets the verbose error information. + * + * @param info The verbose error information. + */ + public void setInfo(String info) { + this.info = info; + } + + public String getInfo() { + return info; + } + + /** + * Gets the response type. + * + * @return ERROR_RESPONSE + */ + public int getResponseType() { + return ERROR_RESPONSE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java new file mode 100644 index 000000000..bf21c8634 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ExclusiveCanonicalizationTransformImpl.java @@ -0,0 +1,48 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; + +/** + * Default implementation of ExclusiveCanonicalizationTransform. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ExclusiveCanonicalizationTransformImpl + extends TransformImpl + implements ExclusiveCanonicalizationTransform { + + /** The namespaces to treat according to canonical XML. */ + private List inclusiveNamespacePrefixes; + + /** + * Create a ExclusiveCanonicalizationTransformImpl object. + * + * @param algorithmURI The algorithm URI identifying the transformation + * algorithm. + */ + public ExclusiveCanonicalizationTransformImpl(String algorithmURI) { + setAlgorithmURI(algorithmURI); + } + + /** + * Sets the namespaces to treat according to canonical XML. + * @param inclusiveNamespacePrefixes The namespaces to treat according to + * canonical XML. + */ + public void setInclusiveNamespacePrefixes(List inclusiveNamespacePrefixes) { + this.inclusiveNamespacePrefixes = + inclusiveNamespacePrefixes != null + ? Collections.unmodifiableList(new ArrayList(inclusiveNamespacePrefixes)) + : null; + } + + public List getInclusiveNamespacePrefixes() { + return inclusiveNamespacePrefixes; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java new file mode 100644 index 000000000..42d61559e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataBinaryImpl.java @@ -0,0 +1,99 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; + +import at.gv.egovernment.moa.spss.MOARuntimeException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.ContentBinary; +import at.gv.egovernment.moa.spss.api.common.InputData; + +/** + * Content wrapper decorating a binary content with two additional attributes + * needed for returning HashInputData and ReferenceInputData + * information as part of VerifyXMLSignatureResponse. + * + * @author Gregor Karlinger + * + * @version $Id$ + */ +public class InputDataBinaryImpl implements ContentBinary, InputData +{ + /** + * The wrapped Content. + */ + protected ContentBinary wrapped_; + + /** + * This attribute signals what kind of container the XMLDSIG Reference + * this InputData belongs to is part of. + */ + protected String partOf_; + + /** + * If this InputData belongs to an XMLDSIG Reference + * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute + * (a positive int) signals the particular Reference of the XMLDSIG + * SignedInfo referring to the XMLDSIGManifest or SignatureManifest + * respectively. + */ + protected int referringReferenceNumber_; + + /** + * Creates a new instance. + * + * @param wrapped The wrapped Content. Must be of type {@link Content#BINARY_CONTENT}. + * + * @param partOf see {@link InputData} + * + * @param referringReferenceNumber see {@link InputData} + */ + public InputDataBinaryImpl(Content wrapped, String partOf, int referringReferenceNumber) throws MOARuntimeException + { + if (wrapped.getContentType() != Content.BINARY_CONTENT) throw new MOARuntimeException("9901", null); + + wrapped_ = (ContentBinary) wrapped; + partOf_ = partOf; + referringReferenceNumber_ = referringReferenceNumber; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() + */ + public int getContentType() + { + return wrapped_.getContentType(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() + */ + public String getReference() + { + return wrapped_.getReference(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.ContentBinary#getBinaryContent() + */ + public InputStream getBinaryContent() + { + return wrapped_.getBinaryContent(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() + */ + public String getPartOf() + { + return partOf_; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() + */ + public int getReferringReferenceNumber() + { + return referringReferenceNumber_; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java new file mode 100644 index 000000000..029a402f5 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/InputDataXMLImpl.java @@ -0,0 +1,99 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.MOARuntimeException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.ContentXML; +import at.gv.egovernment.moa.spss.api.common.InputData; + +/** + * Content wrapper decorating an XML content with two additional attributes + * needed for returning HashInputData and ReferenceInputData + * information as part of VerifyXMLSignatureResponse. + * + * @author Gregor Karlinger + * + * @version $Id$ + */ +public class InputDataXMLImpl implements ContentXML, InputData +{ + /** + * The wrapped ContentXML. + */ + protected ContentXML wrapped_; + + /** + * This attribute signals what kind of container the XMLDSIG Reference + * this InputData belongs to is part of. + */ + protected String partOf_; + + /** + * If this InputData belongs to an XMLDSIG Reference + * being part of either a XMLDSIGManifest or a SignatureManifest, this attribute + * (a positive int) signals the particular Reference of the XMLDSIG + * SignedInfo referring to the XMLDSIGManifest or SignatureManifest + * respectively. + */ + protected int referringReferenceNumber_; + + /** + * Creates a new instance. + * + * @param wrapped The wrapped ContentBinary. Must be of type {@link Content#XML_CONTENT}. + * + * @param partOf see {@link InputData} + * + * @param referringReferenceNumber see {@link InputData} + */ + public InputDataXMLImpl(Content wrapped, String partOf, int referringReferenceNumber) + { + if (wrapped.getContentType() != Content.XML_CONTENT) throw new MOARuntimeException("9901", null); + + wrapped_ = (ContentXML) wrapped; + partOf_ = partOf; + referringReferenceNumber_ = referringReferenceNumber; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getContentType() + */ + public int getContentType() + { + return wrapped_.getContentType(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.Content#getReference() + */ + public String getReference() + { + return wrapped_.getReference(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.ContentXML#getXMLContent() + */ + public NodeList getXMLContent() + { + return wrapped_.getXMLContent(); + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getPartOf() + */ + public String getPartOf() + { + return partOf_; + } + + /** + * @see at.gv.egovernment.moa.spss.api.common.InputData#getReferringReferenceNumber() + */ + public int getReferringReferenceNumber() + { + return referringReferenceNumber_; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java new file mode 100644 index 000000000..9174e3a46 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultImpl.java @@ -0,0 +1,44 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; + +/** + * Default implementation of ManifestRefsCheckResult. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ManifestRefsCheckResultImpl implements ManifestRefsCheckResult { + /** The numerical check code. */ + private int code; + /** Additional information about the check. */ + private ManifestRefsCheckResultInfo info; + + /** + * Sets the check code. + * + * @param code A numerical representation of the result of the manifest check. + */ + public void setCode(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + /** + * Sets a reference to the manifest. + * + * @param info The reference to the manifest. + */ + public void setInfo(ManifestRefsCheckResultInfo info) { + this.info = info; + } + + public ManifestRefsCheckResultInfo getInfo() { + return info; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java new file mode 100644 index 000000000..0071a14f3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ManifestRefsCheckResultInfoImpl.java @@ -0,0 +1,32 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; + +/** + * Default implementation of ManifestRefsCheckResultInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ManifestRefsCheckResultInfoImpl + extends ReferencesCheckResultInfoImpl + implements ManifestRefsCheckResultInfo { + + /** The position of the signature reference containing the reference to the + * manifest being described by this object.*/ + private int referringSignatureReference; + + /** + * Sets the position of the signature reference containing the reference to + * the manifest being described by this object. + * @param referringSignatureReference The position of the signature reference. + */ + public void setReferringSignatureReference(int referringSignatureReference) { + this.referringSignatureReference = referringSignatureReference; + } + + public int getReferringSignatureReference() { + return referringSignatureReference; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java new file mode 100644 index 000000000..93aceb033 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java @@ -0,0 +1,75 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.api.common.MetaInfo; + +/** + * Default implementation of MetaInfo. + * @author Fatemeh Philippi + * @version $Id$ + */ +public class MetaInfoImpl implements MetaInfo { + /** Information about the MIME type. */ + private String mimeType; + /** URI pointing to a description of the content. */ + private String description; + /** Descriptive XML content. */ + private NodeList anyElements; + /** Type information for XML signature creation */ + private String type; + + /** + * Sets the MIME type. + * + * @param mimeType The MIME type to set. + */ + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + public String getMimeType() { + return mimeType; + } + + /** + * Sets the URI pointing to a description of the content. + * + * @param description The URI pointing to a description of the content. + */ + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + /** + * Sets descriptive XML content. + * + * @param anyElements The elements to set. + */ + public void setAnyElements(NodeList anyElements) { + this.anyElements = anyElements; + } + + public NodeList getAnyElements() { + return anyElements; + } + + /** + * Sets the XML signature creation type information. + * + * @param type the XML signature creation type information to set. + */ + public void setType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java new file mode 100644 index 000000000..923a4bce1 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferenceInfoImpl.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; + +/** + * Default implementation of ReferenceInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class ReferenceInfoImpl implements ReferenceInfo { + /** Profile containing the transforms allowed in the signature. */ + private List verifyTransformsInfoProfiles; + + /** + * Sets the transforms profile used for verifying the transforms contained + * in the signature. + * + * @param verifyTransformsInfoProfiles The profiles containing the transforms + * allowed in the signature. + */ + public void setVerifyTransformsInfoProfiles(List verifyTransformsInfoProfiles) { + this.verifyTransformsInfoProfiles = + verifyTransformsInfoProfiles != null + ? Collections.unmodifiableList( + new ArrayList(verifyTransformsInfoProfiles)) + : null; + } + + public List getVerifyTransformsInfoProfiles() { + return verifyTransformsInfoProfiles; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java new file mode 100644 index 000000000..6bb4d30ac --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultImpl.java @@ -0,0 +1,46 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; + +/** + * Default implementation of ReferencesCheckResult. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ReferencesCheckResultImpl implements ReferencesCheckResult { + /** The check code. */ + private int code; + /** Additional information about the reference check. */ + private ReferencesCheckResultInfo info; + + /** + * Sets the check code. + * + * @param code A numerical representation of the result of the reference + * check. + */ + public void setCode(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + /** + * Sets additional information about the reference check. + * + * @param manifestRefsCheckResultInfo Additional information about the + * reference check. + */ + public void setInfo(ReferencesCheckResultInfo manifestRefsCheckResultInfo) { + this.info = manifestRefsCheckResultInfo; + } + + public ReferencesCheckResultInfo getInfo() { + return info; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java new file mode 100644 index 000000000..a21b417ae --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/ReferencesCheckResultInfoImpl.java @@ -0,0 +1,46 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; + +/** + * Default implementation of ReferencesCheckResultInfo. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ReferencesCheckResultInfoImpl + implements ReferencesCheckResultInfo { + + /** Additional information about the references check. */ + private NodeList anyOtherInfo; + /** The indexes of the failed references. */ + private int[] failedReferences = new int[0]; + + /** + * Sets additional information about the references check. + * @param anyOtherInfo Additional information about the references check. + */ + public void setAnyOtherInfo(NodeList anyOtherInfo) { + this.anyOtherInfo = anyOtherInfo; + } + + public NodeList getAnyOtherInfo() { + return anyOtherInfo; + } + + /** + * Sets the indexes of the failed references. + * + * @param failedReferences The indexes of the failed references. + */ + public void setFailedReferences(int[] failedReferences) { + this.failedReferences = failedReferences; + } + + public int[] getFailedReferences() { + return failedReferences; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java new file mode 100644 index 000000000..bf15bf37e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java @@ -0,0 +1,568 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; +import java.math.BigInteger; +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; +import at.gv.egovernment.moa.spss.api.common.Transform; +import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.common.XPathFilter; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * Default implementation of SPSSFactory. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SPSSFactoryImpl extends SPSSFactory { + + public CreateXMLSignatureRequest createCreateXMLSignatureRequest( + String keyIdentifier, + List singleSignatureInfos) { + CreateXMLSignatureRequestImpl createXMLSignatureRequest = + new CreateXMLSignatureRequestImpl(); + createXMLSignatureRequest.setKeyIdentifier(keyIdentifier); + createXMLSignatureRequest.setSingleSignatureInfos(singleSignatureInfos); + return createXMLSignatureRequest; + } + + public SingleSignatureInfo createSingleSignatureInfo( + List dataObjectInfos, + CreateSignatureInfo createSignatureInfo, + boolean securityLayerConform) { + SingleSignatureInfoImpl singleSignatureInfo = new SingleSignatureInfoImpl(); + singleSignatureInfo.setDataObjectInfos(dataObjectInfos); + singleSignatureInfo.setCreateSignatureInfo(createSignatureInfo); + singleSignatureInfo.setSecurityLayerConform(securityLayerConform); + return singleSignatureInfo; + } + public DataObjectInfo createDataObjectInfo( + String structure, + boolean childOfManifest, + Content dataObject, + CreateTransformsInfoProfile createTransformsInfoProfile) { + DataObjectInfoImpl dataObjectInfo = new DataObjectInfoImpl(); + dataObjectInfo.setStructure(structure); + dataObjectInfo.setChildOfManifest(childOfManifest); + dataObjectInfo.setDataObject(dataObject); + dataObjectInfo.setCreateTransformsInfoProfile(createTransformsInfoProfile); + return dataObjectInfo; + } + + public CreateTransformsInfoProfile createCreateTransformsInfoProfile(String profileID) { + + CreateTransformsInfoProfileIDImpl createTransformsInfoProfile = + new CreateTransformsInfoProfileIDImpl(); + createTransformsInfoProfile.setCreateTransformsInfoProfileID(profileID); + return createTransformsInfoProfile; + } + + public CreateTransformsInfoProfile createCreateTransformsInfoProfile( + CreateTransformsInfo transformsInfo, + List supplements) { + CreateTransformsInfoProfileExplicitImpl createTransformsInfoProfile = + new CreateTransformsInfoProfileExplicitImpl(); + createTransformsInfoProfile.setCreateTransformsInfo(transformsInfo); + createTransformsInfoProfile.setSupplements(supplements); + return createTransformsInfoProfile; + } + + public CreateTransformsInfo createCreateTransformsInfo( + List transforms, + MetaInfo finalDataMetaInfo) { + CreateTransformsInfoImpl createTransformsInfo = + new CreateTransformsInfoImpl(); + + createTransformsInfo.setTransforms(transforms); + createTransformsInfo.setFinalDataMetaInfo(finalDataMetaInfo); + return createTransformsInfo; + } + + public CreateSignatureInfo createCreateSignatureInfo( + Content createSignatureEnvironment, + CreateSignatureEnvironmentProfile createSignatureEnvironmentProfile) { + CreateSignatureInfoImpl createSignatureInfo = new CreateSignatureInfoImpl(); + createSignatureInfo.setCreateSignatureEnvironment( + createSignatureEnvironment); + createSignatureInfo.setCreateSignatureEnvironmentProfile( + createSignatureEnvironmentProfile); + return createSignatureInfo; + } + + public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile( + CreateSignatureLocation createSignatureLocation, + List supplements) { + CreateSignatureEnvironmentProfileExplicitImpl createSignatureEnvironmentProfile = + new CreateSignatureEnvironmentProfileExplicitImpl(); + createSignatureEnvironmentProfile.setCreateSignatureLocation( + createSignatureLocation); + createSignatureEnvironmentProfile.setSupplements(supplements); + return createSignatureEnvironmentProfile; + } + + public CreateSignatureLocation createCreateSignatureLocation( + String signatureLocationXPath, + int signatureLocationIndex, + Map namespaceDeclarations) { + CreateSignatureLocationImpl createSignatureLocation = + new CreateSignatureLocationImpl(); + createSignatureLocation.setIndex(signatureLocationIndex); + createSignatureLocation.setNamespaceDeclarations(namespaceDeclarations); + createSignatureLocation.setXPathExpression(signatureLocationXPath); + return createSignatureLocation; + } + + public CreateSignatureEnvironmentProfile createCreateSignatureEnvironmentProfile(String profileID) { + CreateSignatureEnvironmentProfileIDImpl createSignatureEnvironmentProfile = + new CreateSignatureEnvironmentProfileIDImpl(); + createSignatureEnvironmentProfile.setCreateSignatureEnvironmentProfileID( + profileID); + return createSignatureEnvironmentProfile; + } + + public CreateXMLSignatureResponse createCreateXMLSignatureResponse(List responseElements) { + CreateXMLSignatureResponseImpl createXMLSignatureResponse = + new CreateXMLSignatureResponseImpl(); + createXMLSignatureResponse.setResponseElements(responseElements); + return createXMLSignatureResponse; + } + + public SignatureEnvironmentResponse createSignatureEnvironmentResponse(Element signatureEnvironment) { + SignatureEnvironmentResponseImpl signatureEnvironmentResponse = + new SignatureEnvironmentResponseImpl(); + signatureEnvironmentResponse.setSignatureEnvironment(signatureEnvironment); + return signatureEnvironmentResponse; + } + + public ErrorResponse createErrorResponse(int code, String info) { + ErrorResponseImpl errorResponse = new ErrorResponseImpl(); + errorResponse.setErrorCode(code); + errorResponse.setInfo(info); + return errorResponse; + } + + public VerifyCMSSignatureRequest createVerifyCMSSignatureRequest( + int[] signatories, + Date dateTime, + InputStream cmsSignature, + CMSDataObject dataObject, + String trustProfileID) { + VerifyCMSSignatureRequestImpl verifyCMSSignatureRequest = + new VerifyCMSSignatureRequestImpl(); + verifyCMSSignatureRequest.setDateTime(dateTime); + verifyCMSSignatureRequest.setCMSSignature(cmsSignature); + verifyCMSSignatureRequest.setDataObject(dataObject); + verifyCMSSignatureRequest.setTrustProfileId(trustProfileID); + verifyCMSSignatureRequest.setSignatories(signatories); + return verifyCMSSignatureRequest; + } + + public CMSDataObject createCMSDataObject( + MetaInfo metaInfo, + CMSContent content) { + + CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); + cmsDataObject.setMetaInfo(metaInfo); + cmsDataObject.setContent(content); + + return cmsDataObject; + } + + public CMSContent createCMSContent(InputStream binaryContent) { + CMSContentExplicitImpl cmsContent = new CMSContentExplicitImpl(); + + cmsContent.setBinaryContent(binaryContent); + return cmsContent; + } + + public CMSContent createCMSContent(String referenceURI) { + CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); + + cmsContent.setReference(referenceURI); + return cmsContent; + } + + + public CMSDataObject createCMSDataObject( + MetaInfo metaInfo, + String referenceURI) { + CMSDataObjectImpl cmsDataObject = new CMSDataObjectImpl(); + CMSContentReferenceImpl cmsContent = new CMSContentReferenceImpl(); + cmsDataObject.setMetaInfo(metaInfo); + cmsContent.setReference(referenceURI); + return cmsDataObject; + } + + public VerifyCMSSignatureResponse createVerifyCMSSignatureResponse(List responseElements) { + VerifyCMSSinatureResponseImpl verifyCMSSignatureResponse = + new VerifyCMSSinatureResponseImpl(); + verifyCMSSignatureResponse.setResponseElements(responseElements); + return verifyCMSSignatureResponse; + } + + public VerifyCMSSignatureResponseElement createVerifyCMSSignatureResponseElement( + SignerInfo signerInfo, + CheckResult signatureCheck, + CheckResult certificateCheck) { + VerifyCMSSignatureResponseElementImpl verifyCMSSignatureResponseElement = + new VerifyCMSSignatureResponseElementImpl(); + verifyCMSSignatureResponseElement.setSignerInfo(signerInfo); + verifyCMSSignatureResponseElement.setSignatureCheck(signatureCheck); + verifyCMSSignatureResponseElement.setCertificateCheck(certificateCheck); + return verifyCMSSignatureResponseElement; + } + + public VerifyXMLSignatureRequest createVerifyXMLSignatureRequest( + Date dateTime, + VerifySignatureInfo verifySignatureInfo, + List supplementProfiles, + SignatureManifestCheckParams signatureManifestParams, + boolean returnHashInputData, + String trustProfileID) { + VerifyXMLSignatureRequestImpl verifyXMLSignatureRequest = + new VerifyXMLSignatureRequestImpl(); + verifyXMLSignatureRequest.setDateTime(dateTime); + verifyXMLSignatureRequest.setSignatureInfo(verifySignatureInfo); + verifyXMLSignatureRequest.setSupplementProfiles(supplementProfiles); + verifyXMLSignatureRequest.setSignatureManifestCheckParams( + signatureManifestParams); + verifyXMLSignatureRequest.setReturnHashInputData(returnHashInputData); + verifyXMLSignatureRequest.setTrustProfileId(trustProfileID); + return verifyXMLSignatureRequest; + } + + public VerifySignatureInfo createVerifySignatureInfo( + Content verifySignatureEnvironment, + VerifySignatureLocation verifySignatureLocation) { + VerifySignatureInfoImpl verifySignatureInfo = new VerifySignatureInfoImpl(); + verifySignatureInfo.setVerifySignatureEnvironment( + verifySignatureEnvironment); + verifySignatureInfo.setVerifySignatureLocation(verifySignatureLocation); + return verifySignatureInfo; + } + + public VerifySignatureLocation createVerifySignatureLocation( + String xPathExpression, + Map namespaceDeclarations) { + VerifySignatureLocationImpl verifySignatureLocation = + new VerifySignatureLocationImpl(); + verifySignatureLocation.setXPathExpression(xPathExpression); + verifySignatureLocation.setNamespaceDeclarations(namespaceDeclarations); + return verifySignatureLocation; + } + + public SupplementProfile createSupplementProfile(String profileID) { + SupplementProfileIDImpl supplementProfileID = new SupplementProfileIDImpl(); + supplementProfileID.setSupplementProfileID(profileID); + return supplementProfileID; + } + + public SupplementProfile createSupplementProfile(XMLDataObjectAssociation supplementProfile) { + SupplementProfileExplicitImpl supplementProfileExplicit = + new SupplementProfileExplicitImpl(); + supplementProfileExplicit.setSupplementProfile(supplementProfile); + return supplementProfileExplicit; + } + + public SignatureManifestCheckParams createSignatureManifestCheckParams( + List referenceInfos, + boolean returnReferenceInputData) { + SignatureManifestCheckParamsImpl signatureManifestCheckParams = + new SignatureManifestCheckParamsImpl(); + signatureManifestCheckParams.setReferenceInfos(referenceInfos); + signatureManifestCheckParams.setReturnReferenceInputData( + returnReferenceInputData); + return signatureManifestCheckParams; + } + + public ReferenceInfo createReferenceInfo(List verifyTransformsInfoProfiles) { + ReferenceInfoImpl referenceInfo = new ReferenceInfoImpl(); + referenceInfo.setVerifyTransformsInfoProfiles(verifyTransformsInfoProfiles); + return referenceInfo; + } + + public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile( + List transforms, + List transformParameters) { + VerifyTransformsInfoProfileExplicitImpl verifyTransformsInfoProfile = + new VerifyTransformsInfoProfileExplicitImpl(); + + verifyTransformsInfoProfile.setTransforms(transforms); + verifyTransformsInfoProfile.setTransformParameters(transformParameters); + + return verifyTransformsInfoProfile; + } + + public VerifyTransformsInfoProfile createVerifyTransformsInfoProfile(String profileID) { + VerifyTransformsInfoProfileIDImpl verifyTransformsInfoProfile = + new VerifyTransformsInfoProfileIDImpl(); + verifyTransformsInfoProfile.setVerifyTransformsInfoProfileID(profileID); + return verifyTransformsInfoProfile; + } + + + public TransformParameter createTransformParameter(String URI, String digestMethod, byte[] digestValue) { + TransformPatameterHashImpl transformParameter = + new TransformPatameterHashImpl(); + transformParameter.setURI(URI); + transformParameter.setDigestMethod(digestMethod); + transformParameter.setDigestValue(digestValue); + return transformParameter; + } + + public TransformParameter createTransformParameter( + String URI, + InputStream binaryData) { + TransformParameterBinaryImpl transformParameter = + new TransformParameterBinaryImpl(); + transformParameter.setURI(URI); + transformParameter.setBinaryContent(binaryData); + return transformParameter; + } + + public TransformParameter createTransformParameter(String URI) { + TransformParameterURIImpl transformParameter = + new TransformParameterURIImpl(); + transformParameter.setURI(URI); + return transformParameter; + } + + public VerifyXMLSignatureResponse createVerifyXMLSignatureResponse( + SignerInfo signerInfo, + List hashInputDatas, + List referenceInputDatas, + ReferencesCheckResult signatureCheck, + ReferencesCheckResult signatureManifestCheck, + List xmlDsigManifestChecks, + CheckResult certificateCheck) { + VerifyXMLSignatureResponseImpl verifyXMLSignatureResponse = + new VerifyXMLSignatureResponseImpl(); + verifyXMLSignatureResponse.setSignerInfo(signerInfo); + verifyXMLSignatureResponse.setHashInputDatas(hashInputDatas); + verifyXMLSignatureResponse.setReferenceInputDatas(referenceInputDatas); + verifyXMLSignatureResponse.setSignatureCheck(signatureCheck); + verifyXMLSignatureResponse.setSignatureManifestCheck( + signatureManifestCheck); + verifyXMLSignatureResponse.setXMLDsigManifestChecks(xmlDsigManifestChecks); + verifyXMLSignatureResponse.setCertificateCheck(certificateCheck); + return verifyXMLSignatureResponse; + } + + public ReferencesCheckResult createReferencesCheckResult( + int code, + ReferencesCheckResultInfo info) { + ReferencesCheckResultImpl referencesCheckResult = + new ReferencesCheckResultImpl(); + referencesCheckResult.setCode(code); + referencesCheckResult.setInfo(info); + return referencesCheckResult; + } + + public ReferencesCheckResultInfo createReferencesCheckResultInfo( + NodeList anyOtherInfo, + int[] failedReferences) { + ReferencesCheckResultInfoImpl referencesCheckResultInfo = + new ReferencesCheckResultInfoImpl(); + referencesCheckResultInfo.setAnyOtherInfo(anyOtherInfo); + referencesCheckResultInfo.setFailedReferences(failedReferences); + return referencesCheckResultInfo; + } + + public ManifestRefsCheckResult createManifestRefsCheckResult( + int code, + ManifestRefsCheckResultInfo info) { + ManifestRefsCheckResultImpl manifestRefsCheckResult = + new ManifestRefsCheckResultImpl(); + manifestRefsCheckResult.setCode(code); + manifestRefsCheckResult.setInfo(info); + return manifestRefsCheckResult; + } + + public ManifestRefsCheckResultInfo createManifestRefsCheckResultInfo( + NodeList anyOtherInfo, + int[] failedReferences, + int referringSigReference) { + ManifestRefsCheckResultInfoImpl manifestRefsCheckResultInfo = + new ManifestRefsCheckResultInfoImpl(); + manifestRefsCheckResultInfo.setAnyOtherInfo(anyOtherInfo); + manifestRefsCheckResultInfo.setReferringSignatureReference( + referringSigReference); + manifestRefsCheckResultInfo.setFailedReferences(failedReferences); + return manifestRefsCheckResultInfo; + } + + public Content createContent(InputStream binaryData, String referenceURI) { + ContentBinaryImpl content = new ContentBinaryImpl(); + content.setBinaryContent(binaryData); + content.setReference(referenceURI); + return content; + } + + public Content createContent(String locationReferenceURI, String referenceURI) { + ContentLocRefImpl content = new ContentLocRefImpl(); + content.setLocationReferenceURI(locationReferenceURI); + content.setReference(referenceURI); + return content; + } + + public Content createContent(String referenceURI) { + ContentReferenceImpl content = new ContentReferenceImpl(); + content.setReference(referenceURI); + return content; + } + + public Content createContent(NodeList xmlData, String referenceURI) { + ContentXMLImpl content = new ContentXMLImpl(); + content.setXMLContent(xmlData); + content.setReference(referenceURI); + return content; + } + + public XMLDataObjectAssociation createXMLDataObjectAssociation( + MetaInfo metaInfo, + Content xmlContent) { + XMLDataObjectAssociationImpl xmlDataObjectAssociation = + new XMLDataObjectAssociationImpl(); + xmlDataObjectAssociation.setMetaInfo(metaInfo); + xmlDataObjectAssociation.setContent(xmlContent); + return xmlDataObjectAssociation; + } + + public MetaInfo createMetaInfo( + String mimeType, + String description, + NodeList otherInfo, + String type) { + MetaInfoImpl metaInfo = new MetaInfoImpl(); + metaInfo.setMimeType(mimeType); + metaInfo.setDescription(description); + metaInfo.setAnyElements(otherInfo); + metaInfo.setType(type); + return metaInfo; + } + + public Transform createCanonicalizationTransform(String algorithmURI) { + CanonicalizationTransformImpl transform = new CanonicalizationTransformImpl(algorithmURI); + return transform; + } + + public Transform createExclusiveCanonicalizationTransform(String algorithmURI, List inclusiveNamespacePrefixes) { + ExclusiveCanonicalizationTransformImpl transform = new ExclusiveCanonicalizationTransformImpl(algorithmURI); + transform.setInclusiveNamespacePrefixes(inclusiveNamespacePrefixes); + return transform; + } + + public Transform createBase64Transform() { + Base64TransformImpl transform = new Base64TransformImpl(); + return transform; + } + + public Transform createEnvelopedSignatureTransform() { + EnvelopedSignatureTransformImpl transform = + new EnvelopedSignatureTransformImpl(); + return transform; + } + + public Transform createXSLTTransform(Element styleSheet) { + XSLTransformImpl transform = new XSLTransformImpl(); + transform.setStylesheet(styleSheet); + return transform; + } + + public Transform createXPathTransform( + String xPathExpression, + Map namespaceDeclarations) { + XPathTransformImpl transform = new XPathTransformImpl(); + transform.setXPathExpression(xPathExpression); + transform.setNamespaceDelcarations(namespaceDeclarations); + return transform; + } + + public Transform createXPathFilter2Transform(List xPathFilters) { + XPathFilter2TransformImpl transform = new XPathFilter2TransformImpl(); + transform.setFilters(xPathFilters); + return transform; + } + + public XPathFilter createXPathFilter( + String filterType, + String xPathExpression, + Map namespaceDeclarations) { + XPathFilterImpl xPathFilter = new XPathFilterImpl(); + xPathFilter.setFilterType(filterType); + xPathFilter.setXPathExpression(xPathExpression); + xPathFilter.setNamespaceDelcarations(namespaceDeclarations); + return xPathFilter; + } + + public CheckResult createCheckResult(int code, NodeList info) { + CheckResultImpl checkResult = new CheckResultImpl(); + checkResult.setCode(code); + checkResult.setInfo(info); + return checkResult; + } + + public SignerInfo createSignerInfo( + X509Certificate signerCertificate, + boolean qualifiedCertificate, + boolean publicAuthority, + String publicAuthorityID) { + SignerInfoImpl signerInfo = new SignerInfoImpl(); + signerInfo.setSignerCertificate(signerCertificate); + signerInfo.setQualifiedCertificate(qualifiedCertificate); + signerInfo.setPublicAuthority(publicAuthority); + signerInfo.setPublicAuhtorityID(publicAuthorityID); + return signerInfo; + } + + public X509IssuerSerial createX509IssuerSerial( + String issuerName, + BigInteger serialNumber) { + X509IssuerSerialImpl x509IssuerSerial = new X509IssuerSerialImpl(); + x509IssuerSerial.setX509IssuerName(issuerName); + x509IssuerSerial.setX509SerialNumber(serialNumber); + return x509IssuerSerial; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java new file mode 100644 index 000000000..57d30ad3b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureEnvironmentResponseImpl.java @@ -0,0 +1,41 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; + +/** + * Default implementation of SignatureEnvironmentResponse. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SignatureEnvironmentResponseImpl + implements SignatureEnvironmentResponse { + + /** The signature environment containing the XML signature. */ + private Element signatureEnvironment; + + /** + * Sets the XML structure which contains the signature. + * + * @param signatureEnvironment A general XML structure containing the signature. + */ + public void setSignatureEnvironment(Element signatureEnvironment) { + this.signatureEnvironment = signatureEnvironment; + } + + public Element getSignatureEnvironment() { + return signatureEnvironment; + } + + /** + * Gets the type of CreateXMLSignatureResponseElement. + * + * @return SIGNATURE_ENVIRONMENT_RESPONSE + */ + public int getResponseType() { + return SIGNATURE_ENVIRONMENT_RESPONSE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java new file mode 100644 index 000000000..5924f8447 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignatureManifestCheckParamsImpl.java @@ -0,0 +1,52 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; + +/** + * Default implementation of SignatureManifestCheckParams. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SignatureManifestCheckParamsImpl + implements SignatureManifestCheckParams { + + /** Referential information. */ + private List referenceInfos; + /** Whether to return the signature source data. */ + private boolean returnReferenceInputData = true; + + /** + * Sets the referantial information. + * + * @param referenceInfos The referential information. + */ + public void setReferenceInfos(List referenceInfos) { + this.referenceInfos = + referenceInfos != null + ? Collections.unmodifiableList(new ArrayList(referenceInfos)) + : null; + } + + public List getReferenceInfos() { + return referenceInfos; + } + + /** + * Sets whether to return signature source data. + * + * @param returnReferenceInputData Whether to return signature source data. + */ + public void setReturnReferenceInputData(boolean returnReferenceInputData) { + this.returnReferenceInputData = returnReferenceInputData; + } + + public boolean getReturnReferenceInputData() { + return returnReferenceInputData; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java new file mode 100644 index 000000000..277f1a008 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SignerInfoImpl.java @@ -0,0 +1,81 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.security.cert.X509Certificate; + +import at.gv.egovernment.moa.spss.api.common.SignerInfo; + +/** + * Default implementation of SignerInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SignerInfoImpl implements SignerInfo { + + /** The signer certificate. */ + private X509Certificate signerCertificate; + /** Determines, whether signerCertificate is a qualified + * certificate. */ + private boolean qualifiedCertificate; + /** Determines, whether signerCertificate is from a public + * authority. */ + private boolean publicAuthority; + /** The public authority ID of the signerCertificate. */ + private String publicAuthorityID; + + /** + * Sets the signer certificate. + * + * @param signerCertificate The signer certificate. + */ + public void setSignerCertificate(X509Certificate signerCertificate) { + this.signerCertificate = signerCertificate; + } + + public X509Certificate getSignerCertificate() { + return signerCertificate; + } + + /** + * Sets, whether the certificate contained in this object is qualified or not. + * + * @param qualifiedCertificate Is true, if the certificate is + * qualified, otherwise false. + */ + public void setQualifiedCertificate(boolean qualifiedCertificate) { + this.qualifiedCertificate = qualifiedCertificate; + } + + public boolean isQualifiedCertificate() { + return qualifiedCertificate; + } + + /** + * Sets, whether the certificate contained in this object is an + * e-government certificate or not. + * + * @param publicAuthority Is true, if the certificate is + * public authority certificate, otherwise false. + */ + public void setPublicAuthority(boolean publicAuthority) { + this.publicAuthority = publicAuthority; + } + + public boolean isPublicAuthority() { + return publicAuthority; + } + + /** + * Sets the public authority ID of the signer certificate. + * + * @param publicAuhtorityID The public authority ID of the signer certificate. + */ + public void setPublicAuhtorityID(String publicAuhtorityID) { + this.publicAuthorityID = publicAuhtorityID; + } + + public String getPublicAuhtorityID() { + return publicAuthorityID; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java new file mode 100644 index 000000000..b50a65c68 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SingleSignatureInfoImpl.java @@ -0,0 +1,49 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; + +/** + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SingleSignatureInfoImpl implements SingleSignatureInfo { + + private List dataObjectInfos = new ArrayList(); + + private CreateSignatureInfo createSignatureInfo; + + private boolean securityLayerConform = true; + + public void setDataObjectInfos(List dataObjectInfos) { + this.dataObjectInfos = + dataObjectInfos != null + ? Collections.unmodifiableList(new ArrayList(dataObjectInfos)) + : null; + } + + public List getDataObjectInfos() { + return dataObjectInfos; + } + + public void setCreateSignatureInfo(CreateSignatureInfo createSignatureInfo) { + this.createSignatureInfo = createSignatureInfo; + } + + public CreateSignatureInfo getCreateSignatureInfo() { + return createSignatureInfo; + } + + public void setSecurityLayerConform(boolean securityLayerConform) { + this.securityLayerConform = securityLayerConform; + } + + public boolean isSecurityLayerConform() { + return securityLayerConform; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java new file mode 100644 index 000000000..78723fec2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileExplicitImpl.java @@ -0,0 +1,39 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; + +/** + * Default implementation of SupplementProfileExplicit. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SupplementProfileExplicitImpl implements SupplementProfileExplicit { + + /** Supplemental information for verifying a signature. */ + private XMLDataObjectAssociation supplement; + + /** + * Sets the supplemental information for verifying a signature. + * + * @param supplement The supplemental information for verifying a signature. + */ + public void setSupplementProfile(XMLDataObjectAssociation supplement) { + this.supplement = supplement; + } + + public XMLDataObjectAssociation getSupplementProfile() { + return supplement; + } + + /** + * Gets the type of SupplementProfile. + * + * @return EXPLICIT_SUPPLEMENTPROFILE + */ + public int getSupplementProfileType() { + return EXPLICIT_SUPPLEMENTPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java new file mode 100644 index 000000000..320827fad --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/SupplementProfileIDImpl.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileID; + +/** + * Default implementation of SupplementProfileID. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class SupplementProfileIDImpl implements SupplementProfileID { + /** The profile ID. */ + private String profileID; + + /** + * Sets the SupplementProfile profile ID. + * + * @param profileID The profile ID. + */ + public void setSupplementProfileID(String profileID) { + this.profileID = profileID; + } + + public String getSupplementProfileID() { + return profileID; + } + + /** + * Gets the type of SupplementProfile. + * + * @return ID_SUPPLEMENTPROFILE + */ + public int getSupplementProfileType() { + return ID_SUPPLEMENTPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java new file mode 100644 index 000000000..51c7a543f --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformImpl.java @@ -0,0 +1,26 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Transform; + +/** + * @author Fatemeh Philippi + * @version $Id$ + */ +public class TransformImpl implements Transform { + /** The URI identifying the transformation algorithm. */ + private String algorithmURI; + + /** + * Sets the URI identifying the transformation algorithm. + * + * @param algorithmURI The URI identifying the transformation algorithm. + */ + public void setAlgorithmURI(String algorithmURI) { + this.algorithmURI = algorithmURI; + } + + public String getAlgorithmURI() { + return algorithmURI; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java new file mode 100644 index 000000000..2901fb1bb --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterBinaryImpl.java @@ -0,0 +1,42 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; + +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterBinary; + +/** + * Default implementation of TransformParameterBinary. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class TransformParameterBinaryImpl + extends TransformParameterImpl + implements TransformParameterBinary { + + /** The binary content as a stream. */ + private InputStream binaryContent; + + /** + * Sets the binary content as a stream. + * + * @param binaryContent The binary content as a stream. + */ + public void setBinaryContent(InputStream binaryContent) { + this.binaryContent = binaryContent; + } + + public InputStream getBinaryContent() { + return binaryContent; + } + + /** + * Gets the TransformParameter type. + * + * @return BINARY_TRANSFORMPARAMETER + */ + public int getTransformParameterType() { + return BINARY_TRANSFORMPARAMETER; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java new file mode 100644 index 000000000..9fe60638e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterImpl.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.impl; + +/** + * Default base implementation of TransformParameter. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class TransformParameterImpl { + /** An URI identifying the TransformParameter. */ + private String uri; + + /** + * Sets the URI identifying the TransformParameter. + * @param uri The URI identifying the TransformParameter. + */ + public void setURI(String uri) { + this.uri = uri; + } + + public String getURI() { + return uri; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java new file mode 100644 index 000000000..25449504c --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformParameterURIImpl.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterURI; + +/** + * Default implementation of TransformParameterURI. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class TransformParameterURIImpl + extends TransformParameterImpl + implements TransformParameterURI { + + /** + * Gets the type of TransformParameter. + * + * @return URI_TRANSFORMPARAMETER + */ + public int getTransformParameterType() { + return URI_TRANSFORMPARAMETER; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java new file mode 100644 index 000000000..a7843e68c --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/TransformPatameterHashImpl.java @@ -0,0 +1,54 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterHash; + +/** + * Default implementation of TransformParameterHash + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class TransformPatameterHashImpl + extends TransformParameterImpl + implements TransformParameterHash { + + /** The method used to calculate the digest value. */ + private String digestMethod; + /** The digest value. */ + private byte[] digestValue; + + /** + * Sets method used to calculate the digest value. + * @param digestMethod The method used to calculate the digest value. + */ + public void setDigestMethod(String digestMethod) { + this.digestMethod = digestMethod; + } + + public String getDigestMethod() { + return digestMethod; + } + + /** + * Sets the digest value. + * + * @param digestValue The digest value. + */ + public void setDigestValue(byte[] digestValue) { + this.digestValue = digestValue; + } + + public byte[] getDigestValue() { + return digestValue; + } + + /** + * Gets the type of TransformParameter. + * + * @return HASH_TRANSFORMPARAMETER + */ + public int getTransformParameterType() { + return HASH_TRANSFORMPARAMETER; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java new file mode 100644 index 000000000..a3c37aaef --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureRequestImpl.java @@ -0,0 +1,93 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.io.InputStream; +import java.util.Date; + +import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; + +/** + * Default implementation of VerifyCMSSignatureRequest. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyCMSSignatureRequestImpl + implements VerifyCMSSignatureRequest { + + /** The indexes of the signatories whose signature should be verified. */ + private int[] signatories; + /** The profile ID of trusted certificates. */ + private String trustProfileId; + /** The data object necessary for signature verification. */ + private CMSDataObject dataObject; + /** The CMS signature to verify. */ + private InputStream cmsSignature; + /** The date for which to verify the signature. */ + private Date dateTime; + + /** + * Sets the indexes of the signatories whose signature should be verified. + * + * @param signatories The indexes of the signatories whose signature should be + * verified. + */ + public void setSignatories(int[] signatories) { + this.signatories = signatories; + } + + public int[] getSignatories() { + return signatories; + } + + /** + * Sets the date for which to verify the signature. + * + * @param dateTime The date for which to verify the signature. + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public Date getDateTime() { + return dateTime; + } + + /** + * Sets the CMS signature to verify. + * @param signature The CMS signature to verify. + */ + public void setCMSSignature(InputStream signature) { + this.cmsSignature = signature; + + } + + public InputStream getCMSSignature() { + return cmsSignature; + } + + /** + * Sets the data object necessary for signature verification. + * @param dataObject The data object necessary for signature verification. + */ + public void setDataObject(CMSDataObject dataObject) { + this.dataObject = dataObject; + } + + public CMSDataObject getDataObject() { + return dataObject; + } + + /** + * Sets the profile ID of trusted certificates. + * @param trustProfileId The profile ID of trusted certificates. + */ + public void setTrustProfileId(String trustProfileId) { + this.trustProfileId = trustProfileId; + } + + public String getTrustProfileId() { + return trustProfileId; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java new file mode 100644 index 000000000..40dc04683 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSignatureResponseElementImpl.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; + +/** + * Default implementation of VerifyCMSSignatureResponseElement. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyCMSSignatureResponseElementImpl + implements VerifyCMSSignatureResponseElement { + + /** Information about the signer certificate. */ + private SignerInfo signerInfo; + /** Information about the signature check. */ + private CheckResult signatureCheck; + /** Information about the certificate check. */ + private CheckResult certificateCheck; + + /** + * Sets a SignerInfo element according to CMS. + * + * @param signerInfo The SignerInfo element according to CMS. + */ + public void setSignerInfo(SignerInfo signerInfo) { + this.signerInfo = signerInfo; + } + + public SignerInfo getSignerInfo() { + return signerInfo; + } + + /** + * Sets a result of the signature verification. + * + * @param signatureCheck The result of the signature verification. + */ + public void setSignatureCheck(CheckResult signatureCheck) { + this.signatureCheck = signatureCheck; + } + + public CheckResult getSignatureCheck() { + return signatureCheck; + } + + /** + * Sets a result of the certificate verification. + * + * @param certificateCheck The result of the certificate verification. + */ + public void setCertificateCheck(CheckResult certificateCheck) { + this.certificateCheck = certificateCheck; + } + + public CheckResult getCertificateCheck() { + return certificateCheck; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java new file mode 100644 index 000000000..f258380e0 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyCMSSinatureResponseImpl.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; + +/** + * Default implementation of VerifyCMSSignatureResponse. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyCMSSinatureResponseImpl + implements VerifyCMSSignatureResponse { + + /** The elements contained in the response. */ + private List responseElements; + + /** + * Sets the elements contained in the response. + * + * @param responseElements The elements contained in the response. + */ + public void setResponseElements(List responseElements) { + this.responseElements = + responseElements != null + ? Collections.unmodifiableList(new ArrayList(responseElements)) + : null; + } + + public List getResponseElements() { + return responseElements; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java new file mode 100644 index 000000000..2653e2fd2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureInfoImpl.java @@ -0,0 +1,47 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; + +/** + * Default implementation of VerifySignatureInfo. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifySignatureInfoImpl implements VerifySignatureInfo { + /** The location of the signature to be verified. */ + private VerifySignatureLocation verifySignatureLocation; + /** The environment containing the signature to be verified. */ + private Content verifySignatureEnvironment; + + /** + * Sets the location of the signature to be verified. + * + * @param verifySignatureLocation The location of the signature to be + * verified. + */ + public void setVerifySignatureLocation(VerifySignatureLocation verifySignatureLocation) { + this.verifySignatureLocation = verifySignatureLocation; + } + + public VerifySignatureLocation getVerifySignatureLocation() { + return verifySignatureLocation; + } + + /** + * Sets the signature environment containing the signature to be verified. + * + * @param verifySignatureEnvironment The signature environment containing the + * signature to be verified. + */ + public void setVerifySignatureEnvironment(Content verifySignatureEnvironment) { + this.verifySignatureEnvironment = verifySignatureEnvironment; + } + + public Content getVerifySignatureEnvironment() { + return verifySignatureEnvironment; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java new file mode 100644 index 000000000..933e42987 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifySignatureLocationImpl.java @@ -0,0 +1,15 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; + +/** + * Default implementation of VerifySignatureLocation. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifySignatureLocationImpl + extends ElementSelectorImpl + implements VerifySignatureLocation { + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java new file mode 100644 index 000000000..594f9c246 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsDataImpl.java @@ -0,0 +1,36 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; + +/** + * Default implementation of . + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyTransformsDataImpl implements ReferenceInfo { + /** Information about the transformations contained in the signature. */ + private List verifyTransformsInfoProfiles; + + /** + * Sets the information about the transformations contained in the signature. + * + * @param verifyTransformsInfoProfiles The profiles containing transformation + * information. + */ + public void setVerifyTransformsInfoProfiles(List verifyTransformsInfoProfiles) { + this.verifyTransformsInfoProfiles = + verifyTransformsInfoProfiles != null + ? Collections.unmodifiableList( + new ArrayList(verifyTransformsInfoProfiles)) + : null; + } + + public List getVerifyTransformsInfoProfiles() { + return verifyTransformsInfoProfiles; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java new file mode 100644 index 000000000..d9a864499 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileExplicitImpl.java @@ -0,0 +1,61 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; + +/** + * Default implementation of VerifyTransformsInfoProfileExplicit. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyTransformsInfoProfileExplicitImpl + implements VerifyTransformsInfoProfileExplicit { + + /** The transforms contained in this profile. */ + private List transforms; + /** Additional information for the transforms. */ + private List transformParameters = new ArrayList(); + + /** + * Sets the transforms contained in this profile. + * + * @param transforms The transforms contained in this profile. + */ + public void setTransforms(List transforms) { + this.transforms = + transforms != null + ? Collections.unmodifiableList(new ArrayList(transforms)) + : null; + } + + public List getTransforms() { + return transforms; + } + + /** + * Sets additional information for the transforms. + * + * @param transformParameters Additional information for the transforms. + */ + public void setTransformParameters(List transformParameters) { + this.transformParameters = new ArrayList(transformParameters); + } + + public List getTransformParameters() { + return transformParameters; + } + + /** + * Gets the type of VerifyTransformsInfoProfile. + * + * @return EXPLICIT_VERIFYTRANSFORMSINFOPROFILE + */ + public int getVerifyTransformsInfoProfileType() { + return EXPLICIT_VERIFYTRANSFORMSINFOPROFILE; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java new file mode 100644 index 000000000..fb1f10cea --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyTransformsInfoProfileIDImpl.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileID; + +/** + * Default implementation of VerifyTransformsInfoProfileID. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyTransformsInfoProfileIDImpl implements VerifyTransformsInfoProfileID { + + /** The profile ID. */ + private String verifyTransformsInfoProfileID; + + /** + * Sets the profile ID. + * + * @param profileID The profile ID. + */ + public void setVerifyTransformsInfoProfileID(String profileID) { + this.verifyTransformsInfoProfileID = profileID; + } + + public String getVerifyTransformsInfoProfileID() { + return verifyTransformsInfoProfileID; + } + + /** + * Gets the type of VerifyTransformsInfoProfile. + * + * @return ID_VERIFYTRANSFORMSINFOPROFILE + */ + public int getVerifyTransformsInfoProfileType() { + return ID_VERIFYTRANSFORMSINFOPROFILE; + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java new file mode 100644 index 000000000..26d7def4c --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureRequestImpl.java @@ -0,0 +1,113 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; + +/** + * Default implementation of VerifyXMLSignatureRequest. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyXMLSignatureRequestImpl + implements VerifyXMLSignatureRequest { + /** Date and time for signature verification. */ + private Date dateTime; + /** The signature to be verified. */ + private VerifySignatureInfo verifySignatureInfo; + /** Supplemental information about the singature. */ + private List supplementProfiles; + /** Additional parameters for checking the signature manifest. */ + private SignatureManifestCheckParams signatureManifestCheckParams; + /** Whether to return the hash input data. */ + private boolean returnHashInputData; + /** The profile ID of the trust profile containing the trusted certificates. + */ + private String trustProfileId; + + /** + * Sets the date and time for signature verification. + * + * @param dateTime The date and time for signature verification. + */ + public void setDateTime(Date dateTime) { + this.dateTime = dateTime; + } + + public Date getDateTime() { + return dateTime; + } + + /** + * Sets the signature to be verified. + * + * @param signatureInfo The signature to be verified. + */ + public void setSignatureInfo(VerifySignatureInfo signatureInfo) { + this.verifySignatureInfo = signatureInfo; + } + + public VerifySignatureInfo getSignatureInfo() { + return verifySignatureInfo; + } + + /** + * Sets supplemental information about the singature. + * @param supplementProfiles + */ + public void setSupplementProfiles(List supplementProfiles) { + this.supplementProfiles = + supplementProfiles != null + ? Collections.unmodifiableList(new ArrayList(supplementProfiles)) + : null; + } + + public List getSupplementProfiles() { + return supplementProfiles; + } + + /** + * Sets supplemental information about the singature. + * @param params Supplemental information about the singature. + */ + public void setSignatureManifestCheckParams(SignatureManifestCheckParams params) { + this.signatureManifestCheckParams = params; + } + + public SignatureManifestCheckParams getSignatureManifestCheckParams() { + return signatureManifestCheckParams; + } + + /** + * Sets whether to return hash input data. + * + * @param returnSignedData Whether to return hash input data. + */ + public void setReturnHashInputData(boolean returnSignedData) { + this.returnHashInputData = returnSignedData; + } + + public boolean getReturnHashInputData() { + return returnHashInputData; + } + + /** + * Sets the profile ID of trusted certificates. + * + * @param trustProfileId The profile ID of trusted certificates. + */ + public void setTrustProfileId(String trustProfileId) { + this.trustProfileId = trustProfileId; + } + + public String getTrustProfileId() { + return trustProfileId; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java new file mode 100644 index 000000000..989dbfb4a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/VerifyXMLSignatureResponseImpl.java @@ -0,0 +1,141 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * @author Fatemeh Philippi + * @version $Id$ + */ +public class VerifyXMLSignatureResponseImpl + implements VerifyXMLSignatureResponse { + + /** Information about the signer certificate. */ + private SignerInfo signerInfo; + + /** + * The hash input data objects. The list consists of {@link at.gv.egovernment.moa.spss.api.common.InputData}s. + * */ + private List hashInputDatas = new ArrayList(); + + /** + * The reference input data objects. The list consists of {@link at.gv.egovernment.moa.spss.api.common.InputData}s. + * */ + private List referenceInputDatas = new ArrayList(); + + /** Information about the signature check. */ + private ReferencesCheckResult signatureCheck; + /** Information about the signature manifest check. */ + private ReferencesCheckResult signatureManifestCheck; + /** Information about the XMLDsig manifest check. */ + private List xmlDsigManifestChecks = new ArrayList(); + /** Information about the certificate check. */ + private CheckResult certificateCheck; + + /** + * Sets information about the signer certificate. + * + * @param signerInfo Information about the signer certificate. + */ + public void setSignerInfo(SignerInfo signerInfo) { + this.signerInfo = signerInfo; + } + + public SignerInfo getSignerInfo() { + return signerInfo; + } + + /** + * Sets data signed by the signatory. + * + * @param hashInputDatas The signed datas. + */ + public void setHashInputDatas(List hashInputDatas) { + this.hashInputDatas = + hashInputDatas != null + ? Collections.unmodifiableList(new ArrayList(hashInputDatas)) + : null; + } + + public List getHashInputDatas() { + return hashInputDatas; + } + + /** + * Sets the source data elements. + * + * @param referenceInputDatas The source data elements. + */ + public void setReferenceInputDatas(List referenceInputDatas) { + this.referenceInputDatas = + referenceInputDatas != null + ? Collections.unmodifiableList(new ArrayList(referenceInputDatas)) + : null; + } + + public List getReferenceInputDatas() { + return referenceInputDatas; + } + + /** + * Sets the result of the signature verification. + * + * @param signatureCheck The result of the signature verification. + */ + public void setSignatureCheck(ReferencesCheckResult signatureCheck) { + this.signatureCheck = signatureCheck; + } + + public ReferencesCheckResult getSignatureCheck() { + return signatureCheck; + } + + /** + * Sets the result of the signature manifest verification. + * + * @param signatureManifestCheck The result of the signature manifest verification. + */ + public void setSignatureManifestCheck(ReferencesCheckResult signatureManifestCheck) { + this.signatureManifestCheck = signatureManifestCheck; + } + + public ReferencesCheckResult getSignatureManifestCheck() { + return signatureManifestCheck; + } + + /** + * Sets the result of the certification verification. + * + * @param certificateCheck The result of the certificate verification. + */ + public void setCertificateCheck(CheckResult certificateCheck) { + this.certificateCheck = certificateCheck; + } + + public CheckResult getCertificateCheck() { + return certificateCheck; + } + + /** + * Sets the XMLDSigManifestChecks. + * + * @param xmlDsigManifestChecks The XMLDSigManifestChecks. + */ + public void setXMLDsigManifestChecks(List xmlDsigManifestChecks) { + this.xmlDsigManifestChecks = + xmlDsigManifestChecks != null + ? Collections.unmodifiableList(new ArrayList(xmlDsigManifestChecks)) + : null; + } + + public List getXMLDsigManifestChecks() { + return xmlDsigManifestChecks; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java new file mode 100644 index 000000000..e6d644fd9 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/X509IssuerSerialImpl.java @@ -0,0 +1,45 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.math.BigInteger; + +import at.gv.egovernment.moa.spss.api.common.X509IssuerSerial; + +/** + * Default implementation of X509IssuerSerial. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class X509IssuerSerialImpl implements X509IssuerSerial { + /** The certificate serial number. */ + private BigInteger x509SerialNumber; + /** The certificate issuer DN. */ + private String x509IssuerName; + + /** + * Sets the issuer distinguished name. + * + * @param x509IssuerName The issuer distinguished name. + */ + public void setX509IssuerName(String x509IssuerName) { + this.x509IssuerName = x509IssuerName; + } + + public String getX509IssuerName() { + return x509IssuerName; + } + + /** + * Sets the certificate serial number. + * + * @param x509SerialNumber The issuer serial number. + */ + public void setX509SerialNumber(BigInteger x509SerialNumber) { + this.x509SerialNumber = x509SerialNumber; + } + + public BigInteger getX509SerialNumber() { + return x509SerialNumber; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java new file mode 100644 index 000000000..b603c3367 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XMLDataObjectAssociationImpl.java @@ -0,0 +1,45 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; + +/** + * Default implementation of XMLDataObjectAssociation. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class XMLDataObjectAssociationImpl implements XMLDataObjectAssociation { + + /** Meta information about the Content object. */ + private MetaInfo metaInfo; + /** The actual data contained in this object. */ + private Content content; + + /** + * Sets meta information about the Content object. + * @param metaInfo Meta information about the Content object. + */ + public void setMetaInfo(MetaInfo metaInfo) { + this.metaInfo = metaInfo; + } + + public MetaInfo getMetaInfo() { + return metaInfo; + } + + /** + * Sets the actual data contained in this object. + * + * @param content The actual data contained in this object. + */ + public void setContent(Content content) { + this.content = content; + } + + public Content getContent() { + return content; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java new file mode 100644 index 000000000..a96a8f161 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilter2TransformImpl.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.ArrayList; +import java.util.List; + +import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; + +/** + * Default implementation of XPathFilter2Transform. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class XPathFilter2TransformImpl + extends TransformImpl + implements XPathFilter2Transform { + + /** The XPath filters. */ + private List filters; + + /** + * Create a new XPathFilter2TransformImpl object. + */ + public XPathFilter2TransformImpl() { + setAlgorithmURI(XPATH_FILTER2); + } + + /** + * Sets the XPath filters contained in this + * XPathFilter2Transform. + * + * @param filters The XPath filters contained in this + * XPathFilter2Transform. + */ + public void setFilters(List filters) { + this.filters = new ArrayList(filters); + } + + public List getFilters() { + return filters; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java new file mode 100644 index 000000000..72d91bc58 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathFilterImpl.java @@ -0,0 +1,64 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.HashMap; +import java.util.Map; + +import at.gv.egovernment.moa.spss.api.common.XPathFilter; + +/** + * Default implementation of XPathFilter. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class XPathFilterImpl implements XPathFilter { + /** The type of filter. */ + private String filterType; + /** The XPath expression of the filter. */ + private String xPathExpression; + /** The namespace prefix to URI mapping to while evaluating the XPath + * expression. */ + private Map namespaceDeclarations = new HashMap(); + + /** + * Sets the type of filter. + * + * @param filterType The type of filter. + */ + public void setFilterType(String filterType) { + this.filterType = filterType; + } + + public String getFilterType() { + return filterType; + } + + /** + * Sets the XPath expression of the filter. + * + * @param xPathExpression The XPath expression of the filter. + */ + public void setXPathExpression(String xPathExpression) { + this.xPathExpression = xPathExpression; + } + + public String getXPathExpression() { + return xPathExpression; + } + + /** + * Sets the namespace prefix to URI mapping to while evaluating the XPath + * expression. + * + * @param namespaceDeclarations The namespace prefix to URI mapping to while + * evaluating the XPath expression. + */ + public void setNamespaceDelcarations(Map namespaceDeclarations) { + this.namespaceDeclarations = namespaceDeclarations; + } + + public Map getNamespaceDeclarations() { + return namespaceDeclarations; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java new file mode 100644 index 000000000..1c9817ecc --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XPathTransformImpl.java @@ -0,0 +1,59 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import java.util.HashMap; +import java.util.Map; + +import at.gv.egovernment.moa.spss.api.common.XPathTransform; + +/** + * Default implementation of XPathTransform. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class XPathTransformImpl + extends TransformImpl + implements XPathTransform { + + /** The XPath expression to evaluate. */ + private String xPathExpression; + /** The namespace prefix to URI mapping to while evaluating the XPath + * expression. */ + private Map namespaceDeclarations = new HashMap(); + + /** + * Create a new XPathTransformImpl object. + */ + public XPathTransformImpl() { + setAlgorithmURI(XPATH); + } + + /** + * Sets the XPath expression to evaluate. + * + * @param xPathExpression The XPath expression to evaluate. + */ + public void setXPathExpression(String xPathExpression) { + this.xPathExpression = xPathExpression; + } + + public String getXPathExpression() { + return xPathExpression; + } + + /** + * Sets the namespace prefix to URI mapping to while evaluating the XPath + * expression. + * + * @param namespaceDeclarations The namespace prefix to URI mapping to while + * evaluating the XPath expression. + */ + public void setNamespaceDelcarations(Map namespaceDeclarations) { + this.namespaceDeclarations = namespaceDeclarations; + } + + public Map getNamespaceDeclarations() { + return namespaceDeclarations; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java new file mode 100644 index 000000000..c6ddc0fd6 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/impl/XSLTransformImpl.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.spss.api.impl; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.api.common.XSLTTransform; + +/** + * Default implementation of XSLTTransform. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class XSLTransformImpl extends TransformImpl implements XSLTTransform { + /** The XSLT stylesheet to apply. */ + private Element styleSheet; + + /** + * Create a new XSLTransformImpl object. + */ + public XSLTransformImpl() { + setAlgorithmURI(XSLT); + } + + /** + * Sets the XSLT stylesheet to apply. + * + * @param styleSheet The XSLT stylesheet to apply. + */ + public void setStylesheet(Element styleSheet) { + this.styleSheet = styleSheet; + } + + public Element getStylesheet() { + return styleSheet; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java new file mode 100644 index 000000000..319d3ac9d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParser.java @@ -0,0 +1,288 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.util.ArrayList; +import java.util.List; + +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.util.BoolUtils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; + +/** + * A parser to parse CreateXMLSignatureRequest DOM trees into + * CreateXMLSignatureRequest API objects. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CreateXMLSignatureRequestParser { + + // + // XPath expresssions to select elements in the CreateXMLSignatureRequest + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String KEY_IDENTIFIER_XPATH = + "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "KeyIdentifier"; + private static final String SINGLE_SIGNATURE_INFO_XPATH = + "/" + MOA + "CreateXMLSignatureRequest/" + MOA + "SingleSignatureInfo"; + private static final String DATA_OBJECT_INFO_XPATH = MOA + "DataObjectInfo"; + private static final String DATA_OBJECT_XPATH = MOA + "DataObject"; + private static final String CREATE_SIGNATURE_INFO_XPATH = + MOA + "CreateSignatureInfo"; + private static final String CREATE_TRANSFORMS_INFO_PROFILE_XPATH = + (MOA + "CreateTransformsInfoProfile | ") + + (MOA + "CreateTransformsInfoProfileID"); + private static final String CREATE_SIGNATURE_ENVIRONMENT_XPATH = + MOA + "CreateSignatureEnvironment"; + private static final String CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH = + (MOA + "CreateSignatureEnvironmentProfile | ") + + (MOA + "CreateSignatureEnvironmentProfileID"); + private static final String SL_CONFORM_ATTR_NAME = "SecurityLayerConformity"; + + /** The factory to create API objects. */ + private SPSSFactory factory; + + /** + * Create a new CreateXMLSignatureRequestParser. + */ + public CreateXMLSignatureRequestParser() { + this.factory = SPSSFactory.getInstance(); + } + + /** + * Parse a CreateXMLSignatureRequest DOM element, as defined + * by the MOA schema. + * + * @param requestElem The CreateXMLSignatureRequest to parse. The + * request must have been successfully parsed against the schema for this + * method to succeed. + * @return A CreateXMLSignatureRequest API object containing + * the data from the DOM element. + * @throws MOAApplicationException An error occurred parsing the request. + */ + public CreateXMLSignatureRequest parse(Element requestElem) + throws MOAApplicationException { + + List singleSignatureInfos = parseSingleSignatureInfos(requestElem); + String keyIdentifier = + XPathUtils.getElementValue(requestElem, KEY_IDENTIFIER_XPATH, null); + + return factory.createCreateXMLSignatureRequest( + keyIdentifier, + singleSignatureInfos); + } + + /** + * Parse all SingleSignatureInfo elements of the + * CreateXMLSignatureRequest. + * + * @param requestElem The CreateXMLSignatureRequest to parse. + * @return A List of SingleSignatureInfo API + * objects. + * @throws MOAApplicationException An error occurred parsing on of the + * SingleSignatureInfo elements. + */ + private List parseSingleSignatureInfos(Element requestElem) + throws MOAApplicationException { + + List singleSignatureInfos = new ArrayList(); + NodeIterator sigInfoElems = + XPathUtils.selectNodeIterator(requestElem, SINGLE_SIGNATURE_INFO_XPATH); + Element sigInfoElem; + + while ((sigInfoElem = (Element) sigInfoElems.nextNode()) != null) { + singleSignatureInfos.add(parseSingleSignatureInfo(sigInfoElem)); + } + + return singleSignatureInfos; + } + + /** + * Parse a SingleSignatureInfo DOM element. + * + * @param sigInfoElem The SingleSignatureInfo DOM element to + * parse. + * @return A SingleSignatureInfo API object containing the + * information of sigInfoElem. + * @throws MOAApplicationException An error occurred parsing the + * SingleSignatureInfo. + */ + private SingleSignatureInfo parseSingleSignatureInfo(Element sigInfoElem) + throws MOAApplicationException { + + List dataObjectInfos = parseDataObjectInfos(sigInfoElem); + CreateSignatureInfo createSignatureInfo = + parseCreateSignatureInfo(sigInfoElem); + boolean securityLayerConform; + + if (sigInfoElem.hasAttribute(SL_CONFORM_ATTR_NAME)) { + securityLayerConform = + BoolUtils.valueOf(sigInfoElem.getAttribute(SL_CONFORM_ATTR_NAME)); + } else { + securityLayerConform = true; + } + + return factory.createSingleSignatureInfo( + dataObjectInfos, + createSignatureInfo, + securityLayerConform); + } + + /** + * Parse the DataObjectInfo DOM elements contained in the given + * SingleSignatureInfo DOM element. + * + * @param sigInfoElem The SingleSignatureInfo DOM element + * whose DataObjectInfos to parse. + * @return A List of DataObjectInfo API objects + * containing the data from the DataObjectInfo DOM elements. + * @throws MOAApplicationException An error occurred parsing one of the + * DataObjectInfos. + */ + private List parseDataObjectInfos(Element sigInfoElem) + throws MOAApplicationException { + + List dataObjectInfos = new ArrayList(); + NodeIterator dataObjInfoElems = + XPathUtils.selectNodeIterator(sigInfoElem, DATA_OBJECT_INFO_XPATH); + Element dataObjInfoElem; + + while ((dataObjInfoElem = (Element) dataObjInfoElems.nextNode()) != null) { + dataObjectInfos.add(parseDataObjectInfo(dataObjInfoElem)); + } + return dataObjectInfos; + } + + /** + * Parse a DataObjectInfo DOM element. + * + * @param dataObjInfoElem The DataObjectInfo DOM element to + * parse. + * @return A DataObjectInfo API element containing the data + * from dataObjInfoElem. + * @throws MOAApplicationException An error occurred parsing the + * DataObjectInfo. + */ + private DataObjectInfo parseDataObjectInfo(Element dataObjInfoElem) + throws MOAApplicationException { + + String structure = dataObjInfoElem.getAttribute("Structure"); + Element dataObjectElem = + (Element) XPathUtils.selectSingleNode(dataObjInfoElem, DATA_OBJECT_XPATH); + Content dataObject = RequestParserUtils.parseContent(dataObjectElem); + CreateTransformsInfoProfile createTransformsInfoProfile = + parseCreateTransformsInfoProfile(dataObjInfoElem); + boolean childOfManifest; + + if (dataObjInfoElem.hasAttribute("ChildOfManifest")) { + childOfManifest = + BoolUtils.valueOf(dataObjInfoElem.getAttribute("ChildOfManifest")); + } else { + childOfManifest = false; + } + + return factory.createDataObjectInfo( + structure, + childOfManifest, + dataObject, + createTransformsInfoProfile); + } + + /** + * Parse a CreateTransformsInfoProfile DOM element. + * + * @param dataObjInfoElem The DataObjectInfo DOM element + * containing the CreateTransformsInfoProfile. + * @return The CreateTransformsInfoProfile API object containing + * the profile found in dataObjInfoElem. + * @throws MOAApplicationException An error occurred parsing the + * CreateTransformsInfoProfile. + */ + private CreateTransformsInfoProfile parseCreateTransformsInfoProfile(Element dataObjInfoElem) + throws MOAApplicationException { + + Element profileElem = + (Element) XPathUtils.selectSingleNode( + dataObjInfoElem, + CREATE_TRANSFORMS_INFO_PROFILE_XPATH); + + if ("CreateTransformsInfoProfile".equals(profileElem.getLocalName())) { + ProfileParser profileParser = new ProfileParser(); + return profileParser.parseCreateTransformsInfoProfile(profileElem); + + } else { + String profileID = DOMUtils.getText(profileElem); + return factory.createCreateTransformsInfoProfile(profileID); + } + } + + /** + * Parse the CreateSignatureInfo DOM element contained in + * a SingleSignatureInfo. + * + * @param sigInfoElem The SingleSignatureInfo DOM element + * containing the CreateSignatureInfo to be parsed. + * @return A CreateSignatureInfo API object containing the + * data from the CreateSignatureInfo DOM element, or + * null, if none was found. + */ + private CreateSignatureInfo parseCreateSignatureInfo(Element sigInfoElem) { + Element createInfoElem = + (Element) XPathUtils.selectSingleNode( + sigInfoElem, + CREATE_SIGNATURE_INFO_XPATH); + + if (createInfoElem != null) { + Element environmentElem = + (Element) XPathUtils.selectSingleNode( + createInfoElem, + CREATE_SIGNATURE_ENVIRONMENT_XPATH); + Content environment = RequestParserUtils.parseContent(environmentElem); + CreateSignatureEnvironmentProfile environmentProfile = + parseCreateSignatureEnvironmentProfile(createInfoElem); + + return factory.createCreateSignatureInfo(environment, environmentProfile); + } else { + return null; + } + } + + /** + * Parse the CreateSignatureEnvironmentProfile contained in + * the given CreateSignatureInfo DOM element. + * + * @param createInfoElem CreateSignatureInfo DOM element to + * parse. + * @return The CreateSignatureEnvironmentProfile contained + * in the given CreateSignatureInfo DOM element.. + */ + private CreateSignatureEnvironmentProfile parseCreateSignatureEnvironmentProfile(Element createInfoElem) { + Element profileElem = + (Element) XPathUtils.selectSingleNode( + createInfoElem, + CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH); + + if ("CreateSignatureEnvironmentProfile" + .equals(profileElem.getLocalName())) { + ProfileParser profileParser = new ProfileParser(); + return profileParser.parseCreateSignatureEnvironmentProfile(profileElem); + } else { + String profileID = DOMUtils.getText(profileElem); + return factory.createCreateSignatureEnvironmentProfile(profileID); + } + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java new file mode 100644 index 000000000..eec9c4882 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureResponseBuilder.java @@ -0,0 +1,119 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.util.Iterator; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import at.gv.egovernment.moa.util.Constants; + +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponseElement; +import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; + +/** + * Convert a CreateXMLSignatureResponse API object into its + * XML representation, according to the MOA XML schema. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CreateXMLSignatureResponseBuilder { + private static final String MOA_NS_URI = Constants.MOA_NS_URI; + + /** The XML document containing the response element. */ + private Document responseDoc; + /** The response CreateXMLSignatureResponse DOM element. */ + private Element responseElem; + + /** + * Create a new CreateXMLSignatureResponseBuilder: + * + * @throws MOASystemException An error occurred setting up the resulting + * XML document. + */ + public CreateXMLSignatureResponseBuilder() throws MOASystemException { + responseDoc = + ResponseBuilderUtils.createResponse("CreateXMLSignatureResponse"); + responseElem = responseDoc.getDocumentElement(); + } + + /** + * Build a document containing a CreateXMLSignatureResponse + * DOM element being the XML representation of the given + * CreateXMLSignatureResponse API object. + * + * @param response The CreateXMLSignatureResponse to convert + * to XML. + * @return A document containing the CreateXMLSignatureResponse + * DOM element. + */ + public Document build(CreateXMLSignatureResponse response) { + Iterator iter; + + for (iter = response.getResponseElements().iterator(); iter.hasNext();) { + CreateXMLSignatureResponseElement responseElement = + (CreateXMLSignatureResponseElement) iter.next(); + + switch (responseElement.getResponseType()) { + case CreateXMLSignatureResponseElement.SIGNATURE_ENVIRONMENT_RESPONSE : + SignatureEnvironmentResponse envResponse = + (SignatureEnvironmentResponse) responseElement; + addSignatureEnvironment(envResponse); + break; + + case CreateXMLSignatureResponseElement.ERROR_RESPONSE : + ErrorResponse errorResponse = (ErrorResponse) responseElement; + addErrorResponse(errorResponse); + break; + } + + } + + return responseDoc; + } + + /** + * Add a SignatureEnvironment element to the response. + * + * @param envResponse The content to put under the + * SignatureEnvironment element. This should either be a + * dsig:Signature element (in case of a detached signature) or + * the signature environment containing the signature (in case of + * an enveloping signature). + */ + private void addSignatureEnvironment(SignatureEnvironmentResponse envResponse) { + Element content = envResponse.getSignatureEnvironment(); + Node importedSignature = responseDoc.importNode(content, true); + Element signatureEnvironment = + responseDoc.createElementNS(MOA_NS_URI, "SignatureEnvironment"); + signatureEnvironment.appendChild(importedSignature); + responseElem.appendChild(signatureEnvironment); + } + + /** + * Add a ErrorResponse element to the response. + * + * @param errorResponse The API object containing the information to put into + * the ErrorResponse DOM element. + */ + private void addErrorResponse(ErrorResponse errorResponse) { + Element errorElem = + responseDoc.createElementNS(MOA_NS_URI, "ErrorResponse"); + Element errorCodeElem = + responseDoc.createElementNS(MOA_NS_URI, "ErrorCode"); + Element infoElem = responseDoc.createElementNS(MOA_NS_URI, "Info"); + String errorCodeStr = Integer.toString(errorResponse.getErrorCode()); + + errorCodeElem.appendChild(responseDoc.createTextNode(errorCodeStr)); + errorElem.appendChild(errorCodeElem); + infoElem.appendChild(responseDoc.createTextNode(errorResponse.getInfo())); + errorElem.appendChild(errorCodeElem); + errorElem.appendChild(infoElem); + responseElem.appendChild(errorElem); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java new file mode 100644 index 000000000..66c08e0ab --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ProfileParser.java @@ -0,0 +1,285 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; + +/** + * Parse the various profile elements contained in the MOA web service requests + * and given as separate files in the MOA configuration. + * + * The profiles parsed must be schema valid according to the MOA XML schema. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ProfileParser { + + // + // XPath expressions to select parts of the profiles + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + private static final String CREATE_TRANSFORMS_XPATH = + MOA + "CreateTransformsInfo/" + DSIG + "Transforms"; + private static final String FINAL_DATA_META_INFO_XPATH = + MOA + "CreateTransformsInfo/" + MOA + "FinalDataMetaInfo"; + private static final String CREATE_SIGNATURE_LOCATION_XPATH = + MOA + "CreateSignatureLocation"; + private static final String SUPPLEMENT_XPATH = MOA + "Supplement"; + private static final String VERIFY_TRANSFORMS_XPATH = DSIG + "Transforms"; + private static final String TRANSFORM_PARAMETER_XPATH = + MOA + "TransformParameter"; + private static final String TRANSFORM_PARAMETER_CONTENT_XPATH = + MOA + "Base64Content | " + MOA + "Hash"; + private static final String DIGEST_METHOD_XPATH = DSIG + "DigestMethod"; + private static final String DIGEST_VALUE_XPATH = DSIG + "DigestValue"; + + /** The factory used to create API objects. */ + private SPSSFactory factory = SPSSFactory.getInstance(); + + /** + * Parse a CreateTransformsInfoProfile DOM element. + * + * @param profileElem The CreateTransformsInfoProfile element + * to parse. + * @return The CreateTransformsInfoProfile API object containing + * the data from the profileElem. + * @throws MOAApplicationException An error occurred parsing the DOM element. + */ + public CreateTransformsInfoProfile parseCreateTransformsInfoProfile(Element profileElem) + throws MOAApplicationException { + CreateTransformsInfo createTransformsInfo = + parseCreateTransformsInfo(profileElem); + List supplements = parseSupplements(profileElem); + + return factory.createCreateTransformsInfoProfile( + createTransformsInfo, + supplements); + } + + /** + * Parse the CreateTransformsInfo DOM element contained in a + * CreateTransformsInfoProfile. + * + * @param profileElem The CreateTransformsInfoProfile DOM + * element containing the CreateTransformsInfo. + * @return The CreateTransformsInfo API object containinig the + * data from the CreateTransformsInfo DOM element. + * @throws MOAApplicationException An error occurred parsing the + * CreateTransformsInfo DOM element. + */ + private CreateTransformsInfo parseCreateTransformsInfo(Element profileElem) + throws MOAApplicationException { + + Element transformsElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + CREATE_TRANSFORMS_XPATH); + Element metaInfoElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + FINAL_DATA_META_INFO_XPATH); + MetaInfo finalDataMetaInfo; + List transforms; + + // parse the dsig:Transforms + if (transformsElem != null) { + TransformParser transformsParser = new TransformParser(); + transforms = transformsParser.parseTransforms(transformsElem); + } else { + transforms = null; + } + + // parse the meta info + finalDataMetaInfo = RequestParserUtils.parseMetaInfo(metaInfoElem); + + return factory.createCreateTransformsInfo(transforms, finalDataMetaInfo); + } + + /** + * Parse a CreateSignatureEnvironmentProfile DOM element. + * + * @param profileElem The CreateSignatureEnvironmentProfile + * DOM element to parse. + * @return The CreateSignatureEnvironmentProfile API object + * containing the data from the profileElem. + */ + public CreateSignatureEnvironmentProfile parseCreateSignatureEnvironmentProfile(Element profileElem) { + CreateSignatureLocation createSignatureLocation = + parseCreateSignatureLocation(profileElem); + List supplements = parseSupplements(profileElem); + + return factory.createCreateSignatureEnvironmentProfile( + createSignatureLocation, + supplements); + } + + /** + * Parse a CreateSignatureLocation DOM element contained in + * a CreateSignatureEnvironmentProfile. + * + * @param profileElem The CreateSignatureEnvironmentProfile DOM + * element containing the CreateSignatureLocation. + * @return The CreateSignatureLocation API object containing + * the data from the CreateSignatureLocation DOM element. + */ + private CreateSignatureLocation parseCreateSignatureLocation(Element profileElem) { + Element locationElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + CREATE_SIGNATURE_LOCATION_XPATH); + String xPathExpression = DOMUtils.getText(locationElem); + Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); + String indexStr = locationElem.getAttribute("Index"); + int index = Integer.parseInt(indexStr); + + return factory.createCreateSignatureLocation( + xPathExpression, + index, + namespaceDeclarations); + } + + /** + * Parse all Supplement DOM elements contained in a given + * parent DOM element. + * + * @param supplementsParentElem The DOM element being the parent of the + * Supplements. + * @return A List of Supplement API objects + * containing the data from the Supplement DOM elements. + */ + private List parseSupplements(Element supplementsParentElem) { + List supplements = new ArrayList(); + NodeIterator supplementElems = + XPathUtils.selectNodeIterator(supplementsParentElem, SUPPLEMENT_XPATH); + Element supplementElem; + + while ((supplementElem = (Element) supplementElems.nextNode()) != null) { + XMLDataObjectAssociation supplement = + RequestParserUtils.parseXMLDataObjectAssociation(supplementElem); + supplements.add(supplement); + } + return supplements; + } + + /** + * Parse a SupplementProfile DOM element. + * + * @param profileElem The SupplementProfile DOM element to parse. + * @return The SupplementProfile API object containing the + * data from the SupplementProfile DOM element. + */ + public SupplementProfile parseSupplementProfile(Element profileElem) { + XMLDataObjectAssociation supplementProfile = + RequestParserUtils.parseXMLDataObjectAssociation(profileElem); + + return factory.createSupplementProfile(supplementProfile); + } + + /** + * Parse a VerifyTransformsInfoProfile DOM element. + * + * @param profileElem The VerifyTransformsInfoProfile DOM + * element to parse. + * @return A VerifyTransformsInfoProfile API object containing + * the information from the VerifyTransformsInfoProfile DOM + * element. + * @throws MOAApplicationException An error occurred parsing the + * VerifyTransformsInfoProfile. + */ + public VerifyTransformsInfoProfile parseVerifyTransformsInfoProfile(Element profileElem) + throws MOAApplicationException { + Element transformsElem = + (Element) XPathUtils.selectSingleNode( + profileElem, + VERIFY_TRANSFORMS_XPATH); + List transforms = null; + NodeIterator paramElems = + XPathUtils.selectNodeIterator(profileElem, TRANSFORM_PARAMETER_XPATH); + Element paramElem; + List transformParameters = new ArrayList(); + + // parse the dsig:Transforms + if (transformsElem != null) { + TransformParser transformsParser = new TransformParser(); + transforms = transformsParser.parseTransforms(transformsElem); + } + + // parse the TransformParameter elements + while ((paramElem = (Element) paramElems.nextNode()) != null) { + transformParameters.add(parseTransformParameter(paramElem)); + } + + return factory.createVerifyTransformsInfoProfile( + transforms, + transformParameters); + } + + /** + * Parse a TransformParameter DOM element. + * + * @param paramElem The TransformParameter DOM element to + * parse. + * @return The TransformParameter API object containing the + * information from the TransformParameter DOM element. + * @throws MOAApplicationException An error occurred parsing the + * TransformParameter DOM element. + */ + private TransformParameter parseTransformParameter(Element paramElem) + throws MOAApplicationException { + String uri = paramElem.getAttribute("URI"); + Element contentElem = + (Element) XPathUtils.selectSingleNode( + paramElem, + TRANSFORM_PARAMETER_CONTENT_XPATH); + + if (contentElem == null) { + return factory.createTransformParameter(uri); + } else if ("Base64Content".equals(contentElem.getLocalName())) { + String base64Str = DOMUtils.getText(contentElem); + InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); + + return factory.createTransformParameter(uri, binaryContent); + } else { // "Hash".equals(contentElem.getLocalName()) + String digestMethodStr = + XPathUtils.getElementValue(contentElem, DIGEST_METHOD_XPATH, ""); + String digestValueStr = + XPathUtils.getElementValue(contentElem, DIGEST_VALUE_XPATH, ""); + byte[] digestValue = null; + + try { + digestValue = Base64Utils.decode(digestValueStr, true); + } catch (IOException e) { + throw new MOAApplicationException("2270", null); + } + return factory.createTransformParameter( + uri, + digestMethodStr, + digestValue); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java new file mode 100644 index 000000000..9e8c7d0e2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java @@ -0,0 +1,157 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.text.ParseException; +import java.util.Date; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.DateTimeUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; + +/** + * Utility methods for parsing XML requests definied in the MOA XML schema. + * + * @author Patrick Peck + * @version $Id$ + */ +public class RequestParserUtils { + // + // XPath expressions for parsing parts of a request + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String REFERENCE_ATTR_NAME = "Reference"; + private static final String MIME_TYPE_XPATH = MOA + "MimeType"; + private static final String DESCRIPTION_XPATH = MOA + "Description"; + private static final String TYPE_XPATH = MOA + "Type"; + private static final String XML_ASSOC_CONTENT_XPATH = MOA + "Content"; + private static final String CONTENT_XPATH = + MOA + "Base64Content | " + MOA + "XMLContent |" + MOA + "LocRefContent"; + private static final String ANY_OTHER_XPATH = + "*[namespace-uri() != \"" + Constants.MOA_NS_URI + "\"]"; + + /** + * Parse a XMLDataObjectAssociationType kind of DOM element. + * + * @param assocElem The XMLDataObjectAssociationType kind of + * DOM elmeent to parse. + * @return The XMLDataObjectAssociation API object containing + * the data from the XMLDataObjectAssociationType DOM element. + */ + public static XMLDataObjectAssociation parseXMLDataObjectAssociation(Element assocElem) { + SPSSFactory factory = SPSSFactory.getInstance(); + MetaInfo metaInfo = parseMetaInfo(assocElem); + Element contentElem = + (Element) XPathUtils.selectSingleNode(assocElem, XML_ASSOC_CONTENT_XPATH); + Content content = parseContent(contentElem); + + return factory.createXMLDataObjectAssociation(metaInfo, content); + } + + /** + * Parse a MetaInfoType kind of DOM element. + * + * @param metaInfoElem The MetaInfoType kind of DOM element. + * @return The MetaInfo API object containing the data from + * the metaInfoElem. + */ + public static MetaInfo parseMetaInfo(Element metaInfoElem) { + SPSSFactory factory = SPSSFactory.getInstance(); + String mimeType = + XPathUtils.getElementValue(metaInfoElem, MIME_TYPE_XPATH, null); + String description = + XPathUtils.getElementValue(metaInfoElem, DESCRIPTION_XPATH, null); + NodeList anyOther = + XPathUtils.selectNodeList(metaInfoElem, ANY_OTHER_XPATH); + String type = + XPathUtils.getElementValue(metaInfoElem, TYPE_XPATH, null); + + return factory.createMetaInfo(mimeType, description, anyOther, type); + } + + /** + * Parse a ContentOptionalRefType or + * ContentRequiredRefType kind of DOM element. + * @param contentParentElem The DOM element being the parent of the + * content element. + * @return The Content API object containing the data from + * the given DOM element. + */ + public static Content parseContent(Element contentParentElem) { + SPSSFactory factory = SPSSFactory.getInstance(); + String referenceURI = + contentParentElem.hasAttribute(REFERENCE_ATTR_NAME) + ? contentParentElem.getAttribute(REFERENCE_ATTR_NAME) + : null; + Element contentElem = + (Element) XPathUtils.selectSingleNode(contentParentElem, CONTENT_XPATH); + + if (contentElem == null) { + return factory.createContent(referenceURI); + } + + if ("Base64Content".equals(contentElem.getLocalName())) { + String base64String = DOMUtils.getText(contentElem); + return factory.createContent( + Base64Utils.decodeToStream(base64String, true), + referenceURI); + } else if ("LocRefContent".equals(contentElem.getLocalName())) { + String locationReferenceURI = DOMUtils.getText(contentElem); + return factory.createContent( + locationReferenceURI, + referenceURI); + } else { // "XMLContent".equals(contentElem.getLocalName()) + return factory.createContent( + contentElem.getChildNodes(), + referenceURI); + } + } + + /** + * Get the signing time from a Verfiy(CMS|XML)SignatureRequest. + * + * @param requestElem A Verify(CMS|XML)SignatureRequest DOM + * element. + * @param dateTimeXPath The XPath to lookup the DateTime element + * within the request. + * @return Date The date and time corresponding to the DateTime + * element in the request. If no DateTime element exists in the + * request, null is returned. + * @throws MOAApplicationException An error occurred during a parsing the + * DateTime element or creating the return value. + */ + public static Date parseDateTime(Element requestElem, String dateTimeXPath) + throws MOAApplicationException { + + Element dateTimeElem; + String dateTimeText; + + // select the DateTime element + dateTimeElem = + (Element) XPathUtils.selectSingleNode(requestElem, dateTimeXPath); + + // parse a date from the element value + if (dateTimeElem != null) { + dateTimeText = DOMUtils.getText(dateTimeElem); + try { + return DateTimeUtils.parseDateTime(dateTimeText); + } catch (ParseException e) { + throw new MOAApplicationException( + "1104", + new Object[] { dateTimeText }); + } + } else { + return null; + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java new file mode 100644 index 000000000..44134a70c --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/ResponseBuilderUtils.java @@ -0,0 +1,206 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.io.IOException; +import java.security.cert.CertificateEncodingException; +import java.security.cert.X509Certificate; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; + +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOASystemException; + +/** + * Utility methods used by the verious ResponseBuilder classes. + * + * @author Patrick Peck + * @version $Id$ + */ +class ResponseBuilderUtils { + // + // shortcuts to various XML namespace constants + // + private static final String MOA_NS_URI = Constants.MOA_NS_URI; + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + private static final String DSIG_NS_URI = Constants.DSIG_NS_URI; + private static final String XMLNS_NS_URI = Constants.XMLNS_NS_URI; + + /** + * Create a response element with all the namespaces set. + * + * @param responseName The name of the response root element. + * @return A DOM document containing the response root element and predefined + * MOA, DSIG and XML namespace declarations. + * @throws MOASystemException An error building the response document. + */ + public static Document createResponse(String responseName) + throws MOASystemException { + + try { + DocumentBuilder docBuilder = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + DOMImplementation impl = docBuilder.getDOMImplementation(); + Document response; + Element root; + String attrValue; + + response = impl.createDocument(MOA_NS_URI, responseName, null); + root = response.getDocumentElement(); + + // add namespace prefix declarations + root.setAttributeNS(XMLNS_NS_URI, "xmlns", MOA_NS_URI); + attrValue = "xmlns:" + Constants.DSIG_PREFIX; + root.setAttributeNS(XMLNS_NS_URI, attrValue, DSIG_NS_URI); + + return response; + } catch (ParserConfigurationException e) { + throw new MOASystemException("2200", null, e); + } + } + + /** + * Add a SignerInfo element to the response. + * + * @param response The response document, in order to create new elements in + * it. + * @param root The root element into which the SignerInfo element + * will be inserted. + * @param cert The signer certificate to add. + * @param isQualified Indicates, whether cert is a qualified + * certificate. + * @param isPublicAuthority Indicates, whether cert is + * certificate owned by a public authority. + * @param publicAuthorityID Information about the public authority owning + * cert. Must not be null, if + * isPublicAuthority ! = null. + * @throws MOAApplicationException An error occurred reading data from the + * certificate. + */ + public static void addSignerInfo( + Document response, + Element root, + X509Certificate cert, + boolean isQualified, + boolean isPublicAuthority, + String publicAuthorityID) + throws MOAApplicationException { + + Element signerInfoElem = response.createElementNS(MOA_NS_URI, "SignerInfo"); + Element x509DataElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509Data"); + Element x509IssuerSerialElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerSerial"); + Element x509IssuerElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509IssuerName"); + String issuer = cert.getIssuerDN().getName(); + Element x509SerialNumberElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509SerialNumber"); + String serialNumber = cert.getSerialNumber().toString(); + Element x509SubjectNameElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509SubjectName"); + Element x509CertificateElem = + response.createElementNS(DSIG_NS_URI, DSIG + "X509Certificate"); + Element qualifiedCertificateElem = + isQualified + ? response.createElementNS(MOA_NS_URI, "QualifiedCertificate") + : null; + Element publicAuthorityElem = + isPublicAuthority + ? response.createElementNS(MOA_NS_URI, "PublicAuthority") + : null; + Element codeElem = + publicAuthorityID != null + ? response.createElementNS(MOA_NS_URI, "Code") + : null; + + // fill in text + x509IssuerElem.appendChild(response.createTextNode(issuer)); + x509SerialNumberElem.appendChild(response.createTextNode(serialNumber)); + try { + RFC2253NameParser parser = + new RFC2253NameParser(cert.getSubjectDN().getName()); + String subjectRfc2253 = parser.parse().getRFC2253String(); + x509SubjectNameElem.appendChild(response.createTextNode(subjectRfc2253)); + } catch (RFC2253NameParserException e) { + x509SubjectNameElem.appendChild( + response.createTextNode(cert.getSubjectDN().getName())); + } + try { + x509CertificateElem.appendChild( + response.createTextNode(Base64Utils.encode(cert.getEncoded()))); + } catch (CertificateEncodingException e) { + throw new MOAApplicationException("2245", null, e); + } catch (IOException e) { + throw new MOAApplicationException("2245", null, e); + } + + // build structure + x509DataElem.appendChild(x509SubjectNameElem); + x509IssuerSerialElem.appendChild(x509IssuerElem); + x509IssuerSerialElem.appendChild(x509SerialNumberElem); + x509DataElem.appendChild(x509IssuerSerialElem); + x509DataElem.appendChild(x509CertificateElem); + if (isQualified) { + x509DataElem.appendChild(qualifiedCertificateElem); + } + if (isPublicAuthority) { + x509DataElem.appendChild(publicAuthorityElem); + if (publicAuthorityID != null) { + codeElem.appendChild(response.createTextNode(publicAuthorityID)); + publicAuthorityElem.appendChild(codeElem); + } + } + signerInfoElem.appendChild(x509DataElem); + root.appendChild(signerInfoElem); + } + + /** + * Add an element containing Code and Info + * subelements. + * + * @param response The response document, in order to create new elements in + * it. + * @param root The root element into which to insert the newly created + * element. + * @param elementName The name of the newly created element. + * @param code The content of the Code subelement. + * @param info The content of the Info subelement. + */ + public static void addCodeInfoElement( + Document response, + Element root, + String elementName, + int code, + NodeList info) { + + Element codeInfoElem = response.createElementNS(MOA_NS_URI, elementName); + Element codeElem = response.createElementNS(MOA_NS_URI, "Code"); + Element infoElem; + int i; + + codeElem.appendChild(response.createTextNode(Integer.toString(code))); + codeInfoElem.appendChild(codeElem); + if (info != null) { + infoElem = response.createElementNS(MOA_NS_URI, "Info"); + + for (i = 0; i < info.getLength(); i++) { + infoElem.appendChild(info.item(i).cloneNode(true)); + } + codeInfoElem.appendChild(infoElem); + } + root.appendChild(codeInfoElem); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java new file mode 100644 index 000000000..2d01f2a0f --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/TransformParser.java @@ -0,0 +1,246 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.Base64Transform; +import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; +import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; +import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; +import at.gv.egovernment.moa.spss.api.common.Transform; +import at.gv.egovernment.moa.spss.api.common.XPathFilter; +import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; +import at.gv.egovernment.moa.spss.api.common.XPathTransform; +import at.gv.egovernment.moa.spss.api.common.XSLTTransform; + +/** + * A parser to parse XMLDsig Transform DOM elements into their + * MOA SPSS API representation. + * + * @author Patrick Peck + * @version $Id$ + */ +public class TransformParser { + // + // XPath expressions for selecting information from the DOM tree + // + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + private static final String DSIG_FILTER2 = + Constants.DSIG_FILTER2_PREFIX + ":"; + private static final String XSLT = Constants.XSLT_PREFIX + ":"; + private static final String EC = Constants.DSIG_EC_PREFIX + ":"; + private static final String TRANSFORM_XPATH = DSIG + "Transform"; + private static final String XPATH_XPATH = DSIG + "XPath"; + private static final String XSLT_ELEMENT_XPATH = XSLT + "stylesheet"; + private static final String XPATH2_XPATH = + (DSIG_FILTER2 + "XPath[@Filter=\"intersect\"] | ") + + (DSIG_FILTER2 + "XPath[@Filter=\"subtract\"] | ") + + (DSIG_FILTER2 + "XPath[@Filter=\"union\"]"); + private static final String INCLUSIVE_NAMESPACES_XPATH = + EC + "InclusiveNamespaces"; + + /** + * The SPSSFactory to use for creating new API objects. + */ + private SPSSFactory factory = SPSSFactory.getInstance(); + + /** + * Parse an XMLDsig Transforms DOM element. + * + * @param transformsElem The Transforms DOM element to parse. + * @return A List of Transform API objects + * containing the data from the individual Transform DOM + * elements. + * @throws MOAApplicationException An error occurred parsing the + * Transforms DOM element. + */ + public List parseTransforms(Element transformsElem) + throws MOAApplicationException { + List transforms = new ArrayList(); + NodeIterator transformElems = + XPathUtils.selectNodeIterator(transformsElem, TRANSFORM_XPATH); + Element transformElem; + Transform transform; + + while ((transformElem = (Element) transformElems.nextNode()) != null) { + transform = parseTransform(transformElem); + transforms.add(transform); + } + + return transforms; + } + + /** + * Parse an XMLDsig Transform DOM element. + * + * @param transformElem Transform DOM element to parse. + * @return The Transform API object containing the data + * from the Transform DOM element. + * @throws MOAApplicationException An error occurred parsing the + * Transform DOM element. + */ + public Transform parseTransform(Element transformElem) + throws MOAApplicationException { + + String algorithmUri = transformElem.getAttribute("Algorithm"); + + if (CanonicalizationTransform.CANONICAL_XML.equals(algorithmUri) + || CanonicalizationTransform.CANONICAL_XML_WITH_COMMENTS.equals( + algorithmUri)) { + return factory.createCanonicalizationTransform(algorithmUri); + } else if ( + ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML.equals( + algorithmUri) + || ExclusiveCanonicalizationTransform + .EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS + .equals( + algorithmUri)) { + return parseExclusiveC14nTransform(algorithmUri, transformElem); + } else if (Base64Transform.BASE64_DECODING.equals(algorithmUri)) { + return factory.createBase64Transform(); + } else if ( + EnvelopedSignatureTransform.ENVELOPED_SIGNATURE.equals(algorithmUri)) { + return factory.createEnvelopedSignatureTransform(); + } else if (XPathTransform.XPATH.equals(algorithmUri)) { + return parseXPathTransform(transformElem); + } else if (XPathFilter2Transform.XPATH_FILTER2.equals(algorithmUri)) { + return parseXPathFilter2Transform(transformElem); + } else if (XSLTTransform.XSLT.equals(algorithmUri)) { + return parseXSLTTransform(transformElem); + } else { + throw new MOAApplicationException("1108", new Object[] { algorithmUri }); + } + } + + /** + * Parse an exclusive canonicalization type of transform. + * + * @param algorithmUri The algorithm URI of the canonicalization algorithm. + * @param transformElem The Transform DOM element to parse. + * @return An ExclusiveCanonicalizationTransform API object + * containing the data from the transformElem. + */ + private Transform parseExclusiveC14nTransform( + String algorithmUri, + Element transformElem) + { + + Element inclusiveNamespacesElem = + (Element) XPathUtils.selectSingleNode( + transformElem, + INCLUSIVE_NAMESPACES_XPATH); + + List inclusiveNamespaces = new ArrayList(); + if (inclusiveNamespacesElem != null) + { + StringTokenizer tokenizer = new StringTokenizer(inclusiveNamespacesElem.getAttribute("PrefixList")); + while (tokenizer.hasMoreTokens()) + { + inclusiveNamespaces.add(tokenizer.nextToken()); + } + } + return factory.createExclusiveCanonicalizationTransform( + algorithmUri, + inclusiveNamespaces); + } + + /** + * Parse an XPath type of Transform. + * + * @param transformElem The Transform DOM element to parse. + * @return The Transform API object representation of the + * Transform DOM element. + * @throws MOAApplicationException An error occurred parsing the + * Transform DOM element. + */ + private Transform parseXPathTransform(Element transformElem) + throws MOAApplicationException { + Element xPathElem = + (Element) XPathUtils.selectSingleNode(transformElem, XPATH_XPATH); + Map nsDecls; + + if (xPathElem == null) { + throw new MOAApplicationException("2202", null); + } + + nsDecls = DOMUtils.getNamespaceDeclarations(xPathElem); + nsDecls.remove(""); + + return factory.createXPathTransform(DOMUtils.getText(xPathElem), nsDecls); + } + + /** + * Parse an XPathFilter2 type of Transform. + * + * @param transformElem The Transform DOM element to parse. + * @return The Transform API object representation of the + * Transform DOM element. + * @throws MOAApplicationException An error occurred parsing the + * Transform DOM element. + */ + private Transform parseXPathFilter2Transform(Element transformElem) + throws MOAApplicationException { + List filters = new ArrayList(); + NodeIterator iter = + XPathUtils.selectNodeIterator(transformElem, XPATH2_XPATH); + Element filterElem; + + while ((filterElem = (Element) iter.nextNode()) != null) { + String filterAttr = filterElem.getAttribute("Filter"); + String filterType; + String expression; + Map nsDecls; + + if (filterAttr.equals("intersect")) { + filterType = XPathFilter.INTERSECT_TYPE; + } else if (filterAttr.equals("subtract")) { + filterType = XPathFilter.SUBTRACT_TYPE; + } else { + filterType = XPathFilter.UNION_TYPE; + } + + expression = DOMUtils.getText(filterElem); + nsDecls = DOMUtils.getNamespaceDeclarations(filterElem); + nsDecls.remove(""); + filters.add(factory.createXPathFilter(filterType, expression, nsDecls)); + } + if (filters.size() == 0) { + throw new MOAApplicationException("2216", null); + } + + return factory.createXPathFilter2Transform(filters); + } + + /** + * Parse an XSLT type of Transform. + * + * @param transformElem The Transform DOM element to parse. + * @return The Transform API object representation of the + * Transform DOM element. + * @throws MOAApplicationException An error occurred parsing the + * Transform DOM element. + */ + private Transform parseXSLTTransform(Element transformElem) + throws MOAApplicationException { + Element xsltElem = + (Element) XPathUtils.selectSingleNode(transformElem, XSLT_ELEMENT_XPATH); + + if (xsltElem == null) { + throw new MOAApplicationException("2215", null); + } + + return factory.createXSLTTransform(xsltElem); + } + +} 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 new file mode 100644 index 000000000..74d14b7cc --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParser.java @@ -0,0 +1,169 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.StringTokenizer; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.CollectionUtils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; + +/** + * A parser to parse VerifyCMSSignatureRequest DOM trees into + * VerifyCMSSignatureRequest API objects. + * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyCMSSignatureRequestParser { + + // + // XPath expressions for selecting parts of the DOM message + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String DATE_TIME_XPATH = MOA + "DateTime"; + private static final String CMS_SIGNATURE_XPATH = MOA + "CMSSignature"; + private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID"; + private static final String DATA_OBJECT_XPATH = MOA + "DataObject"; + private static final String META_INFO_XPATH = MOA + "MetaInfo"; + private static final String CONTENT_XPATH = MOA + "Content"; + private static final String BASE64_CONTENT_XPATH = MOA + "Base64Content"; + + /** The SPSSFactory for creating new API objects. */ + private SPSSFactory factory = SPSSFactory.getInstance(); + + /** + * Parse a VerifyCMSSignatureRequest DOM element, as defined + * by the MOA schema. + * + * @param requestElem The VerifyCMSSignatureRequest to parse. The + * request must have been successfully parsed against the schema for this + * method to succeed. + * @return A VerifyCMSSignatureRequest API objects containing + * the data from the DOM element. + * @throws MOAApplicationException An error occurred parsing the request. + */ + public VerifyCMSSignatureRequest parse(Element requestElem) + throws MOAApplicationException { + + int[] signatories = parseSignatories(requestElem); + Date dateTime = + RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); + String cmsSignatureStr = + XPathUtils.getElementValue(requestElem, CMS_SIGNATURE_XPATH, ""); + CMSDataObject dataObject = parseDataObject(requestElem); + String trustProfileID = + XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); + InputStream cmsSignature = + Base64Utils.decodeToStream(cmsSignatureStr, true); + + return factory.createVerifyCMSSignatureRequest( + signatories, + dateTime, + cmsSignature, + dataObject, + trustProfileID); + } + + /** + * Parse the Signatories attribute contained in the + * VerifyCMSSignatureRequest DOM element. + * + * @param requestElem The VerifyCMSSignatureRequest DOM element. + * @return The signatories contained in the given + * VerifyCMSSignatureRequest DOM element. + */ + private int[] parseSignatories(Element requestElem) { + String signatoriesStr = requestElem.getAttribute("Signatories"); + + if ("all".equals(signatoriesStr)) { + return VerifyCMSSignatureRequest.ALL_SIGNATORIES; + } else { + StringTokenizer tokenizer = new StringTokenizer(signatoriesStr); + List signatoriesList = new ArrayList(); + int[] signatories; + + // put the signatories into a List + while (tokenizer.hasMoreTokens()) { + try { + signatoriesList.add(new Integer(tokenizer.nextToken())); + } catch (NumberFormatException e) { + // this cannot occur if the request has been validated + } + } + + // convert the List into an int array + signatories = CollectionUtils.toIntArray(signatoriesList); + + return signatories; + } + } + + /** + * Parse a the DataObject DOM element contained in a given + * VerifyCMSSignatureRequest DOM element. + * + * @param requestElem The VerifyCMSSignatureRequest DOM element + * to parse. + * @return The CMSDataObject API object containing the data + * from the DataObject DOM element. + */ + private CMSDataObject parseDataObject(Element requestElem) { + Element dataObjectElem = + (Element) XPathUtils.selectSingleNode(requestElem, DATA_OBJECT_XPATH); + + if (dataObjectElem != null) { + Element metaInfoElem = + (Element) XPathUtils.selectSingleNode(dataObjectElem, META_INFO_XPATH); + MetaInfo metaInfo = null; + Element contentElem = + (Element) XPathUtils.selectSingleNode(dataObjectElem, CONTENT_XPATH); + CMSContent content = parseContent(contentElem); + + if (metaInfoElem != null) { + metaInfo = RequestParserUtils.parseMetaInfo(metaInfoElem); + } + + return factory.createCMSDataObject(metaInfo, content); + } else { + return null; + } + + } + + /** + * Parse the content contained in a CMSContentBaseType kind of + * DOM element. + * + * @param contentElem The CMSContentBaseType kind of element to + * parse. + * @return A CMSDataObject API object containing the data + * from the given DOM element. + */ + private CMSContent parseContent(Element contentElem) { + Element base64ContentElem = + (Element) XPathUtils.selectSingleNode(contentElem, BASE64_CONTENT_XPATH); + + if (base64ContentElem != null) { + String base64Str = DOMUtils.getText(base64ContentElem); + InputStream binaryContent = Base64Utils.decodeToStream(base64Str, true); + return factory.createCMSContent(binaryContent); + } else { + return factory.createCMSContent( + contentElem.getAttribute("Reference")); + } + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java new file mode 100644 index 000000000..3fc8f223d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureResponseBuilder.java @@ -0,0 +1,101 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.util.Iterator; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; + +/** + * Convert a VerifyCMSSignatureResponse API object into its + * XML representation, according to the MOA XML schema. + * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyCMSSignatureResponseBuilder { + /** The XML document containing the response element. */ + private Document responseDoc; + /** The response VerifyCMSSignatureResponse DOM element. */ + private Element responseElem; + + /** + * Create a new VerifyCMSSignatureResponseBuilder: + * + * @throws MOASystemException An error occurred setting up the resulting + * XML document. + */ + public VerifyCMSSignatureResponseBuilder() throws MOASystemException { + responseDoc = + ResponseBuilderUtils.createResponse("VerifyCMSSignatureResponse"); + responseElem = responseDoc.getDocumentElement(); + } + + /** + * Build a document containing a VerifyCMSSignatureResponse + * DOM element being the XML representation of the given + * VerifyCMSSignatureResponse API object. + * + * @param response The VerifyCMSSignatureResponse to convert + * to XML. + * @return A document containing the VerifyCMSSignatureResponse + * DOM element. + * @throws MOAApplicationException An error occurred building the response. + */ + public Document build(VerifyCMSSignatureResponse response) + throws MOAApplicationException { + + Iterator iter; + + for (iter = response.getResponseElements().iterator(); iter.hasNext();) { + VerifyCMSSignatureResponseElement responseElement = + (VerifyCMSSignatureResponseElement) iter.next(); + addResponseElement(responseElement); + } + + return responseDoc; + } + + /** + * Add an element to the response. + * + * @param responseElement The element to add to the response. + * @throws MOAApplicationException An error occurred adding the element. + */ + private void addResponseElement(VerifyCMSSignatureResponseElement responseElement) + throws MOAApplicationException { + + SignerInfo signerInfo = responseElement.getSignerInfo(); + CheckResult signatureCheck = responseElement.getSignatureCheck(); + CheckResult certCheck = responseElement.getCertificateCheck(); + + ResponseBuilderUtils.addSignerInfo( + responseDoc, + responseElem, + signerInfo.getSignerCertificate(), + signerInfo.isQualifiedCertificate(), + signerInfo.isPublicAuthority(), + signerInfo.getPublicAuhtorityID()); + + ResponseBuilderUtils.addCodeInfoElement( + responseDoc, + responseElem, + "SignatureCheck", + signatureCheck.getCode(), + signatureCheck.getInfo()); + + ResponseBuilderUtils.addCodeInfoElement( + responseDoc, + responseElem, + "CertificateCheck", + certCheck.getCode(), + certCheck.getInfo()); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java new file mode 100644 index 000000000..e736af522 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParser.java @@ -0,0 +1,275 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import at.gv.egovernment.moa.util.BoolUtils; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; + +/** + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyXMLSignatureRequestParser { + + // + // XPath expressions for parsing parts of the request + // + private static final String MOA = Constants.MOA_PREFIX + ":"; + private static final String DATE_TIME_XPATH = MOA + "DateTime"; + private static final String RETURN_HASH_INPUT_DATA_XPATH = + MOA + "ReturnHashInputData"; + private static final String TRUST_PROFILE_ID_XPATH = MOA + "TrustProfileID"; + private static final String VERIFY_SIGNATURE_ENVIRONMENT_XPATH = + MOA + "VerifySignatureInfo/" + MOA + "VerifySignatureEnvironment"; + private static final String VERIFY_SIGNATURE_LOCATION_XPATH = + MOA + "VerifySignatureInfo/" + MOA + "VerifySignatureLocation"; + private static final String SUPPLEMENT_PROFILE_XPATH = + MOA + "SupplementProfile | " + MOA + "SupplementProfileID"; + private static final String SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH = + MOA + "SignatureManifestCheckParams"; + private static final String VERIFY_TRANSFORMS_INFO_PROFILE_XPATH = + (MOA + "VerifyTransformsInfoProfile | ") + + (MOA + "VerifyTransformsInfoProfileID"); + private static final String REFERENCE_INFO_XPATH = MOA + "ReferenceInfo"; + + /** The SPSSFactory for creating new API objects. */ + private SPSSFactory factory = SPSSFactory.getInstance(); + + + /** + * Parse a VerifyXMLSignatureRequest DOM element, as defined + * by the MOA schema. + * + * @param requestElem The VerifyXMLSignatureRequest to parse. The + * request must have been successfully parsed against the schema for this + * method to succeed. + * @return A VerifyXMLSignatureRequest API object containing + * the data from the DOM element. + * @throws MOAApplicationException An error occurred parsing the request. + */ + public VerifyXMLSignatureRequest parse(Element requestElem) + throws MOAApplicationException { + + Date dateTime = + RequestParserUtils.parseDateTime(requestElem, DATE_TIME_XPATH); + VerifySignatureInfo verifySignatureInfo = + parseVerifySignatureInfo(requestElem); + List supplementProfiles = parseSupplementProfiles(requestElem); + SignatureManifestCheckParams signatureManifestCheckParams = + parseSignatureManifestCheckParams(requestElem); + boolean returnHashInputData = + XPathUtils.selectSingleNode(requestElem, RETURN_HASH_INPUT_DATA_XPATH) + != null; + String trustProfileID = + XPathUtils.getElementValue(requestElem, TRUST_PROFILE_ID_XPATH, null); + + return factory.createVerifyXMLSignatureRequest( + dateTime, + verifySignatureInfo, + supplementProfiles, + signatureManifestCheckParams, + returnHashInputData, + trustProfileID); + } + + /** + * Parse the VerifySignatureInfo DOM element contained in + * the VerifyXMLSignatureRequest DOM element. + * + * @param requestElem The VerifyXMLSignatureRequest DOM element + * containing the VerifySignatureInfo DOM element. + * @return The VerifySignatureInfo API object containing the + * data from the DOM element. + */ + private VerifySignatureInfo parseVerifySignatureInfo(Element requestElem) { + Element verifySignatureEnvironmentElem = + (Element) XPathUtils.selectSingleNode( + requestElem, + VERIFY_SIGNATURE_ENVIRONMENT_XPATH); + Content verifySignatureEnvironment = + RequestParserUtils.parseContent(verifySignatureEnvironmentElem); + VerifySignatureLocation verifySignatureLocation = + parseVerifySignatureLocation(requestElem); + + return factory.createVerifySignatureInfo( + verifySignatureEnvironment, + verifySignatureLocation); + } + + /** + * Parse the VerifySignatureLocation DOM element contained + * in the given VerifyXMLSignatureRequest DOM element. + * + * @param requestElem The VerifyXMLSignatureRequst DOM element. + * @return The VerifySignatureLocation API object containing the + * data from the DOM element. + */ + private VerifySignatureLocation parseVerifySignatureLocation(Element requestElem) { + Element locationElem = + (Element) XPathUtils.selectSingleNode( + requestElem, + VERIFY_SIGNATURE_LOCATION_XPATH); + String xPathExpression = DOMUtils.getText(locationElem); + Map namespaceDeclarations = DOMUtils.getNamespaceDeclarations(locationElem); + + return factory.createVerifySignatureLocation( + xPathExpression, + namespaceDeclarations); + } + + /** + * Parse the supplement profiles contained in the given + * VerifyXMLSignatureRequest DOM element. + * + * @param requestElem The VerifyXMLSignatureRequest DOM element. + * @return A List of SupplementProfile API objects + * containing the data from the SupplementProfile DOM elements. + */ + private List parseSupplementProfiles(Element requestElem) { + List supplementProfiles = new ArrayList(); + NodeIterator profileElems = + XPathUtils.selectNodeIterator(requestElem, SUPPLEMENT_PROFILE_XPATH); + Element profileElem; + + while ((profileElem = (Element) profileElems.nextNode()) != null) { + SupplementProfile profile; + + if ("SupplementProfile".equals(profileElem.getLocalName())) { + ProfileParser profileParser = new ProfileParser(); + profile = profileParser.parseSupplementProfile(profileElem); + } else { + String profileID = DOMUtils.getText(profileElem); + profile = factory.createSupplementProfile(profileID); + } + supplementProfiles.add(profile); + } + return supplementProfiles; + } + + /** + * Parse the SignatureManifestCheckParams DOM element contained + * in the given VerifyXMLSignatureRequest DOM element. + * @param requestElem The VerifyXMLSignatureRequest DOM element. + * @return The SignatureManifestCheckParams API object containing + * the data from the SignatureManifestCheckParams DOM element. + * @throws MOAApplicationException An error occurred parsing the + * SignatureManifestCheckParams DOM element. + */ + private SignatureManifestCheckParams parseSignatureManifestCheckParams(Element requestElem) + throws MOAApplicationException { + Element paramsElem = + (Element) XPathUtils.selectSingleNode( + requestElem, + SIGNATURE_MANIFEST_CHECK_PARAMS_XPATH); + + if (paramsElem != null) { + String returnReferenceInputDataStr = + paramsElem.getAttribute("ReturnReferenceInputData"); + boolean returnReferencInputData = + BoolUtils.valueOf(returnReferenceInputDataStr); + List referenceInfos = parseReferenceInfos(paramsElem); + + return factory.createSignatureManifestCheckParams( + referenceInfos, + returnReferencInputData); + } else { + return null; + } + } + + /** + * Parse the ReferenceInfo DOM elements contained in a + * SignatureManifestCheckParams DOM element. + * + * @param paramsElem The SignatureManifestCheckParams DOM element + * containing the ReferenceInfo DOM elements. + * @return A List of RefernceInfo API objects + * containing the data from the ReferenceInfo DOM elements. + * @throws MOAApplicationException An error occurred parsing the + * ReferenceInfo DOM elements. + */ + private List parseReferenceInfos(Element paramsElem) + throws MOAApplicationException { + + List referenceInfos = new ArrayList(); + NodeIterator refInfoElems = + XPathUtils.selectNodeIterator(paramsElem, REFERENCE_INFO_XPATH); + Element refInfoElem; + + while ((refInfoElem = (Element) refInfoElems.nextNode()) != null) { + ReferenceInfo referenceInfo = parseReferenceInfo(refInfoElem); + + referenceInfos.add(referenceInfo); + } + + return referenceInfos; + } + + /** + * Parse a ReferenceInfo DOM element. + * + * @param refInfoElem The ReferenceInfo DOM element to parse. + * @return The ReferenceInfo API object containing the data + * from the given ReferenceInfo DOM element. + * @throws MOAApplicationException An error occurred parsing the + * ReferenceInfo DOM element. + */ + private ReferenceInfo parseReferenceInfo(Element refInfoElem) + throws MOAApplicationException { + List profiles = parseVerifyTransformsInfoProfiles(refInfoElem); + return factory.createReferenceInfo(profiles); + } + + /** + * Parse the VerifyTransformsInfoProfile DOM elements contained + * in a ReferenceInfo DOM element. + * + * @param refInfoElem ReferenceInfo DOM element containing + * the VerifyTransformsInfoProfile DOM elements. + * @return A List of VerifyTransformsInfoProfile + * API objects containing the profile data. + * @throws MOAApplicationException An error occurred building the + * VerifyTransformsInfoProfiles. + */ + private List parseVerifyTransformsInfoProfiles(Element refInfoElem) + throws MOAApplicationException { + + List profiles = new ArrayList(); + NodeIterator profileElems = + XPathUtils.selectNodeIterator( + refInfoElem, + VERIFY_TRANSFORMS_INFO_PROFILE_XPATH); + Element profileElem; + + while ((profileElem = (Element) profileElems.nextNode()) != null) { + if ("VerifyTransformsInfoProfile".equals(profileElem.getLocalName())) { + ProfileParser profileParser = new ProfileParser(); + profiles.add( + profileParser.parseVerifyTransformsInfoProfile(profileElem)); + } else { + String profileID = DOMUtils.getText(profileElem); + profiles.add(factory.createVerifyTransformsInfoProfile(profileID)); + } + } + return profiles; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java new file mode 100644 index 000000000..960d9571d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureResponseBuilder.java @@ -0,0 +1,310 @@ +package at.gv.egovernment.moa.spss.api.xmlbind; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.Constants; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.ContentBinary; +import at.gv.egovernment.moa.spss.api.common.ContentXML; +import at.gv.egovernment.moa.spss.api.common.InputData; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * Convert a VerifyXMLSignatureResponse API object into its + * XML representation, according to the MOA XML schema. + * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyXMLSignatureResponseBuilder { + private static final String MOA_NS_URI = Constants.MOA_NS_URI; + + /** The XML document containing the response element. */ + private Document responseDoc; + /** The response VerifyXMLSignatureResponse DOM element. */ + private Element responseElem; + + /** + * Create a new VerifyXMLSignatureResponseBuilder: + * + * @throws MOASystemException An error occurred setting up the resulting + * XML document. + */ + public VerifyXMLSignatureResponseBuilder() throws MOASystemException { + responseDoc = + ResponseBuilderUtils.createResponse("VerifyXMLSignatureResponse"); + responseElem = responseDoc.getDocumentElement(); + } + + /** + * Build a document containing a VerifyXMLSignatureResponse + * DOM element being the XML representation of the given + * VerifyXMLSignatureResponse API object. + * + * @param response The VerifyXMLSignatureResponse to convert + * to XML. + * @return A document containing the VerifyXMLSignatureResponse + * DOM element. + * @throws MOAApplicationException An error occurred building the response. + */ + public Document build(VerifyXMLSignatureResponse response) + throws MOAApplicationException { + + Iterator iter; + List responseData; + + // add the SignerInfo + ResponseBuilderUtils.addSignerInfo( + responseDoc, + responseElem, + response.getSignerInfo().getSignerCertificate(), + response.getSignerInfo().isQualifiedCertificate(), + response.getSignerInfo().isPublicAuthority(), + response.getSignerInfo().getPublicAuhtorityID()); + + // add HashInputData elements + responseData = response.getHashInputDatas(); + if (responseData != null && !responseData.isEmpty()) { + for (iter = responseData.iterator(); iter.hasNext();) { + InputData inputData = (InputData) iter.next(); + addContent("HashInputData", inputData); + } + } + + // add ReferenceInputData elements + responseData = response.getReferenceInputDatas(); + if (responseData != null && !responseData.isEmpty()) { + for (iter = responseData.iterator(); iter.hasNext();) { + InputData inputData = (InputData) iter.next(); + addContent("ReferenceInputData", inputData); + } + } + + // add the SignatureCheck + addReferencesCheckResult("SignatureCheck", response.getSignatureCheck()); + + // add the SignatureManifestCheck + if (response.getSignatureManifestCheck() != null) { + addReferencesCheckResult( + "SignatureManifestCheck", + response.getSignatureManifestCheck()); + } + + // add the XMLDsigManifestChecks + responseData = response.getXMLDsigManifestChecks(); + if (responseData != null && !responseData.isEmpty()) { + for (iter = responseData.iterator(); iter.hasNext();) { + ManifestRefsCheckResult checkResult = + (ManifestRefsCheckResult) iter.next(); + addManifestRefsCheckResult("XMLDSIGManifestCheck", checkResult); + } + } + + // add the CertificateCheck + ResponseBuilderUtils.addCodeInfoElement( + responseDoc, + responseElem, + "CertificateCheck", + response.getCertificateCheck().getCode(), + response.getCertificateCheck().getInfo()); + + return responseDoc; + } + + /** + * Add an element of type ContentBaseType to the response. + * + * @param elementName The name of the element. + * + * @param inputData The InputData to add. Based on the type of + * + * the InputData, either a Base64Content element + * or a XMLContent subelement will be added. An + * InputDataBinaryImpl will be added as a Base64Content + * child element. AnInputDataXMLImpl will be added as + * XMLContent child element. + * + * @throws MOAApplicationException An error occurred adding the content. + */ + private void addContent(String elementName, InputData inputData) + throws MOAApplicationException { + + Element contentElem = responseDoc.createElementNS(MOA_NS_URI, elementName); + + contentElem.setAttributeNS(null, "PartOf", inputData.getPartOf()); + if (inputData.getReferringReferenceNumber() != InputData.REFERER_NONE_) + contentElem.setAttributeNS( + null, + "ReferringSigReference", + Integer.toString(inputData.getReferringReferenceNumber())); + + switch (inputData.getContentType()) { + case Content.XML_CONTENT : + ContentXML contentXml = (ContentXML) inputData; + NodeList nodes = contentXml.getXMLContent(); + Element xmlElem; + int i; + + xmlElem = responseDoc.createElementNS(MOA_NS_URI, "XMLContent"); + //xmlElem.setAttributeNS(XML_NS_URI, "xml:space", "preserve"); + xmlElem.setAttribute("xml:space", "preserve"); + + for (i = 0; i < nodes.getLength(); i++) { + xmlElem.appendChild(responseDoc.importNode(nodes.item(i), true)); + } + contentElem.appendChild(xmlElem); + responseElem.appendChild(contentElem); + break; + case Content.BINARY_CONTENT : + Element binaryElem = + responseDoc.createElementNS(MOA_NS_URI, "Base64Content"); + ContentBinary contentBinary = (ContentBinary) inputData; + String base64Str; + + try { + base64Str = Base64Utils.encode(contentBinary.getBinaryContent()); + } catch (IOException e) { + throw new MOAApplicationException("2200", null, e); + } + binaryElem.appendChild(responseDoc.createTextNode(base64Str)); + contentElem.appendChild(binaryElem); + responseElem.appendChild(contentElem); + break; + } + } + + /** + * Add a ReferencesCheckResult to the response. + * + * @param elementName The DOM element name to use. + * @param checkResult The ReferencesCheckResult to add. + */ + private void addReferencesCheckResult( + String elementName, + ReferencesCheckResult checkResult) { + + NodeList info = null; + + if (checkResult.getInfo() != null) { + DocumentFragment fragment = responseDoc.createDocumentFragment(); + NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); + int[] failedReferences = checkResult.getInfo().getFailedReferences(); + + if (anyOtherInfo != null) { + addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); + } + + if (failedReferences != null) { + addFailedReferences(fragment, failedReferences); + } + + info = fragment.getChildNodes(); + } + + ResponseBuilderUtils.addCodeInfoElement( + responseDoc, + responseElem, + elementName, + checkResult.getCode(), + info); + } + + + /** + * Add a ManifestRefsCheckResult to the response. + * + * @param elementName The DOM element name to use. + * @param checkResult The ManifestRefsCheckResult to add. + */ + private void addManifestRefsCheckResult( + String elementName, + ManifestRefsCheckResult checkResult) { + + DocumentFragment fragment = responseDoc.createDocumentFragment(); + NodeList anyOtherInfo = checkResult.getInfo().getAnyOtherInfo(); + int[] failedReferences = checkResult.getInfo().getFailedReferences(); + Element referringSigRefElem; + String referringSigRefStr; + + // add any other elements + if (anyOtherInfo != null) { + addAnyOtherInfo(fragment, checkResult.getInfo().getAnyOtherInfo()); + } + + // add the failed references + if (failedReferences != null) { + addFailedReferences(fragment, failedReferences); + } + + // add the ReferringSigReference + referringSigRefElem = + responseDoc.createElementNS(MOA_NS_URI, "ReferringSigReference"); + referringSigRefStr = + Integer.toString(checkResult.getInfo().getReferringSignatureReference()); + referringSigRefElem.appendChild( + responseDoc.createTextNode(referringSigRefStr)); + fragment.appendChild(referringSigRefElem); + + // add XMLDSIGManifestCheckResult to the response + ResponseBuilderUtils.addCodeInfoElement( + responseDoc, + responseElem, + elementName, + checkResult.getCode(), + fragment.getChildNodes()); + } + + /** + * Add arbitrary XML content to a DOM DocumentFragment. + * + * @param fragment The fragment to add the XML content to. + * @param anyOtherInfo The XML content to add. + */ + private void addAnyOtherInfo( + DocumentFragment fragment, + NodeList anyOtherInfo) { + + int i; + + for (i = 0; i < anyOtherInfo.getLength(); i++) { + fragment.appendChild(responseDoc.importNode(anyOtherInfo.item(i), true)); + } + } + + /** + * Add the failed references as FailedReference DOM elements to + * the fragment. + * + * @param fragment The DOM document fragment to add the + * FailedReference elements to. + * @param failedReferences The indexes of the failed references. + */ + private void addFailedReferences( + DocumentFragment fragment, + int[] failedReferences) { + Element failedReferenceElem; + int i; + + for (i = 0; i < failedReferences.length; i++) { + failedReferenceElem = + responseDoc.createElementNS(MOA_NS_URI, "FailedReference"); + failedReferenceElem.appendChild( + responseDoc.createTextNode(Integer.toString(failedReferences[i]))); + fragment.appendChild(failedReferenceElem); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java new file mode 100644 index 000000000..425c410ad --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfile.java @@ -0,0 +1,30 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +/** + * Base class for signature environment profile data used in XML signature + * creation. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface CreateSignatureEnvironmentProfile { + /** + * Indicates that the profile data is given explicitly. + */ + public static int EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE = 0; + /** + * Indicates that the profile data is stored in the configuration and resolved + * using an ID. + */ + public static int ID_CREATESIGNATUREENVIRONMENTPROFILE = 1; + + /** + * Gets the type of this object. + * + * @return The type of CreateSignatureEnvironmentProfile denoted + * by this object. Either + * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE or + * ID_CREATESIGNATUREENVIRONMENTPROFILE. + */ + public int getCreateSignatureEnvironmentProfileType(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java new file mode 100644 index 000000000..6aebd102b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileExplicit.java @@ -0,0 +1,30 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import java.util.List; + +/** + * A CreateSignatureEnvironmentProfile containing the profile + * data explicitly. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface CreateSignatureEnvironmentProfileExplicit + extends CreateSignatureEnvironmentProfile { + + /** + * Gets the location and index of where to insert the signature into the + * signature environment. + * + * @return The location and index of the signature in the signature + * environment. + */ + public CreateSignatureLocation getCreateSignatureLocation(); + /** + * Gets the supplemental information. + * + * @return The supplemental information. + */ + public List getSupplements(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java new file mode 100644 index 000000000..1c0d87adc --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureEnvironmentProfileID.java @@ -0,0 +1,20 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +/** + * A CreateSignatureEnvironmentProfile containing a profile ID + * pointing to locally stored profile data. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface CreateSignatureEnvironmentProfileID + extends CreateSignatureEnvironmentProfile { + + /** + * Gets the profile ID. + * + * @return The profile ID. + */ + public String getCreateSignatureEnvironmentProfileID(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java new file mode 100644 index 000000000..5ceae4d0a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureInfo.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import at.gv.egovernment.moa.spss.api.common.Content; + +/** + * Encapsulates a signature object used during signature creation. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateSignatureInfo { + /** + * Gets the XML structure where the signature will be inserted. + * + * @return The XML structure where the signature will be inserted. + */ + public Content getCreateSignatureEnvironment(); + /** + * Gets the supplemental data for the signature environment. + * + * @return The supplemental data for the signature envoronment. + */ + public CreateSignatureEnvironmentProfile getCreateSignatureEnvironmentProfile(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java new file mode 100644 index 000000000..81374ceaa --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateSignatureLocation.java @@ -0,0 +1,23 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import at.gv.egovernment.moa.spss.api.common.ElementSelector; + +/** + * Specifies where to insert the newly created signature. + * + * An XPath expression is used to select the signature parent element. An + * additional index specifies the node index after which to insert the + * signature into the parent element. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface CreateSignatureLocation extends ElementSelector { + /** + * Gets the node index, after which the signature will be inserted into the + * parent elemen. + * + * @return The index of the node after which the signature will be inserted. + */ + public int getIndex(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java new file mode 100644 index 000000000..94152434e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfo.java @@ -0,0 +1,27 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import java.util.List; + +import at.gv.egovernment.moa.spss.api.common.MetaInfo; + +/** + * Encapsulates information used for the transformation of the data object. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateTransformsInfo { + /** + * Gets the XMLDSig transforms. + * + * @return A List of Transform objects. + */ + public List getTransforms(); + /** + * Gets meta information about the data resulting from the transformation. + * + * @return Meta information about the resulting data. + */ + public MetaInfo getFinalDataMetaInfo(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java new file mode 100644 index 000000000..40acfd317 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfile.java @@ -0,0 +1,28 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +/** + * Base class for transformation informations used in signature creation. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateTransformsInfoProfile { + /** + * Indicates transformation information given explicitly. + */ + public static final int EXPLICIT_CREATETRANSFORMSINFOPROFILE = 0; + /** + * Indicates transformation information given as an ID. + */ + public static final int ID_CREATETRANSFORMSINFOPROFILE = 1; + + /** + * Gets the type of profile information this object contains. + * + * @return The type of transformation information, either + * EXPLICIT_CREATETRANSFORMSINFOPROFILE or + * ID_CREATETRANSFORMSINFOPROFILE. + */ + public int getCreateTransformsInfoProfileType(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java new file mode 100644 index 000000000..aeb74445f --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileExplicit.java @@ -0,0 +1,26 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import java.util.List; + +/** + * Encapsulates explicit transformation informations. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateTransformsInfoProfileExplicit + extends CreateTransformsInfoProfile { + /** + * Gets the transformation information of the data object. + * + * @return Transformation information of the data object. + */ + public CreateTransformsInfo getCreateTransformsInfo(); + /** + * Gets the supplemental information. + * + * @return The supplemental information. + */ + public List getSupplements(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java new file mode 100644 index 000000000..3631ead29 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateTransformsInfoProfileID.java @@ -0,0 +1,18 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +/** + * Encapsulates transformation information given via an identifier. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateTransformsInfoProfileID + extends CreateTransformsInfoProfile { + /** + * Gets the ID of the transformation. + * + * @return The transformation profile ID. + */ + public String getCreateTransformsInfoProfileID(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java new file mode 100644 index 000000000..b8157fdfb --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureRequest.java @@ -0,0 +1,26 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import java.util.List; + + +/** + * Object that encapsulates a request to create an XML Signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateXMLSignatureRequest { + /** + * Gets the identifier for the keys to be used for the signature. + * + * @return The identifier for the keys to be used. + */ + public String getKeyIdentifier(); + /** + * Gets the information of the singleSignatureInfo elements. + * + * @return The information of singleSignatureInfo elements. + */ + public List getSingleSignatureInfos(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java new file mode 100644 index 000000000..6bf54e6a5 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponse.java @@ -0,0 +1,20 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import java.util.List; + +/** + * Object that encapsulates the response on to a + * CreateXMLSignatureRequest to create an XML signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateXMLSignatureResponse { + /** + * Gets the response elements. + * + * @return The response elements. + */ + public List getResponseElements(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java new file mode 100644 index 000000000..2162d82fd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/CreateXMLSignatureResponseElement.java @@ -0,0 +1,29 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +/** + * Base class for SignatureEnvironmentResponse and + * ErrorResponse elements in a + * CreateXMLSignatureResponse. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface CreateXMLSignatureResponseElement { + /** + * Indicates that this object contains a SignatureEnvironment. + */ + public static final int SIGNATURE_ENVIRONMENT_RESPONSE = 0; + /** + * Indicates that this objet contains an ErrorResponse. + */ + public static final int ERROR_RESPONSE = 1; + + /** + * Gets the type of response object. + * + * @return The type of response object, either + * SIGNATURE_ENVIRONMENT_RESPONSE or ERROR_RESPONSE. + */ + public int getResponseType(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java new file mode 100644 index 000000000..43d49c587 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/DataObjectInfo.java @@ -0,0 +1,48 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import at.gv.egovernment.moa.spss.api.common.Content; + +/** + * Encapsulates information required to create a single signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface DataObjectInfo { + /** + * Indicates that a detached signature will be created. + */ + public static final String STRUCTURE_DETACHED = "detached"; + /** + * Indicates that an enveloping signature will be created. + */ + public static final String STRUCTURE_ENVELOPING = "enveloping"; + + /** + * Gets the structure of the signature. + * + * @return The structure of the signature. + */ + public String getStructure(); + /** + * Checks whether a refercence will be placed in the signature itself or + * in the manifest. + * + * @return true if a reference will be placed in the manifest, + * false if it will be placed in the signature. + */ + public boolean isChildOfManifest(); + /** + * Gets information related to a single data object. + * + * @return Information related to a single data object. + */ + public Content getDataObject(); + /** + * Gets information for the transformation of the data object. + * + * @return The transformation information. + */ + public CreateTransformsInfoProfile getCreateTransformsInfoProfile(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java new file mode 100644 index 000000000..30fa4fb52 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/ErrorResponse.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + + +/** + * Object containing detailed error information. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface ErrorResponse extends CreateXMLSignatureResponseElement { + /** + * Gets the error code. + * + * @return The error code. + */ + public int getErrorCode(); + /** + * Gets verbose error information. + * + * @return Verbose error information. + */ + public String getInfo(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java new file mode 100644 index 000000000..449349a68 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SignatureEnvironmentResponse.java @@ -0,0 +1,20 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import org.w3c.dom.Element; + +/** + * Contains the signature if the signature creation was successful. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SignatureEnvironmentResponse + extends CreateXMLSignatureResponseElement { + /** + * Gets the XML structure which contains the signature. + * + * @return A general XML structure containing the signature. + */ + public Element getSignatureEnvironment(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java new file mode 100644 index 000000000..9c74c5157 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlsign/SingleSignatureInfo.java @@ -0,0 +1,32 @@ +package at.gv.egovernment.moa.spss.api.xmlsign; + +import java.util.List; + +/** + * Encapsulates data to create a single signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SingleSignatureInfo { + /** + * Gets the dataObjectInfo information. + * + * @return The dataObjectInfo information. + */ + public List getDataObjectInfos(); + /** + * Gets the signature object. + * + * @return The signature object used during signature creation. + */ + public CreateSignatureInfo getCreateSignatureInfo(); + /** + * Check whether a Security Layer conform signature manifest will be created. + * + * @return true, if a Security Layer conform signature manifest + * will be created, false otherwise. + */ + public boolean isSecurityLayerConform(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java new file mode 100644 index 000000000..1984ba349 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResult.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + + +/** + * Contains the results of manifest checks according to XMLDsig. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface ManifestRefsCheckResult { + /** + * Gets the check code. + * + * @return A numerical representation of the result of the manifest check. + */ + public int getCode(); + /** + * Gets the reference to the manifest. + * + * @return The reference to the manifest. + */ + public ManifestRefsCheckResultInfo getInfo(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java new file mode 100644 index 000000000..258840162 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ManifestRefsCheckResultInfo.java @@ -0,0 +1,19 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + + +/** + * Encapsulates information referring to the manifest of the check. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface ManifestRefsCheckResultInfo extends ReferencesCheckResultInfo { + /** + * Gets the position of the signature reference containing the + * reference to the manifest being described by this object. + * + * @return The position of the signature reference. + */ + public int getReferringSignatureReference(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java new file mode 100644 index 000000000..4c644583b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferenceInfo.java @@ -0,0 +1,19 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import java.util.List; + +/** + * Contains transformation parameters which are locally available. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface ReferenceInfo { + /** + * Gets the transformation info. + * + * @return The transformation info. + */ + public List getVerifyTransformsInfoProfiles(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java new file mode 100644 index 000000000..7b5488613 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResult.java @@ -0,0 +1,23 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Contains information about the verification status of references contained + * in the signature. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface ReferencesCheckResult { + /** + * Gets the check code. + * + * @return A numerical representation of the result of the reference check. + */ + public int getCode(); + /** + * Gets the additional information about the result. + * + * @return Additional information about the result. + */ + public ReferencesCheckResultInfo getInfo(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java new file mode 100644 index 000000000..be21b61c2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/ReferencesCheckResultInfo.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import org.w3c.dom.NodeList; + +/** + * Additional information contained in a ReferencesCheckResult. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface ReferencesCheckResultInfo { + /** + * Gets the additional info of the failed dsig:reference element. + * + * @return The info elements. + */ + public NodeList getAnyOtherInfo(); + /** + * Gets the positions of the failed signature references containing the + * references to the manifests being described by this object. + * + * @return The positions of the failed signature references. + */ + public int[] getFailedReferences(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java new file mode 100644 index 000000000..8f0efacf3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SignatureManifestCheckParams.java @@ -0,0 +1,26 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import java.util.List; + +/** + * Contains parameters used to check the signature manifest. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SignatureManifestCheckParams { + /** + * Gets the referential information. + * + * @return The referential information. + */ + public List getReferenceInfos(); + /** + * Gets information on whether signature source data should be returned. + * + * @return true, if signature source data should be returned, + * otherwise false. + */ + public boolean getReturnReferenceInputData(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java new file mode 100644 index 000000000..569e691ca --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfile.java @@ -0,0 +1,28 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Base class for supplementary information. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SupplementProfile { + /** + * Indicates that this object contains explicit supplementary information. + */ + public static final int EXPLICIT_SUPPLEMENTPROFILE = 0; + /** + * Indicates that this object contains a profile id where supplementary + * information can be found. + */ + public static final int ID_SUPPLEMENTPROFILE = 1; + + /** + * Gets the type of supplementary information contained in this object. + * + * @return The type of supplementary information contained in this object, + * either EXPLICIT_SUPPLEMENT or ID_SUPPLEMENT. + */ + public int getSupplementProfileType(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java new file mode 100644 index 000000000..7dd37a2d1 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileExplicit.java @@ -0,0 +1,19 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; + +/** + * Encapsulates explicit supplementary information. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SupplementProfileExplicit extends SupplementProfile { + /** + * Gets the supplemental object. + * + * @return The supplemental object. + */ + public XMLDataObjectAssociation getSupplementProfile(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java new file mode 100644 index 000000000..5b5083be9 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/SupplementProfileID.java @@ -0,0 +1,18 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Encapsulates supplementary information stored in a profile. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface SupplementProfileID extends SupplementProfile { + /** + * Gets the id of the profile where the supplementary information can be + * found. + * + * @return The profile id. + */ + public String getSupplementProfileID(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java new file mode 100644 index 000000000..3e173e0cd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameter.java @@ -0,0 +1,40 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Object encapsulating transform parameters either as a URI, binary or + * hashed. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface TransformParameter { + /** + * Indicates that this object contains a transform parameter given as + * a URI. + */ + public static final int URI_TRANSFORMPARAMETER = 0; + /** + * Indicates that this object contains binary transform parameter. + */ + public static final int BINARY_TRANSFORMPARAMETER = 1; + /** + * Indicatest that this object contains a binary hash of the transform + * parameter. + */ + public static final int HASH_TRANSFORMPARAMETER = 2; + + /** + * Gets the type of transform parameter contained in this object. + * + * @return The type of transform parameter, being one of + * URI_TRANSFORMPARAMETER, BINARY_TRANSFORMPARAMETER + * or HASH_TRANSFORMPARAMETER. + */ + public int getTransformParameterType(); + /** + * Gets the transform parameter URI. + * + * @return The transform parameter URI. + */ + public String getURI();} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java new file mode 100644 index 000000000..600227dfd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterBinary.java @@ -0,0 +1,21 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import java.io.InputStream; + +/** + * Encapsulates a binary transform parameter. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface TransformParameterBinary extends TransformParameter { + /** + * Gets the binary transform parameter. + * + * @return An InputStream from which the binary content can + * be read. + */ + public InputStream getBinaryContent(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java new file mode 100644 index 000000000..ec45ea4f4 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterHash.java @@ -0,0 +1,26 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + + +/** + * Contains a hash of the transform parameter. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface TransformParameterHash extends TransformParameter { + /** + * Gets the method used for calculating the digest value. + * + * @return The digest method. + */ + public String getDigestMethod(); + /** + * Gets the binary hash of the transform parameter. + * + * @return A binary representation of the hash. + */ + public byte[] getDigestValue(); + + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java new file mode 100644 index 000000000..4a6f0a58f --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/TransformParameterURI.java @@ -0,0 +1,12 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Encapsulates a transform parameter given as a URI. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface TransformParameterURI extends TransformParameter { + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java new file mode 100644 index 000000000..386651c47 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureInfo.java @@ -0,0 +1,27 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import at.gv.egovernment.moa.spss.api.common.Content; + +/** + * Encapsulates a signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifySignatureInfo { + /** + * Gets the content of the VerifySignatureEnvironment element. + * + * @return A MOAElement containing the + * VerifySignatureEnvironment in a DOM-like structure. + */ + public Content getVerifySignatureEnvironment(); + /** + * Gets the location of the signature. + * + * @return The location of the signature within the signature environment. + */ + public VerifySignatureLocation getVerifySignatureLocation(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java new file mode 100644 index 000000000..f05e3e889 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifySignatureLocation.java @@ -0,0 +1,13 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import at.gv.egovernment.moa.spss.api.common.ElementSelector; + +/** + * Specifies where to find the signature to be verified. + * + * @author Patrick Peck + * @version $Id$ + */ +public interface VerifySignatureLocation extends ElementSelector { + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java new file mode 100644 index 000000000..909fc58a2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfile.java @@ -0,0 +1,28 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Object for explicitly specifying a transformation path. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyTransformsInfoProfile { + /** + * Indicates that this object contains the transformation path explicitly. + */ + public static final int EXPLICIT_VERIFYTRANSFORMSINFOPROFILE = 0; + /** + * Indicatest that this object contains a transformation info id. + */ + public static final int ID_VERIFYTRANSFORMSINFOPROFILE = 1; + + /** + * Gets the type of transformation information contained in this object. + * + * @return The type of transformation information, either + * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE or + * ID_VERIFYTRANSFORMSINFOPROFILE. + */ + public int getVerifyTransformsInfoProfileType(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java new file mode 100644 index 000000000..ff19683da --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileExplicit.java @@ -0,0 +1,25 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import java.util.List; + +/** + * Encapsulates explicit transformation information. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyTransformsInfoProfileExplicit extends VerifyTransformsInfoProfile { + /** + * Gets the XMLDSig transforms element. + * + * @return The List of Transforms. + */ + public List getTransforms(); + /** + * Gets the transformation parameters. + * + * @return The transformation parameters. + */ + public List getTransformParameters(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java new file mode 100644 index 000000000..0df3664da --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyTransformsInfoProfileID.java @@ -0,0 +1,18 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +/** + * Encapsulates transformation info id for signature verification. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyTransformsInfoProfileID extends VerifyTransformsInfoProfile { + /** + * Gets the identifier referencing the transformation info. + * + * @return The identifier referencing the transformation info. + */ + public String getVerifyTransformsInfoProfileID(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java new file mode 100644 index 000000000..eb71f500b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureRequest.java @@ -0,0 +1,55 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import java.util.Date; +import java.util.List; + + +/** + * Object that encapsulates a request to verify an XML signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyXMLSignatureRequest { + /** + * Gets the date and time for which the signature verification has to + * be performed. + * + * @return Date and time for which the signature verification has + * to be performed. + */ + public Date getDateTime(); + /** + * Gets the signature to be verified. + * + * @return The signature to be verified. + */ + public VerifySignatureInfo getSignatureInfo(); + /** + * Gets the supplemental information. + * + * @return The supplemental information. + */ + public List getSupplementProfiles(); + /** + * Gets parameters for Security Layer signature verification. + * + * @return Parameters for Security Layer signature verification. + */ + public SignatureManifestCheckParams getSignatureManifestCheckParams(); + /** + * Checks, whether actually signed data shall be returned. + * + * @return true, if signed data will be returned, + * otherwise false. + */ + public boolean getReturnHashInputData(); + /** + * Gets the profile id of the set of trusted certificates to be used for + * signature verification. + * + * @return The id of the trusted certificates. + */ + public String getTrustProfileId(); +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java new file mode 100644 index 000000000..14ac71e67 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/api/xmlverify/VerifyXMLSignatureResponse.java @@ -0,0 +1,60 @@ +package at.gv.egovernment.moa.spss.api.xmlverify; + +import java.util.List; + +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; + +/** + * Object that encapsulates the response on a request to verify an XML + * signature. + * + * @author Patrick Peck + * @author Stephan Grill + * @version $Id$ + */ +public interface VerifyXMLSignatureResponse { + /** + * Gets a SignerInfo element according to XMLDSig. + * + * @return A SignerInfo element according to XMLDSig. + */ + public SignerInfo getSignerInfo(); + /** + * Gets datas signed by the signatory. + * + * @return The signed datas. + */ + public List getHashInputDatas(); + /** + * Gets source datas elements. + * + * @return The source datas elements. + */ + public List getReferenceInputDatas(); + /** + * Gets the result of the signature verification. + * + * @return The result of the signature verification. + */ + public ReferencesCheckResult getSignatureCheck(); + /** + * Gets the result of the signature manifest verification. + * + * @return The result of the signature manifest verification. + */ + public ReferencesCheckResult getSignatureManifestCheck(); + /** + * Gets XMLDSigManifestCheck elements. + * + * @return The XMLDSigManifestCheck elements. + */ + public List getXMLDsigManifestChecks(); + /** + * Gets the result of the certification verification. + * + * @return The result of the certificate verification. + */ + public CheckResult getCertificateCheck(); + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/overview.htm b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/overview.htm new file mode 100644 index 000000000..9b17bbf91 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/overview.htm @@ -0,0 +1,155 @@ + + + + + + +MOA SP/SS API documentation overview. + + +

Using the MOA SP/SS API

+ +

Invoking the services

+In general, invoking the MOA SP/SS API involves the following steps: +
    +
  1. Set the moa.spss.server.configuration system property to point +to the main MOA SP/SS configuration file. This needs to be done only once per +JVM instance. You may also call +{@link at.gv.egovernment.moa.spss.api.Configurator#init} at this point to +pre-initialize MOA SP/SS (if not, it is done automatically upon service +invocation).
  2. +
  3. Create an instance of the service to be used +({@link at.gv.egovernment.moa.spss.api.SignatureCreationService} or +{@link at.gv.egovernment.moa.spss.api.SignatureVerificationService}), +via its getInstance() method.
  4. +
  5. Create an instance of the +{@link at.gv.egovernment.moa.spss.api.SPSSFactory}, via its +{@link at.gv.egovernment.moa.spss.api.SPSSFactory#getInstance} method.
  6. +
  7. Use the create... methods of the SPSSFactory to +create the desired {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest}, +{@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest} or +{@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest} object. +
  8. +
  9. Call one of the service methods: +{@link at.gv.egovernment.moa.spss.api.SignatureCreationService#createXMLSignature(at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest) createXMLSignature()}, +{@link at.gv.egovernment.moa.spss.api.SignatureVerificationService#verifyCMSSignature(at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest) verifyCMSSignature()} or +{@link at.gv.egovernment.moa.spss.api.SignatureVerificationService#verifyXMLSignature(at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest) verifyXMLSignature()}. +
  10. +
  11. Analyze the result of the service call, given as a +{@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse}, +{@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse} or +{@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse}. +In case of an error, a {@link at.gv.egovernment.moa.spss.MOAException} +is thrown by the service. Please be aware that errors during signature creation +are reported as part of a CreateXMLSignatureResponse. +
+ +

Creating MOA SP/SS API objects

+

+Invoking the MOA SP/SS API Service classes involves creating +a Request object using the {@link at.gv.egovernment.moa.spss.api.SPSSFactory SPSSFactory}. +Object creation using the SPSSFactory is always bottom-up, meaning +that in order to create an object all of its components must have been created +before. +

+

+The names of the MOA SP/SS API classes have been chosen to correspond to the +MOA SP/SS schema elements. The structure of the classes (i.e., their fields) +also corresponds to the structure of the respective MOA SP/SS schema elements. +However, a few classes escape this naming convention, mainly because the +corresponding schema elements contain xsd:choice components: +

    +
  • The various Profile classes have subclasses called +ProfileID and ProfileExplicit +(e.g., {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID} and +{@link at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit}), +so that the profile can be given either as an ID (which is to be resolved from the +MOA SP/SS configuration) or explicitly.
  • +
  • The classes {@link at.gv.egovernment.moa.spss.api.common.Content}, +{@link at.gv.egovernment.moa.spss.api.cmsverify.CMSContent} and +{@link at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter} have +subclasses specifying the type of content they actually contain. E.g., +{@link at.gv.egovernment.moa.spss.api.common.ContentBinary} will contain +a byte stream.
  • +
+ +

+

+For clarity, the MOA SP/SS API classes have been organized in several packages +listed in the following table: +

+ + + + + + + + + + + + + + + + + + + + + +
PackagePurpose
{@link at.gv.egovernment.moa.spss.api.xmlsign}Components of the {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest} and + {@link at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse}
{@link at.gv.egovernment.moa.spss.api.cmsverify}Components of the + {@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest} and + {@link at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse}
{@link at.gv.egovernment.moa.spss.api.xmlverify}Components of the + {@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest} and + {@link at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse}
{@link at.gv.egovernment.moa.spss.api.common}Common components used across the classes of the above packages
+ +

Converting MOA SP/SS API objects to and from DOM trees

+The package {@link at.gv.egovernment.moa.spss.api.xmlbind} contains helper +classes to: +
    +
  • Parse a DOM tree containing a CreateXMLSignatureRequest, +VerifyCMSSignatureRequest or +VerifyCMSSignatureRequest into its respective MOA SP/SS API object +representation. For example, to parse a CreateXMLSignatureRequest +DOM tree, the {@link at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser#parse(org.w3c.dom.Element) CreateXMLSignatureRequestParser.parse()} +method can be used.
    +Note: The DOM tree of the request must be derived from a schema valid +XML document. Otherwise, unexpected behaviour will almost certainly result.
  • +
  • Build a CreateXMLSignatureResponse, +VerifyCMSSignatureResponse or a +VerifyXMLSignatureResponse DOM tree from the respective MOA SP/SS +API object. For example, to build a VerifyXMLSignatureResponse +DOM tree, the {@link at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder#build(at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse) VerifyXMLSignatureResponseBuilder.build()} +can be used.
    +Note:The serialized DOM tree will be schema valid. +
  • +
+The DOM trees can easily be read from and written to XML byte streams using +the methods in the {@link at.gv.egovernment.moa.util.DOMUtils} class. +
+ +

Utilities and Logging

+

The packages {@link at.gv.egovernment.moa.util} and +{@link at.gv.egovernment.moa.spss.util} contain utility classes developed for +the MOA SP/SS implementation. Since the classes contained in these packages are +tailored towards the MOA SP/SS implementation, they are far from being complete +in the sense of providing a utility class library. Therefore, they may or may +not prove useful in the context of your application. Their interfaces may also +change in future releases. +

+ +

The package {@link at.gv.egovernment.moa.logging} contains classes for +logging messages to the MOA SP/SS log hierarchy via the +{@link at.gv.egovernment.moa.logging.Logger} class. +

+ +

Related Documentation

+ +See also the API example in the +MOA SP/SS documentation. + + + \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java new file mode 100644 index 000000000..bd78012ef --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/CRLDistributionPoint.java @@ -0,0 +1,165 @@ +package at.gv.egovernment.moa.spss.server.config; + +import iaik.pki.revocation.RevocationSourceTypes; + +import java.util.HashMap; +import java.util.Map; +import java.util.StringTokenizer; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; + +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * A class representing a CRL distribution point. + * + * @author Sven Aigner + * @author Patrick Peck + * @version $Id$ + */ +public class CRLDistributionPoint + extends DistributionPoint + implements iaik.pki.revocation.CRLDistributionPoint +{ + + private static Map RC_MAPPING = new HashMap(); + + static { + + // create the mapping between reason code strings and their integer values + RC_MAPPING.put( + "unused", + new Integer(iaik.asn1.structures.DistributionPoint.unused)); + RC_MAPPING.put( + "keyCompromise", + new Integer(iaik.asn1.structures.DistributionPoint.keyCompromise)); + RC_MAPPING.put( + "cACompromise", + new Integer(iaik.asn1.structures.DistributionPoint.cACompromise)); + RC_MAPPING.put( + "affiliationChanged", + new Integer(iaik.asn1.structures.DistributionPoint.affiliationChanged)); + RC_MAPPING.put( + "superseded", + new Integer(iaik.asn1.structures.DistributionPoint.superseded)); + RC_MAPPING.put( + "cessationOfOperation", + new Integer(iaik.asn1.structures.DistributionPoint.cessationOfOperation)); + RC_MAPPING.put( + "certificateHold", + new Integer(iaik.asn1.structures.DistributionPoint.certificateHold)); + RC_MAPPING.put( + "privilegeWithdrawn", + new Integer(iaik.asn1.structures.DistributionPoint.privilegeWithdrawn)); + RC_MAPPING.put( + "aACompromise", + new Integer(iaik.asn1.structures.DistributionPoint.aACompromise)); + } + + /** + * The name of the CA issuing the CRL referred to by this DP. + */ + private String issuerName_; + + /** + * The reason codes applicable for the distribution point. + */ + private int reasonCodes; + + /** + * Create a CRLDistributionPoint. + * + * @param issuerName The name of the CA issuing the CRL referred to by this DP. + * + * @param uri The URI of the distribution point. + * + * @param reasonCodeStr A list of reason codes (a space-separated enumeration). + */ + public CRLDistributionPoint(String issuerName, String uri, String reasonCodeStr) + { + super(uri); + issuerName_ = issuerName; + this.reasonCodes = extractReasonCodes(reasonCodeStr); + } + + /** + * @see DistributionPoint#getType() + */ + public String getType() + { + return RevocationSourceTypes.CRL; + } + + /** + * Convert a list of reason codes provided as a String to a + * binary representation. + * + * @param reasonCodeStr A String containing a blank-separated, + * textual representation of reason codes. + * @return int A binary representation of reason codes. + * @see iaik.asn1.structures.DistributionPoint + */ + private int extractReasonCodes(String reasonCodeStr) { + int codes = 0; + StringTokenizer tokenizer = new StringTokenizer(reasonCodeStr); + String token; + Integer reasonCode; + + while (tokenizer.hasMoreTokens()) { + token = tokenizer.nextToken(); + reasonCode = (Integer) RC_MAPPING.get(token); + if (reasonCode != null) { + codes |= reasonCode.intValue(); + } else { + MessageProvider msg = MessageProvider.getInstance(); + Logger.warn( + new LogMsg(msg.getMessage("config.07", new Object[] { token }))); + } + } + + // If reasonCodeStr is empty, set all possible reason codes + if (codes == 0) codes = + iaik.asn1.structures.DistributionPoint.unused | + iaik.asn1.structures.DistributionPoint.keyCompromise | + iaik.asn1.structures.DistributionPoint.cACompromise | + iaik.asn1.structures.DistributionPoint.affiliationChanged | + iaik.asn1.structures.DistributionPoint.superseded | + iaik.asn1.structures.DistributionPoint.cessationOfOperation | + iaik.asn1.structures.DistributionPoint.certificateHold | + iaik.asn1.structures.DistributionPoint.privilegeWithdrawn | + iaik.asn1.structures.DistributionPoint.aACompromise; + + return codes; + } + + /** + * Return a binary representation of the reason codes of this distribution + * point. + * + * @return The binary representation of the reason codes. + */ + public int getReasonCodes() { + return reasonCodes; + } + + /** + * Return a String representation of this distribution point. + * + * @return The String representation of this distribution point. + * @see java.lang.Object#toString() + */ + public String toString() { + return "(DistributionPoint - " + + ("URI<" + getUri()) + + ("> REASONCODES<" + getReasonCodes() + ">)"); + } + + /** + * @see iaik.pki.revocation.CRLDistributionPoint#getIssuerName() + */ + public String getIssuerName() + { + return issuerName_; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java new file mode 100644 index 000000000..4c2b3aea3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationException.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.spss.server.config; + +import at.gv.egovernment.moa.spss.MOASystemException; + +/** + * Exception signalling an error in the configuration. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ConfigurationException extends MOASystemException { + + /** + * Create a ConfigurationException. + * + * @see at.gv.egovernment.moa.spss.MOAException#MOAException(String, Object[]) + */ + public ConfigurationException(String messageId, Object[] parameters) { + super(messageId, parameters); + } + + /** + * Create a ConfigurationException. + * @see at.gv.egovernment.moa.spss.MOAException#MOAException(String, Object[], Throwable) + */ + public ConfigurationException( + String messageId, + Object[] parameters, + Throwable wrapped) { + + super(messageId, parameters, wrapped); + } + +} 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 new file mode 100644 index 000000000..14ceb71cd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java @@ -0,0 +1,1239 @@ +package at.gv.egovernment.moa.spss.server.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.net.MalformedURLException; +import java.security.Principal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Attr; +import org.w3c.dom.Element; +import org.w3c.dom.traversal.NodeIterator; + +import org.xml.sax.SAXException; + +import iaik.ixsil.exceptions.URIException; +import iaik.ixsil.util.URI; +import iaik.pki.pathvalidation.ChainingModes; +import iaik.pki.revocation.RevocationSourceTypes; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * A class that builds configuration data from a DOM based representation. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ConfigurationPartsBuilder { + + // + // XPath namespace prefix shortcuts + // + + private static final String CONF = Constants.MOA_CONFIG_PREFIX + ":"; + private static final String DSIG = Constants.DSIG_PREFIX + ":"; + + // + // chaining mode constants appearing in the configuration file + // + + private static final String CM_CHAINING = "chaining"; + private static final String CM_PKIX = "pkix"; + + // + // XPath expressions to select certain parts of the configuration + // + + private static final String ROOT = "/" + CONF + "MOAConfiguration/"; + + private static final String DIGEST_METHOD_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "XMLDSig/" + + CONF + "DigestMethodAlgorithm"; + private static final String C14N_ALGORITHM_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "XMLDSig/" + + CONF + "CanonicalizationAlgorithm"; + private static final String HARDWARE_CRYPTO_MODULE_XPATH = + ROOT + CONF + "Common/" + + CONF + "HardwareCryptoModule"; + private static final String HARDWARE_KEY_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "KeyModules/" + + CONF + "HardwareKeyModule"; + private static final String SOFTWARE_KEY_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "KeyModules/" + + CONF + "SoftwareKeyModule"; + private static final String KEYGROUP_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "KeyGroup"; + private static final String KEYGROUP_MAPPING_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "KeyGroupMapping"; + private static final String ISSUER_XPATH = + DSIG + "X509IssuerName"; + private static final String SERIAL_XPATH = + DSIG + "X509SerialNumber"; + private static final String CERTSTORE_LOCATION_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "PathConstruction/" + + CONF + "CertificateStore/" + + CONF + "DirectoryStore/" + + CONF + "Location"; + private static final String AUTO_ADD_CERTIFICATES_XPATH_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "PathConstruction/" + + CONF + "AutoAddCertificates"; + private static final String USE_AUTHORITY_INFO_ACCESS_XPATH_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "PathConstruction/" + + CONF + "UseAuthorityInformationAccess"; + private static final String CHAINING_MODES_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "PathValidation/" + + CONF + "ChainingMode"; + private static final String CHAINING_MODES_DEFAULT_XPATH = + CHAINING_MODES_XPATH + "/" + + CONF + "DefaultMode"; + private static final String TRUST_ANCHOR_XPATH = + CHAINING_MODES_XPATH + "/" + + CONF + "TrustAnchor"; + private static final String TRUST_PROFILE_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "PathValidation/" + + CONF + "TrustProfile"; + private static final String DISTRIBUTION_POINTS_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "DistributionPoint"; + private static final String ENABLE_REVOCATION_CHECKING_XPATH_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "EnableChecking"; + private static final String MAX_REVOCATION_AGE_XPATH_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "MaxRevocationAge"; + private static final String REVOCATION_SERVICEORDER_XPATH_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "ServiceOrder/" + + CONF + "Service"; + private static final String ENABLE_ARCHIVING_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "Archiving/" + + CONF + "EnableArchiving"; + private static final String CRL_ARCHIVE_DURATION_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "Archiving/" + + CONF + "ArchiveDuration"; + private static final String ACHIVE_JDBC_URL_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "Archiving/" + + CONF + "Archive/" + + CONF + "DatabaseArchive/" + + CONF + "JDBCURL"; + private static final String ACHIVE_JDBC_DRIVER_CLASS_ = + ROOT + CONF + "SignatureVerification/" + + CONF + "CertificateValidation/" + + CONF + "RevocationChecking/" + + CONF + "Archiving/" + + CONF + "Archive/" + + CONF + "DatabaseArchive/" + + CONF + "JDBCDriverClassName"; + private static final String CREATE_TRANSFORMS_INFO_PROFILE_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "CreateTransformsInfoProfile"; + private static final String CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH = + ROOT + CONF + "SignatureCreation/" + + CONF + "CreateSignatureEnvironmentProfile"; + private static final String VERIFY_TRANSFORMS_INFO_PROFILE_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "VerifyTransformsInfoProfile"; + private static final String SUPPLEMENT_PROFILE_XPATH = + ROOT + CONF + "SignatureVerification/" + + CONF + "SupplementProfile"; + + // + // default values for configuration parameters + // + + /** The accepted canonicalization algorithm URIs, as an array */ + private static final String[] ACCEPTED_C14N_ALGORITHMS_ARRAY = + { + Constants.C14N_URI, + Constants.C14N_WITH_COMMENTS_URI, + Constants.EXC_C14N_URI, + Constants.EXC_C14N_WITH_COMMENTS_URI }; + + /** The accepted canonicalization algorithm URIs, as a Set */ + private static final Set ACCEPTED_C14N_ALGORITHMS = + new HashSet(Arrays.asList(ACCEPTED_C14N_ALGORITHMS_ARRAY)); + + /** Default canonicalization algorithm, if none/illegal has been configured */ + private static final String C14N_ALGORITHM_DEFAULT = Constants.C14N_URI; + + /** The accepted digest method algorithm URIs, as an array */ + private static final String[] ACCEPTED_DIGEST_ALGORITHMS_ARRAY = + { Constants.SHA1_URI }; + + /** The accepted digest method algorithm URIs, as a Set */ + private static final Set ACCEPTED_DIGEST_ALGORITHMS = + new HashSet(Arrays.asList(ACCEPTED_DIGEST_ALGORITHMS_ARRAY)); + + /** Default digest algorithm URI, if none/illegal has been configured */ + private static final String DIGEST_ALGORITHM_DEFAULT = Constants.SHA1_URI; + + /** The root element of the MOA configuration */ + private Element configElem; + + /** + * The directory containing the underlying configuration file. + */ + private File configRoot_; + + /** Whether any warnings were encountered building the configuration. */ + private List warnings = new ArrayList(); + + /** + * Create a new ConfigurationPartsBuilder. + * + * @param configElem The root element of the MOA configuration. + * + * @param configRoot The directory containing the underlying configuration file. + */ + public ConfigurationPartsBuilder(Element configElem, File configRoot) + { + this.configElem = configElem; + configRoot_ = configRoot; + } + + /** + * Returns the root element of the MOA configuration. + * + * @return The root element of the MOA configuration. + */ + public Element getConfigElem() { + return configElem; + } + + /** + * Returns the directory containing the underlying configuration file. + * + * @return the directory containing the underlying configuration file. + */ + public File getConfigRoot() + { + return configRoot_; + } + + /** + * Returns the warnings encountered during building the configuration. + * + * @return A List of Strings, containing the + * warning messages. + */ + public List getWarnings() { + return warnings; + } + + /** + * Returns the digest method algorithm name. + * + * @return The digest method algorithm name from the configuration. + */ + public String getDigestMethodAlgorithmName() + { + String digestMethod = getElementValue(getConfigElem(), DIGEST_METHOD_XPATH, null); + + if (digestMethod == null || !ACCEPTED_DIGEST_ALGORITHMS.contains(digestMethod)) + { + info( + "config.23", + new Object[] { "DigestMethodAlgorithm", DIGEST_ALGORITHM_DEFAULT }); + digestMethod = DIGEST_ALGORITHM_DEFAULT; + } + + return digestMethod; + } + + /** + * Returns the canonicalization algorithm name. + * + * @return The canonicalization algorithm name from the configuration. + */ + public String getCanonicalizationAlgorithmName() + { + String c14nAlgorithm = getElementValue(getConfigElem(), C14N_ALGORITHM_XPATH, null); + + if (c14nAlgorithm == null || !ACCEPTED_C14N_ALGORITHMS.contains(c14nAlgorithm)) + { + info( + "config.23", + new Object[] { "CanonicalizationAlgorithm", C14N_ALGORITHM_DEFAULT }); + c14nAlgorithm = C14N_ALGORITHM_DEFAULT; + } + + return c14nAlgorithm; + } + + /** + * Build the configured hardware crypto modules. + * + * @return The hardware crypto modules from the configuration. + */ + public List buildHardwareCryptoModules() + { + List modules = new ArrayList(); + NodeIterator modIter = XPathUtils.selectNodeIterator( + getConfigElem(), + HARDWARE_CRYPTO_MODULE_XPATH); + + Element modElem; + while ((modElem = (Element) modIter.nextNode()) != null) { + String name = getElementValue(modElem, CONF + "Name", null); + String slotId = getElementValue(modElem, CONF + "SlotId", null); + String userPIN = getElementValue(modElem, CONF + "UserPIN", null); + HardwareCryptoModule module = new HardwareCryptoModule(name, slotId, userPIN); + modules.add(module); + } + + return modules; + } + + /** + * Build the configured hardware keys. + * + * @param keyModules The keyModules that the configuration already knows about. To + * prevent multiple key modules with the same ID. + * @return The hardware keys contained in the configuration. + */ + public List buildHardwareKeyModules(List keyModules) + { + Set existingIds = toIdSet(keyModules); + List hardwareKeys = new ArrayList(); + NodeIterator hkIter = + XPathUtils.selectNodeIterator(getConfigElem(), HARDWARE_KEY_XPATH); + Element keyElem; + + while ((keyElem = (Element) hkIter.nextNode()) != null) + { + String id = getElementValue(keyElem, CONF + "Id", null); + String name = getElementValue(keyElem, CONF + "Name", null); + String slotId = getElementValue(keyElem, CONF + "SlotId", null); + String userPIN = getElementValue(keyElem, CONF + "UserPIN", null); + + if (existingIds.contains(id)) + { + warn( + "config.04", + new Object[] { "Hardware- oder SoftwareKeyModule", id }); + } + else + { + KeyModule key = new HardwareKeyModule(id, name, slotId, userPIN); + hardwareKeys.add(key); + existingIds.add(id); + } + + } + + return hardwareKeys; + } + + /** + * Build the configured software keys. + * + * @param keyModules The keyModules that the configuration already knows about. To + * prevent multiple key modules with the same ID. + * + * @return The software keys contained in the configuration. + */ + public List buildSoftwareKeyModules(List keyModules) + { + Set existingIds = toIdSet(keyModules); + List softwareKeys = new ArrayList(); + NodeIterator skIter = + XPathUtils.selectNodeIterator(getConfigElem(), SOFTWARE_KEY_XPATH); + + Element keyElem; + while ((keyElem = (Element) skIter.nextNode()) != null) + { + String id = getElementValue(keyElem, CONF + "Id", null); + String fileName = getElementValue(keyElem, CONF + "FileName", null); + String passWord = getElementValue(keyElem, CONF + "Password", null); + + if (existingIds.contains(id)) + { + warn( + "config.04", + new Object[] { "Hardware- oder SoftwareKeyModule", id }); + } + else + { + File keyFile; + KeyModule key; + + // make keyFile absolute + keyFile = new File(fileName); + if (!keyFile.isAbsolute()) { + keyFile = new File(configRoot_, fileName); + } + + // check for existence + if (!keyFile.exists() || keyFile.isDirectory()) { + warn("config.25", new Object[] { id, keyFile.getAbsolutePath()}); + } else { + // create a new key module + key = new SoftwareKeyModule(id, keyFile.getAbsolutePath(), passWord); + softwareKeys.add(key); + existingIds.add(id); + } + } + } + + return softwareKeys; + } + + /** + * Build the key group configuration. + * + * @param keyModules The KeyModules that the configuration + * knows about. Used to check for errors in the configuration. + * @return The mapping between key group IDs and key groups. + */ + public Map buildKeyGroups(List keyModules) + { + Set keyModuleIds = toIdSet(keyModules); + Map keyGroups = new HashMap(); + NodeIterator kgIter; + Element keyGroupElem; + + // select all KeyGroup elements and build the KeyGroup objects from them + kgIter = XPathUtils.selectNodeIterator(getConfigElem(), KEYGROUP_XPATH); + while ((keyGroupElem = (Element) kgIter.nextNode()) != null) + { + String keyGroupId = getElementValue(keyGroupElem, CONF + "Id", null); + Set keyGroupEntries = + buildKeyGroupEntries(keyGroupId, keyModuleIds, keyGroupElem); + KeyGroup keyGroup = new KeyGroup(keyGroupId, keyGroupEntries); + + if (keyGroups.containsKey(keyGroupId)) + { + warn("config.04", new Object[] { "KeyGroup", keyGroupId }); + } + else + { + keyGroups.put(keyGroup.getId(), keyGroup); + } + } + + return keyGroups; + } + + /** + * Return the set of IDs contained in the given KeyModules. + * + * @param keyModules The KeyModules from which to extract the + * IDs. + * @return The IDs from the given KeyModules. + */ + private Set toIdSet(List keyModules) { + Set ids = new HashSet(); + Iterator iter; + + for (iter = keyModules.iterator(); iter.hasNext();) { + KeyModule keyModule = (KeyModule) iter.next(); + ids.add(keyModule.getId()); + } + + return ids; + } + + /** + * Build the key entries belonging to a key group. + * + * @param keyGroupId The ID of the key group we are building here. Passed + * for logging purposes. + * @param keyModuleIds The IDs of the HardwareKeyModules and + * SoftwareKeyModules that exist in the configuration. + * @param keyGroupElem The KeyGroup DOM element to parse. + * @return A Set of KeyGroupEntry objects. + */ + private Set buildKeyGroupEntries( + String keyGroupId, + Set keyModuleIds, + Element keyGroupElem) { + + Set entries = new HashSet(); + NodeIterator keyEntryIter; + Element keyEntryElem; + + // select all Key elements and put them into the Map + keyEntryIter = XPathUtils.selectNodeIterator(keyGroupElem, CONF + "Key"); + while ((keyEntryElem = (Element) keyEntryIter.nextNode()) != null) + { + String keyModuleId = getElementValue(keyEntryElem, CONF + "KeyModuleId", ""); + Element keyCertElem = (Element) XPathUtils.selectSingleNode(keyEntryElem, CONF + "KeyCertIssuerSerial"); + IssuerAndSerial issuerSerial = buildIssuerAndSerial(keyCertElem); + + if (!keyModuleIds.contains(keyModuleId)) { + warn("config.26", new Object[] { keyGroupId, keyModuleId }); + } else if (issuerSerial != null) { + KeyGroupEntry entry = new KeyGroupEntry(keyModuleId, issuerSerial); + entries.add(entry); + } + } + return entries; + } + + /** + * Build the key group mapping. + * + * @param keyGroups The available key groups. + * @param anonymous The IssuerAndSerial to be used for key group + * mappings not protected by a certificate. + * @return The key group mapping. + */ + public Map buildKeyGroupMappings(Map keyGroups, IssuerAndSerial anonymous) { + Map mappings = new HashMap(); + NodeIterator mappingIter; + Element mappingElem; + + // select all KeyGroupMapping elements + mappingIter = + XPathUtils.selectNodeIterator(getConfigElem(), KEYGROUP_MAPPING_XPATH); + + // build the mapping for each KeyGroupMapping element + while ((mappingElem = (Element) mappingIter.nextNode()) != null) + { + Element issuerSerialElem = (Element) XPathUtils.selectSingleNode(mappingElem, CONF + "CustomerId"); + + // build the IssuerAndSerial who has access to the key groups + IssuerAndSerial issuerAndSerial; + if (issuerSerialElem != null) + { + issuerAndSerial = buildIssuerAndSerial(issuerSerialElem); + } + else + { + // IssuerSerial element: the keygroup is generally available + issuerAndSerial = anonymous; + } + + // add the key groups to the mappings + if (issuerAndSerial != null) { + Map groups = (Map) mappings.get(issuerAndSerial); + NodeIterator keyGroupIter; + Element keyGroupElem; + + if (groups == null) + { + // no mapping exist -> build one + groups = new HashMap(); + mappings.put(issuerAndSerial, groups); + } + + // select the available key groups and add them to the mapping + keyGroupIter = XPathUtils.selectNodeIterator(mappingElem, CONF + "KeyGroupId"); + while ((keyGroupElem = (Element) keyGroupIter.nextNode()) != null) + { + String keyGroupId = getElementValue(keyGroupElem, ".", null); + KeyGroup keyGroup = (KeyGroup) keyGroups.get(keyGroupId); + + if (keyGroup != null) + { + groups.put(keyGroupId, keyGroup); + } else + { + warn("config.00", new Object[] { keyGroupId }); + } + } + } + } + + return mappings; + } + + /** + * Returns the default chaining mode from the configuration. + * + * @return The default chaining mode. + */ + public String getDefaultChainingMode() + { + String defaultChaining = getElementValue( + getConfigElem(), + CHAINING_MODES_DEFAULT_XPATH, + CM_PKIX); + + return translateChainingMode(defaultChaining); + + } + + /** + * Build the chaining modes for all configured trust anchors. + * + * @return The mapping from trust anchors to chaining modes. + */ + public Map buildChainingModes() + { + Map chainingModes = new HashMap(); + NodeIterator trustIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_ANCHOR_XPATH); + + Element trustAnchorElem; + while ((trustAnchorElem = (Element) trustIter.nextNode()) != null) + { + IssuerAndSerial issuerAndSerial = buildIssuerAndSerial( + (Element)XPathUtils.selectSingleNode(trustAnchorElem, CONF + "Identification")); + String mode = getElementValue(trustAnchorElem, CONF + "Mode", null); + + if (issuerAndSerial != null) + { + chainingModes.put(issuerAndSerial, translateChainingMode(mode)); + } + } + + return chainingModes; + } + + /** + * Build an IssuerAndSerial from the DOM representation. + * + * @param root The root element (being of type dsig: + * X509IssuerSerialType. + * @return The issuer and serial number contained in the root + * element or null if could not be built for any reason. + */ + private IssuerAndSerial buildIssuerAndSerial(Element root) { + String issuer = getElementValue(root, ISSUER_XPATH, null); + String serial = getElementValue(root, SERIAL_XPATH, null); + + if (issuer != null && serial != null) { + try { + RFC2253NameParser nameParser = new RFC2253NameParser(issuer); + Principal issuerDN = nameParser.parse(); + + return new IssuerAndSerial(issuerDN, new BigInteger(serial)); + } catch (RFC2253NameParserException e) { + warn("config.16", new Object[] { issuer, serial }, e); + return null; + } catch (NumberFormatException e) { + warn("config.16", new Object[] { issuer, serial }, e); + return null; + } + } + return null; + } + + /** + * Translate the chaining mode from the configuration file to one used in the + * IAIK MOA API. + * + * @param chainingMode The chaining mode from the configuration. + * @return The chaining mode as provided by the ChainingModes + * interface. + * @see iaik.pki.pathvalidation.ChainingModes + */ + private String translateChainingMode(String chainingMode) { + if (chainingMode.equals(CM_CHAINING)) { + return ChainingModes.CHAIN_MODE; + } else if (chainingMode.equals(CM_PKIX)) { + return ChainingModes.PKIX_MODE; + } else { + return ChainingModes.PKIX_MODE; + } + } + + /** + * Build the distribution points mapping. + * + * @return The mapping from certificate authorities to distribution points. + */ + public Map buildDistributionPoints() + { + Map dPs = new HashMap(); + NodeIterator dPIter; + Element dPElem; + + // select all DistributionPoint elements + dPIter = XPathUtils.selectNodeIterator(getConfigElem(), DISTRIBUTION_POINTS_XPATH); + + // build the mapping of CA name to distribution points + while ((dPElem = (Element) dPIter.nextNode()) != null) { + String caIssuerDNText = getElementValue(dPElem, CONF + "CAIssuerDN", ""); + RFC2253NameParser nameParser = new RFC2253NameParser(caIssuerDNText); + NodeIterator cRLDPIter = XPathUtils.selectNodeIterator(dPElem, CONF + "CRLDP"); + NodeIterator oCSPDPPIter = XPathUtils.selectNodeIterator(dPElem, CONF + "OCSPDP"); + + try + { + String caIssuerDN = nameParser.parse().getName(); + + // check, if a mapping exists or make a new mapping + Set dPsForCA = (Set) dPs.get(caIssuerDN); + if (dPsForCA == null) + { + dPsForCA = new HashSet(); + dPs.put(caIssuerDN, dPsForCA); + } + + // add the CRL distribution points of this CA to the set + Element cRLDPElem; + while ((cRLDPElem = (Element) cRLDPIter.nextNode()) != null) + { + CRLDistributionPoint cRLDP = (CRLDistributionPoint) buildDistributionPoint(cRLDPElem, caIssuerDN); + dPsForCA.add(cRLDP); + } + + // add the OCSP distribution points of this CA to the set + Element oCSPPElem; + while ((oCSPPElem = (Element) oCSPDPPIter.nextNode()) != null) + { + OCSPDistributionPoint oCSPDP = (OCSPDistributionPoint) buildDistributionPoint(oCSPPElem, null); + dPsForCA.add(oCSPDP); + } +} + catch (RFC2253NameParserException e) + { + warn("config.13", new Object[] { caIssuerDNText }, e); + } + + } + + return dPs; + } + + /** + * Build a distribution point from the DOM representation. + * + * @param dpElem The root element of the distribution point. + * + * @param issuerName The name of the CA issuing the CRL referred to by this DP, or null + * if this DP refers to an OCSP responder. + * + * @return The distribution point. + */ + private DistributionPoint buildDistributionPoint(Element dpElem, String issuerName) + { + String uri = getElementValue(dpElem, CONF + "Location", null); + + if ("CRLDP".equals(dpElem.getLocalName())) + { + NodeIterator reasonCodesIter = XPathUtils.selectNodeIterator(dpElem, CONF + "ReasonCode"); + Element reasonCodeElem; + StringBuffer reasonCodesSB = new StringBuffer(); + while ((reasonCodeElem = (Element)reasonCodesIter.nextNode()) != null) + { + if (reasonCodesSB.length() > 0) reasonCodesSB.append(" "); + reasonCodesSB.append(getElementValue(reasonCodeElem, ".", "").trim()); + } + return new CRLDistributionPoint(issuerName, uri, reasonCodesSB.toString()); + } + else + { + return new OCSPDistributionPoint(uri); + } + } + + /** + * Return the CRL archive duration. + * + * @return The value of the CRL archive duration setting from the configuration, or 0 if + * no value is set in the configuration. + */ + public int getRevocationArchiveDuration() + { + String archiveDuration = getElementValue(getConfigElem(), CRL_ARCHIVE_DURATION_XPATH, null); + try + { + return Integer.parseInt(archiveDuration); + } + catch (NumberFormatException e) + { + warn("config.01", null); + return 365; + } + } + + /** + * Build the CreateTransformsInfoProfiles. + * + * @return The mapping from profile ID to profile. + */ + public Map buildCreateTransformsInfoProfiles() + { + return loadProfiles(CREATE_TRANSFORMS_INFO_PROFILE_XPATH, "CreateTransformsInfoProfile"); + } + + /** + * Build the CreateSignatureEnvironmentProfiles. + * + * @return The mapping from profile ID to profile. + */ + public Map buildCreateSignatureEnvironmentProfiles() + { + return loadProfiles(CREATE_SIGNATURE_ENVIRONMENT_PROFILE_XPATH, "CreateSignatureEnvironmentProfile"); + } + + /** + * Build the VerifyTransformsInfoProfiles. + * + * @return The mapping from profile ID to profile. + */ + public Map buildVerifyTransformsInfoProfiles() + { + return loadProfiles(VERIFY_TRANSFORMS_INFO_PROFILE_XPATH, "VerifyTransformsInfoProfile"); + } + + /** + * Build the SupplementProfiles. + * + * @return The mapping from profile ID to profile. + */ + public Map buildSupplementProfiles() + { + return loadProfiles(SUPPLEMENT_PROFILE_XPATH, "SupplementProfile"); + } + + /** + * Load a profile mapping. + * + * @param xpath The XPath to select the profiles from the configuration. + * + * @param profileRoot The name of the profile root element. + * + * @return Map The profile ID to profile mapping. + */ + private Map loadProfiles(String xpath, String profileRoot) + { + Map profiles = new HashMap(); + NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), xpath); + Element profileElem; + + while ((profileElem = (Element) profileIter.nextNode()) != null) + { + String id = getElementValue(profileElem, CONF + "Id", null); + String fileName = getElementValue(profileElem, CONF + "Location", null); + + if (profiles.containsKey(id)) + { + warn("config.04", new Object[] { profileRoot, id }); + } + else + { + try + { + File profileFile = new File(fileName); + + // make profileFile absolute + if (!profileFile.isAbsolute()) profileFile = new File(configRoot_, fileName); + + // load the profile + info("config.22", new Object[] { profileRoot, id, profileFile.getAbsoluteFile()}); + Element profile = loadProfile(profileFile); + + if (profile.getTagName().equals(profileRoot)) + { + profiles.put(id, profile); + } + else + { + warn("config.02", new Object[] { profileRoot, id, fileName }); + } + } catch (ConfigurationException e) { + warn("config.03", new Object[] { profileRoot, id }); + } + } + } + + return profiles; + } + + /** + * Load a profile from a file. + * + * @param root The absolute directory path of the main configuration file. + * @param profileFile The file containing the profile. + * @return The profile in its DOM representation. + * @throws ConfigurationException An error occurred loading the profile. + */ + private Element loadProfile(File profileFile) throws ConfigurationException { + + Element profile; + + try { + profile = parseXml(new FileInputStream(profileFile)); + } catch (Exception e) { + throw new ConfigurationException("config.12", null, e); + } + + return profile; + } + + /** + * Bulid 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 = new TrustProfile(id, trustAnchorsLocURI.toString(), signerCertsLocStr); + trustProfiles.put(id, profile); + } + + return trustProfiles; + } + + /** + * Returns the location of the certificate store. + * + * @return the location of the certificate store. + */ + public String getCertStoreLocation() + { + String certStoreLocStr = getElementValue(getConfigElem(), CERTSTORE_LOCATION_XPATH, null); + File certStoreLocFile; + + // No value specified in configuration file: Set it to a reasonable (absolute) default + if (certStoreLocStr == null) + return new File(configRoot_, "certstore").getAbsolutePath(); + + // Make cert store location an absolute value + certStoreLocFile = new File(certStoreLocStr); + if (!certStoreLocFile.isAbsolute()) + { + certStoreLocFile = new File(configRoot_, certStoreLocStr); + } + + // Check if cert store location exists, eventually try to create it + if (!certStoreLocFile.isDirectory()) + { + boolean created = false; + try + { + created = certStoreLocFile.mkdirs(); + } + finally + { + if (!created) + { + warn("config.32", new Object[] { certStoreLocFile.getAbsolutePath() }); + } + } + } + + return certStoreLocFile.getAbsolutePath(); + } + + // + // various utility methods + // + + /** + * Parse a configuration XML file. + * + * @param inputStream The stream from which to read the XML data. + * @return The DOM representation of the XML data. + * @throws ParserConfigurationException XML parser not configured properly. + * @throws SAXException An error parsing the XML file. + * @throws IOException An error reading the stream. + */ + private static Element parseXml(InputStream inputStream) + throws ParserConfigurationException, SAXException, IOException { + return DOMUtils + .parseDocument(inputStream, true, Constants.ALL_SCHEMA_LOCATIONS, null) + .getDocumentElement(); + } + + /** + * Return the value of an element located by an XPath. + * + * @param root The root element from which to evaluate the xpath. + * @param xpath The XPath pointing to the element. + * @param def The default value, if no element can be found with the given + * xpath. + * @return The element value or def, if the element cannot be + * found. + */ + private String getElementValue(Element root, String xpath, String def) { + + Element elem = (Element) XPathUtils.selectSingleNode(root, xpath); + return elem != null ? DOMUtils.getText(elem) : def; + } + + /** + * Return the value of an attribute located by an XPath. + * + * @param root The root element from which to evaluate the xpath. + * @param xpath The XPath pointing to the attribute. + * @param def The default value, if no attribute can be found with the given + * xpath. + * @return The element value or def, if the attribute cannot be + * found. + */ + private String getAttributeValue(Element root, String xpath, String def) { + Attr attr = (Attr) XPathUtils.selectSingleNode(root, xpath); + return attr != null ? attr.getValue() : def; + } + + /** + * Log an info 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 info(String messageId, Object[] parameters) { + MessageProvider msg = MessageProvider.getInstance(); + Logger.info(new LogMsg(msg.getMessage(messageId, parameters))); + } + + /** + * 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 warn(String messageId, Object[] args) { + MessageProvider msg = MessageProvider.getInstance(); + String txt = msg.getMessage(messageId, args); + + Logger.warn(new LogMsg(txt)); + warnings.add(txt); + } + + /** + * Log a warning. + * + * @param messageId The message ID. + * @param args Additional parameters for the message. + * @param t An exception being the cause of the warning. + * @see at.gv.egovernment.moa.spss.server.util.MessageProvider + */ + private void warn(String messageId, Object[] args, Throwable t) { + MessageProvider msg = MessageProvider.getInstance(); + String txt = msg.getMessage(messageId, args); + + Logger.warn(new LogMsg(txt), t); + warnings.add(txt); + } + + /** + * Returns whether revocation information should be archived. + * + * @return whether revocation information should be archived. + */ + public boolean getEnableRevocationArchiving() + { + String enableArchiving = getElementValue(getConfigElem(), ENABLE_ARCHIVING_XPATH, null); + return Boolean.valueOf(enableArchiving).booleanValue(); + } + + /** + * Returns the JDBC URL for the revocation archive database. + * + * @return the JDBC URL for the revocation archive database, or nullnullConfiguration data is read from an XML file, whose location is given by + * the moa.spss.server.configuration system property.

+ *

This class implements the Singleton pattern. The reload() + * method can be used to update the configuration data. Therefore, it is not + * guaranteed that consecutive calls to getInstance() will return + * the same ConfigurationProvider all the time. During the + * processing of a web service request, the current + * TransactionContext should be used to obtain the + * ConfigurationProvider local to that request.

+ * + * @author Patrick Peck + * @author Sven Aigner + * @version $Id$ + */ +public class ConfigurationProvider +{ + /** + * The name of the system property which contains the file name of the + * configuration file. + */ + public static final String CONFIG_PROPERTY_NAME = + "moa.spss.server.configuration"; + + /** + * A fake IssuerAndSerial object for storing KeyGroup information + * accessible by all clients. + */ + private static final IssuerAndSerial ANONYMOUS_ISSUER_SERIAL = + new IssuerAndSerial(new Name(), new BigInteger("0")); + + /** Singleton instance. null, if none has been created. */ + private static ConfigurationProvider instance; + + // + // configuration data + // + + /** The warnings generated when building the configuration. */ + private List warnings = new ArrayList(); + + /** The default digest method algorithm name */ + private String digestMethodAlgorithmName; + + /** The default canonicalization algorithm name */ + private String canonicalizationAlgorithmName; + + /** + * A List of HardwareCryptoModule objects for + * configuring hardware modules. + */ + private List hardwareCryptoModules; + + /** + * A List of HardwareKey objects containing the + * configuration data for hardware keys. + */ + private List hardwareKeyModules; + + /** + * A List of SoftwareKey objects containing the + * configuration data for software keys. + */ + private List softwareKeyModules; + + /** + * A Map which contains a KeyGroupId (a String) to + * KeyGroup mapping. + */ + private Map keyGroups; + + /** + * A Map which contains the IssuerAndSerial to + * KeyGroup mapping. + */ + private Map keyGroupMappings; + + /** The default chaining mode. */ + private String defaultChainingMode; + + /** + * A Map which contains the IssuerAndSerial to + * chaining mode (a String) mapping. + */ + private Map chainingModes; + + /** + * A Map which contains the CAIssuerDN (a String) + * to distribution points (a Set of + * DistributionPoints) mapping. + */ + private Map distributionPoints; + + /** + * The CRL archive duration. + */ + private int cRLArchiveDuration; + + /** + * Indicates whether revocation information should be archived. + */ + private boolean enableRevocationArchiving_; + + /** + * The location of the certificate store. + */ + private String certStoreLocation_; + + /** + * A Map which contains a mapping from + * CreateSignatureEnvironmentProfile Ids (String) to + * CreateSignatureEnvironmentProfile elements (an Element). + */ + private Map createSignatureEnvironmentProfiles; + + /** + * A Map which contains a mapping from + * CreateTransformsInfoProfile Ids (String) to + * CreateTransformsInfoProfile elements (an Element). + */ + private Map createTransformsInfoProfiles; + + /** + * A Map which contains a mapping from + * VerifyTransformsInfoProfile Ids (String) to + * VerifyTransformsInfoProfile elements (an Element). + */ + private Map verifyTransformsInfoProfiles; + + /** + * A Map which contains a mapping from + * SupplementProfile Ids (String) to SupplementProfile elements + * (an Element). + */ + private Map supplementProfiles; + + /** + * A Map which contains a TrustProfile Id (a String + * to trust profile (a TrustProfile) mapping. + */ + private Map trustProfiles; + + /** + * The JDBC URL for the revocation archive database. + */ + private String revocationArchiveJDBCURL_; + + /** + * The JDBC driver class name for the revocation archive database. + */ + private String revocationArchiveJDBCDriverClass_; + + /** + * Indicates whether revocation checking should be done. + */ + private boolean enableRevocationChecking_; + + /** + * The maximum age of a revocation information for considering it still as valid. + */ + private long maxRevocationAge_; + + /** + * The service order for revocation checking. + */ + private String[] serviceOrder_; + + /** + * Indicates whether certificates found during certificate path construction + * should be added to the certificate store. + */ + private boolean autoAddCertificates_; + + /** + * Indicates whether the certificate extension Authority Info Access should + * be used during certificate path construction. + */ + private boolean useAuthorityInfoAccess_; + + /** + * Return the single instance of configuration data. + * + * @return MOAConfigurationProvider The current configuration data. + * @throws ConfigurationException Failure to load the configuration data. + */ + public static synchronized ConfigurationProvider getInstance() + throws ConfigurationException { + + if (instance == null) { + reload(); + } + return instance; + } + + /** + * Reload the configuration data and set it if successful. + * + * @return MOAConfigurationProvider The loaded configuration data. + * @throws ConfigurationException Failure to load the configuration data. + */ + public static synchronized ConfigurationProvider reload() + throws ConfigurationException { + String fileName = System.getProperty(CONFIG_PROPERTY_NAME); + + if (fileName == null) { + // find out where we are running and use the configuration provided + // under WEB-INF/conf/moa-spss/MOA-SPSSConfiguration + URL url = ConfigurationProvider.class.getResource("/"); + fileName = + new File(url.getPath()).getParent() + + "/conf/moa-spss/MOA-SPSSConfiguration.xml"; + info("config.05", new Object[] { CONFIG_PROPERTY_NAME }); + } + + instance = new ConfigurationProvider(fileName); + return instance; + } + + /** + * Constructor for ConfigurationProvider. + * + * @param fileName The name of the configuration file. + * @throws ConfigurationException An error occurred loading the configuration. + */ + public ConfigurationProvider(String fileName) throws ConfigurationException { + load(fileName); + } + + /** + * Load the configuration data from XML file with the given name and build + * the internal data structures representing the MOA configuration. + * + * @param fileName The name of the XML file to load. + * @throws ConfigurationException The MOA configuration could not be + * read/built. + */ + private void load(String fileName) throws ConfigurationException { + FileInputStream stream = null; + File configFile; + File configRoot; + Element configElem; + ConfigurationPartsBuilder builder; + List allKeyModules; + + + // load the main config file + try { + configFile = new File(fileName); + configRoot = new File(configFile.getParent()); + info("config.21", new Object[] { configFile.getAbsoluteFile()}); + stream = new FileInputStream(fileName); + configElem = DOMUtils.parseXmlValidating(new FileInputStream(fileName)); + } catch (Throwable t) { + throw new ConfigurationException("config.10", null, t); + } + + // build the internal datastructures + try { + builder = new ConfigurationPartsBuilder(configElem, configRoot); + digestMethodAlgorithmName = builder.getDigestMethodAlgorithmName(); + canonicalizationAlgorithmName = + builder.getCanonicalizationAlgorithmName(); + hardwareCryptoModules = builder.buildHardwareCryptoModules(); + hardwareKeyModules = + builder.buildHardwareKeyModules(Collections.EMPTY_LIST); + softwareKeyModules = + builder.buildSoftwareKeyModules(hardwareKeyModules); + allKeyModules = new ArrayList(hardwareKeyModules); + allKeyModules.addAll(softwareKeyModules); + keyGroups = builder.buildKeyGroups(allKeyModules); + keyGroupMappings = + builder.buildKeyGroupMappings(keyGroups, ANONYMOUS_ISSUER_SERIAL); + defaultChainingMode = builder.getDefaultChainingMode(); + chainingModes = builder.buildChainingModes(); + useAuthorityInfoAccess_ = builder.getUseAuthorityInfoAccess(); + autoAddCertificates_ = builder.getAutoAddCertificates(); + trustProfiles = builder.buildTrustProfiles(); + distributionPoints = builder.buildDistributionPoints(); + enableRevocationChecking_ = builder.getEnableRevocationChecking(); + maxRevocationAge_ = builder.getMaxRevocationAge(); + serviceOrder_ = builder.getServiceOrder(); + enableRevocationArchiving_ = builder.getEnableRevocationArchiving(); + cRLArchiveDuration = builder.getRevocationArchiveDuration(); + revocationArchiveJDBCURL_ = builder.getRevocationArchiveJDBCURL(); + revocationArchiveJDBCDriverClass_ = builder.getRevocationArchiveJDBCDriverClass(); + certStoreLocation_ = builder.getCertStoreLocation(); + createTransformsInfoProfiles = builder.buildCreateTransformsInfoProfiles(); + createSignatureEnvironmentProfiles = builder.buildCreateSignatureEnvironmentProfiles(); + verifyTransformsInfoProfiles = builder.buildVerifyTransformsInfoProfiles(); + supplementProfiles = builder.buildSupplementProfiles(); + warnings = new ArrayList(builder.getWarnings()); + } catch (Throwable t) { + throw new ConfigurationException("config.11", null, t); + } finally { + try { + if (stream != null) { + stream.close(); + } + } catch (IOException e) { + // don't complain about this + } + } + } + + /** + * Returns the warnings encountered during building the configuration. + * + * @return A List of Strings, containing the + * warning messages. + */ + public List getWarnings() { + return warnings; + } + + /** + * Return the name of the digest algorithm used during signature creation. + * + * @return The digest method algorithm name, or an empty String, + * if none has been configured. + */ + public String getDigestMethodAlgorithmName() { + return digestMethodAlgorithmName; + } + + /** + * Return the name of the canonicalization algorithm used during signature + * creation. + * + * @return The canonicalization algorithm name, or an empty + * String if none has been configured. + */ + public String getCanonicalizationAlgorithmName() { + return canonicalizationAlgorithmName; + } + + /** + * Return the configured hardware crypto modules. + * + * @return A List of HardwareCryptoModule objects + * containing the hardware crypto module configurations. + */ + public List getHardwareCryptoModules() { + return hardwareCryptoModules; + } + + /** + * Return the hardware key modules configuration. + * + * @return A List of HardwareKeyModule objects + * containing the configuration of the hardware key modules. + */ + public List getHardwareKeyModules() { + return hardwareKeyModules; + } + + /** + * Return the software key module configuration. + * + * @return A List of SoftwareKeyModule objects + * containing the configuration of the software key modules. + */ + public List getSoftwareKeyModules() { + return softwareKeyModules; + } + + /** + * Return the key group mapping. + * + * @return A mapping from key group ID (a String) to + * KeyGroup mapping. + */ + public Map getKeyGroups() { + return keyGroups; + } + + /** + * Return the set of KeyGroupEntrys of a given key group, which a + * client (identified by an issuer/serial pair) may access. + * + * @param issuer The issuer of the client certificate. + * @param serial The serial number of the client certificate. + * @param keyGroupId The ID of the key group. + * @return A Set of all the KeyGroupEntrys in the + * given key group, if the user may access them. Returns null, if + * the user may not access the given key group or if the key group does not + * exist. + */ + public Set getKeyGroupEntries( + Principal issuer, + BigInteger serial, + String keyGroupId) { + + IssuerAndSerial issuerAndSerial; + Map mapping; + + if (issuer == null && serial == null) { + issuerAndSerial = ANONYMOUS_ISSUER_SERIAL; + } else { + issuerAndSerial = new IssuerAndSerial(issuer, serial); + } + + mapping = (Map) keyGroupMappings.get(issuerAndSerial); + if (mapping != null) { + KeyGroup keyGroup = (KeyGroup) mapping.get(keyGroupId); + + if (keyGroup != null) { + return keyGroup.getKeyGroupEntries(); + } + } + + // If no key group is available for a client identified by a certificate, + // try to find a key group in the anonymous key group mapping + if (issuer != null || serial != null) + { + mapping = (Map) keyGroupMappings.get(ANONYMOUS_ISSUER_SERIAL); + if (mapping != null) + { + KeyGroup keyGroup = (KeyGroup) mapping.get(keyGroupId); + if (keyGroup != null) return keyGroup.getKeyGroupEntries(); + } + } + + return null; + } + + /** + * Return the chaining mode for a given trust anchor. + * + * @param trustAnchor The trust anchor for which the chaining mode should be + * returned. + * @return The chaining mode for the given trust anchor. If the trust anchor + * has not been configured separately, the system default will be returned. + */ + public String getChainingMode(X509Certificate trustAnchor) { + Principal issuer = trustAnchor.getIssuerDN(); + BigInteger serial = trustAnchor.getSerialNumber(); + IssuerAndSerial issuerAndSerial = new IssuerAndSerial(issuer, serial); + + String mode = (String) chainingModes.get(issuerAndSerial); + return mode != null ? mode : defaultChainingMode; + } + + /** + * Return the distribution points for a given CA. + * + * @param cert The certificate for which the distribution points should be + * looked up. The issuer information is used to perform the lookup. + * + * @return A Set of DistributionPoint objects. The + * set will be empty, if no distribution points have been configured + * for this certificate. + */ + public Set getDistributionPoints(X509Certificate cert) + { + try { + RFC2253NameParser nameParser = + new RFC2253NameParser(cert.getIssuerDN().toString()); + String caIssuerDN = nameParser.parse().getName(); + Set dps = (Set) distributionPoints.get(caIssuerDN); + + if (dps == null) { + return Collections.EMPTY_SET; + } + return dps; + } catch (RFC2253NameParserException e) { + return Collections.EMPTY_SET; + } + } + + /** + * Return the CRL archive duration. + * + * @return The duration of how long to keep CRL archive entries (measured in + * days). + */ + public int getCRLArchiveDuration() { + return cRLArchiveDuration; + } + + /** + * Returns whether revocation information should be archived. + * + * @return whether revocation information should be archived. + */ + public boolean getEnableRevocationArchiving() + { + return enableRevocationArchiving_; + } + + /** + * Returns the location of the certificate store. + * + * @return the location of the certificate store. + */ + public String getCertStoreLocation() + { + return certStoreLocation_; + } + + /** + * Return a CreateTransformsInfoProfile with the given ID. + * + * @param id The CreateTransformsInfoProfile ID. + * @return The CreateTransformsInfoProfile with the given + * ID or null, if none exists. + */ + public Element getCreateTransformsInfoProfile(String id) { + return (Element) createTransformsInfoProfiles.get(id); + } + + /** + * Return a CreateSignatureEnvironmentProfile with the given ID. + * + * @param id The CreateSignatureEnvironmentProfile ID. + * @return The CreateSignatureEnvironmentProfile with the given + * ID or null, if none exists. + */ + public Element getCreateSignatureEnvironmentProfile(String id) { + return (Element) createSignatureEnvironmentProfiles.get(id); + } + + /** + * Return a VerifyTransformsInfoProfile with the given ID. + * + * @param id The VerifyTransformsInfoProfile ID. + * @return The VerifyTransformsInfoProfile with the given ID or + * null, if none exists. + */ + public Element getVerifyTransformsInfoProfile(String id) { + return (Element) verifyTransformsInfoProfiles.get(id); + } + + /** + * Return a SupplementProfile with the given ID. + * + * @param id The SupplementProfile ID. + * @return The SupplementProfile with the given ID or + * null, if none exists. + */ + public Element getSupplementProfile(String id) { + return (Element) supplementProfiles.get(id); + } + + /** + * Return a TrustProfile with the given ID. + * + * @param id The TrustProfile ID. + * @return The TrustProfile with the given ID or + * null, if none exists. + */ + public TrustProfile getTrustProfile(String id) { + return (TrustProfile) trustProfiles.get(id); + } + + /** + * Log a warning. + * + * @param messageId The message ID. + * @param parameters Additional parameters for the message. + * @see at.gv.egovernment.moa.spss.server.util.MessageProvider + */ + private static void info(String messageId, Object[] parameters) { + MessageProvider msg = MessageProvider.getInstance(); + Logger.info(new LogMsg(msg.getMessage(messageId, parameters))); + } + + /** + * 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 warn(String messageId, Object[] args) { + MessageProvider msg = MessageProvider.getInstance(); + String txt = msg.getMessage(messageId, args); + + Logger.warn(new LogMsg(txt)); + warnings.add(txt); + } + + /** + * Returns the JDBC URL for the revocation archive database. + * + * @return the JDBC URL for the revocation archive database. + */ + public String getRevocationArchiveJDBCURL() + { + return revocationArchiveJDBCURL_; + } + + /** + * Returns the JDBC driver class name for the revocation archive database. + * + * @return the JDBC driver class name for the revocation archive database. + */ + public String getRevocationArchiveJDBCDriverClass() + { + return revocationArchiveJDBCDriverClass_; + } + + /** + * Returns whether revocation checking should be done. + * + * @return whether revocation checking should be done. + */ + public boolean getEnableRevocationChecking() + { + return enableRevocationChecking_; + } + + /** + * Returns the maximum age of a revocation information for considering it + * still as valid. + * + * @return the maximum age of a revocation information for considering it + * still as valid. + */ + public long getMaxRevocationAge() + { + return maxRevocationAge_; + } + + /** + * Returns the service order for revocation checking. + * + * @return the service order for revocation checking. Valid array entries are + * {@link RevocationSourceTypes#OCSP} and {@link RevocationSourceTypes#CRL}. + */ + public String[] getServiceOrder() + { + return serviceOrder_; + } + + /** + * Returns whether certificates found during certificate path construction + * should be added to the certificate store. + * + * @return whether certificates found during certificate path construction + * should be added to the certificate store. + */ + public boolean getAutoAddCertificates() + { + return autoAddCertificates_; + } + + /** + * Returns whether the certificate extension Authority Info Access should + * be used during certificate path construction. + * + * @return whether the certificate extension Authority Info Access should + * be used during certificate path construction. + */ + public boolean getUseAuthorityInfoAccess() + { + return useAuthorityInfoAccess_; + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java new file mode 100644 index 000000000..5c0646449 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/DistributionPoint.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.server.config; + +/** + * Abstract base class for distribution points. + * + * @author Gregor Karlinger + * @version $Id$ + * */ +public abstract class DistributionPoint implements iaik.pki.revocation.DistributionPoint +{ + /** + * The distribution point URI. + */ + private String uri_; + + /** + * Create a DistributionPoint with a URI. + * + * @param uri The URI of the distribution point. + */ + public DistributionPoint(String uri) + { + uri_ = uri; + } + + /** + * @see iaik.pki.revocation.DistributionPoint#getType() + */ + public abstract String getType(); + + /** + * @see iaik.pki.revocation.DistributionPoint#getUri() + */ + public String getUri() + { + return uri_; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java new file mode 100644 index 000000000..62e8d63a6 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareCryptoModule.java @@ -0,0 +1,60 @@ +package at.gv.egovernment.moa.spss.server.config; + +/** + * Contains configuration data for a hardware crypto module. + * + * @author Patrick Peck + * @version $Id$ + */ +public class HardwareCryptoModule { + /** The name of the module. */ + private String name; + /** The slod ID of the module. */ + private String slotID; + /** The user PIN of the module. */ + private String userPIN; + + /** + * Create a new HardwareCryptoModule. + * + * @param name The name of this HardwareCryptoModule. + * @param slotID The slot ID of this HardwareCryptoModule. + * @param userPIN The user PIN to access this + * HardwareCryptoModule. + */ + public HardwareCryptoModule(String name, String slotID, String userPIN) { + this.name = name; + this.slotID = slotID; + this.userPIN = userPIN; + } + + /** + * Returns the name of this HardwareCryptoModule. + * + * @return The name of this HardwareCryptoModule. + */ + public String getName() { + return name; + } + + /** + * Returns the slot ID of this HardwareCryptoModule. + * + * @return The slot ID. + */ + public String getSlotID() { + return slotID; + } + + + /** + * Returns the user PIN of this HardwareCryptoModule. + * + * @return The user PIN used to access the module. + */ + public String getUserPIN() { + return userPIN; + } + + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java new file mode 100644 index 000000000..622c8d110 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/HardwareKeyModule.java @@ -0,0 +1,59 @@ +package at.gv.egovernment.moa.spss.server.config; + +/** + * A class that contains information about a hardware key module. + * + * @author Patrick Peck + * @version $Id$ + */ +public class HardwareKeyModule extends KeyModule { + /** The name of the module. */ + private String name; + /** The slod ID of the module. */ + private String slotID; + /** The user PIN of the module. */ + private String userPIN; + + /** + * Create a new HardwareKey. + * + * @param id The key module ID. + * @param name The name of the key. + * @param slotID The slot ID of the key within the hardware module. May be + * null. + * @param userPIN The user PIN to access the key. + */ + public HardwareKeyModule(String id, String name, String slotID, String userPIN) { + super(id); + this.name = name; + this.slotID = slotID; + this.userPIN = userPIN; + } + + /** + * Return the name of this HardwareKey. + * + * @return The name of this HardwareKey. + */ + public String getName() { + return name; + } + + /** + * Return the slot ID of this HardwareKey. + * + * @return The slot ID of this HardwareKey. + */ + public String getSlotID() { + return slotID; + } + + /** + * Return the user PIN to access this HardwareKey. + * + * @return The user PIN to access this HardwareKey. + */ + public String getUserPIN() { + return userPIN; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java new file mode 100644 index 000000000..0814c90d6 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/IssuerAndSerial.java @@ -0,0 +1,125 @@ +package at.gv.egovernment.moa.spss.server.config; + +import java.math.BigInteger; +import java.security.Principal; + +import iaik.asn1.structures.Name; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; + +/** + * A class containing the issuer and serial number of a certificate, which can + * be used to uniquely identify the certificate. + * + * The issuer is contained as an RFC2253 encoded String. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IssuerAndSerial { + + /** The issuer distinguished name. */ + private String issuerDN; + /** The certificate serial number. */ + private BigInteger serial; + + /** + * Create an IssuerAndSerial object. + * + * The name of the issuer is converted to RFC2253. If it cannot be parsed, the + * DN contained in the issuer is set. + * + * @param issuer The isser of a certificate. + * @param serial The serial number of the certificate. + */ + public IssuerAndSerial(Principal issuer, BigInteger serial) { + String issuerDN = null; + if (issuer instanceof Name) { + try { + issuerDN = ((Name)issuer).getRFC2253String(); + } catch (RFC2253NameParserException e) { + // do nothing + } + } + if (issuerDN == null) { + RFC2253NameParser parser = new RFC2253NameParser(issuer.getName()); + try { + issuerDN = ((Name)parser.parse()).getRFC2253String(); + } catch (RFC2253NameParserException e) { + issuerDN = issuer.getName(); + } + } + this.serial = serial; + this.issuerDN = issuerDN; + } + + /** + * Create an IssuerAndSerial object. + * + * @param issuerDN The issuer distinguished name. Should be an RFC2253 name. + * @param serial The serial number of the certificate. + */ + public IssuerAndSerial(String issuerDN, BigInteger serial) { + this.issuerDN = issuerDN; + this.serial = serial; + } + + /** + * Return the issuer DN in RFC2253 format. + * + * @return The issuer part of this object. + */ + public String getIssuerDN() { + return issuerDN; + } + + /** + * Return the serial number. + * + * @return The serial number of this object. + */ + public BigInteger getSerial() { + return serial; + } + + /** + * Compare this IssuerAndSerial to another object. + * + * @param other The object to compare this IssuerAndSerial to. + * @return true, if other is an + * IssuerAndSerial object and the issuer and + * serial fields are both equal. false otherwise. + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object other) { + if (other instanceof IssuerAndSerial) { + IssuerAndSerial ias = (IssuerAndSerial) other; + return getIssuerDN().equals(ias.getIssuerDN()) + && getSerial().equals(ias.getSerial()); + } + return false; + } + + /** + * Return the hash code of this IssuerAndSerial. + * + * @return The hash code of this IssuerAndSerial. + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return issuerDN.hashCode() ^ serial.hashCode(); + } + + /** + * Return a String representation of this + * IssuerAndSerial object. + * + * @return The String representation. + * @see java.lang.Object#toString() + */ + public String toString() { + return ("(IssuerAndSerial - Issuer<" + getIssuerDN()) + + ("> Serial<" + serial.toString() + ">)"); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroup.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroup.java new file mode 100644 index 000000000..5fd108e1a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroup.java @@ -0,0 +1,69 @@ +package at.gv.egovernment.moa.spss.server.config; + +import java.util.Iterator; +import java.util.Set; + +/** + * A collection of KeyGroupEntrys with its own ID. + * + * @author Sven Aigner + * @author Patrick Peck + * @version $Id$ + */ +public class KeyGroup { + + /** The keys belonging to this key group. */ + private Set keyGroupEntries; + /** The key group ID. */ + private String id; + + /** + * Create a KeyGroup. + * + * @param id The ID of this KeyGroup. + * @param keyGroupEntries The keys belonging to this KeyGroup. + */ + public KeyGroup(String id, Set keyGroupEntries) { + this.id = id; + this.keyGroupEntries = keyGroupEntries; + } + + /** + * Return the KeyEntrys contained in this KeyGroup. + * + * @return The KeyEntrys contained in this KeyGroup. + */ + public Set getKeyGroupEntries() { + return keyGroupEntries; + } + + /** + * Return the ID of this KeyGroup. + * + * @return The KeyGroup ID. + */ + public String getId() { + return id; + } + + /** + * Return a String representation of this KeyGroup. + * + * @return The String representation. + * @see java.lang.Object#toString() + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + Iterator i; + + if (getKeyGroupEntries() != null) { + i = getKeyGroupEntries().iterator(); + + while (i.hasNext()) { + sb.append(" " + i.next()); + } + } + return "(KeyGroup - ID:" + id + " " + sb.toString() + ")"; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java new file mode 100644 index 000000000..2e39d6aa3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyGroupEntry.java @@ -0,0 +1,106 @@ +package at.gv.egovernment.moa.spss.server.config; + +import java.math.BigInteger; + +/** + * A class containing information about an entry in a key group. + * + * @author Patrick Peck + * @version $Id$ + */ +public class KeyGroupEntry { + /** The module ID of the key. */ + private String moduleID; + /** The issuer DN of the certificate identifying the key. */ + private String issuerDN; + /** The serial number of the certificate identifying the key. */ + private BigInteger serialNumber; + + /** + * Create a new KeyGroupEntry. + * + * @param moduleID The key module ID to which this entry belongs to. + * @param issuerAndSerial The issuer and serial number which uniquely + * identifies a certificate within the key module. + */ + public KeyGroupEntry(String moduleID, IssuerAndSerial issuerAndSerial) { + this.moduleID = moduleID; + this.issuerDN = issuerAndSerial.getIssuerDN(); + this.serialNumber = issuerAndSerial.getSerial(); + } + + /** + * Create a new KeyGroupEntry. + * + * @param moduleID The key module ID to which this entry belongs to. + * @param issuerDN The isser DN of the certificate within the key module. + * @param serialNumber The serial number of the certificate within the key + * module. + */ + public KeyGroupEntry( + String moduleID, + String issuerDN, + BigInteger serialNumber) { + this.moduleID = moduleID; + this.issuerDN = issuerDN; + this.serialNumber = serialNumber; + } + + /** + * Return the key module ID to which this KeyGroupEntry belongs + * to. + * + * @return The key module ID. + */ + public String getModuleID() { + return moduleID; + } + + /** + * Return the issuer DN of this KeyGroupEntry for identifying the + * certificate within the key module. + * + * @return The issuer DN of the certificate. + */ + public String getIssuerDN() { + return issuerDN; + } + + /** + * Return the serial number of this KeyGroupEntry for identifying + * the certificate within the key module. + * + * @return The serial number of the certificate. + */ + public BigInteger getSerialNumber() { + return serialNumber; + } + + /** + * Compare this KeyGroupEntry to another. + * + * @param other The KeyGroupEntry to compare to. + * @return true, if module ID, isser DN and serial number of + * other match the ones contained in this object, otherwise + * false. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof KeyGroupEntry) { + KeyGroupEntry entry = (KeyGroupEntry) other; + return getModuleID().equals(entry.getModuleID()) + && getIssuerDN().equals(entry.getIssuerDN()) + && getSerialNumber().equals(entry.getSerialNumber()); + } + return false; + } + + /** + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return getModuleID().hashCode() + ^ getIssuerDN().hashCode() + ^ getSerialNumber().hashCode(); + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyModule.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyModule.java new file mode 100644 index 000000000..412516d82 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/KeyModule.java @@ -0,0 +1,41 @@ +package at.gv.egovernment.moa.spss.server.config; + +/** + * A class that contains information about a key module. + * + * @author Patrick Peck + * @version $Id$ + */ +public class KeyModule { + + /** The key module ID. */ + private String id; + + /** + * Create a Key object. + * + * @param id The key module ID. + */ + public KeyModule(String id) { + this.id = id; + } + + /** + * Return the key ID. + * + * @return The key ID. + */ + public String getId() { + return id; + } + + /** + * Return a String representation of this Key. + * + * @return The String representation. + * @see java.lang.Object#toString() + */ + public String toString() { + return "(Key - Id<" + id + ">)"; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java new file mode 100644 index 000000000..e4509ac97 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/OCSPDistributionPoint.java @@ -0,0 +1,33 @@ +package at.gv.egovernment.moa.spss.server.config; + +import iaik.pki.revocation.RevocationSourceTypes; + +/** + * A class representing a CRL distribution point. + * + * @author Gregor Karlinger + * @version $Id$ + */ +public class OCSPDistributionPoint + extends DistributionPoint + implements iaik.pki.revocation.DistributionPoint +{ + /** + * Create a OCSPDistributionPoint with a URI. + * + * @param uri The URI of the ocsp distribution point. + */ + public OCSPDistributionPoint(String uri) + { + super(uri); + } + + /** + * @see iaik.pki.revocation.DistributionPoint#getType() + */ + public String getType() + { + return RevocationSourceTypes.OCSP; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java new file mode 100644 index 000000000..479e98ca5 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/SoftwareKeyModule.java @@ -0,0 +1,48 @@ +package at.gv.egovernment.moa.spss.server.config; + +/** + * A class containing information about a software key, stored in PKCS12 format. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SoftwareKeyModule extends KeyModule { + /** The name of the file containing the keys. */ + private String fileName; + /** The password for accessing the file. */ + private String passWord; + + /** + * Create a new SoftwareKey. + * + * @param id The key ID. + * @param fileName The name of the PKCS12 keystore file containing the key. + * @param passWord The password to access the keystore file. + */ + public SoftwareKeyModule(String id, String fileName, String passWord) { + super(id); + this.fileName = fileName; + this.passWord = passWord; + } + + /** + * Return the name of the PKCS12 keystore file containing this + * SoftwareKey. + * + * @return The name of the PKCS12 keystore file. + */ + public String getFileName() { + return fileName; + } + + /** + * Return the password to access the keystore file. + * + * @return The password to access the keystore file. + */ + public String getPassWord() { + return passWord; + } + + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java new file mode 100644 index 000000000..929d5ce2b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java @@ -0,0 +1,58 @@ +package at.gv.egovernment.moa.spss.server.config; + +/** + * Information about a trust profile. + * + * @author Patrick Peck + * @version $Id$ + */ +public class TrustProfile { + /** The ID of the trust profile. */ + private String id; + /** The URI giving the location of the trust profile. */ + private String uri; + /** The URI giving the location of the allowed signer certificates. */ + private String signerCertsUri; + + /** + * Create a TrustProfile. + * + * @param id The ID of the TrustProfile to create. + * @param uri The URI of the TrustProfile to create. + * @param signerCertsUri The URI of the location of the allowed signer + * certificates of the TrustProfile to create. + */ + public TrustProfile(String id, String uri, String signerCertsUri) { + this.id = id; + this.uri = uri; + this.signerCertsUri = signerCertsUri; + } + + /** + * Return the ID of this TrustProfile. + * + * @return The TrustProfile ID. + */ + public String getId() { + return id; + } + + /** + * Return the URI of this TrustProfile. + * + * @return The URI of TrustProfile. + */ + public String getUri() { + return uri; + } + + /** + * Return the URI giving the location of the allowed signer certificates + * of this TrustProfile. + * + * @return The URI of TrustProfile. + */ + public String getSignerCertsUri() { + return signerCertsUri; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java new file mode 100644 index 000000000..eaee58d3f --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/cmsverify/CMSSignatureVerificationProfileImpl.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.spss.server.iaik.cmsverify; + +import iaik.pki.PKIProfile; +import iaik.server.modules.cmsverify.CMSSignatureVerificationProfile; + +/** + * An implementation of the CMSSignatureVerificationProfile + * interface. + * + * @see iaik.server.modules.cmsverify.CMSSignatureVerificationProfile + * @author Patrick Peck + * @version $Id$ + */ +public class CMSSignatureVerificationProfileImpl + implements CMSSignatureVerificationProfile { + + /** The profile for validating the certificate. */ + private PKIProfile certificateValidationProfile; + + /** + * @see iaik.server.modules.cmsverify.CMSSignatureVerificationProfile#getCertificateValidationProfile() + */ + public PKIProfile getCertificateValidationProfile() { + return certificateValidationProfile; + } + + /** + * Sets the profile for validating the signer certificate. + * + * @param certificateValidationProfile The certificate validation profile to + * set. + */ + public void setCertificateValidationProfile(PKIProfile certificateValidationProfile) { + this.certificateValidationProfile = certificateValidationProfile; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java new file mode 100644 index 000000000..713891714 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractKeyModuleConfigurationImpl.java @@ -0,0 +1,36 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.server.modules.keys.KeyModuleConfiguration; + +/** + * Base implementation class for the KeyModuleConfiguration + * interface and the interfaces derived from it. + * + * @see iaik.server.modules.keys.KeyModuleConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public abstract class AbstractKeyModuleConfigurationImpl + implements KeyModuleConfiguration { + + /** The module ID. */ + private String moduleID; + + /** + * Creata new AbstractKeyModuleConfigurationImpl. + * + * @param moduleID The key module ID of this + * KeyModuleConfiguration. + */ + public AbstractKeyModuleConfigurationImpl(String moduleID) { + this.moduleID = moduleID; + } + + /** + * @see iaik.server.modules.keys.KeyModuleConfiguration#getModuleID() + */ + public String getModuleID() { + return moduleID; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java new file mode 100644 index 000000000..88d53d6ad --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/AbstractObservableConfiguration.java @@ -0,0 +1,48 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import iaik.pki.store.observer.NotificationData; +import iaik.pki.store.observer.Observable; +import iaik.pki.store.observer.Observer; + +/** + * A base class for observable configuration data. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class AbstractObservableConfiguration implements Observable { + + /** The observers registered with this Observable. */ + private List observers = new ArrayList(); + + /** + * @see iaik.pki.store.observer.Observable#addObserver(iaik.pki.store.observer.Observer) + */ + public void addObserver(Observer observer) { + observers.add(observer); + } + + /** + * @see iaik.pki.store.observer.Observable#removeObserver(iaik.pki.store.observer.Observer) + */ + public boolean removeObserver(Observer observer) { + return observers.remove(observer); + } + + /** + * @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData) + */ + public void notify(NotificationData data) { + Iterator iter = observers.iterator(); + + for (iter = observers.iterator(); iter.hasNext();) { + Observer observer = (Observer) iter.next(); + observer.notify(data); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java new file mode 100644 index 000000000..bf56d437c --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ArchiveConfigurationImpl.java @@ -0,0 +1,97 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.pki.store.revocation.archive.ArchiveConfiguration; +import iaik.pki.store.revocation.archive.ArchiveParameter; +import iaik.pki.store.revocation.archive.ArchiveTypes; + +import java.sql.Driver; +import java.sql.DriverManager; +import java.util.Enumeration; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the ArchiveConfiguration interface + * using configuration data provided by the MOA configuration file. + * + * @see iaik.pki.store.revocation.archive.ArchiveConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class ArchiveConfigurationImpl + extends AbstractObservableConfiguration + implements ArchiveConfiguration { + + /** The configuration parameters of the archive. */ + private ArchiveParameter archiveParameters; + + /** + * Create a new ArchiveConfigurationImpl. + * + * @param config The MOA configuration from which the configuration data is being read. + */ + public ArchiveConfigurationImpl(ConfigurationProvider config) + { + String jdbcUrl = config.getRevocationArchiveJDBCURL(); + this.archiveParameters = new DataBaseArchiveParameterImpl(jdbcUrl); + + // Register JDBC driver class + if (jdbcUrl != null) + { + String jdbcDriverClass = config.getRevocationArchiveJDBCDriverClass(); + try + { + Class.forName(jdbcDriverClass); + } + catch (ClassNotFoundException e) + { + // TODO 20030709 GK Improve exception handling + throw new RuntimeException("JDBC driver class \"" + jdbcDriverClass + " could not be found."); + } + + Enumeration regDrivers = DriverManager.getDrivers(); + boolean isRegistered = false; + while (regDrivers.hasMoreElements()) + { + Object currentDriver = regDrivers.nextElement(); + if (jdbcDriverClass.equals(currentDriver.getClass().getName())) isRegistered = true; + } + if (!isRegistered) + { + // Workaround for a driver which does not register itselve at invocation of Class.forName(drvname) + try + { + DriverManager.registerDriver((Driver)Class.forName(jdbcDriverClass).newInstance()); + } + catch (Exception e) + { + // TODO 20030709 GK Improve exception handling + throw new RuntimeException("Registering JDBC driver \"" + jdbcDriverClass + " failed."); + } + } + } + } + + /** + * Return the type of archive. + * + * This will always return ArchiveTypes.DATABASE. + * @return ArchiveTypes.DATABASE. + * @see iaik.pki.store.revocation.archive.ArchiveConfiguration#getType() + */ + public String getType() { + return ArchiveTypes.DATABASE; + } + + /** + * Return the ArchiveParameters describing this + * ArchiveConfiguration. + * + * @return The archive parameters. + * @see iaik.pki.store.revocation.archive.ArchiveConfiguration#getArchiveParameters() + */ + public ArchiveParameter getArchiveParameters() { + return archiveParameters; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java new file mode 100644 index 000000000..71b8680c8 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CRLRetriever.java @@ -0,0 +1,69 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.logging.TransactionId; +import iaik.pki.revocation.RevocationSourceTypes; +import iaik.pki.store.revocation.RevocationInfoRetriever; +import iaik.pki.store.revocation.RevocationSource; +import iaik.pki.store.revocation.RevocationStoreException; +import iaik.pki.ldap.Handler; + +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLStreamHandler; +import java.util.Collection; +import java.util.Date; + +import at.gv.egovernment.moa.logging.Logger; + +/** + * A customized implementation of {@link iaik.pki.store.revocation.RevocationInfoRetriever}. Will be used + * instead of the default implementation {@link iaik.pki.store.revocation.CRLRetriever} to overcome a + * classloader problem in connection with the {@link java.net.URL} class in a Tomcat deployment environment. + * + * @author Gregor Karlinger + * @version $$ + */ +public class CRLRetriever implements RevocationInfoRetriever +{ + public void update(RevocationSource source, Collection supplementalRequestData, TransactionId tid) + throws RevocationStoreException + { + if (source == null) + { + throw new NullPointerException("RevocationSource parameter mustn't be null."); + } + Logger.info("Downloading crl from " + source.getUri()); + if (!source.getType().equals(RevocationSourceTypes.CRL)) + { + throw new RevocationStoreException( + source.getType() + " not supported", + null, + getClass().getName() + ":1"); + } + try + { + URL crlUrl; + try + { + crlUrl = new URL(source.getUri()); + } + catch (MalformedURLException e) + { + // Workaround for classloader problem with deployment in Tomcat 4.1 + URLStreamHandler handler = new Handler(); + crlUrl = new URL(null, source.getUri(), handler); + } + + InputStream crlInputStream = crlUrl.openStream(); + source.readFrom(crlInputStream, tid); + source.setDownloadTime(new Date()); + crlInputStream.close(); + } + catch (Exception iox) + { + Logger.warn("Cannot retrieve crl", iox); + throw new RevocationStoreException("Cannot retrieve CRL", iox, getClass().getName() + ":1"); + } + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java new file mode 100644 index 000000000..e6e084e11 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/CertStoreConfigurationImpl.java @@ -0,0 +1,50 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.pki.store.certstore.CertStoreConfiguration; +import iaik.pki.store.certstore.CertStoreParameters; +import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the CertStoreConfiguration interface based + * on MOA configuration data. + * + * @see iaik.pki.store.certstore.CertStoreConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class CertStoreConfigurationImpl + extends AbstractObservableConfiguration + implements CertStoreConfiguration { + + /** The configuration parameters of the CertStore. */ + private CertStoreParameters[] parameters; + + /** + * Create a new CertStoreConfigurationImpl. + * + * @param config The MOA configuration from which the configuration data is + * being read. + */ + public CertStoreConfigurationImpl(ConfigurationProvider config) + { + String certStoreRoot = config.getCertStoreLocation(); + + DirectoryCertStoreParameters dirParameters = new DirectoryCertStoreParametersImpl( + "MOA Directory CertStore", + certStoreRoot, + true, + false); + + parameters = new CertStoreParameters[] { dirParameters }; + } + + /** + * @see iaik.pki.store.certstore.CertStoreConfiguration#getParameters() + */ + public CertStoreParameters[] getParameters() { + return parameters; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java new file mode 100644 index 000000000..7aa4cbe4b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImpl.java @@ -0,0 +1,121 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import iaik.logging.LoggerConfig; +import iaik.pki.PKIConfiguration; +import iaik.server.ConfigurationData; + +import at.gv.egovernment.moa.spss.server.config.HardwareCryptoModule; +import at.gv.egovernment.moa.spss.server.config.HardwareKeyModule; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.SoftwareKeyModule; + +/** + * An implementation of the ConfigurationData interface using + * MOA configuration data. + * + * @see iaik.server.ConfigurationData + * @author Patrick Peck + * @version $Id$ + */ +public class ConfigurationDataImpl implements ConfigurationData { + /** PKI configuration data. */ + private PKIConfiguration pkiConfiguration; + /** Crypto modules configuration data. */ + private List cryptoModuleConfigurations; + /** Key modules configuration data. */ + private List keyModuleConfigurations; + /** Logging configuration data. */ + private LoggerConfig loggerConfig; + + /** + * Create a new ConfigurationDataImpl. + * + * @param config The underlying MOA configuration data. + */ + public ConfigurationDataImpl(ConfigurationProvider config) { + this.pkiConfiguration = new PKIConfigurationImpl(config); + this.cryptoModuleConfigurations = buildCryptoModuleConfigurations(config); + this.keyModuleConfigurations = buildKeyModuleConfigurations(config); + this.loggerConfig = new LoggerConfigImpl(); + } + + /** + * Build the list of CryptoModuleConfigurations. + * + * @param config The underlying MOA configuration data. + * @return The list of CryptoModuleConfigurations configured in + * the MOA configuration. + */ + private List buildCryptoModuleConfigurations(ConfigurationProvider config) { + List modules = new ArrayList(); + Iterator iter = config.getHardwareCryptoModules().iterator(); + + while (iter.hasNext()) { + HardwareCryptoModule module = (HardwareCryptoModule) iter.next(); + modules.add(new HardwareCryptoModuleConfigurationImpl(module)); + } + + return modules; + } + + /** + * Build the list of KeyModuleConfigurations. + * + * @param config The underlying MOA configuration data. + * @return The list of KeyModuleConfigurations configured in the + * MOA configuration. + */ + private List buildKeyModuleConfigurations(ConfigurationProvider config) { + List keys = new ArrayList(); + Iterator iter; + + // add the hardware keys + iter = config.getHardwareKeyModules().iterator(); + while (iter.hasNext()) { + HardwareKeyModule key = (HardwareKeyModule) iter.next(); + keys.add(new HardwareKeyModuleConfigurationImpl(key)); + } + + // add the software keys + iter = config.getSoftwareKeyModules().iterator(); + while (iter.hasNext()) { + SoftwareKeyModule key = (SoftwareKeyModule) iter.next(); + keys.add(new SoftwareKeyModuleConfigurationImpl(key)); + } + + return keys; + } + + /** + * @see iaik.server.ConfigurationData#getPKIConfiguration() + */ + public PKIConfiguration getPKIConfiguration() { + return pkiConfiguration; + } + + /** + * @see iaik.server.ConfigurationData#getCryptoModuleConfigurations() + */ + public List getCryptoModuleConfigurations() { + return cryptoModuleConfigurations; + } + + /** + * @see iaik.server.ConfigurationData#getKeyModuleConfigurations() + */ + public List getKeyModuleConfigurations() { + return keyModuleConfigurations; + } + + /** + * @see iaik.server.ConfigurationData#getLoggerConfig() + */ + public LoggerConfig getLoggerConfig() { + return loggerConfig; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java new file mode 100644 index 000000000..d67523944 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DataBaseArchiveParameterImpl.java @@ -0,0 +1,33 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter; + +/** + * An implementation of the DataBaseArchiveParameter interface. + * + * @see iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter + * @author Patrick Peck + * @version $Id$ + */ +public class DataBaseArchiveParameterImpl implements DataBaseArchiveParameter { + + /** The JDBC URL for accessing the archive. */ + private String jDBCUrl; + + /** + * Create a new DataBaseArchiveParameterImpl. + * + * @param jDBCUrl The JDBC URL of the archive. + */ + public DataBaseArchiveParameterImpl(String jDBCUrl) { + this.jDBCUrl = jDBCUrl; + } + + /** + * @see iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter#getJDBCUrl() + */ + public String getJDBCUrl() { + return jDBCUrl; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java new file mode 100644 index 000000000..2b00d6766 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/DirectoryCertStoreParametersImpl.java @@ -0,0 +1,81 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.pki.store.certstore.CertStoreTypes; +import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; + +/** + * An implementation of the DirectoryCertStoreParameters interface. + * + * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters + * @author Patrick Peck + * @version $Id$ + */ +public class DirectoryCertStoreParametersImpl + implements DirectoryCertStoreParameters { + + /** The root directory of the CertStore. */ + private String rootDirectory; + /** Whether a new directory may be created. */ + private boolean createNew; + /** The CertStore ID. */ + private String id; + /** Whether the CertStore is read-only. */ + private boolean readOnly; + + /** + * Create a new DirectoryCertStoreParameterImpl. + * + * @param id The CertStore ID. + * @param rootDirectory The root directory of the CertStore. + * @param createNew Whether a new directory may be created. + * @param readOnly Whether the CertStore is read-only. + */ + public DirectoryCertStoreParametersImpl( + String id, + String rootDirectory, + boolean createNew, + boolean readOnly) { + + this.id = id; + this.rootDirectory = rootDirectory; + this.createNew = createNew; + this.readOnly = readOnly; + } + + /** + * @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 createNew; + } + + /** + * @see iaik.pki.store.certstore.CertStoreParameters#getId() + */ + public String getId() { + return id; + } + + /** + * @see iaik.pki.store.certstore.CertStoreParameters#isReadOnly() + */ + public boolean isReadOnly() { + return readOnly; + } + + /** + * @return CertStoreTypes.DIRECTORY + * @see iaik.pki.store.certstore.CertStoreParameters#getType() + */ + public String getType() { + return CertStoreTypes.DIRECTORY; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java new file mode 100644 index 000000000..3c8f4c002 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareCryptoModuleConfigurationImpl.java @@ -0,0 +1,51 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.server.modules.crypto.HardwareCryptoModuleConfiguration; + +import at.gv.egovernment.moa.spss.server.config.HardwareCryptoModule; + +/** + * An implementation of the HardwareCryptoModuleConfiguration + * wrapping a HardwareCryptoModule from the MOA configuration. + * + * @author Patrick Peck + * @version $Id$ + */ +public class HardwareCryptoModuleConfigurationImpl + implements HardwareCryptoModuleConfiguration { + + /** The wrapped HardwareCryptoModule. */ + private HardwareCryptoModule module; + + /** + * Create a new HardwareCryptoModuleConfigurationImpl. + * + * @param module The HardwareCryptoModule from the underlying MOA + * configuration. + */ + public HardwareCryptoModuleConfigurationImpl(HardwareCryptoModule module) { + this.module = module; + } + + /** + * @see iaik.server.modules.crypto.HardwareCryptoModuleConfiguration#getModuleName() + */ + public String getModuleName() { + return module.getName(); + } + + /** + * @see iaik.server.modules.crypto.HardwareCryptoModuleConfiguration#getSlotID() + */ + public String getSlotID() { + return module.getSlotID(); + } + + /** + * @see iaik.server.modules.crypto.HardwareCryptoModuleConfiguration#getUserPIN() + */ + public char[] getUserPIN() { + return module.getUserPIN().toCharArray(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java new file mode 100644 index 000000000..d905588c6 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/HardwareKeyModuleConfigurationImpl.java @@ -0,0 +1,55 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.server.modules.keys.HardwareKeyModuleConfiguration; + +import at.gv.egovernment.moa.spss.server.config.HardwareKeyModule; + +/** + * An implementation of the HardwareKeyModuleConfiguration + * interface wrapping a HardwareKeyModule from the MOA + * configuration. + * + * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class HardwareKeyModuleConfigurationImpl + extends AbstractKeyModuleConfigurationImpl + implements HardwareKeyModuleConfiguration { + + /** The wrapped HardwareKeyModule. */ + private HardwareKeyModule keyModule; + + /** + * Create a new HardwareKeyModuleConfigurationImpl. + * + * @param keyModule The HardwareKeyModule from the underlying + * MOA configuration. + */ + public HardwareKeyModuleConfigurationImpl(HardwareKeyModule keyModule) { + super(keyModule.getId()); + this.keyModule = keyModule; + } + + /** + * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration#getModuleName() + */ + public String getModuleName() { + return keyModule.getName(); + } + + /** + * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration#getSlotID() + */ + public String getSlotID() { + return keyModule.getSlotID(); + } + + /** + * @see iaik.server.modules.keys.HardwareKeyModuleConfiguration#getUserPIN() + */ + public char[] getUserPIN() { + return keyModule.getUserPIN().toCharArray(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java new file mode 100644 index 000000000..2508b7946 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java @@ -0,0 +1,173 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import iaik.pki.revocation.RevocationSourceTypes; +import iaik.pki.store.revocation.RevocationFactory; +import iaik.pki.store.revocation.RevocationSourceStore; +import iaik.pki.store.truststore.TrustStoreFactory; +import iaik.server.ConfigurationData; +import iaik.server.Configurator; +import iaik.server.modules.keys.KeyEntryID; +import iaik.server.modules.keys.KeyModule; +import iaik.server.modules.keys.KeyModuleFactory; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.KeyGroup; +import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry; +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * A class responsible for configuring the IAIK MOA modules. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IaikConfigurator { + + /** The warnings encountered during configuration. */ + private List warnings = new ArrayList(); + + /** + * Configure the IAIK MOA subsystem. + * + * + * @param moaConfig The underlying MOA configuration. + * @throws ConfigurationException An error occurred configuring the IAIK + * MOA subsystem. + */ + public void configure(ConfigurationProvider moaConfig) + throws ConfigurationException { + ConfigurationData configData = new ConfigurationDataImpl(moaConfig); + + warnings = new ArrayList(); + + try { + TransactionId transId = new TransactionId("IaikConfigurator"); + Configurator.init(configData, transId); + + // Set customized CRL retriever to overcome a classloader problem when MOA is deployed in Tomcat + RevocationSourceStore rss = RevocationFactory.getInstance(transId).getRevocationSourceStore(); + rss.setRetriever(new CRLRetriever(), RevocationSourceTypes.CRL); + if ((moaConfig.getSoftwareKeyModules().size() > 0) || (moaConfig.getHardwareKeyModules().size() > 0)) { + dumpKeyEntryIDs(); + } + checkKeyGroupConfig(moaConfig); + TrustStoreFactory.reset(); + } catch (iaik.server.ConfigurationException e) { + throw new ConfigurationException("config.08", null, e); + } catch (Throwable t) { + throw new ConfigurationException("config.08", null, t); + } + } + + /** + * Return the warnings encountered during configuration. + * + * @return The warnings. + */ + public List getWarnings() { + return warnings; + } + + /** + * Dump all KeyEntryIDs contained in the configured + * KeyModules to the log file. + */ + private void dumpKeyEntryIDs() { + MessageProvider msg = MessageProvider.getInstance(); + KeyModule module = KeyModuleFactory.getInstance(new TransactionId("dump")); + Set keyEntryIds = module.getPrivateKeyEntryIDs(); + Iterator iter; + + for (iter = keyEntryIds.iterator(); iter.hasNext();) { + KeyEntryID keyEntryId = (KeyEntryID) iter.next(); + Logger.info( + new LogMsg(msg.getMessage("config.19", new Object[] { keyEntryId }))); + } + } + + /** + * Check that each key group entry in each key group can be resolved to a + * KeyEntryID. + * + * Logs a warning for each key group entry that cannot be resolved. + * + * @param moaConfig The MOA configuration to check. + */ + private void checkKeyGroupConfig(ConfigurationProvider moaConfig) { + Map keyGroups = moaConfig.getKeyGroups(); + Iterator iter; + + for (iter = keyGroups.values().iterator(); iter.hasNext();) { + KeyGroup keyGroup = (KeyGroup) iter.next(); + Set keyGroupEntries = keyGroup.getKeyGroupEntries(); + Iterator kgIter; + + for (kgIter = keyGroupEntries.iterator(); kgIter.hasNext();) { + KeyGroupEntry entry = (KeyGroupEntry) kgIter.next(); + + if (!findKeyEntryID(entry)) { + warn( + "config.31", + new Object[] { + keyGroup.getId(), + entry.getModuleID(), + entry.getIssuerDN(), + entry.getSerialNumber()}); + } + } + } + } + + /** + * Find out that a certain KeyGroupEntry could be resolved to a KeyEntryID + * by the Configurator. + * + * @param keyGroupEntry The key group entry to find. + * @return true, if the keyGroupEntry could be + * resolved to a KeyEntryID; otherwise false. + */ + private boolean findKeyEntryID(KeyGroupEntry keyGroupEntry) { + KeyModule module = KeyModuleFactory.getInstance(new TransactionId("check")); + Set keyEntryIDs = module.getPrivateKeyEntryIDs(); + Iterator iter; + + for (iter = keyEntryIDs.iterator(); iter.hasNext();) { + KeyEntryID entry = (KeyEntryID) iter.next(); + + if (entry.getCertificateIssuer().equals(keyGroupEntry.getIssuerDN()) + && entry.getCertificateSerialNumber().equals( + keyGroupEntry.getSerialNumber()) + && entry.getModuleID().equals(keyGroupEntry.getModuleID())) { + return true; + } + } + + return false; + } + + /** + * 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 warn(String messageId, Object[] args) { + MessageProvider msg = MessageProvider.getInstance(); + String txt = msg.getMessage(messageId, args); + + Logger.warn(new LogMsg(txt)); + warnings.add(txt); + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java new file mode 100644 index 000000000..9679e8d18 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/LoggerConfigImpl.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import java.util.Properties; + +import iaik.logging.LogConfigurationException; +import iaik.logging.LoggerConfig; + +import at.gv.egovernment.moa.logging.LoggingContextManager; + +/** + * Default implementation of the LoggerConfig interface. + * + * @author Patrick Peck + * @version $Id$ + */ +public class LoggerConfigImpl implements LoggerConfig { + + /** The implementation of iaik.logging.LogFactory. */ + private static final String DEFAULT_IMPLEMENTATION = + "at.gv.egovernment.moa.spss.server.logging.IaikLogFactory"; + + public String getFactory() { + return DEFAULT_IMPLEMENTATION; + } + + public Properties getProperties() throws LogConfigurationException { + return new Properties(); + } + + public String getNodeId() { + return LoggingContextManager.getInstance().getLoggingContext().getNodeID(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java new file mode 100644 index 000000000..1c42cc4af --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/PKIConfigurationImpl.java @@ -0,0 +1,80 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.pki.PKIConfiguration; +import iaik.pki.pathvalidation.ValidationConfiguration; +import iaik.pki.revocation.RevocationConfiguration; +import iaik.pki.store.certstore.CertStoreConfiguration; +import iaik.pki.store.revocation.archive.ArchiveConfiguration; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the PKIConfiguration interface using data + * from the MOA configuration. + * + * @see iaik.pki.PKIConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class PKIConfigurationImpl implements PKIConfiguration { + /** The CertStore configuration. */ + private CertStoreConfiguration certStoreConfiguration; + /** The revocation checking configuration. */ + private RevocationConfiguration revocationConfiguration; + /** The revocation archive configuration. */ + private ArchiveConfiguration archiveConfiguration; + /** The certificate validation configuration. */ + private ValidationConfiguration validationConfiguration; + + /** + * Create a new PKIConfigurationImpl. + * + * @param config The underlying MOA configuration which will be used to build + * the configuration data contained in this object. + */ + public PKIConfigurationImpl(ConfigurationProvider config) { + + this.certStoreConfiguration = new CertStoreConfigurationImpl(config); + this.revocationConfiguration = new RevocationConfigurationImpl(config); + + boolean archiveInfo = config.getEnableRevocationArchiving(); + if (archiveInfo) + { + this.archiveConfiguration = new ArchiveConfigurationImpl(config); + } + else + { + this.archiveConfiguration = null; + } + + this.validationConfiguration = new ValidationConfigurationImpl(config); + } + + /** + * @see iaik.pki.PKIConfiguration#getCertStoreConfiguration() + */ + public CertStoreConfiguration getCertStoreConfiguration() { + return certStoreConfiguration; + } + + /** + * @see iaik.pki.PKIConfiguration#getRevocationConfiguration() + */ + public RevocationConfiguration getRevocationConfiguration() { + return revocationConfiguration; + } + + /** + * @see iaik.pki.PKIConfiguration#getArchiveConfiguration() + */ + public ArchiveConfiguration getArchiveConfiguration() { + return archiveConfiguration; + } + + /** + * @see iaik.pki.PKIConfiguration#getValidationConfiguration() + */ + public ValidationConfiguration getValidationConfiguration() { + return validationConfiguration; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java new file mode 100644 index 000000000..bccb04a09 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/RevocationConfigurationImpl.java @@ -0,0 +1,53 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import iaik.pki.revocation.RevocationConfiguration; + +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.Set; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the RevocationConfiguration interface using + * MOA configuration data. + * + * @see iaik.pki.revocation.RevocationConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class RevocationConfigurationImpl + extends AbstractObservableConfiguration + implements RevocationConfiguration { + + /** The ConfigurationProvider to read the configuration data + * from. */ + private ConfigurationProvider config; + + /** + * Create a new RevocationConfigurationImpl. + * + * @param config The underlying MOA configuration containing the configuration + * data. + */ + public RevocationConfigurationImpl(ConfigurationProvider config) { + this.config = config; + } + + /** + * @see iaik.pki.revocation.RevocationConfiguration#getAlternativeDistributionPoints + */ + public Set getAlternativeDistributionPoints(X509Certificate cert, X509Certificate issuer, Date date) + { + return config.getDistributionPoints(cert); + } + + /** + * @see iaik.pki.revocation.RevocationConfiguration#archiveRevocationInfo(java.lang.String, java.lang.String) + */ + public boolean archiveRevocationInfo(String type, String uri) + { + return config.getEnableRevocationArchiving(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java new file mode 100644 index 000000000..343f096ef --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/SoftwareKeyModuleConfigurationImpl.java @@ -0,0 +1,75 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; + +import iaik.server.modules.keys.ConfigurationException; +import iaik.server.modules.keys.SoftwareKeyModuleConfiguration; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; + +import at.gv.egovernment.moa.spss.server.config.SoftwareKeyModule; +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * An implementation of the SoftwareKeyModuleConfiguration wrapping + * a SoftwareKeyModule from the MOA configuration. + * + * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class SoftwareKeyModuleConfigurationImpl + extends AbstractKeyModuleConfigurationImpl + implements SoftwareKeyModuleConfiguration { + + /** The wrapped SoftwareKeyModule. */ + private SoftwareKeyModule keyModule; + + /** + * Create a new SoftwareKeyModuleConfigurationImpl. + * + * @param keyModule The SoftwareKeyModule from the underlying MOA + * configuration. + */ + public SoftwareKeyModuleConfigurationImpl(SoftwareKeyModule keyModule) { + super(keyModule.getId()); + this.keyModule = keyModule; + } + + /** + * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration#getKeyStoreTypeName() + */ + public String getKeyStoreTypeName() { + return KEY_STORE_TYPE_NAME_PKCS12; + } + + /** + * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration#getKeyStoreAsStream() + */ + public InputStream getKeyStoreAsStream() { + MessageProvider msg = MessageProvider.getInstance(); + + try { + String message = + msg.getMessage("config.18", new Object[] { keyModule.getFileName()}); + Logger.info(new LogMsg(message)); + return new FileInputStream(keyModule.getFileName()); + } catch (FileNotFoundException e) { + String message = + msg.getMessage("config.09", new Object[] { keyModule.getFileName()}); + + throw new ConfigurationException(message, e, null); + } + } + + /** + * @see iaik.server.modules.keys.SoftwareKeyModuleConfiguration#getKeyStoreAuthenticationData() + */ + public char[] getKeyStoreAuthenticationData() { + return keyModule.getPassWord().toCharArray(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java new file mode 100644 index 000000000..f6fbad215 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/ValidationConfigurationImpl.java @@ -0,0 +1,56 @@ +package at.gv.egovernment.moa.spss.server.iaik.config; + +import java.security.cert.X509Certificate; +import java.security.spec.AlgorithmParameterSpec; + +import iaik.pki.pathvalidation.ValidationConfiguration; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the ValidationConfiguration interface using + * MOA configuration data. + * + * @see iaik.pki.pathvalidation.ValidationConfiguration + * @author Patrick Peck + * @version $Id$ + */ +public class ValidationConfigurationImpl + extends AbstractObservableConfiguration + implements ValidationConfiguration { + + /** The ConfigurationProvider to read the configuration data + * from. */ + private ConfigurationProvider config; + + /** + * Create a new ValidationConfigurationImpl. + * + * @param config The underlying MOA configuration data. + */ + public ValidationConfigurationImpl(ConfigurationProvider config) { + this.config = config; + } + + /** + * @see iaik.pki.pathvalidation.ValidationConfiguration#getChainingMode(java.security.cert.X509Certificate) + */ + public String getChainingMode(X509Certificate cert) { + return config.getChainingMode(cert); + } + + /** + * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsSpec(java.security.cert.X509Certificate) + */ + public AlgorithmParameterSpec getPublicKeyParamsAsSpec(X509Certificate cert) { + return null; + } + + /** + * @see iaik.pki.pathvalidation.ValidationConfiguration#getPublicKeyParamsAsCert(java.security.cert.X509Certificate) + */ + public X509Certificate getPublicKeyParamsAsCert(X509Certificate cert) { + return null; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java new file mode 100644 index 000000000..76f03ae07 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/PKIProfileImpl.java @@ -0,0 +1,116 @@ +package at.gv.egovernment.moa.spss.server.iaik.pki; + +import iaik.pki.PKIProfile; +import iaik.pki.pathvalidation.ValidationProfile; +import iaik.pki.revocation.RevocationProfile; +import iaik.pki.store.truststore.TrustStoreProfile; +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation.ValidationProfileImpl; +import at.gv.egovernment.moa.spss.server.iaik.pki.revocation.RevocationProfileImpl; +import at.gv.egovernment.moa.spss.server.iaik.pki.store.truststore.TrustStoreProfileImpl; + +/** + * Implementation of the PKIProfile interface containing + * information needed for certificate path validation. It uses configuration + * data from the MOA configuration. + * + * @author Patrick Peck + * @version $Id$ + */ +public class PKIProfileImpl implements PKIProfile { + + /** Profile information for revocation checking. */ + private RevocationProfile revocationProfile; + /** Profile information about the trust profile to use. */ + private TrustStoreProfile trustStoreProfile; + /** Profile information about the certificate validation. */ + private ValidationProfile validationProfile; + /** The ConfigurationProvider to read the MOA configuration data + * from. */ + private ConfigurationProvider config; + + /** + * Create a new PKIProfileImpl. + * + * @param config The MOA configuration providing configuration data about + * certificate path validation. + * @param trustProfileID The trust profile ID denoting the location of the + * trust store. + * @throws MOAApplicationException An error occurred building the profile. + */ + public PKIProfileImpl(ConfigurationProvider config, String trustProfileID) + throws MOAApplicationException { + + this.config = config; + setRevocationProfile(new RevocationProfileImpl(config)); + setTrustStoreProfile(new TrustStoreProfileImpl(config, trustProfileID)); + setValidationProfile(new ValidationProfileImpl(config)); + } + + /** + * @see iaik.pki.PKIProfile#autoAddCertificates() + */ + public boolean autoAddCertificates() + { + return useAuthorityInfoAccess() ? true : config.getAutoAddCertificates(); + } + + /** + * @see iaik.pki.PKIProfile#getRevocationProfile() + */ + public RevocationProfile getRevocationProfile() { + return revocationProfile; + } + + /** + * Sets the RevocationProfile. + * + * @param revocationProfile The RevocationProfile used for + * revocation checking. + */ + protected void setRevocationProfile(RevocationProfile revocationProfile) { + this.revocationProfile = revocationProfile; + } + + /** + * @see iaik.pki.PKIProfile#getTrustStoreProfile() + */ + public TrustStoreProfile getTrustStoreProfile() { + return trustStoreProfile; + } + + /** + * Sets the TrustStoreProfile. + * + * @param trustStoreProfile The TrustStoreProfile. + */ + protected void setTrustStoreProfile(TrustStoreProfile trustStoreProfile) { + this.trustStoreProfile = trustStoreProfile; + } + + /** + * @see iaik.pki.PKIProfile#getValidationProfile() + */ + public ValidationProfile getValidationProfile() { + return validationProfile; + } + + /** + * Sets the ValidationProfile. + * + * @param validationProfile The ValidationProfile to set. + */ + protected void setValidationProfile(ValidationProfile validationProfile) { + this.validationProfile = validationProfile; + } + + /** + * @see iaik.pki.PKIProfile#useAuthorityInfoAccess() + */ + public boolean useAuthorityInfoAccess() + { + return config.getUseAuthorityInfoAccess(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java new file mode 100644 index 000000000..a4d7ea7fa --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/pathvalidation/ValidationProfileImpl.java @@ -0,0 +1,107 @@ +package at.gv.egovernment.moa.spss.server.iaik.pki.pathvalidation; + +import iaik.pki.pathvalidation.ValidationProfile; + +import java.util.Collections; +import java.util.Set; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the ValidationProfile interface providing + * information about certificat path validation. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ValidationProfileImpl implements ValidationProfile { + + /** The ConfigurationProvider to read the configuration data + * from. */ + private ConfigurationProvider config; + private boolean initialAnyPolicyInhibit; + private boolean initialExplicitPolicy; + private boolean initialPolicyMappingInhibit; + private Set initialPolicySet; + private boolean nameConstraintsProcessing; + private boolean policyProcessing; + + /** + * Create a new ValidationProfileImpl object. + * + * This objects's fields are preset to the following values: + * + *
    + *
  • initialAnyPolicyInhibit = true
  • + *
  • initialExplicitPoliy = true
  • + *
  • initialPolicyMappingInhibit = true
  • + *
  • initialPolicySet = empty
  • + *
  • policyProcessing = false
  • + *
  • nameConstraintsProcessing = false
  • + *
  • revocationChecking = false
  • + *
+ * + * @param config MOA configuration data for additional configuration + * information (currently unused). + */ + public ValidationProfileImpl(ConfigurationProvider config) { + this.config = config; + initialAnyPolicyInhibit = true; + initialExplicitPolicy = true; + initialPolicyMappingInhibit = true; + initialPolicySet = Collections.EMPTY_SET; + policyProcessing = false; + nameConstraintsProcessing = false; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialAnyPolicyInhibit() + */ + public boolean getInitialAnyPolicyInhibit() { + return initialAnyPolicyInhibit; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialExplicitPolicy() + */ + public boolean getInitialExplicitPolicy() { + return initialExplicitPolicy; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicyMappingInhibit() + */ + public boolean getInitialPolicyMappingInhibit() { + return initialPolicyMappingInhibit; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getInitialPolicySet() + */ + public Set getInitialPolicySet() { + return initialPolicySet; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getPolicyProcessing() + */ + public boolean getPolicyProcessing() { + return policyProcessing; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getNameConstraintsProcessing() + */ + public boolean getNameConstraintsProcessing() { + return nameConstraintsProcessing; + } + + /** + * @see iaik.pki.pathvalidation.ValidationProfile#getRevocationChecking() + */ + public boolean getRevocationChecking() + { + return config.getEnableRevocationChecking(); + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java new file mode 100644 index 000000000..c8809b0d8 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/revocation/RevocationProfileImpl.java @@ -0,0 +1,64 @@ +package at.gv.egovernment.moa.spss.server.iaik.pki.revocation; + +import java.security.cert.X509Certificate; + +import iaik.pki.revocation.RevocationProfile; +import iaik.pki.revocation.RevocationSourceTypes; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * An implementation of the RevocationProfile interface providing + * information about revocation status checking, based on MOA configuration + * data. + * + * @author Patrick Peck + * @version $Id$ + */ +public class RevocationProfileImpl implements RevocationProfile { + /** The default service order. */ + private static final String[] DEFAULT_SERVICE_ORDER = + { RevocationSourceTypes.CRL, RevocationSourceTypes.OCSP }; + /** The ConfigurationProvider to read the MOA configuration data + * from. */ + private ConfigurationProvider config; + /** The OCSP request hash algorithm. Currently only "SHA" is supported. */ + private static final String oCSPRequestHashAlgorithm = "SHA"; + + /** + * Create a new RevocationProfileImpl. + * + * @param config The MOA configuration data. + */ + public RevocationProfileImpl(ConfigurationProvider config) { + this.config = config; + // currently only "SHA" is supported +// this.oCSPRequestHashAlgorithm = ""; + } + + /** + * @see iaik.pki.revocation.RevocationProfile#getMaxRevocationAge(String) + */ + public long getMaxRevocationAge(String distributionPointUri) + { + return config.getMaxRevocationAge(); + } + + /** + * @see iaik.pki.revocation.RevocationProfile#getOCSPRequestHashAlgorithm() + */ + public String getOCSPRequestHashAlgorithm() { + return oCSPRequestHashAlgorithm; + } + + /** + * @see iaik.pki.revocation.RevocationProfile#getPreferredServiceOrder(java.security.cert.X509Certificate) + */ + public String[] getPreferredServiceOrder(X509Certificate cert) + { + String[] serviceOrder = config.getServiceOrder(); + if (serviceOrder == null || serviceOrder.length == 0) return DEFAULT_SERVICE_ORDER; + return serviceOrder; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java new file mode 100644 index 000000000..c49f7fe8c --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/pki/store/truststore/TrustStoreProfileImpl.java @@ -0,0 +1,135 @@ +package at.gv.egovernment.moa.spss.server.iaik.pki.store.truststore; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import iaik.pki.store.truststore.TrustStoreProfile; +import iaik.pki.store.truststore.TrustStoreTypes; +import iaik.pki.store.observer.NotificationData; +import iaik.pki.store.observer.Observer; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.TrustProfile; + +/** + * An implementation of the TrustStoreProfile interface, using data + * from the MOA configuration. + * + * @see iaik.pki.store.truststore.TrustStoreProfile + * @author Patrick Peck + * @version $Id$ + */ +public class TrustStoreProfileImpl implements TrustStoreProfile { + + /** The observers of this profile. */ + private List observers = new ArrayList(); + + /** + * The trust profile identifier. + */ + private String id_; + + /** The type of the trust profile. */ + private String type; + /** The URI of the trust profile.*/ + private String URI; + + /** + * Create a new TrustStoreProfileImpl. + * + * @param config The MOA configuration data, from which trust store + * configuration data is read. + * @param trustProfileId The trust profile id on which this + * TrustStoreProfile is based. + * @throws MOAApplicationException The trustProfileId could not + * be found in the MOA configuration. + */ + public TrustStoreProfileImpl( + ConfigurationProvider config, + String trustProfileId) + throws MOAApplicationException { + + TrustProfile tp = (TrustProfile) config.getTrustProfile(trustProfileId); + if (tp != null) + { + id_ = trustProfileId; + setURI(tp.getUri()); + setType(TrustStoreTypes.DIRECTORY); + } + else + { + throw new MOAApplicationException("2203", new Object[] { trustProfileId }); + } + } + + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getType() + */ + public String getType() { + return type; + } + + /** + * Sets the the trust store type. + * + * @param type The trust store type to set. + */ + protected void setType(String type) { + this.type = type; + } + + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getURI() + */ + public String getURI() { + return URI; + } + + /** + * Sets the trust store URI. + * + * @param URI The trust store URI to set. + */ + protected void setURI(String URI) { + this.URI = URI; + } + + // + // Methods of iaik.pki.store.observer.Observable interface + // + + /** + * @see iaik.pki.store.observer.Observable#addObserver(iaik.pki.store.observer.Observer) + */ + public void addObserver(Observer observer) { + observers.add(observer); + } + + /** + * @see iaik.pki.store.observer.Observable#removeObserver(iaik.pki.store.observer.Observer) + */ + public boolean removeObserver(Observer observer) { + return observers.remove(observer); + } + + /** + * @see iaik.pki.store.observer.Observable#notify(iaik.pki.store.observer.NotificationData) + */ + public void notify(NotificationData notificationData) { + for (Iterator iter = observers.iterator(); iter.hasNext();) { + Observer observer = (Observer) iter.next(); + observer.notify(notificationData); + } + } + + /** + * @see iaik.pki.store.truststore.TrustStoreProfile#getId() + */ + public String getId() + { + return id_; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java new file mode 100644 index 000000000..e076fe1eb --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/Base64TransformationImpl.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import iaik.server.modules.xml.Base64Transformation; + +/** + * An implementation of the Base64Transformation + * Transformation type. + * + * @author Patrick Peck + * @version $Id$ + */ +public class Base64TransformationImpl + extends TransformationImpl + implements Base64Transformation { + + /** + * Create a new Base64TransformationImpl. + * + * @see java.lang.Object#Object() + */ + public Base64TransformationImpl() { + setAlgorithmURI(Base64Transformation.BASE64_DECODING); + } + + /** + * Compare this Base64Transformation to another. + * + * @param other The object to compare thisBase64Transformation + * to. + * @return true, if other is a + * Base64Transformation and the algorithm URIs match, otherwise + * false. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof Base64Transformation) { + Base64Transformation transform = (Base64Transformation) other; + return getAlgorithmURI().equals(transform.getAlgorithmURI()); + } + return false; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java new file mode 100644 index 000000000..921b10cb6 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteArrayDataObjectImpl.java @@ -0,0 +1,54 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import iaik.server.modules.xml.BinaryDataObject; + +/** + * A BinaryDataObject encapsulating Base64 data. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ByteArrayDataObjectImpl + extends DataObjectImpl + implements BinaryDataObject { + + /** The binary data contained in this BinaryDataObject. */ + private byte[] bytes; + + /** + * Create a new ByteArrayDataObjectImpl. + * + * @param bytes The binary data contained in this + * BinaryDataObject. + */ + public ByteArrayDataObjectImpl(byte[] bytes) { + setBytes(bytes); + } + + /** + * Set the Base64 data. + * + * @param bytes The binary data contained in this + * BinaryDataObject. + */ + public void setBytes(byte[] bytes) { + this.bytes = bytes; + } + + /** + * Return the binary data encoded in the Base64 String as a + * stream. + * + * @return The binary data contained in this object, as a + * InputStream. Repeated calls to this function will return a + * new stream to the Base64 data. + * @see iaik.server.modules.xml.BinaryDataObject#getInputStream() + */ + public InputStream getInputStream() { + return new ByteArrayInputStream(bytes); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java new file mode 100644 index 000000000..ce400e61a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ByteStreamDataObjectImpl.java @@ -0,0 +1,49 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.io.InputStream; + +import iaik.server.modules.xml.BinaryDataObject; + +/** + * A BinaryDataObject encapsulating binary data from a stream. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ByteStreamDataObjectImpl + extends DataObjectImpl + implements BinaryDataObject { + + /** The InputStream containing the binary data. */ + private InputStream inputStream; + + /** + * Create a new ByteStreamDataObjectImpl. + * + * @param inputStream The stream from which to read the binary data. + */ + public ByteStreamDataObjectImpl(InputStream inputStream) { + setInputStream(inputStream); + } + + /** + * Set the input stream from which to read the binary data. + * + * @param inputStream The input stream from which to read the binary data. + */ + public void setInputStream(InputStream inputStream) { + this.inputStream = inputStream; + } + + /** + * Return the binary data from this object as a stream. + * + * @return The stream containing the binary data. Calling this function + * repeatedly will always return the same InputStream. + * @see iaik.server.modules.xml.BinaryDataObject#getInputStream() + */ + public InputStream getInputStream() { + return inputStream; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java new file mode 100644 index 000000000..a597b214d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/CanonicalizationImpl.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import iaik.server.modules.xml.Canonicalization; + +/** + * An implementation of the CanonicalizationTransform + * Transformation type. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CanonicalizationImpl + extends TransformationImpl + implements Canonicalization { + + /** + * Create a new CanonicalizationTransformImpl object. + * + * @param algorithmURI The canonicalization algorithm URI. + */ + public CanonicalizationImpl(String algorithmURI) { + setAlgorithmURI(algorithmURI); + } + + /** + * Compare this object to another Canonicalization. + * + * @param other The object to compare this + * Canonicalization to. + * @return true, if other is a + * Canonicalization and the algorithm URIs match, otherwise + * false. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof Canonicalization) { + Canonicalization c14n = (Canonicalization) other; + return getAlgorithmURI().equals(c14n.getAlgorithmURI()); + } + return false; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java new file mode 100644 index 000000000..875d82613 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/DataObjectImpl.java @@ -0,0 +1,87 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import iaik.server.modules.xml.DataObject; + +/** + * Abstract base implementation for the classes derived from + * DataObject. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class DataObjectImpl implements DataObject { + + /** The MIME type of the data object. */ + private String mimeType; + /** The refernce ID. */ + private String referenceID; + /** The URI of the type. */ + private String typeURI; + /** The URI identifying the data. */ + private String URI; + + /** + * @see iaik.server.modules.xml.DataObject#getMimeType() + */ + public String getMimeType() { + return mimeType; + } + + /** + * Set the mime type. + * + * @param mimeType The mime type to set. + */ + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + /** + * @see iaik.server.modules.xml.DataObject#getReferenceID() + */ + public String getReferenceID() { + return referenceID; + } + + /** + * Set the reference ID. + * + * @param referenceID The reference ID. + */ + public void setReferenceID(String referenceID) { + this.referenceID = referenceID; + } + + /** + * @see iaik.server.modules.xml.DataObject#getTypeURI() + */ + public String getTypeURI() { + return typeURI; + } + + /** + * Set the type URI. + * + * @param typeURI The type URI. + */ + public void setTypeURI(String typeURI) { + this.typeURI = typeURI; + } + + /** + * @see iaik.server.modules.xml.DataObject#getURI() + */ + public String getURI() { + return URI; + } + + /** + * Set the URI. + * + * @param URI The URI. + */ + public void setURI(String URI) { + this.URI = URI; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java new file mode 100644 index 000000000..41a47d0a1 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/EnvelopedSignatureTransformationImpl.java @@ -0,0 +1,42 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import iaik.server.modules.xml.EnvelopedSignatureTransformation; + +/** + * An implementation of the EnvelopedSignatureTransformation + * Transformation type. + * + * @author Patrick Peck + * @version $Id$ + */ +public class EnvelopedSignatureTransformationImpl + extends TransformationImpl + implements EnvelopedSignatureTransformation { + + /** + * Create a new EnvelopedSignatureTransformationImpl. + */ + public EnvelopedSignatureTransformationImpl() { + setAlgorithmURI(EnvelopedSignatureTransformation.ENVELOPED_SIGNATURE); + } + + /** + * Compare this object to another EnvelopedSignatureTransformation. + * + * @param other The object to compare this + * EnvelopedSignatureTransformation to. + * @return true, if other is a + * EnvelopedSignatureTransformation, otherwise + * false. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof EnvelopedSignatureTransformation) { + EnvelopedSignatureTransformation transform = + (EnvelopedSignatureTransformation) other; + return getAlgorithmURI().equals(transform.getAlgorithmURI()); + } + return false; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java new file mode 100644 index 000000000..b38fbe128 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/ExclusiveCanonicalizationImpl.java @@ -0,0 +1,76 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.util.List; + +import iaik.server.modules.xml.ExclusiveCanonicalization; + +/** + * An implementation of the ExclusiveCanonicalization type + * of Transformation. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ExclusiveCanonicalizationImpl + extends TransformationImpl + implements ExclusiveCanonicalization { + + /** The prefixes of the namespaces to treat according to canonical XML. */ + private List inclusiveNamespacePrefixes; + + /** + * Create a new ExclusiveCanonicalizationImpl object. + * + * @param algorithmURI The exclusive canonicalization algorithm URI. + * @param inclusiveNamespacePrefixes The namespace prefixes to be processed + * according to canonical XML. + */ + public ExclusiveCanonicalizationImpl( + String algorithmURI, + List inclusiveNamespacePrefixes) { + setAlgorithmURI(algorithmURI); + setInclusiveNamespacePrefixes(inclusiveNamespacePrefixes); + } + + /** + * Sets the namespace prefixes to be processed according to canonical XML. + * + * @param inclusiveNamespacePrefixes The prefixes of the namespaces to treat + * according to canonical XML. + */ + protected void setInclusiveNamespacePrefixes(List inclusiveNamespacePrefixes) { + this.inclusiveNamespacePrefixes = inclusiveNamespacePrefixes; + } + + /** + * @see iaik.server.modules.xml.ExclusiveCanonicalization#getInclusiveNamespacePrefixes() + */ + public List getInclusiveNamespacePrefixes() { + return inclusiveNamespacePrefixes; + } + + /** + * Compare this object to another CanonicalizationTransform. + * + * @param other The object to compare this + * ExclusiveCanonicalization to. + * @return true, if other is a + * ExclusiveCanonicalization and the algorithm URIs match, + * otherwise false. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof ExclusiveCanonicalization) { + ExclusiveCanonicalization eC14n = + (ExclusiveCanonicalization) other; + boolean algURIEquals = getAlgorithmURI().equals(eC14n.getAlgorithmURI()); + boolean inclNSPrefs = + (getInclusiveNamespacePrefixes() == null || getInclusiveNamespacePrefixes().isEmpty()) + ? eC14n.getInclusiveNamespacePrefixes() == null || eC14n.getInclusiveNamespacePrefixes().isEmpty() + : getInclusiveNamespacePrefixes().equals(eC14n.getInclusiveNamespacePrefixes()); + return algURIEquals && inclNSPrefs; + } + return false; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java new file mode 100644 index 000000000..19ca3dadf --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/SigningTimeImpl.java @@ -0,0 +1,34 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.util.Date; + +import iaik.server.modules.xml.SigningTime; + +/** + * An implementation of the SigningTime Property. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SigningTimeImpl implements SigningTime { + + /** The signing time. */ + private Date signingTime; + + /** + * Create a new SigningTimeImpl. + * + * @param signingTime The signing time. + */ + public SigningTimeImpl(Date signingTime) { + this.signingTime = signingTime; + } + + /** + * @see iaik.server.modules.xml.SigningTime#getSigningTime() + */ + public Date getSigningTime() { + return signingTime; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java new file mode 100644 index 000000000..59a414b69 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/TransformationImpl.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import iaik.server.modules.xml.Transformation; + +/** + * Base implementation class for Transformation derived classes. + * + * @author Patrick Peck + * @version $Id$ + */ +public abstract class TransformationImpl implements Transformation { + + /** The algorithm URI identifying the transformation algorithm. */ + private String algorithmURI; + + /** + * @see iaik.server.modules.xml.Transformation#getAlgorithmURI() + */ + public String getAlgorithmURI() { + return algorithmURI; + } + + /** + * Sets the algorithm URI. + * + * @param algorithmURI The algorithm URI to set. + */ + protected void setAlgorithmURI(String algorithmURI) { + this.algorithmURI = algorithmURI; + } + + /** + * Returns the hash code of the algorithm URI. Should be overridden if a + * transformation distinguishes itself from others by more than just the + * algorithm URI. + * + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return getAlgorithmURI().hashCode(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java new file mode 100644 index 000000000..bc31d694e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLDataObjectImpl.java @@ -0,0 +1,46 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import org.w3c.dom.Element; + +import iaik.server.modules.xml.XMLDataObject; + +/** + * A DataObject containing a single DOM element. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLDataObjectImpl + extends DataObjectImpl + implements XMLDataObject { + + /** The XML data contained in this XMLDataObject. */ + private Element element; + + /** + * Create a new XMLDataObjectImpl. + * + * @param element The DOM element contained in this + * XMLDataObject. + */ + public XMLDataObjectImpl(Element element) { + setElement(element); + } + + /** + * @see iaik.server.modules.xml.XMLDataObject#getElement() + */ + public Element getElement() { + return element; + } + + /** + * Set the DOM element contained in this XMLDataObject. + * + * @param element The DOM element to set. + */ + public void setElement(Element element) { + this.element = element; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java new file mode 100644 index 000000000..c855a922a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLNodeListDataObjectImpl.java @@ -0,0 +1,47 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import org.w3c.dom.NodeList; + +import iaik.server.modules.xml.XMLNodeListDataObject; + +/** + * A DataObject containing a list of DOM nodes. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLNodeListDataObjectImpl + extends DataObjectImpl + implements XMLNodeListDataObject { + + /** The nodes contained in this XMLNodeListDataObject. */ + private NodeList nodeList; + + /** + * Create a new XMLNodeListDataObjectImpl. + * + * @param nodeList The list of DOM nodes contained in this + * XMLNodeListDataObject. + */ + public XMLNodeListDataObjectImpl(NodeList nodeList) { + setNodeList(nodeList); + } + + /** + * Set the list of DOM nodes contained in this + * XMLNodeListDataObject. + * + * @param nodeList The list of DOM nodes to set. + */ + public void setNodeList(NodeList nodeList) { + this.nodeList = nodeList; + } + + /** + * @see iaik.server.modules.xml.XMLNodeListDataObject#getNodeList() + */ + public NodeList getNodeList() { + return nodeList; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java new file mode 100644 index 000000000..4fca907f3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XMLSignatureImpl.java @@ -0,0 +1,43 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import org.w3c.dom.Element; + +import iaik.server.modules.xml.XMLSignature; + +/** + * An object containing an XMLDsig signature in the form of a + * dsig:Signature DOM element. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureImpl implements XMLSignature { + /** The signature DOM element. */ + private Element element; + + /** + * Create a new XMLSignatureImpl. + * + * @param element The dsig:Signature DOM element. + */ + public XMLSignatureImpl(Element element) { + setElement(element); + } + + /** + * Set the dsig:Signature DOM element. + * + * @param element The dsig:Signature element to set. + */ + public void setElement(Element element) { + this.element = element; + } + + /** + * @see iaik.server.modules.xml.XMLSignature#getElement() + */ + public Element getElement() { + return element; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java new file mode 100644 index 000000000..034d4b653 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2FilterImpl.java @@ -0,0 +1,116 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.util.Map; + +import iaik.server.modules.xml.XPath2Transformation; +import iaik.server.modules.xml.XPath2Transformation.XPath2Filter; + +/** + * An object encapsulating an XPath-Filter2 expression. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XPath2FilterImpl implements XPath2Filter { + + /** The type of this filter. */ + private String filterType; + /** The XPath expression of this filter. */ + private String xPathExpression; + /** The namespace prefix to URI mapping to use for evaluating the XPath. */ + private Map namespaceDeclarations; + + /** + * Create a new XPath2FilterImpl object. + * + * @param filterType The type of filter. Must be one of the filter type + * constants declared in iaik.server.modules.xml.XPath2Transformation.XPath2Filter + * @param xPathExpression The XPath expression belonging to this filter. + * @param namespaceDeclarations The namespace declarations visible for this + * XPath2Filter. + */ + public XPath2FilterImpl( + String filterType, + String xPathExpression, + Map namespaceDeclarations) { + + setFilterType(filterType); + setXPathExpression(xPathExpression); + setNamespaceDeclarations(namespaceDeclarations); + } + + /** + * @see iaik.server.modules.xml.XPath2Transformation.XPath2Filter#getFilterType() + */ + public String getFilterType() { + return filterType; + } + + /** + * Set the filter type. + * + * @param filterType The filter type to set. + */ + protected void setFilterType(String filterType) { + this.filterType = filterType; + } + + /** + * @see iaik.server.modules.xml.XPath2Transformation.XPath2Filter#getXPathExpression() + */ + public String getXPathExpression() { + return xPathExpression; + } + + /** + * Set the XPath expression. + * + * @param xPathExpression The XPath expression to set. + */ + protected void setXPathExpression(String xPathExpression) { + this.xPathExpression = xPathExpression; + } + + /** + * @see iaik.server.modules.xml.XPath2Transformation.XPath2Filter#getNamespaceDeclarations() + */ + public Map getNamespaceDeclarations() { + return namespaceDeclarations; + } + + /** + * Set the namespace declarations. + * + * @param namespaceDeclarations The mapping between namespace prefixes and + * their associated URI. + */ + protected void setNamespaceDeclarations(Map namespaceDeclarations) { + this.namespaceDeclarations = namespaceDeclarations; + } + + /** + * Compare this object to another. + * + * @param other The object to compare this XPath2Filter to. + * @return true, if other is a + * XPath2Filter and the filter types match and the XPath + * expressions match. Otherwise false is returned. + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object other) { + if (other instanceof XPath2Transformation.XPath2Filter) { + XPath2Filter filter = (XPath2Transformation.XPath2Filter) other; + return getFilterType().equals(filter.getFilterType()) + && getXPathExpression().equals(filter.getXPathExpression()); + } + return false; + } + + /** + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return getXPathExpression().hashCode() * 31 + getFilterType().hashCode(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java new file mode 100644 index 000000000..c7496c2cd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPath2TransformationImpl.java @@ -0,0 +1,82 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import iaik.server.modules.xml.XPath2Transformation; + +/** + * An object encapsulating a Transformation containing several + * XPath-Filter2 expressions. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XPath2TransformationImpl + extends TransformationImpl + implements XPath2Transformation { + + /** The filters contained in this XPath2Transformation */ + private List xPathFilters = new ArrayList(); + + /** + * Create a new XPath2TransformationImpl. + * + * The list of XPath-Filter2 expression is initially empty. + */ + public XPath2TransformationImpl() { + setAlgorithmURI(XPath2Transformation.XPATH2); + } + + /** + * @see iaik.server.modules.xml.XPath2Transformation#getXPathFilters() + */ + public List getXPathFilters() { + return xPathFilters; + } + + /** + * Add an XPath-Filter2 expression to the list of filters. + * + * @param filter The filter to add. + */ + public void addXPathFilter(XPath2Filter filter) { + xPathFilters.add(filter); + } + + /** + * Compare this XPath2Transformation to another. + * + * @param other The object to compare this + * XPath2Transformation to. + * @return true, if other is an + * XPath2Transformation and getXPathFilters() equals + * other.getXPathFilters(). Otherwise false is + * returned. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof XPath2Transformation) { + XPath2Transformation transform = (XPath2Transformation) other; + + return getXPathFilters().equals(transform.getXPathFilters()); + } + return false; + } + + /** + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + Iterator iter = getXPathFilters().iterator(); + int hashCode = 0; + + while (iter.hasNext()) { + hashCode ^= iter.next().hashCode(); + } + + return hashCode; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java new file mode 100644 index 000000000..ccedbadb2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XPathTransformationImpl.java @@ -0,0 +1,98 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.util.Map; + +import iaik.server.modules.xml.XPathTransformation; + +/** + * A Transformation containing an XPath expression. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XPathTransformationImpl + extends TransformationImpl + implements XPathTransformation { + + /** The XPath expression. */ + private String xPathExpression; + /** The namespace prefix to URI mapping to use for XPath evaluation. */ + private Map namespaceDeclarations; + + /** + * Create a new XPathTransformationImpl. + * + * The namespace declarations are initialized empty. + * + * @param xPathExpression The XPath expression this object will contain. + * @param namespaceDeclarations The namespace declarations visible for this + * XPath. + */ + public XPathTransformationImpl( + String xPathExpression, + Map namespaceDeclarations) { + + setAlgorithmURI(XPathTransformation.XPATH); + setXPathExpression(xPathExpression); + setNamespaceDeclarations(namespaceDeclarations); + } + + /** + * Set the XPath expression. + * + * @param xPathExpression The XPath expression. + */ + protected void setXPathExpression(String xPathExpression) { + this.xPathExpression = xPathExpression; + } + + /** + * @see iaik.server.modules.xml.XPathTransformation#getXPathExpression() + */ + public String getXPathExpression() { + return xPathExpression; + } + + /** + * @see iaik.server.modules.xml.XPathTransformation#getNamespaceDeclarations() + */ + public Map getNamespaceDeclarations() { + return namespaceDeclarations; + } + + /** + * Set the namespace declarations. + * + * @param namespaceDeclarations The mapping between namespace prefixes and + * their associated URI. + */ + protected void setNamespaceDeclarations(Map namespaceDeclarations) { + this.namespaceDeclarations = namespaceDeclarations; + } + + /** + * Compare this XPathTransformation to another. + * + * @param other The object to compare this + * XPathTransformation to. + * @return true, if other is an + * XPathTransformation and if this object contains the same XPath + * expression as other. Otherwise false is returned. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof XPathTransformation) { + XPathTransformation transform = (XPathTransformation) other; + return getXPathExpression().equals(transform.getXPathExpression()); + } + return false; + } + + /** + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return getXPathExpression().hashCode(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java new file mode 100644 index 000000000..d38da650b --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xml/XSLTTransformationImpl.java @@ -0,0 +1,168 @@ +package at.gv.egovernment.moa.spss.server.iaik.xml; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; + +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import iaik.ixsil.algorithms.CanonicalizationAlgorithm; +import iaik.ixsil.algorithms.CanonicalizationAlgorithmImplExclusiveCanonicalXML; +import iaik.ixsil.exceptions.AlgorithmException; +import iaik.server.modules.xml.XSLTTransformation; + +import at.gv.egovernment.moa.util.NodeListAdapter; +import at.gv.egovernment.moa.util.StreamUtils; +import at.gv.egovernment.moa.util.XPathException; +import at.gv.egovernment.moa.util.XPathUtils; + + +/** + * A Transformation containing an XSLT transformation. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XSLTTransformationImpl + extends TransformationImpl + implements XSLTTransformation { + + /** The XSLT stylesheet. */ + private Element styleSheetElement; + /** The hash code of the canonicalized stylesheet. If calculated, this value + * should be != 0. */ + private int hashCode; + + /** + * Create a new XSLTTransformationImpl object. + * + * @param styleSheetElement The XSLT stylesheet element. + */ + public XSLTTransformationImpl(Element styleSheetElement) { + setAlgorithmURI(XSLTTransformation.XSLT); + setStyleSheetElement(styleSheetElement); + } + + /** + * Set the XSLT stylesheet element. + * + * @param styleSheetElement The XSLT stylesheet element to set. + */ + protected void setStyleSheetElement(Element styleSheetElement) { + this.styleSheetElement = styleSheetElement; + this.hashCode = 0; + } + + /** + * @see iaik.server.modules.xml.XSLTTransformation#getStylesheetElement() + */ + public Element getStylesheetElement() { + return styleSheetElement; + } + + /** + * Compare this XSLTTransformation to another. + * + * @param other The object to compare this + * XSLTTransformation to. + * @return true, if other is an + * XSLTTransformation and if the canonicalized representations of + * the stylesheets contained in this and other + * match. Otherwise, false is returned. + * @see java.lang.Object#equals(Object) + */ + public boolean equals(Object other) { + if (other instanceof XSLTTransformation) { + XSLTTransformation xslt = (XSLTTransformation) other; + + return compareElements( + getStylesheetElement(), + xslt.getStylesheetElement()); + } + return false; + } + + /** + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + if (hashCode == 0) { + hashCode = calculateHashCode(getStylesheetElement()); + } + return hashCode; + } + + /** + * Calculate the hash code for a DOM element by canonicalizing it. + * + * @param element The DOM element for which the hash code is to be calculated. + * @return int The hash code, or 0, if it could not be + * calculated. + */ + private static int calculateHashCode(Element element) { + try { + InputStream is = canonicalize(element); + byte[] buf = new byte[256]; + int hashCode = 1; + int length; + int i; + + while ((length = is.read(buf)) > 0) { + for (i = 0; i < length; i++) { + hashCode += buf[i] * 31 + i; + } + } + is.close(); + return hashCode; + } catch (AlgorithmException e) { + return 0; + } catch (IOException e) { + return 0; + } + } + + /** + * Compare two DOM elements by canonicalizing their contents and comparing the + * resulting byte stream. + * + * @param elem1 The 1st element to compare. + * @param elem2 The 2nd element to compare. + * @return boolean true, if the elements are considered equal + * after canonicalization. Otherwise false is returned. + */ + private static boolean compareElements(Element elem1, Element elem2) { + try { + InputStream is1 = canonicalize(elem1); + InputStream is2 = canonicalize(elem2); + return StreamUtils.compareStreams(is1, is2); + } catch (AlgorithmException e) { + return false; + } catch (IOException e) { + return false; + } + } + + /** + * Canonicalize a DOM element. + * + * @param element The element to canonicalize. + * @return InputStream A stream with the canonicalized data. + * @throws AlgorithmException An error occurred canonicalizing the element. + */ + private static InputStream canonicalize(Element element) + throws AlgorithmException { + CanonicalizationAlgorithm c14n = + new CanonicalizationAlgorithmImplExclusiveCanonicalXML(); + NodeList nodeList; + + try { + nodeList = XPathUtils.selectNodeList(element, XPathUtils.ALL_NODES_XPATH); + } catch (XPathException e) { + nodeList = new NodeListAdapter(Collections.EMPTY_LIST); + } + c14n.setInput(nodeList); + return c14n.canonicalize(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java new file mode 100644 index 000000000..a14b83b7d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/DataObjectTreatmentImpl.java @@ -0,0 +1,150 @@ +package at.gv.egovernment.moa.spss.server.iaik.xmlsign; + +import java.util.List; + +import iaik.server.modules.xmlsign.DataObjectTreatment; + +import at.gv.egovernment.moa.spss.server.util.IdGenerator; + +/** + * An object encapsulating how to treat an associated DataObject + * when creating a signature. + * + * @author Patrick Peck + * @version $Id$ + */ +public class DataObjectTreatmentImpl implements DataObjectTreatment { + /** The final content MIME type. */ + private String finalContentType; + /** The name of the hash algorithm. */ + private String hashAlgorithmName; + /** This transformations to apply to the associated data object. */ + private List transformationList; + /** Supplemental information for the transformations. */ + private List transformationSupplements; + /** Whether to include the associated data object in the signature. */ + private boolean includedInSignature; + /** Whether to include the associated data object in the manifest. */ + private boolean referenceInManifest; + /** The object ID generator. */ + private IdGenerator objIdGen; + + /** + * Create a new DataObjectTreatmentImpl. + * + * @param objIdGen The IdGenerator for unique object IDs. + */ + public DataObjectTreatmentImpl(IdGenerator objIdGen) { + this.objIdGen = objIdGen; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#getFinalContentType() + */ + public String getFinalContentType() { + return finalContentType; + } + + /** + * Sets the final content type. + * + * @param finalContentType The final content type to set (a MIME-type type of + * String). + */ + public void setFinalContentType(String finalContentType) { + this.finalContentType = finalContentType; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#getHashAlgorithmName() + */ + public String getHashAlgorithmName() { + return hashAlgorithmName; + } + + /** + * Sets the hash algorithm name. + * + * @param hashAlgorithmName The hash algorithm name to set. + */ + public void setHashAlgorithmName(String hashAlgorithmName) { + this.hashAlgorithmName = hashAlgorithmName; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#isIncludedInSignature() + */ + public boolean isIncludedInSignature() { + return includedInSignature; + } + + /** + * Sets whether the associated DataObject is to be included in + * the signature. + * + * @param includedInSignature If true, the associated + * DataObject will be included in the signature, otherwise not. + */ + public void setIncludedInSignature(boolean includedInSignature) { + this.includedInSignature = includedInSignature; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#isReferenceInManifest() + */ + public boolean isReferenceInManifest() { + return referenceInManifest; + } + + /** + * Sets whether the associated DataObject is + * to be included in the dsig:Manifest. + * + * @param referenceInManifest If true, the associated + * DataObject will be included in the manifest, otherwise not. + */ + public void setReferenceInManifest(boolean referenceInManifest) { + this.referenceInManifest = referenceInManifest; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#getTransformationList() + */ + public List getTransformationList() { + return transformationList; + } + + /** + * Set the list of transformations for the associated DataObject. + * + * @param transformationList The transformations to set. + */ + public void setTransformationList(List transformationList) { + this.transformationList = transformationList; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#getTransformationSupplements() + */ + public List getTransformationSupplements() { + return transformationSupplements; + } + + /** + * Sets the transformation supplements for the associated + * DataObject. + * + * @param transformationSupplements The transformation supplements to set. + */ + public void setTransformationSupplements(List transformationSupplements) { + this.transformationSupplements = transformationSupplements; + } + + /** + * @see iaik.server.modules.xmlsign.DataObjectTreatment#getDsigDataObjectID() + */ + public String getDsigDataObjectID() { + return objIdGen.uniqueId(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java new file mode 100644 index 000000000..fb3ff4931 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureCreationProfileImpl.java @@ -0,0 +1,279 @@ +package at.gv.egovernment.moa.spss.server.iaik.xmlsign; + +import java.util.List; +import java.util.Set; + +import iaik.server.modules.algorithms.SignatureAlgorithms; +import iaik.server.modules.keys.AlgorithmUnavailableException; +import iaik.server.modules.keys.KeyEntryID; +import iaik.server.modules.keys.KeyModule; +import iaik.server.modules.keys.KeyModuleFactory; +import iaik.server.modules.keys.UnknownKeyException; +import iaik.server.modules.xml.Canonicalization; +import iaik.server.modules.xmlsign.XMLSignatureCreationProfile; +import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation; + +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.spss.server.util.IdGenerator; + +/** + * An object providing auxiliary information for creating an XML signature. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureCreationProfileImpl + implements XMLSignatureCreationProfile { + + /** The transformations to apply to a data object. */ + private List dataObjectTreatmentList; + /** The set of keys available to the signing process. */ + private Set keySet; + /** The type URI of the signature manifest. */ + private String securityLayerManifestTypeURI; + /** Whether the created signature is to be Security Layer conform. */ + private boolean securityLayerConform; + /** Where to insert the signature into the signature environment. */ + private XMLSignatureInsertionLocation signatureInsertionLocation; + /** The signature structur type. */ + private String signatureStructureType; + /** The type of Canonicalization to use for the signed info. */ + private Canonicalization signedInfoCanonicalization; + /** Properties to be signed during signature creation. */ + private List signedProperties; + /** The ID generator for signature IDs. */ + private IdGenerator signatureIDGenerator; + /** The ID generator for manifst IDs. */ + private IdGenerator manifestIDGenerator; + /** The ID generator for XMLDsig manifest IDs. */ + private IdGenerator dsigManifestIDGenerator; + /** The ID generator for signed property IDs. */ + private IdGenerator propertyIDGenerator; + + /** + * Create a new XMLSignatureCreationProfileImpl. + * + * @param createProfileCount Provides external information about the + * number of calls to the signature creation module, using the same request. + * @param reservedIDs The set of IDs that must not be used while generating + * new IDs. + */ + public XMLSignatureCreationProfileImpl( + int createProfileCount, + Set reservedIDs) { + signatureIDGenerator = + new IdGenerator("signature-" + createProfileCount, reservedIDs); + manifestIDGenerator = + new IdGenerator("manifest-" + createProfileCount, reservedIDs); + dsigManifestIDGenerator = + new IdGenerator("dsig-manifest-" + createProfileCount, reservedIDs); + propertyIDGenerator = + new IdGenerator("etsi-signed-" + createProfileCount, reservedIDs); + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getDataObjectTreatmentList() + */ + public List getDataObjectTreatmentList() { + return dataObjectTreatmentList; + } + + /** + * Sets the list of DataObjectTreatments. + * + * @param dataObjectTreatmentList The DataObjectTreatments to + * set. + */ + public void setDataObjectTreatmentList(List dataObjectTreatmentList) { + this.dataObjectTreatmentList = dataObjectTreatmentList; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getKeySet() + */ + public Set getKeySet() { + return keySet; + } + + /** + * Set the set of KeyEntryIDs which may be used for signature + * creation. + * + * @param keySet The set of KeyEntryIDs to set. + */ + public void setKeySet(Set keySet) { + this.keySet = keySet; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSecurityLayerManifestTypeURI() + */ + public String getSecurityLayerManifestTypeURI() { + return securityLayerManifestTypeURI; + } + + /** + * Set the SecurityLayerManifestTypeURI. + * + * @param securityLayerManifestTypeURI The SecurityLayerManifestTypeURI to + * set. + */ + public void setSecurityLayerManifestTypeURI(String securityLayerManifestTypeURI) { + this.securityLayerManifestTypeURI = securityLayerManifestTypeURI; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureAlgorithmName(KeyEntryID) + */ + public String getSignatureAlgorithmName(KeyEntryID selectedKeyID) + throws AlgorithmUnavailableException { + + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + TransactionId tid = new TransactionId(context.getTransactionID()); + KeyModule module = KeyModuleFactory.getInstance(tid); + Set algorithms; + + try { + algorithms = module.getSupportedSignatureAlgorithms(selectedKeyID); + } catch (UnknownKeyException e) { + throw new AlgorithmUnavailableException( + "Unknown key entry: " + selectedKeyID, + e, + null); + } + + if (algorithms.contains(SignatureAlgorithms.MD2_WITH_RSA) // TODO retournierten Algorithmus abhängig von der Schlüssellänge machen (bei längeren Schlüsseln SHA256 statt SHA1) + || algorithms.contains(SignatureAlgorithms.MD5_WITH_RSA) + || algorithms.contains(SignatureAlgorithms.RIPEMD128_WITH_RSA) + || algorithms.contains(SignatureAlgorithms.RIPEMD160_WITH_RSA) + || algorithms.contains(SignatureAlgorithms.SHA1_WITH_RSA) + || algorithms.contains(SignatureAlgorithms.SHA256_WITH_RSA)) { + + return SignatureAlgorithms.SHA1_WITH_RSA; + } else if ( + algorithms.contains(SignatureAlgorithms.ECDSA)) { + return SignatureAlgorithms.ECDSA; + } else if ( + algorithms.contains(SignatureAlgorithms.DSA)) { + return SignatureAlgorithms.DSA; + } else { + throw new AlgorithmUnavailableException( + "No algorithm for key entry: " + selectedKeyID, + null, + null); + } + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureInsertionLocation() + */ + public XMLSignatureInsertionLocation getSignatureInsertionLocation() { + return signatureInsertionLocation; + } + + /** + * Set the location where the signature is to be inserted into the signature + * parent. + * + * @param signatureInsertionLocation The location to set. + */ + public void setSignatureInsertionLocation(XMLSignatureInsertionLocation signatureInsertionLocation) { + this.signatureInsertionLocation = signatureInsertionLocation; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureStructureType() + */ + public String getSignatureStructureType() { + return signatureStructureType; + } + + /** + * Set the signature structure type. + * @param signatureStructureType The signature structure type to set. + */ + public void setSignatureStructureType(String signatureStructureType) { + this.signatureStructureType = signatureStructureType; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignedInfoCanonicalization() + */ + public Canonicalization getSignedInfoCanonicalization() { + return signedInfoCanonicalization; + } + + /** + * Sets the canonicalization method to use for the SignedInfo object. + * + * @param signedInfoCanonicalization The canonicalization method to set. + */ + public void setSignedInfoCanonicalization(Canonicalization signedInfoCanonicalization) { + this.signedInfoCanonicalization = signedInfoCanonicalization; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignedProperties() + */ + public List getSignedProperties() { + return signedProperties; + } + + /** + * Set the signed properties. + * + * @param signedProperties The signed properties to set. + */ + public void setSignedProperties(List signedProperties) { + this.signedProperties = signedProperties; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#isSecurityLayerConform() + */ + public boolean isSecurityLayerConform() { + return securityLayerConform; + } + + /** + * Sets the security layer conformity. + * + * @param securityLayerConform true, if the created signature + * is to be conform to the Security Layer specification. + */ + public void setSecurityLayerConform(boolean securityLayerConform) { + this.securityLayerConform = securityLayerConform; + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignatureID() + */ + public String getSignatureID() { + return signatureIDGenerator.uniqueId(); + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSecurityLayerManifestID() + */ + public String getSecurityLayerManifestID() { + return manifestIDGenerator.uniqueId(); + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getDsigManifestID() + */ + public String getDsigManifestID() { + return dsigManifestIDGenerator.uniqueId(); + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureCreationProfile#getSignedPropertiesID() + */ + public String getSignedPropertiesID() { + return propertyIDGenerator.uniqueId(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java new file mode 100644 index 000000000..d55f61303 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlsign/XMLSignatureInsertionLocationImpl.java @@ -0,0 +1,45 @@ +package at.gv.egovernment.moa.spss.server.iaik.xmlsign; + +import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation; + +/** + * An object giving the location of where the signature will be + * inserted into the parent element. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureInsertionLocationImpl + implements XMLSignatureInsertionLocation { + + /** Where to put the signature into the signature parent element. */ + private int signatureChildIndex; + + /** + * Create a new XMLSignatureInsertLocationImpl. + * + * @param signatureChildIndex The position index at which to append the + * signature to the parent element. + */ + public XMLSignatureInsertionLocationImpl(int signatureChildIndex) { + setSignatureChildIndex(signatureChildIndex); + } + + /** + * @see iaik.server.modules.xmlsign.XMLSignatureInsertionLocation#getSignatureChildIndex() + */ + public int getSignatureChildIndex() { + return signatureChildIndex; + } + + /** + * Sets the position index at which to append the signature to the parent + * element. + * + * @param signatureChildIndex The position index to set. + */ + public void setSignatureChildIndex(int signatureChildIndex) { + this.signatureChildIndex = signatureChildIndex; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java new file mode 100644 index 000000000..216596dc3 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/xmlverify/XMLSignatureVerificationProfileImpl.java @@ -0,0 +1,131 @@ +package at.gv.egovernment.moa.spss.server.iaik.xmlverify; + +import java.util.List; + +import iaik.pki.PKIProfile; +import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; + +/** + * An object providing auxiliary information for verifying an XML signature. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureVerificationProfileImpl + implements XMLSignatureVerificationProfile { + + /** Whether to check the Security Layer manifest. */ + private boolean checkSecurityLayerManifest; + /** Whether to check the XMLDsig manifest. */ + private boolean checkXMLDsigManifests; + /** The profile for validating the signer certificate. */ + private PKIProfile certificateValidationProfile; + /** Supplements for the transformations. */ + private List transformationSupplements; + /** Whether to include hash input data in the response. */ + private boolean includeHashInputData; + /** Whether to include reference input data in the response. */ + private boolean includeReferenceInputData; + + /** + * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#checkSecurityLayerManifest() + */ + public boolean checkSecurityLayerManifest() { + return checkSecurityLayerManifest; + } + + /** + * Set whether to check the references in the Security Layer manifest. + * + * @param checkSecurityLayerManifest true, if the references + * in the Security Layer manifest must be checked. + */ + public void setCheckSecurityLayerManifest(boolean checkSecurityLayerManifest) { + this.checkSecurityLayerManifest = checkSecurityLayerManifest; + } + + /** + * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#checkXMLDsigManifests() + */ + public boolean checkXMLDsigManifests() { + return checkXMLDsigManifests; + } + + /** + * Sets whether to check the references of all XML Dsig manifests. + * + * @param checkXMLDSigManifests true, if the references in the + * XML Dsig manifest must be checked. + */ + public void setCheckXMLDsigManifests(boolean checkXMLDSigManifests) { + this.checkXMLDsigManifests = checkXMLDSigManifests; + } + + /** + * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#getCertificateValidationProfile() + */ + public PKIProfile getCertificateValidationProfile() { + return certificateValidationProfile; + } + + /** + * Sets the profile for validating the signer certificate. + * + * @param certificateValidationProfile The certificate validation profile to + * set. + */ + public void setCertificateValidationProfile(PKIProfile certificateValidationProfile) { + this.certificateValidationProfile = certificateValidationProfile; + } + + /** + * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#getTransformationSupplements() + */ + public List getTransformationSupplements() { + return transformationSupplements; + } + + /** + * Sets the transformation supplements. + * + * @param transformationSupplements The transformation supplements to set. + */ + public void setTransformationSupplements(List transformationSupplements) { + this.transformationSupplements = transformationSupplements; + } + + /** + * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#includeHashInputData() + */ + public boolean includeHashInputData() { + return includeHashInputData; + } + + /** + * Set whether to include the hash input data in the result. + * + * @param includeHashInputData If true, the hash input data + * will be returned in the result. + */ + public void setIncludeHashInputData(boolean includeHashInputData) { + this.includeHashInputData = includeHashInputData; + } + + /** + * @see iaik.server.modules.xmlverify.XMLSignatureVerificationProfile#includeReferenceInputData() + */ + public boolean includeReferenceInputData() { + return includeReferenceInputData; + } + + /** + * Set whether to include the reference input data in the result. + * + * @param includeReferenceInputData If true, the reference + * input data will be included in the result. + */ + public void setIncludeReferenceInputData(boolean includeReferenceInputData) { + this.includeReferenceInputData = includeReferenceInputData; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java new file mode 100644 index 000000000..caf17db66 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/ConfiguratorImpl.java @@ -0,0 +1,42 @@ +package at.gv.egovernment.moa.spss.server.init; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.Configurator; +import at.gv.egovernment.moa.spss.server.config.ConfigurationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; + +/** + * Default implementation of Configurator. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ConfiguratorImpl extends Configurator { + /** whether the configuration has been initialized */ + private boolean initialized = false; + + public void init() throws MOAException { + if (!initialized) { + SystemInitializer.init(); + initialized = true; + } + } + + public void update() throws MOAException { + if (!initialized) { + return; + } + + try { + // reconfigure the system + ConfigurationProvider config = ConfigurationProvider.reload(); + new IaikConfigurator().configure(config); + } catch (MOAException e) { + throw e; + } catch (Throwable t) { + throw new ConfigurationException("", null, t); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java new file mode 100644 index 000000000..4871ac4fe --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/init/SystemInitializer.java @@ -0,0 +1,129 @@ +package at.gv.egovernment.moa.spss.server.init; + +import java.io.IOException; +import java.security.Security; + +import javax.net.ssl.SSLSocketFactory; + +import org.apache.axis.AxisProperties; + +import iaik.ixsil.init.IXSILInit; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; +import at.gv.egovernment.moa.spss.server.logging.IaikLog; +import at.gv.egovernment.moa.spss.server.service.RevocationArchiveCleaner; +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * MOA SP/SS web service initialization. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SystemInitializer { + /** Interval between archive cleanups in seconds */ + private static final long ARCHIVE_CLEANUP_INTERVAL = 60 * 60; // 1h + /** The MOA SP/SS logging hierarchy. */ + private static final String LOGGING_HIERARCHY = "moa.spss.server"; + /** Whether XML schema grammars have been initialized. */ + private static boolean grammarsInitialized = false; + + /** + * Initialize the MOA SP/SS webservice. + */ + public static void init() { + MessageProvider msg = MessageProvider.getInstance(); + ClassLoader cl = SystemInitializer.class.getClassLoader(); + Thread archiveCleaner; + + // set up the MOA SPSS logging hierarchy + Logger.setHierarchy(LOGGING_HIERARCHY); + + // set up a logging context for logging the startup + LoggingContextManager.getInstance().setLoggingContext( + new LoggingContext("startup")); + + // load some jsse classes so that the integrity of the jars can be verified + // before the iaik jce is installed as the security provider + // this workaround is only needed when sun jsse is used in conjunction with + // iaik-jce (on jdk1.3) + try { + cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar + } catch (ClassNotFoundException e) { + Logger.warn(msg.getMessage("init.03", null), e); + } + + // set up SUN JSSE SSL + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty( + "java.protocol.handler.pkgs", + "com.sun.net.ssl.internal.www.protocol"); + SSLSocketFactory.getDefault(); + + +// AxisProperties.setProperty("enableNamespacePrefixOptimization","false"); +// AxisProperties.setProperty("disablePrettyXML", "true"); +// AxisProperties.setProperty("axis.doAutoTypes", "true"); + + // initialize preparsed Xerces grammar pool for faster XML + // parsing/validating + try { + if (!grammarsInitialized) { + Class clazz = SystemInitializer.class; + // preparse XML schema + DOMUtils.addSchemaToPool( + clazz.getResourceAsStream(Constants.XML_SCHEMA_LOCATION), + Constants.XML_NS_URI); + // preparse XMLDsig Filter2 schema + DOMUtils.addSchemaToPool( + clazz.getResourceAsStream(Constants.DSIG_FILTER2_SCHEMA_LOCATION), + Constants.DSIG_FILTER2_NS_URI); + // preparse XMLDsig schema + DOMUtils.addSchemaToPool( + clazz.getResourceAsStream(Constants.DSIG_SCHEMA_LOCATION), + Constants.DSIG_NS_URI); + // preparse MOA schema + DOMUtils.addSchemaToPool( + clazz.getResourceAsStream(Constants.MOA_SCHEMA_LOCATION), + Constants.MOA_NS_URI); + grammarsInitialized = true; + } + } catch (IOException e) { + Logger.warn(new LogMsg(msg.getMessage("init.04", null)), e); + } + + // initialize configuration + try { + ConfigurationProvider config = ConfigurationProvider.getInstance(); + new IaikConfigurator().configure(config); + Logger.info(new LogMsg(msg.getMessage("init.01", null))); + } catch (MOAException e) { + Logger.fatal(new LogMsg(msg.getMessage("init.00", null)), e); + } + + // set IXSIL debug output + IXSILInit.setPrintDebugLog( + Logger.isDebugEnabled(IaikLog.IAIK_LOG_HIERARCHY)); + + // start the archive cleanup thread + archiveCleaner = + new Thread(new RevocationArchiveCleaner(ARCHIVE_CLEANUP_INTERVAL)); + archiveCleaner.setName("RevocationArchiveCleaner"); + archiveCleaner.setDaemon(true); + archiveCleaner.setPriority(Thread.MIN_PRIORITY); + archiveCleaner.start(); + + // unset the startup logging context + LoggingContextManager.getInstance().setLoggingContext(null); + } + +} 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 new file mode 100644 index 000000000..f7a322d11 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvoker.java @@ -0,0 +1,221 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import iaik.IAIKException; +import iaik.IAIKRuntimeException; +import iaik.server.modules.cmsverify.CMSSignatureVerificationModule; +import iaik.server.modules.cmsverify.CMSSignatureVerificationModuleFactory; +import iaik.server.modules.cmsverify.CMSSignatureVerificationProfile; +import iaik.server.modules.cmsverify.CMSSignatureVerificationResult; + +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContent; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentReference; +import at.gv.egovernment.moa.spss.api.cmsverify.CMSDataObject; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.server.logging.IaikLog; +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * A class providing an interface to the + * CMSSignatureVerificationModule. + * + * This class performs the invocation of the + * iaik.server.modules.cmsverify.CMSSignatureVerificationModule + * from a VerifyCMSSignatureRequest. The result of the invocation + * is integrated into a VerifyCMSSignatureResponse returned. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CMSSignatureVerificationInvoker { + + /** The single instance of this class. */ + private static CMSSignatureVerificationInvoker instance = null; + + /** + * Return the only instance of this class. + * + * @return The only instance of this class. + */ + public static synchronized CMSSignatureVerificationInvoker getInstance() { + if (instance == null) { + instance = new CMSSignatureVerificationInvoker(); + } + return instance; + } + + /** + * Create a new CMSSignatureVerificationInvoker. + * + * Protected to disallow multiple instances. + */ + protected CMSSignatureVerificationInvoker() { + } + + /** + * Verify a CMS signature. + * + * @param request The VerifyCMSSignatureRequest containing the + * CMS signature, as well as additional data needed for verification. + * @return Element A VerifyCMSSignatureResponse containing the + * answer to the VerifyCMSSignatureRequest. + * @throws MOAException An error occurred while processing the request. + */ + public VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) + throws MOAException { + CMSSignatureVerificationProfileFactory profileFactory = + new CMSSignatureVerificationProfileFactory(request); + VerifyCMSSignatureResponseBuilder responseBuilder = + new VerifyCMSSignatureResponseBuilder(); + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + LoggingContext loggingCtx = + LoggingContextManager.getInstance().getLoggingContext(); + InputStream signature; + InputStream signedContent = null; + CMSSignatureVerificationProfile profile; + Date signingTime; + List results; + CMSSignatureVerificationResult result; + int[] signatories; + InputStream input; + byte[] buf = new byte[256]; + + // get the signature + signature = request.getCMSSignature(); + + try { + // get the signed content + signedContent = getSignedContent(request); + + // build the profile + profile = profileFactory.createProfile(); + + // get the signing time + signingTime = request.getDateTime(); + + // verify the signature + CMSSignatureVerificationModule module = + CMSSignatureVerificationModuleFactory.getInstance(); + + module.setLog(new IaikLog(loggingCtx.getNodeID())); + + module.init( + signature, + signedContent, + profile, + new TransactionId(context.getTransactionID())); + input = module.getInputStream(); + + while (input.read(buf) > 0); + results = module.verifySignature(signingTime); + } catch (IAIKException e) { + MOAException moaException = IaikExceptionMapper.getInstance().map(e); + throw moaException; + } catch (IAIKRuntimeException e) { + MOAException moaException = IaikExceptionMapper.getInstance().map(e); + throw moaException; + } catch (IOException e) { + throw new MOAApplicationException("2244", null, e); + } catch (MOAException e) + { + throw e; + } + finally + { + try + { + if (signedContent != null) signedContent.close(); + } + catch (Throwable t) + { + // Intentionally do nothing here + } + } + + // build the response: for each signatory add the result to the response + signatories = request.getSignatories(); + if (signatories == VerifyCMSSignatureRequest.ALL_SIGNATORIES) { + Iterator resultIter; + + for (resultIter = results.iterator(); resultIter.hasNext();) { + result = (CMSSignatureVerificationResult) resultIter.next(); + responseBuilder.addResult(result); + } + } else { + int i; + + for (i = 0; i < signatories.length; i++) { + int sigIndex = signatories[i] - 1; + + try { + result = + (CMSSignatureVerificationResult) results.get(signatories[i] - 1); + responseBuilder.addResult(result); + } catch (IndexOutOfBoundsException e) { + throw new MOAApplicationException( + "2249", + new Object[] { new Integer(sigIndex)}); + } + } + } + + return responseBuilder.getResponse(); + } + + /** + * Get the signed content contained either in the request itself or given as a + * reference to external data. + * + * @param request The VerifyCMSSignatureRequest containing the + * signed content (or the reference to the signed content). + * @return InputStream A stream providing the signed content data, or + * null if no signed content was provided with the request. + * @throws MOAApplicationException An error occurred building the stream. + */ + private InputStream getSignedContent(VerifyCMSSignatureRequest request) + throws MOAApplicationException { + + CMSDataObject dataObj; + CMSContent content; + + // select the Content element + dataObj = request.getDataObject(); + if (dataObj == null) { + return null; + } + content = dataObj.getContent(); + + // build the content data + switch (content.getContentType()) { + case CMSContent.EXPLICIT_CONTENT : + return ((CMSContentExcplicit) content).getBinaryContent(); + case CMSContent.REFERENCE_CONTENT : + String reference = ((CMSContentReference) content).getReference(); + if (!"".equals(reference)) { + ExternalURIResolver resolver = new ExternalURIResolver(); + return resolver.resolve(reference); + } else { + return null; + } + default : + return null; + } + + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java new file mode 100644 index 000000000..442921850 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationProfileFactory.java @@ -0,0 +1,61 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import iaik.server.modules.cmsverify.CMSSignatureVerificationProfile; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.cmsverify.CMSSignatureVerificationProfileImpl; +import at.gv.egovernment.moa.spss.server.iaik.pki.PKIProfileImpl; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * A factory to create a CMSSignatureVerificationProfile from a + * VerifyCMSSignatureRequest and the current MOA configuration + * data. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CMSSignatureVerificationProfileFactory { + + /** The VerifyCMSSignatureRequest to draw profile data from. */ + private VerifyCMSSignatureRequest request; + + /** + * Create a new CMSSignatureVerificationProfileFactory. + * + * @param request The VerifyCMSSignatureRequest to draw profile + * data from. + */ + public CMSSignatureVerificationProfileFactory(VerifyCMSSignatureRequest request) { + this.request = request; + } + + /** + * Create a CMSSignatureVerificationProfile from the given + * request and the current MOA configuration. + * + * @return The CMSSignatureVerificationProfile for the + * request, based on the current configuration. + * @throws MOAException An error occurred creating the profile. + */ + public CMSSignatureVerificationProfile createProfile() + throws MOAException { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + CMSSignatureVerificationProfileImpl profile = + new CMSSignatureVerificationProfileImpl(); + String trustProfileID; + + // set the certificate validation profile + trustProfileID = request.getTrustProfileId(); + profile.setCertificateValidationProfile( + new PKIProfileImpl(config, trustProfileID)); + + return profile; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java new file mode 100644 index 000000000..6302cadfd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/CreateXMLSignatureResponseBuilder.java @@ -0,0 +1,71 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.util.ArrayList; +import java.util.List; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.ErrorResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.SignatureEnvironmentResponse; + +/** + * A class to build a CreateXMLSignatureResponse. + * + *

The methods addSignature() and addError() may be + * called in any combination to add SignatureEnvironment and + * ErrorResponse elements to the response. One of these functions + * must be called at least once to produce a + * CreateXMLSignatureResponse.

+ * + *

The getResponseElement() method then returns the + * CreateXMLSignatureResponse built so far.

+ * + * @author Patrick Peck + * @version $Id$ + */ +public class CreateXMLSignatureResponseBuilder { + + /** The SPSSFactory for creating API objects. */ + private SPSSFactory factory = SPSSFactory.getInstance(); + /** The elements to add to the response. */ + private List responseElements = new ArrayList(); + + /** + * Get the CreateXMLSignatureResponse built so far. + * + * @return The CreateXMLSignatureResponse built so far. + */ + public CreateXMLSignatureResponse getResponse() { + return factory.createCreateXMLSignatureResponse(responseElements); + } + + /** + * Add a SignatureEnvironment element to the response. + * + * @param signatureEnvironment The content to put under the + * SignatureEnvironment element. This should either be a + * dsig:Signature element (in case of a detached signature) or + * the signature environment containing the signature (in case of + * an enveloping signature). + */ + public void addSignatureEnvironment(Element signatureEnvironment) { + SignatureEnvironmentResponse responseElement = + factory.createSignatureEnvironmentResponse(signatureEnvironment); + responseElements.add(responseElement); + } + + /** + * Add a ErrorResponse element to the response. + * + * @param errorCode The error code. + * @param info Additional information about the error. + */ + public void addError(String errorCode, String info) { + ErrorResponse errorResponse = + factory.createErrorResponse(Integer.parseInt(errorCode), info); + responseElements.add(errorResponse); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java new file mode 100644 index 000000000..1386d5c2d --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java @@ -0,0 +1,892 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import org.xml.sax.EntityResolver; +import org.xml.sax.SAXException; + +import iaik.ixsil.util.URI; +import iaik.ixsil.util.XPointerReferenceResolver; +import iaik.server.modules.xml.DataObject; +import iaik.server.modules.xml.XMLDataObject; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.EntityResolverChain; +import at.gv.egovernment.moa.util.MOAEntityResolver; +import at.gv.egovernment.moa.util.MOAErrorHandler; +import at.gv.egovernment.moa.util.StreamEntityResolver; +import at.gv.egovernment.moa.util.StreamUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.ContentBinary; +import at.gv.egovernment.moa.spss.api.common.ContentLocRef; +import at.gv.egovernment.moa.spss.api.common.ContentXML; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterBinary; +import at.gv.egovernment.moa.spss.server.iaik.xml.ByteArrayDataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.ByteStreamDataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.DataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XMLNodeListDataObjectImpl; +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * A class to create DataObjects contained in different + * locations of the MOA XML request format. + * + * @author Patrick Peck + * @author Gregor Karlinger + * @version $Id$ + */ +public class DataObjectFactory { + + /** The single instance of this class. */ + private static DataObjectFactory instance = null; + + /** + * Return the only instance of this class. + * + * @return The only instance of this class. + */ + public static synchronized DataObjectFactory getInstance() { + if (instance == null) { + instance = new DataObjectFactory(); + } + return instance; + } + + /** + * Create a new DataObjectFactory. + * + * Protected to disallow multiple instances. + */ + protected DataObjectFactory() { + } + + /** + * Return the signature environment, i.e., the root element of the + * document, into which the signature will be inserted (if created) or which + * contains the signature (if verified). + * + * @param content The Content object containing the signature + * environment. + * @param supplements Additional schema or DTD information. + * @return The signature environment or null, if no + * signature environment exists. + * @throws MOASystemException A system error occurred building the signature + * environment (see message for details). + * @throws MOAApplicationException An error occurred building the signature + * environment (see message for details). + */ + public XMLDataObject createSignatureEnvironment( + Content content, + List supplements) + throws MOASystemException, MOAApplicationException { + + String reference = content.getReference(); + EntityResolver entityResolver; + byte[] contentBytes; + + // check for content and reference not being set at the same time + checkAllowContentAndReference(content, false); + + // build the EntityResolver for validating parsing + if (supplements == null || supplements.isEmpty()) { + entityResolver = new MOAEntityResolver(); + } else { + EntityResolverChain chain = new EntityResolverChain(); + + chain.addEntityResolver(buildSupplementEntityResolver(supplements)); + chain.addEntityResolver(new MOAEntityResolver()); + entityResolver = chain; + } + + // convert the content into a byte array + try { + switch (content.getContentType()) { + case Content.BINARY_CONTENT : + { + InputStream is = ((ContentBinary) content).getBinaryContent(); + contentBytes = StreamUtils.readStream(is); + break; + } + case Content.LOCREF_CONTENT: + { + ExternalURIResolver uriResolver = new ExternalURIResolver(); + String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); + InputStream is = null; + try + { + is = uriResolver.resolve(locRefURI); + contentBytes = StreamUtils.readStream(is); + } + catch (MOAApplicationException e) + { + throw new MOAApplicationException("3203", new Object[]{reference, locRefURI}, e); + } + finally + { + closeInputStream(is); + } + break; + } + case Content.REFERENCE_CONTENT : + { + ExternalURIResolver uriResolver = new ExternalURIResolver(); + InputStream is = null; + try + { + is = uriResolver.resolve(reference); + contentBytes = StreamUtils.readStream(is); + } + catch (Exception e) + { + throw e; + } + finally + { + closeInputStream(is); + } + break; + } + case Content.XML_CONTENT : + { + Element element = + checkForSingleElement(((ContentXML) content).getXMLContent()); + contentBytes = DOMUtils.serializeNode(element, "UTF-8"); + break; + } + default : + contentBytes = null; // this will not happen + } + } catch (MOAApplicationException e) { + throw e; + } catch (Exception e) { + throw new MOAApplicationException("2219", null); + } + + // try to parse validating + try { + ByteArrayInputStream is = new ByteArrayInputStream(contentBytes); + Document doc = + DOMUtils.parseDocument( + is, + true, + Constants.ALL_SCHEMA_LOCATIONS, + null, + entityResolver, + new MOAErrorHandler()); + + return new XMLDataObjectImpl(doc.getDocumentElement()); + } catch (Exception e) { + // never mind, we'll try non-validating + MessageProvider msg = MessageProvider.getInstance(); + Logger.info(new LogMsg(msg.getMessage("invoker.00", null))); + } + + // try to parse non-validating + try { + ByteArrayInputStream is = new ByteArrayInputStream(contentBytes); + Document doc = DOMUtils.parseDocument(is, false, null, null); + return new XMLDataObjectImpl(doc.getDocumentElement()); + } catch (Exception e) { + throw new MOAApplicationException("2218", null); + } + } + + /** + * Create an XMLDataObject from the given signature environment. + * + * @param signatureEnvironment The signature environment contained in the + * result. + * @param uri The URI identifying the data. This must be either the empty + * URI, an URI starting with "#xpointer", "#xmlns" + * or "#element"; or an URI starting with "#" and + * followed by an element ID. + * @param referenceID The reference ID to set for the data object. + * @return A data object containing the signature environment. + */ + public DataObject createFromSignatureEnvironment( + Element signatureEnvironment, + String uri, + String referenceID) + throws MOAApplicationException { + + DataObjectImpl dataObject = null; + + if ("".equals(uri)) { + dataObject = new XMLDataObjectImpl(signatureEnvironment); + } else if ( + uri.startsWith("#xpointer") + || uri.startsWith("#xmlns") + || uri.startsWith("#element")) { + try { + XPointerReferenceResolver resolver = new XPointerReferenceResolver(); + URI uriObj = new URI(uri); + NodeList nodes = + resolver.resolveForest( + uriObj, + signatureEnvironment.getOwnerDocument(), + null); + dataObject = new XMLNodeListDataObjectImpl(nodes); + } catch (Exception e) { + throw new MOAApplicationException("2237", new Object[] { uri }); + } + } else if (uri.startsWith("#")) { + String id = uri.substring(1); + Element refElem = + signatureEnvironment.getOwnerDocument().getElementById(id); + + if (refElem == null) { + throw new MOAApplicationException("2237", new Object[] { id }); + } + dataObject = new XMLDataObjectImpl(refElem); + } + + dataObject.setReferenceID(referenceID); + dataObject.setURI(uri); + + return dataObject; + } + + /** + * Build a StreamEntityResolver from a List of + * supplements. + * + * @param supplements The supplements, given as + * XMLDataObjectAssociations. + * @return A StreamEntityResolver mapping the supplements by + * their reference URI to an InputStream of their respective + * content. + */ + private static StreamEntityResolver buildSupplementEntityResolver(List supplements) + throws MOAApplicationException + { + Map entities = new HashMap(); + Iterator iter; + + for (iter = supplements.iterator(); iter.hasNext();) { + XMLDataObjectAssociation supplement = + (XMLDataObjectAssociation) iter.next(); + Content content = supplement.getContent(); + String reference = content.getReference(); + + switch (content.getContentType()) { + case Content.BINARY_CONTENT : + { + entities.put(reference, ((ContentBinary) content).getBinaryContent()); + break; + } + case Content.LOCREF_CONTENT: + { + ExternalURIResolver uriResolver = new ExternalURIResolver(); + String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); + InputStream contentIS = null; + InputStream uriStream = null; + try + { + uriStream = uriResolver.resolve(locRefURI); + byte[] contentBytes = StreamUtils.readStream(uriStream); + contentIS = new ByteArrayInputStream(contentBytes); + } + catch (Exception e) + { + throw new MOAApplicationException("3202", new Object[]{reference, locRefURI}, e); + } + finally + { + closeInputStream(uriStream); + } + entities.put(reference, contentIS); + break; + } + case Content.XML_CONTENT : + { + // serialize the first element node that is found in the supplement + // and make it available as a stream + NodeList nodes = ((ContentXML) content).getXMLContent(); + int i = 0; + + // find the first element node + while (i < nodes.getLength() + && nodes.item(i).getNodeType() != Node.ELEMENT_NODE) + i++; + + // serialize the node + if (i < nodes.getLength()) { + try + { + byte[] serialized = DOMUtils.serializeNode(nodes.item(i), "UTF-8"); + entities.put(reference, new ByteArrayInputStream(serialized)); + } + catch (Exception e) + { + throw new MOAApplicationException("2281", new Object[]{reference}, e); + } + } + break; + } + } + } + + return new StreamEntityResolver(entities); + } + + /** + * Create a DataObject from a Content object. + * + * @param content The Content object containing the data. + * @param finalDataMetaInfo The meta information corresponding with content. + * @param referenceID The reference ID to set in the resulting + * DataObject. May be null. + * @param allowContentAndReference If true, then + * content is allowed to contain both a Reference + * attribute and content. Otherwise, either a Reference + * attribute or content must be set. + * @param binaryAsXml If true, a content child given as + * Base64Content must contain XML data. + * @param xmlAsNodeList If true, the children of a + * XMLContent child element are returned as a + * XMLNodeListDataObject. Otherwise, XMLContent may + * only contain a single child node, which must be an element and which is + * returned as an XMLDataObject. + * @param referenceAsXml If true, then content loaded from the + * URI given as the Reference attribute must be XML data. + * If false, an attempt is made to parse the data as XML and + * return an XMLDataObject but if this fails, a + * BinaryDataObject is returned containing a byte stream to the + * data. + * @return A DataObject representing the data in + * content. If base64AsXml==true and + * xmlAsNodeList==false and referenceAsXml==true, + * then the result can safely be cast to an XMLDataObject. + * @throws MOASystemException An error indicating an internal problem. See the + * wrapped exception for details. + * @throws MOAApplicationException An error occurred handling the content + * (probably while opening a reference or parsing the data). See the wrapped + * exception for details. + */ + public DataObject createFromContentOptionalRefType( + Content content, + MetaInfo finalDataMetaInfo, + String referenceID, + boolean allowContentAndReference, + boolean binaryAsXml, + boolean xmlAsNodeList, + boolean referenceAsXml) + throws MOASystemException, MOAApplicationException { + + String reference = content.getReference(); + DataObjectImpl dataObject = null; + + checkAllowContentAndReference(content, allowContentAndReference); + + // ok, build the data object; use content first, if available + switch (content.getContentType()) + { + case Content.XML_CONTENT : + { + ContentXML contentXml = (ContentXML) content; + dataObject = createFromXmlContent(contentXml, xmlAsNodeList); + break; + } + case Content.BINARY_CONTENT : + { + ContentBinary contentBinary = (ContentBinary) content; + dataObject = createFromBinaryContent(contentBinary, binaryAsXml, false); + break; + } + case Content.LOCREF_CONTENT : + { + String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); + try + { + dataObject = createFromURIImpl(locRefURI, referenceAsXml); + } + catch (MOAApplicationException e) + { + throw new MOAApplicationException("3201", new Object[]{reference, locRefURI}, e); + } + break; + } + case Content.REFERENCE_CONTENT : + { + dataObject = createFromURIImpl(reference, referenceAsXml); + break; + } + } + + // set URI and reference ID + dataObject.setURI(reference); + dataObject.setReferenceID(referenceID); + + // set Type gathered from corresponding meta information + dataObject.setTypeURI(finalDataMetaInfo.getType()); + + return dataObject; + } + + /** + * Check, if content and reference URIs are allowed in the content an throw + * an exception if an illegal combination of the two occurs. + * + * @param content The Content to check. + * @param allowContentAndReference Whether explicit content and a reference + * are allowed at the same time. + * @throws MOAApplicationException If allowContentAndRefernece + * is false and both explicit content and reference are set, + * an exception is thrown. + */ + private static void checkAllowContentAndReference( + Content content, + boolean allowContentAndReference) + throws MOAApplicationException { + String reference = content.getReference(); + + // check for content and reference not being set + if (content.getContentType() == Content.REFERENCE_CONTENT + && reference == null) { + String errorCode = allowContentAndReference ? "1111" : "1110"; + throw new MOAApplicationException(errorCode, null); + } + + // if we only allow either content or reference being set at once, check + if (!allowContentAndReference + && (content.getContentType() != Content.REFERENCE_CONTENT) + && (reference != null)) { + throw new MOAApplicationException("1110", null); + } + } + + /** + * Create a DataObject from a + * XMLDataObjectAssociation object. + * + * @param xmlDataObjAssoc The XMLDataObjectAssociation object. + * @param xmlContentAllowed Whether the content contained in the + * xmlDataObjAssoc is allowed to be of type + * XML_CONTENT. + * @param binaryContentRepeatable If binary content must be provided as a + * DataObject that can be read multiple times. + * @return A DataObject representing the data in + * xmlDataObjAssoc. + * @throws MOASystemException An error indicating an internal problem. See the + * wrapped exception for details. + * @throws MOAApplicationException An error occurred handling the content + * (probably while parsing the data). See the wrapped exception for details. + */ + public DataObject createFromXmlDataObjectAssociation( + XMLDataObjectAssociation xmlDataObjAssoc, + boolean xmlContentAllowed, + boolean binaryContentRepeatable) + throws MOASystemException, MOAApplicationException { + + Content content = xmlDataObjAssoc.getContent(); + MetaInfo metaInfo = xmlDataObjAssoc.getMetaInfo(); + String mimeType = metaInfo != null ? metaInfo.getMimeType() : null; + DataObjectImpl dataObject = null; + + switch (content.getContentType()) + { + case Content.XML_CONTENT : + { + if (xmlContentAllowed) + { + dataObject = createFromXmlContent((ContentXML) content, true); + } + else + { + throw new MOAApplicationException("2280", null); + } + break; + } + case Content.BINARY_CONTENT : + { + dataObject = createFromBinaryContent( + (ContentBinary) content, + false, + binaryContentRepeatable); + break; + } + case Content.LOCREF_CONTENT : + { + String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); + try + { + dataObject = createFromURIImpl(locRefURI, false); + } + catch (MOAApplicationException e) + { + throw new MOAApplicationException("3201", new Object[]{content.getReference(), locRefURI}, e); + } + break; + } + } + + dataObject.setURI(content.getReference()); + dataObject.setMimeType(mimeType); + return dataObject; + } + + /** + * Create a DataObject from a TransformParameter + * object. + * + * @param transformParameter The TransformParameter object + * containing the data. + * @return A DataObject representing the data in + * root. + * @throws MOASystemException An error indicating an internal problem. See the + * wrapped exception for details. + * @throws MOAApplicationException An error occurred handling the content + * (probably while opening a reference or parsing the data). See the wrapped + * exception for details. + */ + public DataObject createFromTransformParameter(TransformParameter transformParameter) + throws MOASystemException, MOAApplicationException { + + DataObjectImpl dataObject; + + switch (transformParameter.getTransformParameterType()) { + case TransformParameter.BINARY_TRANSFORMPARAMETER : + TransformParameterBinary tpBinary = + (TransformParameterBinary) transformParameter; + + try { + //dataObject = new ByteArrayDataObjectImpl(Base64Utils.encode(tpBinary.getBinaryContent())); + dataObject = + new ByteArrayDataObjectImpl( + StreamUtils.readStream(tpBinary.getBinaryContent())); + } catch (Exception e) { + return null; + } + //dataObject = new ByteStreamDataObjectImpl(tpBinary.getBinaryContent()); + break; + default : + // resolve uri and build the content + ExternalURIResolver resolver = new ExternalURIResolver(); + InputStream is = resolver.resolve(transformParameter.getURI()); + ByteArrayInputStream bis; + try + { + bis = new ByteArrayInputStream(StreamUtils.readStream(is)); + } + catch (IOException e) + { + throw new MOAApplicationException("2238", new Object[] {transformParameter.getURI()}, e); + } + finally + { + closeInputStream(is); + } + String contentType = resolver.getContentType(); + dataObject = new ByteStreamDataObjectImpl(bis); + dataObject.setMimeType(contentType); + break; + } + + dataObject.setURI(transformParameter.getURI()); + + return dataObject; + } + + /** + * Create a DataObject from data located at the given URI. + * + * @param uri The URI where the data is located. This method uses + * an ExternalURIResolver to resolve URIs. + * @param asXml If true, a DataObject is only + * returned, if the content consists of XML data. If it does not consist of + * XML data, an MOAApplicationException will be thrown. If this + * parameter is false and the content consists of XML data, this + * method will still attempt to parse it. + * @return The DataObject contained at the URI. + * @throws MOASystemException A system error parsing the XML content. + * @throws MOAApplicationException An error occurred on opening, reading or + * parsing the data behind the URI. + */ + public DataObject createFromURI(String uri, boolean asXml) + throws MOASystemException, MOAApplicationException { + return createFromURIImpl(uri, asXml); + } + + /** + * Create a DataObject from data located at the given URI. + * + * @param uri The URI where the data is located. This method uses + * an ExternalURIResolver to resolve URIs. + * @param asXml If true, a DataObject is only + * returned, if the content consists of XML data. If it does not consist of + * XML data, an MOAApplicationException will be thrown. If this + * parameter is false and the content type is detected as being + * XML data, this method will still attemt to parse it. + * @return The DataObject contained at the URI. + * @throws MOASystemException A system error parsing the XML content. + * @throws MOAApplicationException An error occurred on opening, reading or + * parsing the data behind the URI. + */ + private DataObjectImpl createFromURIImpl(String uri, boolean asXml) + throws MOASystemException, MOAApplicationException { + + ExternalURIResolver resolver = new ExternalURIResolver(); + InputStream is = resolver.resolve(uri); + String contentType = resolver.getContentType(); + DataObjectImpl dataObject; + + // read the content + if (contentType != null && contentTypeIsXml(contentType)) { + Document doc; + + if (asXml) { + try { + // try parsing non-validating: this has to succeed or we + // bail out by throwing an exception + is = resolver.resolve(uri); + doc = DOMUtils.parseDocument(is, false, null, null); + dataObject = new XMLDataObjectImpl(doc.getDocumentElement()); + } catch (ParserConfigurationException e) { + throw new MOASystemException("1106", null, e); + } catch (SAXException e) { + throw new MOAApplicationException("2209", null, e); + } catch (IOException e) { + throw new MOAApplicationException("2210", null, e); + } + finally + { + closeInputStream(is); + } + } else { + try { + // try parsing non-validating: need not succeed + is = resolver.resolve(uri); + doc = DOMUtils.parseDocument(is, false, null, null); + closeInputStream(is); + dataObject = new XMLDataObjectImpl(doc.getDocumentElement()); + } catch (Exception e) { + // this is the last chance: return the data as a byte stream + is = resolver.resolve(uri); + ByteArrayInputStream bis; + try + { + bis = new ByteArrayInputStream(StreamUtils.readStream(is)); + dataObject = new ByteStreamDataObjectImpl(bis); + } + catch (IOException e1) + { + throw new MOAApplicationException("2210", new Object[] { uri }, e1); + } + finally + { + closeInputStream(is); + } + } + } + } + else if (asXml) + { + // if we need XML data, we're in the wrong place here + closeInputStream(is); + throw new MOAApplicationException("2211", new Object[] { uri }); + } + else + { + // content is binary: make it available as a binary input stream + ByteArrayInputStream bis; + try + { + bis = new ByteArrayInputStream(StreamUtils.readStream(is)); + } + catch (IOException e) + { + throw new MOAApplicationException("2210", null, e); + } + finally + { + closeInputStream(is); + } + dataObject = new ByteStreamDataObjectImpl(bis); + } + + dataObject.setMimeType(contentType); + dataObject.setURI(uri); + + return dataObject; + } + + /** + * Savely closes the specified input stream. + * + * @param is The input stream to be closed. + */ + private static void closeInputStream(InputStream is) + { + try + { + if (is != null) is.close(); + } + catch (Throwable t) + { + // Intentionally do nothing here + } + } + + /** + * Determine whether the content type is XML. + * + * Content types recognized as XML start with text/xml and + * application/xml. + * + * @param contentType The content MIME type. + * @return boolean If true, the content type is XML, otherwise + * not. + */ + private static boolean contentTypeIsXml(String contentType) { + return contentType.startsWith("text/xml") + || (contentType.startsWith("application/xml")); + } + + /** + * Create a DataObject from a ContentXML object. + * + * @param xmlContent The ContentXML object from + * which the DataObject is to be built. + * @param xmlAsNodeList If true, the children of + * xmlContent are returned as a + * XMLNodeListDataObject. Otherwise, + * xmlContent may only contain a single child node, which must be + * an element and which is returned as an XMLDataObject. + * @return A DataObject representing the XML content in + * xmlContent. + * @throws MOAApplicationException If xmlAsNodeList is + * false and xmlContent does not have a single child + * element. + */ + private DataObjectImpl createFromXmlContent( + ContentXML xmlContent, + boolean xmlAsNodeList) + throws MOAApplicationException { + + DataObjectImpl dataObject; + + if (xmlAsNodeList) { + dataObject = new XMLNodeListDataObjectImpl(xmlContent.getXMLContent()); + } else { + NodeList nodes = xmlContent.getXMLContent(); + Element element = checkForSingleElement(nodes); + + // build the XMLDataObject + dataObject = new XMLDataObjectImpl(element); + } + return dataObject; + } + + /** + * Check, that the given NodeList contains a single DOM element + * node and return it, otherwise throw an exception. + * + * @param nodes The NodeList to check for a single element. + * @return The single element contained in nodes. + * @throws MOAApplicationException Thrown, if nodes does not + * contain exactly 1 element node. + */ + private Element checkForSingleElement(NodeList nodes) + throws MOAApplicationException { + + Element element = null; + int i; + + // check for a single element node + for (i = 0; i < nodes.getLength(); i++) { + if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) { + if (element == null) { + element = (Element) nodes.item(i); + } else { + throw new MOAApplicationException("1109", null); + } + } + } + + // return the element node + if (element == null) { + throw new MOAApplicationException("1107", null); + } else { + return element; + } + } + + /** + * Create a DataObject from a ContentBinary object. + * + * @param binaryContent The ContentBinary object containing the + * data. + * @param asXml If true, binaryContent must + * contain XML data. Otherwise, a BinaryDataObject will be + * returned containing a byte stream to the decoded Base64 data. + * @param repeatable If multiple calls to getInputStream() must + * repeatedly return the content of the data object. + * @return A DataObject representing the content contained in + * binaryContent. + * @throws MOASystemException An error indicating an internal problem. See the + * wrapped exception for details. + * @throws MOAApplicationException An error occurred handling the content + * (probably while parsing the data). See the wrapped exception for details. + */ + private DataObjectImpl createFromBinaryContent( + ContentBinary binaryContent, + boolean asXml, + boolean repeatable) + throws MOASystemException, MOAApplicationException { + + InputStream byteStream = binaryContent.getBinaryContent(); + DataObjectImpl dataObject; + + if (asXml) { + Document doc; + + try { + doc = DOMUtils.parseDocument(byteStream, false, null, null); + dataObject = new XMLDataObjectImpl(doc.getDocumentElement()); + } catch (ParserConfigurationException e) { + throw new MOASystemException("1106", null, e); + } catch (SAXException e) { + throw new MOAApplicationException("2209", null, e); + } catch (IOException e) { + throw new MOAApplicationException("2210", null, e); + } + } else { + if (repeatable) { + try { + dataObject = + new ByteArrayDataObjectImpl(StreamUtils.readStream(byteStream)); + } catch (IOException e) { + throw new MOAApplicationException("2210", null); + } + } else { + dataObject = new ByteStreamDataObjectImpl(byteStream); + } + } + + return dataObject; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java new file mode 100644 index 000000000..106742067 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java @@ -0,0 +1,162 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import iaik.ixsil.exceptions.URIException; +import iaik.ixsil.util.URI; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * Resolve external URIs and provide them as a stream. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ExternalURIResolver { + + /** The MIME type of the content currently resolved. */ + private String contentType; + + /** + * Return a stream to data at the given URI. + * + * This method will try to open an URLConnection to the given + * URI. Access to the file system is disallowed. + * + * @param uriStr The URI to resolve. + * @return InputStream The data contained at the URI. + * @throws MOAApplicationException An error occurred resolving the URI (e.g., + * the URI is syntactically incorrect or the stream could not be opened). + */ + public InputStream resolve(String uriStr) throws MOAApplicationException { + URI uri; + URL url; + URLConnection connection; + InputStream is; + + // build the URI + try { + uri = new URI(uriStr); + } catch (URIException e) { + throw new MOAApplicationException("2207", new Object[] { uriStr }); + } + + // disallow access to local file system + if ("".equals(uri.getScheme()) || "file".equals(uri.getScheme())) { + throw new MOAApplicationException("2213", new Object[] { uriStr }); + } + + // if we have local content (SOAP with attachments) + if ("formdata".equals(uri.getScheme())) { + TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); + if (context==null) { + //no transaction + throw new MOAApplicationException("2282", new Object[] { uri }); + } else { + + InputStream attachmentIs = context.getAttachmentInputStream(uri); + if (attachmentIs != null) { + setContentType(context.getAttachmentContentType(uri.getPath())); + return attachmentIs; + } else { + //maybe attachments provided but no suiting attachment found + throw new MOAApplicationException("2282", new Object[] { uri }); + } +/* + try { + InputStream attachmentIs = context.getAttachment(uri).getInputStream(); + if (attachmentIs != null) { + setContentType(context.getAttachmentContentType(uri.getPath())); + return attachmentIs; + } else { + //maybe attachments provided but no suiting attachment found + throw new MOAApplicationException("2282", new Object[] { uri }); + } + } catch (IOException e) { + throw new MOAApplicationException("2208", new Object[] { uri }, e); + } +*/ + } + } + + // convert URI to URL + try { + // create the URL + url = new URL(uriStr); + } catch (MalformedURLException e) { + throw new MOAApplicationException("2214", new Object[] { uriStr }); + } + + // build the URLConnection + try { + connection = url.openConnection(); + if ("http".equals(url.getProtocol())) { + HttpURLConnection httpConnection = (HttpURLConnection) connection; + + httpConnection.connect(); + if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { + throw new MOAApplicationException("2208", new Object[] { uri }); + } + } else if ("https".equals(url.getProtocol())) { + /* + * this doesn't work because of some interaction between the IAIK + * JCE and Sun JSSE that results in an "Invalid AVA format" exception + */ + + /* + HttpsURLConnection httpsConnection = (HttpsURLConnection) connection; + InputStream trustStore = + getClass().getResourceAsStream(DEFAULT_TRUST_STORE); + SSLSocketFactory factory = + SSLUtils.getSSLSocketFactory("jks", trustStore, "changeit"); + httpsConnection.setSSLSocketFactory(factory); + httpsConnection.connect(); + if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { + throw new MOAApplicationException("2208", new Object[] { uri }); + } + */ + connection.connect(); + } else { + connection.connect(); + } + is = connection.getInputStream(); + } catch (IOException e) { + throw new MOAApplicationException("2208", new Object[] { uri }, e); + } /*catch (GeneralSecurityException e) { + throw new MOAApplicationException("2208", new Object[] { uri }, e); + }*/ + + // set the content type + setContentType(connection.getContentType()); + + return is; + } + + /** + * Set the content type of the data at the URI. + * + * @param contentType The content type to set. + */ + protected void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Return the content type of the data detected at the URI from the previous + * call of resolve(). + * + * @return String The content type. + */ + public String getContentType() { + return contentType; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java new file mode 100644 index 000000000..60f573e5a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/IaikExceptionMapper.java @@ -0,0 +1,267 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import iaik.IAIKException; +import iaik.IAIKRuntimeException; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.MOASystemException; + + +/** + * Map an exception from the iaik namespace to a + * MOAException. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IaikExceptionMapper { + + /** The argument classes for MOAExceptions. */ + private static final Class[] CONSTRUCTOR_ARGS = + new Class[] { String.class, Object[].class, Throwable.class }; + /** The exception mapping, as an array. */ + private static final Object[][] MESSAGES = + { + { iaik.IAIKException.class, "9900", MOASystemException.class }, + { iaik.IAIKRuntimeException.class, "9901", MOASystemException.class }, + { iaik.server.modules.xmlsign.XMLSignatureCreationException.class, "2220", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.XMLSignatureCreationRuntimeException.class, "2220", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.InvalidKeyException.class, "2221", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.ManifestException.class, "2222", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.ReferenceException.class, "2223", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.HashUnavailableException.class, "2224", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.SignatureAlgorithmException.class, "2225", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.SignatureEmbeddingException.class, "2226", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.SignatureValueException.class, "2227", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.SignedPropertyException.class, "2228", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.SignerCertificateUnavailableException.class, "2229", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.SupplementException.class, "2230", MOAApplicationException.class }, + { iaik.server.modules.xmlsign.TransformationException.class, "2233", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.CMSSignatureVerificationException.class, "2240", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.CMSSignatureVerificationRuntimeException.class, "2240", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.AlgorithmNotSupportedException.class, "2241", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.CMSSignatureParsingException.class, "2242", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.SignerCertificateUnavailableException.class, "2243", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.CMSSignatureVerificationRuntimeException.class, "2247", MOAApplicationException.class }, + { iaik.server.modules.cmsverify.InitException.class, "2248", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.XMLSignatureVerificationException.class, "2240", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.XMLSignatureVerificationRuntimeException.class, "2240", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.AlgorithmNotSupportedException.class, "2241", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.ManifestException.class, "2262", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.PropertiesException.class, "2263", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.ReferenceException.class, "2264", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.HashUnavailableException.class, "2224", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.SignerCertificateUnavailableException.class, "2243", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.SupplementException.class, "2230", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.TransformationException.class, "2265", MOAApplicationException.class }, + { iaik.server.modules.xmlverify.TransformationParsingException.class, "2269", MOAApplicationException.class } + }; + + /** The single instance of this class. */ + private static IaikExceptionMapper instance; + /** The exception mapping, as a Map for fast lookup. */ + private Map messages = new HashMap(); + + /** + * Get the single instance of this class. + * + * @return The single instance of this class. + */ + public static synchronized IaikExceptionMapper getInstance() { + if (instance == null) { + instance = new IaikExceptionMapper(); + } + return instance; + } + + /** + * Create a new IaikExceptionMapper. + * + * Protected to disallow multple instances. + */ + protected IaikExceptionMapper() { + registerMessages(); + } + + /** + * Build the complete IAIKException to message code mapping. + */ + protected void registerMessages() { + int i; + + for (i = 0; i < MESSAGES.length; i++) { + registerMessage( + (Class) MESSAGES[i][0], + (String) MESSAGES[i][1], + (Class) MESSAGES[i][2]); + } + } + + /** + * Register a single IAIKException to message mapping. + * + * @param iaikExceptionClass An exception from the iaik package. + * @param messageId The corresponding error message id. + * @param moaExceptionClass The type of MOAException that the + * IAIKException is mapped to (usually + * MOAApplicationException or MOASystemException). + */ + protected void registerMessage( + Class iaikExceptionClass, + String messageId, + Class moaExceptionClass) { + + messages.put( + iaikExceptionClass, + new ExceptionMappingInfo(messageId, moaExceptionClass)); + } + + /** + * Map an IAIKException to a MOAException. + * + * @param iaikException The IAIKException to map. + * @return A MOAException containing the message for the + * given IAIKException. + */ + public MOAException map(IAIKException iaikException) { + return mapImpl(iaikException); + } + + /** + * Map an IAIKRuntimeException to a MOAException. + * + * @param iaikException The IAIKException to map. + * @return A MOAException containing the message for the + * given IAIKRuntimeException. + */ + public MOAException map(IAIKRuntimeException iaikException) { + return mapImpl(iaikException); + } + + /** + * Map an IAIKException or IAIKRuntimeException to a + * MOAException. + * + * @param iaikException The IAIKException or + * IAIKRuntimeException to map. + * @return A MOAException containing the message for the + * given IAIKRuntimeException. + */ + private MOAException mapImpl(Exception iaikException) { + MOAException moaException = createMoaException(iaikException); + + if (moaException == null) { + return new MOASystemException("9999", null, iaikException); + } + return moaException; + } + + /** + * Create a MOAException from a given IAIKException + * by looking it up in the mapping. + * + * @param iaikException The IAIKException to map. + * @return A MOAException with an error code corresponding to + * the given IAIKException. Returns null, if no + * mapping could be found. + */ + protected MOAException createMoaException(Exception iaikException) { + ExceptionMappingInfo info = lookupMessage(iaikException.getClass()); + Constructor constructor; + + if (info == null) { + return null; + } + + // instantiate the proper MOAException and return it + try { + constructor = + info.getMoaExceptionClass().getConstructor(CONSTRUCTOR_ARGS); + return (MOAException) constructor.newInstance( + new Object[] { + info.getMessageId(), + new Object[] { iaikException.getMessage()}, + iaikException }); + } catch (Exception e) { + return null; + } + } + + /** + * Recursively look up the message associated with an + * IAIKException. + * + * This method walks up the exception inheritance hierarchy until it finds a + * mapping. + * + * @param iaikExceptionClass The IAIKException to look up. + * @return Information about the message id and + * MOAException class that the iaikExceptionClass + * maps to. If no mapping could be found, null is returned. + */ + protected ExceptionMappingInfo lookupMessage(Class iaikExceptionClass) { + ExceptionMappingInfo info; + + // break if + if (iaikExceptionClass.equals(Exception.class)) { + return null; + } + + // look up the exception class + info = (ExceptionMappingInfo) messages.get(iaikExceptionClass); + if (info == null) { + return lookupMessage(iaikExceptionClass.getSuperclass()); + } + return info; + } + +} + +/** + * A class containing a mapping from an error message ID to a + * MOAException class. + * + * @author Patrick Peck + * @version $Id$ + */ +class ExceptionMappingInfo { + /** The message ID. */ + private String messageId; + /** The MOAException class. */ + private Class moaExceptionClass; + + /** + * Create a new ExceptionMappingInfo. + * + * @param messageId The message ID. + * @param moaExceptionClass The MOAException class. + */ + public ExceptionMappingInfo(String messageId, Class moaExceptionClass) { + this.messageId = messageId; + this.moaExceptionClass = moaExceptionClass; + } + + /** + * Return the message ID. + * + * @return The message ID. + */ + public String getMessageId() { + return messageId; + } + + /** + * Returns the MOAException class that the message ID maps to. + * + * @return The MOAException class. + */ + public Class getMoaExceptionClass() { + return moaExceptionClass; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java new file mode 100644 index 000000000..0c3b45539 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/InvokerUtils.java @@ -0,0 +1,63 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.util.XPathException; +import at.gv.egovernment.moa.util.XPathUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.common.ElementSelector; + +/** + * Utility methods for invoking the IAIK MOA modules. + * + * @author Patrick Peck + * @version $Id$ + */ +public class InvokerUtils { + + /** + * Select the signature parent element. + * + * @param root The root DOM element which contains the signature parent + * element somewhere in its subtree. + * @param location The ElementSelector containing the XPath + * expression to select the signature parent element from the document. + * It is also contains the namespace prefix to URI mapping. + * @return Element The signature parent element. + * @throws MOAApplicationException An error occurred evaluating the + * location. + */ + public static Element evaluateSignatureLocation( + Element root, + ElementSelector location) + throws MOAApplicationException { + + NodeList nodes; + + try { + nodes = + XPathUtils.selectNodeList( + root, + location.getNamespaceDeclarations(), + location.getXPathExpression()); + } catch (XPathException e) { + throw new MOAApplicationException( + "2212", + new Object[] { location.getXPathExpression()}, + e); + } + + if (nodes.getLength() != 1 + || !(nodes.item(0).getNodeType() == Node.ELEMENT_NODE)) { + throw new MOAApplicationException( + "2212", + new Object[] { location.getXPathExpression()}); + } + return (Element) nodes.item(0); + } + + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java new file mode 100644 index 000000000..158a3ddb5 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java @@ -0,0 +1,249 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.xmlbind.ProfileParser; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileID; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileID; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileID; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * Map ProfileID objects to their explicit represantation. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ProfileMapper { + + /** The parser to parse the profiles. */ + private static ProfileParser profileParser = new ProfileParser(); + + /** + * Map a CreateTransformsInfoProfile to a + * CreateTransformsInfoProfileExplicit. + * + * @param profile The profile object to map. + * @param config The MOA configuration to use for looking up the profile. + * @return profile, if the given profile is of type + * EXPLICIT_CREATETRANSFORMSINFOPROFILE, otherwise the profile + * that is looked up and parsed from the configuration. + * @throws MOAApplicationException An error occurred parsing the profile. + */ + public static CreateTransformsInfoProfileExplicit mapCreateTransformsInfoProfile( + CreateTransformsInfoProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { + + switch (profile.getCreateTransformsInfoProfileType()) { + case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE : + return (CreateTransformsInfoProfileExplicit) profile; + + case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE : + CreateTransformsInfoProfileID profileIdObj = + (CreateTransformsInfoProfileID) profile; + String profileID = profileIdObj.getCreateTransformsInfoProfileID(); + Element profileElem = config.getCreateTransformsInfoProfile(profileID); + + if (profileElem == null) { + throw new MOAApplicationException("2234", new Object[] { profileID }); + } + + return ( + CreateTransformsInfoProfileExplicit) profileParser + .parseCreateTransformsInfoProfile( + profileElem); + } + return null; // this will not happen + } + + /** + * Map a CreateSignatureEnvironmentProfile to a + * CreateSignatureEnvironmentProfileExplicit. + * + * @param profile The profile object to map. + * @param config The MOA configuration to use for looking up the profile. + * @return profile, if the given profile is of type + * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE, otherwise the + * profile that is looked up and parsed from the configuration. + * @throws MOAApplicationException An error occurred parsing the profile. + */ + public static CreateSignatureEnvironmentProfileExplicit mapCreateSignatureEnvironmentProfile( + CreateSignatureEnvironmentProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { + + switch (profile.getCreateSignatureEnvironmentProfileType()) { + case CreateSignatureEnvironmentProfile + .EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE : + + return (CreateSignatureEnvironmentProfileExplicit) profile; + + case CreateSignatureEnvironmentProfile + .ID_CREATESIGNATUREENVIRONMENTPROFILE : + + CreateSignatureEnvironmentProfileID profileIdObj = + (CreateSignatureEnvironmentProfileID) profile; + String profileID = + profileIdObj.getCreateSignatureEnvironmentProfileID(); + Element profileElem = + config.getCreateSignatureEnvironmentProfile(profileID); + + if (profileElem == null) { + throw new MOAApplicationException("2236", new Object[] { profileID }); + } + + return ( + CreateSignatureEnvironmentProfileExplicit) profileParser + .parseCreateSignatureEnvironmentProfile( + profileElem); + + } + return null; + + } + + /** + * Map a List of SupplementProfiles to their + * explicit representation. + * + * @param profiles The profiles to map. + * @param config The MOA configuration to use for looking up profiles. + * @return The mapped profiles. + * @throws MOAApplicationException An error occurred mapping one of the + * profiles. + */ + public static List mapSupplementProfiles( + List profiles, + ConfigurationProvider config) + throws MOAApplicationException { + + List mappedProfiles = new ArrayList(); + Iterator iter; + + for (iter = profiles.iterator(); iter.hasNext();) { + SupplementProfile profile = (SupplementProfile) iter.next(); + mappedProfiles.add(mapSupplementProfile(profile, config)); + } + + return mappedProfiles; + } + + /** + * Map a SupplementProfile to a + * SupplementProfileExplicit. + * + * @param profile The profile object to map. + * @param config The MOA configuration to use for looking up the profile. + * @return profile, if the given profile is of type + * EXPLICIT_SUPPLEMENTPROFILE, otherwise the + * profile that is looked up and parsed from the configuration. + * @throws MOAApplicationException An error occurred parsing the profile. + */ + public static SupplementProfileExplicit mapSupplementProfile( + SupplementProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { + + switch (profile.getSupplementProfileType()) { + case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE : + return (SupplementProfileExplicit) profile; + + case SupplementProfile.ID_SUPPLEMENTPROFILE : + SupplementProfileID profileIdObj = (SupplementProfileID) profile; + String profileID = profileIdObj.getSupplementProfileID(); + Element profileElem = config.getSupplementProfile(profileID); + + if (profileElem == null) { + throw new MOAApplicationException("2267", new Object[] { profileID }); + } + + return ( + SupplementProfileExplicit) profileParser.parseSupplementProfile( + profileElem); + } + + return null; + } + + /** + * Map a List of VerifyTransformsInfoProfiles to + * their explicit representation. + * + * @param profiles The profiles to map. + * @param config The MOA configuration to use for looking up profiles. + * @return The mapped profiles. + * @throws MOAApplicationException An error occurred mapping one of the + * profiles. + */ + public static List mapVerifyTransformsInfoProfiles( + List profiles, + ConfigurationProvider config) + throws MOAApplicationException { + + List mappedProfiles = new ArrayList(); + Iterator iter; + + for (iter = profiles.iterator(); iter.hasNext();) { + VerifyTransformsInfoProfile profile = + (VerifyTransformsInfoProfile) iter.next(); + mappedProfiles.add(mapVerifyTransformsInfoProfile(profile, config)); + } + + return mappedProfiles; + } + + /** + * Map a VerifyTransformsInfoProfile to a + * VerifyTransformsInfoProfileExplicit. + * + * @param profile The profile object to map. + * @param config The MOA configuration to use for looking up the profile. + * @return profile, if the given profile is of type + * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE, otherwise the + * profile that is looked up and parsed from the configuration. + * @throws MOAApplicationException An error occurred parsing the profile. + */ + public static VerifyTransformsInfoProfileExplicit mapVerifyTransformsInfoProfile( + VerifyTransformsInfoProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { + + switch (profile.getVerifyTransformsInfoProfileType()) { + case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE : + return (VerifyTransformsInfoProfileExplicit) profile; + + case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE : + VerifyTransformsInfoProfileID profileIdObj = + (VerifyTransformsInfoProfileID) profile; + String profileID = profileIdObj.getVerifyTransformsInfoProfileID(); + Element profileElem = + config.getVerifyTransformsInfoProfile(profileID); + + if (profileElem == null) { + throw new MOAApplicationException("2268", new Object[] { profileID }); + } + + return ( + VerifyTransformsInfoProfileExplicit) profileParser + .parseVerifyTransformsInfoProfile( + profileElem); + } + + return null; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java new file mode 100644 index 000000000..11f05a2f1 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ServiceContextUtils.java @@ -0,0 +1,51 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * A utility class for setting up and tearing down thread-local context + * information needed for calling the Invoker classes. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ServiceContextUtils { + + /** + * Set up the thread-local context information needed for calling the various + * Invoker classes. + * + * @throws ConfigurationException An error occurred setting up the + * configuration in the TransactionContext. + */ + public static void setUpContexts() throws ConfigurationException { + TransactionContextManager txMgr = TransactionContextManager.getInstance(); + LoggingContextManager logMgr = LoggingContextManager.getInstance(); + String transactionID = Thread.currentThread().getName(); + + if (txMgr.getTransactionContext() == null) { + TransactionContext ctx = new TransactionContext(transactionID, null, ConfigurationProvider.getInstance()); + txMgr.setTransactionContext(ctx); + } + + if (logMgr.getLoggingContext() == null) { + LoggingContext ctx = new LoggingContext(transactionID); + logMgr.setLoggingContext(ctx); + } + } + + /** + * Tear down thread-local context information. + */ + public static void tearDownContexts() { + TransactionContextManager.getInstance().setTransactionContext(null); + LoggingContextManager.getInstance().setLoggingContext(null); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java new file mode 100644 index 000000000..dc5ceb21e --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureCreationServiceImpl.java @@ -0,0 +1,45 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.util.Collections; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.Configurator; +import at.gv.egovernment.moa.spss.api.SignatureCreationService; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; + +/** + * An implementation of the SignatureCreationService, using + * the XMLSignatureCreationInvoker. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SignatureCreationServiceImpl extends SignatureCreationService { + + /** + * Create an XML signature. + * + * @param request The CreateXMLSignatureRequest containing + * information about the signature(s) to create. + * @return The created signature(s). + * @throws MOAException An error occurred creating the signature(s). + */ + public CreateXMLSignatureResponse createXMLSignature(CreateXMLSignatureRequest request) + throws MOAException { + + XMLSignatureCreationInvoker invoker = + XMLSignatureCreationInvoker.getInstance(); + CreateXMLSignatureResponse response; + + try { + Configurator.getInstance().init(); + ServiceContextUtils.setUpContexts(); + response = invoker.createXMLSignature(request, Collections.EMPTY_SET); + return response; + } finally { + ServiceContextUtils.tearDownContexts(); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java new file mode 100644 index 000000000..94cdea5d9 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/SignatureVerificationServiceImpl.java @@ -0,0 +1,72 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.Configurator; +import at.gv.egovernment.moa.spss.api.SignatureVerificationService; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; + +/** + * An implementation of the SignatureVerificationService using + * the XMLSignatureVerificationInvoker and the + * CMSSignatureVerificationInvoker. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SignatureVerificationServiceImpl + extends SignatureVerificationService { + + /** + * Verify a CMS signature. + * + * @param request The VerifyCMSSignatureRequest containing + * information about the signature verification. + * @return The result of the signature verification. + * @throws MOAException An error occurred during signature verification. + */ + public VerifyCMSSignatureResponse verifyCMSSignature(VerifyCMSSignatureRequest request) + throws MOAException { + + CMSSignatureVerificationInvoker invoker = + CMSSignatureVerificationInvoker.getInstance(); + VerifyCMSSignatureResponse response; + + try { + Configurator.getInstance().init(); + ServiceContextUtils.setUpContexts(); + response = invoker.verifyCMSSignature(request); + return response; + } finally { + ServiceContextUtils.tearDownContexts(); + } + } + + /** + * Verify an XML signature. + * + * @param request The VerifyXMLSignatureRequest containinig + * information about the signature verification. + * @return The result of the signature verification. + * @throws MOAException An error occurred during signature verification. + */ + public VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) + throws MOAException { + + XMLSignatureVerificationInvoker invoker = + XMLSignatureVerificationInvoker.getInstance(); + VerifyXMLSignatureResponse response; + + try { + Configurator.getInstance().init(); + ServiceContextUtils.setUpContexts(); + response = invoker.verifyXMLSignature(request); + return response; + } finally { + ServiceContextUtils.tearDownContexts(); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java new file mode 100644 index 000000000..9984a95a5 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java @@ -0,0 +1,258 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import iaik.server.modules.xml.Base64Transformation; +import iaik.server.modules.xml.Canonicalization; +import iaik.server.modules.xml.EnvelopedSignatureTransformation; +import iaik.server.modules.xml.Transformation; +import iaik.server.modules.xml.XPath2Transformation; +import iaik.server.modules.xml.XPathTransformation; +import iaik.server.modules.xml.XSLTTransformation; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; +import at.gv.egovernment.moa.spss.api.common.Transform; +import at.gv.egovernment.moa.spss.api.common.XPathFilter; +import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; +import at.gv.egovernment.moa.spss.api.common.XPathTransform; +import at.gv.egovernment.moa.spss.api.common.XSLTTransform; +import at.gv.egovernment.moa.spss.server.iaik.xml.Base64TransformationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.CanonicalizationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.EnvelopedSignatureTransformationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.ExclusiveCanonicalizationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XPath2FilterImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XPath2TransformationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XPathTransformationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XSLTTransformationImpl; + +/** + * A factory to create Transformation objects from + * Transform objects. + * + * @author Patrick Peck + * @version $Id$ + */ +public class TransformationFactory { + + + /** The single instance of this class. */ + private static TransformationFactory instance = null; + + /** Maps XPathFilter filter types to + * XPath2Transformation filter types. */ + private static Map FILTER_TYPE_MAPPING; + + static { + FILTER_TYPE_MAPPING = new HashMap(); + + FILTER_TYPE_MAPPING.put( + XPathFilter.INTERSECT_TYPE, + XPath2Transformation.XPath2Filter.INTERSECTION); + FILTER_TYPE_MAPPING.put( + XPathFilter.SUBTRACT_TYPE, + XPath2Transformation.XPath2Filter.SUBTRACTION); + FILTER_TYPE_MAPPING.put( + XPathFilter.UNION_TYPE, + XPath2Transformation.XPath2Filter.UNION); + } + + /** + * Get the single instance of the factory. + * + * @return TransformationFactory The single instance. + */ + public static synchronized TransformationFactory getInstance() { + if (instance == null) { + instance = new TransformationFactory(); + } + return instance; + } + + /** + * Create a new TransformationFactory. + * + * Protected to disallow multiple instances. + */ + protected TransformationFactory() { + } + + /** + * Create a Transformation based on a + * Transform object. + * + * @param transform The Transform object to extract + * transformation data from. + * @return The transformation contained in the transform + * object. + * @throws MOAApplicationException An error occured creating the + * Transformation. See exception message for details. + */ + public Transformation createTransformation(Transform transform) + throws MOAApplicationException { + String algorithmUri = transform.getAlgorithmURI(); + + if (Canonicalization.CANONICAL_XML.equals(algorithmUri) + || Canonicalization.CANONICAL_XML_WITH_COMMENTS.equals(algorithmUri)) { + return createC14nTransformation(algorithmUri); + } else if ( + Canonicalization.EXCLUSIVE_CANONICAL_XML.equals(algorithmUri) + || Canonicalization.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS.equals( + algorithmUri)) { + + return createExclusiveC14nTransformation( + (ExclusiveCanonicalizationTransform) transform); + + } else if (Base64Transformation.ALL.contains(algorithmUri)) { + return createBase64Transformation(); + } else if (EnvelopedSignatureTransformation.ALL.contains(algorithmUri)) { + return createEnvelopedSignatureTransformation(); + } else if (XPathTransformation.ALL.contains(algorithmUri)) { + return createXPathTransformation((XPathTransform) transform); + } else if (XPath2Transformation.ALL.contains(algorithmUri)) { + return createXPath2Transformation((XPathFilter2Transform) transform); + } else if (XSLTTransformation.ALL.contains(algorithmUri)) { + return createXSLTTransformation((XSLTTransform) transform); + } else { + throw new MOAApplicationException("1108", new Object[] { algorithmUri }); + } + } + + /** + * Create a List of Transformations from a + * List of Transforms. + * + * @param transforms The List containing the + * Transforms. + * @return The List of Transformations corresponding + * to the transforms. + * @throws MOAApplicationException An error occurred building one of the + * transformations. See exception message for details. + */ + public List createTransformationList(List transforms) + throws MOAApplicationException { + List transformationList = new ArrayList(); + Iterator trIter; + + for (trIter = transforms.iterator(); trIter.hasNext();) { + Transform transform = (Transform) trIter.next(); + transformationList.add(createTransformation(transform)); + } + + return transformationList; + } + + /** + * Create a Canonicalization. + * + * @param algorithmUri The algorithm URI of the canonicalization. + * @return The Canonicalization. + */ + private Transformation createC14nTransformation(String algorithmUri) { + return new CanonicalizationImpl(algorithmUri); + } + + /** + * Create a ExclusiveCanonicalization. + * + * @param transform The ExclusiveCanonicalizationTransform + * containing the transformation data. + * @return The ExclusiveCanonicalization. + */ + private Transformation createExclusiveC14nTransformation(ExclusiveCanonicalizationTransform transform) { + return new ExclusiveCanonicalizationImpl( + transform.getAlgorithmURI(), + transform.getInclusiveNamespacePrefixes()); + } + + /** + * Create a Base64Transformation. + * + * @return The + */ + private Transformation createBase64Transformation() { + return new Base64TransformationImpl(); + } + + /** + * Create an EnvelopedSignatureTransformation. + * + * @return An EnvelopedSignatureTransformation. + */ + private Transformation createEnvelopedSignatureTransformation() { + return new EnvelopedSignatureTransformationImpl(); + } + + /** + * Create an XPathTransformation. + * + * @param transform The Transform object containing the + * XPath transformation. + * @return An XPathTransformation corresponding the + * transformation given in transform. + * @throws MOAApplicationException An error occurred creating the + * Transformation. + */ + private Transformation createXPathTransformation(XPathTransform transform) + throws MOAApplicationException { + + return new XPathTransformationImpl( + transform.getXPathExpression(), + transform.getNamespaceDeclarations()); + } + + /** + * Create an XPath2Transformation. + * + * @param transform The Transform object containing the + * XPath filter transformation. + * @return An XPath2Transformation corresponding the + * transformation given in transform. + * @throws MOAApplicationException An error occurred creating the + * Transformation. + */ + private Transformation createXPath2Transformation(XPathFilter2Transform transform) + throws MOAApplicationException { + + XPath2TransformationImpl xpath2 = new XPath2TransformationImpl(); + Iterator iter; + + for (iter = transform.getFilters().iterator(); iter.hasNext();) { + XPathFilter filter = (XPathFilter) iter.next(); + String mappedFilterType = + (String) FILTER_TYPE_MAPPING.get(filter.getFilterType()); + XPath2FilterImpl mappedFilter = + new XPath2FilterImpl( + mappedFilterType, + filter.getXPathExpression(), + filter.getNamespaceDeclarations()); + xpath2.addXPathFilter(mappedFilter); + } + + if (xpath2.getXPathFilters().size() == 0) { + throw new MOAApplicationException("2216", null); + } + + return xpath2; + } + + /** + * Create an XSLTTransformation. + * + * @param transform The Transform containing the XSLT stylesheet. + * @return An XSLTTransformation corresponding the transformation + * given in transform. + * @throws MOAApplicationException An error occurred creating the + * Transformation. + */ + private Transformation createXSLTTransformation(XSLTTransform transform) + throws MOAApplicationException { + + return new XSLTTransformationImpl(transform.getStylesheet()); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java new file mode 100644 index 000000000..55e2e1505 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyCMSSignatureResponseBuilder.java @@ -0,0 +1,86 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; + +import iaik.server.modules.cmsverify.CMSSignatureVerificationResult; +import iaik.server.modules.cmsverify.CertificateValidationResult; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponseElement; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; + +/** + * A class to build a VerifyCMSSignatureResponse object. + * + *

Via subsequent calls to addResult() a number of results from + * a CMS signature verification can be added to the response.

+ * + *

The getResponseElement() method then returns the + * VerifyCMSSignatureResponse built so far.

+ * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyCMSSignatureResponseBuilder { + /** The SPSSFactory for creating API objects. */ + private SPSSFactory factory = SPSSFactory.getInstance(); + /** The elements making up the response. */ + private List responseElements = new ArrayList(); + + /** + * Get the VerifyCMSSignatureResponse built so far. + * + * @return The VerifyCMSSignatureResponse built so far. + */ + public VerifyCMSSignatureResponse getResponse() { + return factory.createVerifyCMSSignatureResponse(responseElements); + } + + /** + * Add a verification result to the response. + * + * @param result The result to add. + * @throws MOAApplicationException An error occurred adding the result. + */ + public void addResult(CMSSignatureVerificationResult result) + throws MOAApplicationException { + + CertificateValidationResult certResult = + result.getCertificateValidationResult(); + int signatureCheckCode = + result.getSignatureValueVerificationCode().intValue(); + int certificateCheckCode = certResult.getValidationResultCode().intValue(); + VerifyCMSSignatureResponseElement responseElement; + SignerInfo signerInfo; + CheckResult signatureCheck; + CheckResult certificateCheck; + + // add SignerInfo element + signerInfo = + factory.createSignerInfo( + (X509Certificate) certResult.getCertificateChain().get(0), + certResult.isQualifiedCertificate(), + certResult.isPublicAuthorityCertificate(), + certResult.getPublicAuthorityID()); + + // add SignatureCheck element + signatureCheck = factory.createCheckResult(signatureCheckCode, null); + + // add CertificateCheck element + certificateCheck = factory.createCheckResult(certificateCheckCode, null); + + // build the response element + responseElement = + factory.createVerifyCMSSignatureResponseElement( + signerInfo, + signatureCheck, + certificateCheck); + responseElements.add(responseElement); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java new file mode 100644 index 000000000..d6f58a560 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/VerifyXMLSignatureResponseBuilder.java @@ -0,0 +1,437 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import iaik.ixsil.algorithms.CanonicalizationAlgorithm; +import iaik.ixsil.algorithms.CanonicalizationAlgorithmImplExclusiveCanonicalXMLWithComments; +import iaik.server.modules.xml.BinaryDataObject; +import iaik.server.modules.xml.DataObject; +import iaik.server.modules.xml.XMLDataObject; +import iaik.server.modules.xml.XMLNodeListDataObject; +import iaik.server.modules.xmlverify.CertificateValidationResult; +import iaik.server.modules.xmlverify.DsigManifest; +import iaik.server.modules.xmlverify.HashUnavailableException; +import iaik.server.modules.xmlverify.ReferenceData; +import iaik.server.modules.xmlverify.ReferenceInfo; +import iaik.server.modules.xmlverify.SecurityLayerManifest; +import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; +import iaik.server.modules.xmlverify.XMLSignatureVerificationResult; +import iaik.x509.X509Certificate; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.InputData; +import at.gv.egovernment.moa.spss.api.common.SignerInfo; +import at.gv.egovernment.moa.spss.api.impl.InputDataBinaryImpl; +import at.gv.egovernment.moa.spss.api.impl.InputDataXMLImpl; +import at.gv.egovernment.moa.spss.api.xmlverify.ManifestRefsCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.util.CollectionUtils; +import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.NodeListAdapter; + +/** + * A class to build a VerifyXMLSignatureResponse object. + * + *

Via a call to addResult() the only result of the + * signature verification must be added.

+ * + *

The getResponseElement() method then returns the + * VerifyXMLSignatureResponse built so far.

+ * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyXMLSignatureResponseBuilder { + + /** The SPSSFactory for creating API objects. */ + private SPSSFactory factory = SPSSFactory.getInstance(); + + /** Information about the signer certificate. */ + private SignerInfo signerInfo; + /** The hash input data. */ + private List hashInputDatas; + /** The reference input data. */ + private List referenceInputDatas; + /** The result of the signature check. */ + private ReferencesCheckResult signatureCheck; + /** The result of the signature manifest check. */ + private ReferencesCheckResult signatureManifestCheck; + /** The result of the XMLDsig manifest check. */ + private List xmlDsigManifestChecks; + /** The result of the certificate check. */ + private CheckResult certificateCheck; + + /** + * Get the VerifyMLSignatureResponse built so far. + * + * @return The VerifyXMLSignatureResponse built so far. + */ + public VerifyXMLSignatureResponse getResponse() { + return factory.createVerifyXMLSignatureResponse( + signerInfo, + hashInputDatas, + referenceInputDatas, + signatureCheck, + signatureManifestCheck, + xmlDsigManifestChecks, + certificateCheck); + } + + /** + * Sets the verification result to the response. + * + * This method must be called exactly once to ensure a valid + * VerifyXMLSignatureResponse. + * + * @param result The result to set for the response. + * @param profile The profile used for verifying the signature. + * @param transformsSignatureManifestCheck The overall result for the signature + * manifest check. + * @param certificateCheck The overall result for the certificate check. + * @throws MOAApplicationException An error occurred adding the result. + */ + public void setResult( + XMLSignatureVerificationResult result, + XMLSignatureVerificationProfile profile, + ReferencesCheckResult transformsSignatureManifestCheck, + CheckResult certificateCheck) + throws MOAApplicationException { + + CertificateValidationResult certResult = + result.getCertificateValidationResult(); + List referenceDataList; + ReferenceData referenceData; + List dsigManifestList; + ReferencesCheckResultInfo checkResultInfo; + int[] failedReferences; + Iterator iter; + + // create the SignerInfo; + signerInfo = + factory.createSignerInfo( + (X509Certificate) certResult.getCertificateChain().get(0), + certResult.isQualifiedCertificate(), + certResult.isPublicAuthorityCertificate(), + certResult.getPublicAuthorityID()); + + // Create HashInputData Content objects + referenceDataList = result.getReferenceDataList(); + if (profile.includeHashInputData()) { + hashInputDatas = new ArrayList(); + + // Include SignedInfo references + addHashInputDatas( + hashInputDatas, + referenceDataList, + InputData.CONTAINER_SIGNEDINFO_, + InputData.REFERER_NONE_); + + // Include XMLDSIGManifest references + List xMLDSIGManifests = result.getDsigManifestList(); + for (iter = xMLDSIGManifests.iterator(); iter.hasNext();) + { + DsigManifest currentMF = (DsigManifest) iter.next(); + List xMLDSIGMFReferenceDataList = currentMF.getReferenceDataList(); + addHashInputDatas( + hashInputDatas, + xMLDSIGMFReferenceDataList, + InputData.CONTAINER_XMLDSIGMANIFEST_, + currentMF.getReferringReferenceInfo().getReferenceIndex()); + } + } + + // Create the ReferenceInputData Content objects + if (profile.includeReferenceInputData()) { + referenceInputDatas = new ArrayList(); + + // Include SignedInfo references + addReferenceInputDatas( + referenceInputDatas, + referenceDataList, + InputData.CONTAINER_SIGNEDINFO_, + InputData.REFERER_NONE_); + + // Include XMLDSIGManifest references + List xMLDSIGManifests = result.getDsigManifestList(); + for (iter = xMLDSIGManifests.iterator(); iter.hasNext();) + { + DsigManifest currentMF = (DsigManifest) iter.next(); + List xMLDSIGMFReferenceDataList = currentMF.getReferenceDataList(); + addReferenceInputDatas( + referenceInputDatas, + xMLDSIGMFReferenceDataList, + InputData.CONTAINER_XMLDSIGMANIFEST_, + currentMF.getReferringReferenceInfo().getReferenceIndex()); + } + } + + // create the signature check + failedReferences = buildFailedReferences(result.getReferenceDataList()); + checkResultInfo = + failedReferences != null + ? factory.createReferencesCheckResultInfo(null, failedReferences) + : null; + signatureCheck = + factory.createReferencesCheckResult( + result.getSignatureValueVerificationCode().intValue(), + checkResultInfo); + + // create the signature manifest check + if (profile.checkSecurityLayerManifest()) + { + if (transformsSignatureManifestCheck.getCode() == 1) + { + // checking the transforms failed + signatureManifestCheck = transformsSignatureManifestCheck; + } + else if (result.isSecurityLayerManifestRequired()) + { + if (!result.containsSecurityLayerManifest()) + { + // required security layer manifest is missing in signature + signatureManifestCheck = factory.createReferencesCheckResult(2, null); + } + else + { + // security layer manifest exists, so we have to check its validity + SecurityLayerManifest slManifest = result.getSecurityLayerManifest(); + int verificationResult = slManifest.getManifestVerificationResult().intValue(); + + if (SecurityLayerManifest.CODE_MANIFEST_VALID.intValue() == verificationResult) + { + // security layer manifest exists and is free of errors + signatureManifestCheck = factory.createReferencesCheckResult(0, null); + } + else + { + // security layer manifest exists, but has errors + failedReferences = buildFailedReferences(slManifest.getReferenceDataList()); + checkResultInfo = (failedReferences != null) + ? factory.createReferencesCheckResultInfo(null, failedReferences) + : null; + if (SecurityLayerManifest.CODE_MANIFEST_INCOMPLETE.intValue() == verificationResult) + { + signatureManifestCheck = factory.createReferencesCheckResult(3, checkResultInfo); + } + else if (SecurityLayerManifest.CODE_REFERENCE_HASH_INVALID.intValue() == verificationResult) + { + signatureManifestCheck = factory.createReferencesCheckResult(4, checkResultInfo); + } + else + { + // Should not happen + throw new RuntimeException("Unexpected result from security layer manifest verification."); + } + } + } + } + else + { + // no security layer manifest is required, so the signature manifest check is ok + signatureManifestCheck = factory.createReferencesCheckResult(0, null); + } + } + + // create the xmlDsigManifestCheck + if (profile.checkXMLDsigManifests()) { + xmlDsigManifestChecks = new ArrayList(); + dsigManifestList = result.getDsigManifestList(); + for (iter = dsigManifestList.iterator(); iter.hasNext();) { + DsigManifest dsigManifest = (DsigManifest) iter.next(); + int refIndex = + dsigManifest.getReferringReferenceInfo().getReferenceIndex(); + ManifestRefsCheckResultInfo manifestCheckResultInfo; + + failedReferences = + buildFailedReferences(dsigManifest.getReferenceDataList()); + manifestCheckResultInfo = + factory.createManifestRefsCheckResultInfo( + null, + failedReferences, + refIndex); + xmlDsigManifestChecks.add( + factory.createManifestRefsCheckResult( + dsigManifest.getManifestVerificationResult().intValue(), + manifestCheckResultInfo)); + } + } + + // create the certificate check + this.certificateCheck = certificateCheck; + } + + /** + * Adds {@link InputData} entries to the specified inputDatas list. The content of the entry will + * be created from {@link ReferenceData#getHashInputData()}. + * + * @param inputDatas The list to be amended. + * + * @param referenceDataList The list of {@link ReferenceData} objects to be investigated. + * + * @param containerType The type of container of the {@link InputData} objects to be created. + * + * @param refererNumber The number of the referring reference for the {@link InputData} objects to be created. + * + * @throws MOAApplicationException if creating an {@link InputData} fails. + */ + private void addHashInputDatas(List inputDatas, List referenceDataList, String containerType, int refererNumber) + throws MOAApplicationException + { + for (Iterator iter = referenceDataList.iterator(); iter.hasNext();) + { + ReferenceData referenceData = (ReferenceData) iter.next(); + inputDatas.add(buildInputData( + referenceData.getHashInputData(), + containerType, + refererNumber)); + } + } + + /** + * Adds {@link InputData} entries to the specified inputDatas list. The content of the entry will + * be created from {@link ReferenceData#getReferenceInputData()}. + * + * @param inputDatas The list to be amended. + * + * @param referenceDataList The list of {@link ReferenceData} objects to be investigated. + * + * @param containerType The type of container of the {@link InputData} objects to be created. + * + * @param refererNumber The number of the referring reference for the {@link InputData} objects to be created. + * + * @throws MOAApplicationException if creating an {@link InputData} fails. + */ + private void addReferenceInputDatas(List inputDatas, List referenceDataList, String containerType, int refererNumber) + throws MOAApplicationException + { + for (Iterator iter = referenceDataList.iterator(); iter.hasNext();) + { + ReferenceData referenceData = (ReferenceData) iter.next(); + inputDatas.add(buildInputData( + referenceData.getReferenceInputData(), + containerType, + refererNumber)); + } + } + + /** + * Build a InputDataBinaryImpl or an InputDataXMLImpl + * object from the given DataObject and the given attributes. + * + * @param dataObject The DataObject from which to build the result. + * Based on the type of this parameter, the type of the result will either be + * InputDataBinaryImpl or InputDataXMLImpl. + * + * @param partof see {@link InputData} + * + * @param referringReferenceNumber see {@link InputData} + * + * @return The corresponinding input data implementation. + * + * @throws MOAApplicationException An error occurred creating the result. + */ + private Content buildInputData(DataObject dataObject, String partOf, int referringReferenceNumber) + throws MOAApplicationException { + + if (dataObject instanceof BinaryDataObject) { + BinaryDataObject binaryData = (BinaryDataObject) dataObject; + return new InputDataBinaryImpl( + factory.createContent(binaryData.getInputStream(), null), + partOf, + referringReferenceNumber); + } else if (dataObject instanceof XMLDataObject) { + XMLDataObject xmlData = (XMLDataObject) dataObject; + List nodes = new ArrayList(); + + nodes.add(xmlData.getElement()); + return new InputDataXMLImpl( + factory.createContent(new NodeListAdapter(nodes), null), + partOf, + referringReferenceNumber); + } else { // dataObject instanceof XMLNodeListDataObject + // if the data in the NodeList can be converted back to valid XML, + // write it as XMLContent; otherwise, write it as Base64Content + XMLNodeListDataObject nodeData = (XMLNodeListDataObject) dataObject; + NodeList nodes = nodeData.getNodeList(); + + if (DOMUtils.checkAttributeParentsInNodeList(nodes)) { + // insert as XMLContent + try { + DocumentFragment fragment = DOMUtils.nodeList2DocumentFragment(nodes); + + return new InputDataXMLImpl( + factory.createContent(fragment.getChildNodes(), null), + partOf, + referringReferenceNumber); + } catch (Exception e) { + // not successful -> fall through to the Base64Content + } + } + + // insert canonicalized NodeList as binary content + try { + CanonicalizationAlgorithm c14n = + new CanonicalizationAlgorithmImplExclusiveCanonicalXMLWithComments(); + InputStream is; + + c14n.setInput(nodes); + is = c14n.canonicalize(); + return new InputDataBinaryImpl( + factory.createContent(is, null), + partOf, + referringReferenceNumber); + } catch (Exception e) { + throw new MOAApplicationException("2200", null); + } + } + } + + /** + * Build the failed references. + * + * Failed references are references for which the isHashValid() + * method returns false. + * + * @param refInfos A List containing the + * ReferenceInfo objects to be checked. + * @return The indexes of the failed references. + */ + private int[] buildFailedReferences(List refInfos) { + List failedReferencesList = new ArrayList(); + int i; + + // find out the failed references + for (i = 0; i < refInfos.size(); i++) { + ReferenceInfo refInfo = (ReferenceInfo) refInfos.get(i); + + try { + if (refInfo.isHashCalculated() && !refInfo.isHashValid()) { + failedReferencesList.add(new Integer(i + 1)); + } + } catch (HashUnavailableException e) { + // nothing to do here because we called refInfo.isHashCalculated first + } + } + + // convert to an int array + if (failedReferencesList.isEmpty()) { + return null; + } else { + int[] failedReferences = CollectionUtils.toIntArray(failedReferencesList); + + return failedReferences; + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java new file mode 100644 index 000000000..fd207ddea --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java @@ -0,0 +1,545 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import iaik.IAIKException; +import iaik.IAIKRuntimeException; +import iaik.server.modules.xml.DataObject; +import iaik.server.modules.xml.XMLDataObject; +import iaik.server.modules.xml.XMLSignature; +import iaik.server.modules.xmlsign.XMLSignatureCreationModule; +import iaik.server.modules.xmlsign.XMLSignatureCreationModuleFactory; +import iaik.server.modules.xmlsign.XMLSignatureCreationProfile; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl; +import at.gv.egovernment.moa.spss.server.logging.IaikLog; +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.spss.server.util.IdGenerator; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.XPathUtils; + +/** + * A class providing an API based interface to the + * XMLSignatureCreationModule. + * + * This class performs the invocation of the + * iaik.server.modules.xmlsign.XMLSignatureCreationModule from a + * CreateXMLSignatureRequest given as an API object. The result of + * the invocation is integrated into a CreateXMLSignatureResponse + * and returned. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureCreationInvoker { + + /** The single instance of this class. */ + private static XMLSignatureCreationInvoker instance = null; + + /** + * Get the only instance of this class. + * + * @return The only instance of this class. + */ + public static synchronized XMLSignatureCreationInvoker getInstance() { + if (instance == null) { + instance = new XMLSignatureCreationInvoker(); + } + return instance; + } + + /** + * Create a new XMLSignatureCreationInvoker. + * + * Protected to disallow multiple instances. + */ + protected XMLSignatureCreationInvoker() { + } + + /** + * Process the CreateXMLSignatureRequest message and invoke the + * XMLSignatureCreationModule for every + * SingleSignatureInfo contained in the request. + * + * @param request A CreateXMLSignatureRequest API object + * containing the information for creating the signature(s). + * @param reserved A Set of reserved object IDs. + * + * @return A CreateXMLSignatureResponse API object containing + * the created signature(s). The response contains either a + * SignatureEnvironment or a ErrorResponse + * for each SingleSignatureInfo in the request. + * @throws MOAException An error occurred during signature creation. + */ + public CreateXMLSignatureResponse createXMLSignature( + CreateXMLSignatureRequest request, + Set reserved) + throws MOAException { + + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + LoggingContext loggingCtx = + LoggingContextManager.getInstance().getLoggingContext(); + reserved = new HashSet(reserved); + XMLSignatureCreationProfileFactory profileFactory = + new XMLSignatureCreationProfileFactory(request, reserved); + CreateXMLSignatureResponseBuilder responseBuilder = + new CreateXMLSignatureResponseBuilder(); + int createCount = 1; + IdGenerator refIdGen; + XMLSignatureCreationModule module; + Iterator singleSignatureInfoIter; + + // create the XMLSignatureCreationModule and configure it + module = XMLSignatureCreationModuleFactory.getInstance(); + module.setLog(new IaikLog(loggingCtx.getNodeID())); + + // select the SingleSignatureInfo elements + singleSignatureInfoIter = request.getSingleSignatureInfos().iterator(); + + // iterate over all the SingleSignatureInfo elements in the request + while (singleSignatureInfoIter.hasNext()) { + SingleSignatureInfo singleSignatureInfo = + (SingleSignatureInfo) singleSignatureInfoIter.next(); + CreateSignatureInfo createSignatureInfo; + List dataObjectList; + XMLSignatureCreationProfile profile; + XMLDataObject signatureEnvironment; + XMLDataObject signatureParent; + XMLSignature signature; + List additionalSignedProperties; + Node signatureEnvironmentParent = null; + Element requestElement = null; + + try { + + // build the signature environment + createSignatureInfo = singleSignatureInfo.getCreateSignatureInfo(); + if (createSignatureInfo != null) { + DataObjectFactory dataObjFactory = DataObjectFactory.getInstance(); + + signatureEnvironment = + dataObjFactory.createSignatureEnvironment( + createSignatureInfo.getCreateSignatureEnvironment(), + getCreateSignatureEnvironmentProfileSupplements(singleSignatureInfo)); + } else { + signatureEnvironment = null; + } + + HashSet sigInfoReservedIDs = new HashSet(); + if (signatureEnvironment != null) + { + // Find Id attributes of existing XML signatures in signature environment + HashMap nSMap = new HashMap(); + String dsp = Constants.DSIG_PREFIX; + nSMap.put(dsp, Constants.DSIG_NS_URI); + String xPathExpr = "//" + dsp + ":Signature/@Id | //" + dsp + ":Reference/@Id | //" + + dsp + ":Object/@Id | //" + dsp + ":Manifest/@Id"; + NodeList idAttrs = XPathUtils.selectNodeList(signatureEnvironment.getElement(), nSMap, xPathExpr); + + // Add found Id attributes to set of reserved IDs + for (int i = 0; i < idAttrs.getLength(); i++) sigInfoReservedIDs.add(idAttrs.item(i).getNodeValue()); + } + + // create the reference id generator + HashSet allReservedIDs = new HashSet(reserved); + allReservedIDs.addAll(sigInfoReservedIDs); + refIdGen = new IdGenerator("reference-" + createCount++, allReservedIDs); + + // build the list of DataObjects + List createTransformsProfiles = profileFactory.getCreateTransformsInfoProfiles(singleSignatureInfo); + dataObjectList = + buildDataObjectList( + singleSignatureInfo, + createTransformsProfiles, + signatureEnvironment, + refIdGen); + + // build the XMLSignatureCreationProfile + profile = profileFactory.createProfile(singleSignatureInfo, sigInfoReservedIDs); + + // build the additionalSignedProperties + additionalSignedProperties = buildAdditionalSignedProperties(); + + // build the signatureParentElement + if (signatureEnvironment != null) { + signatureParent = + buildSignatureParentElement( + signatureEnvironment.getElement(), + singleSignatureInfo); + } else { + signatureParent = null; + } + + // make the signature environment the root of the document, if it is + // not a separate document anyway; this is done to assure that + // canonicalization of the signature environment contains the correct + // namespace declarations + if (signatureEnvironment != null) { + Document requestDoc = + signatureEnvironment.getElement().getOwnerDocument(); + requestElement = requestDoc.getDocumentElement(); + if (requestElement != signatureEnvironment.getElement()) { + signatureEnvironmentParent = + signatureEnvironment.getElement().getParentNode(); + requestElement.getOwnerDocument().replaceChild( + signatureEnvironment.getElement(), + requestElement); + } + } + + try { + // create the signature + signature = + module.createSignature( + dataObjectList, + profile, + additionalSignedProperties, + signatureParent, + new TransactionId(context.getTransactionID())); + + // insert the result into the response + if (signatureParent != null) { + responseBuilder.addSignatureEnvironment( + signatureEnvironment.getElement()); + } else { + responseBuilder.addSignatureEnvironment(signature.getElement()); + } + + } catch (IAIKException e) { + MOAException moaException = IaikExceptionMapper.getInstance().map(e); + + responseBuilder.addError( + moaException.getMessageId(), + moaException.getMessage()); + Logger.warn(moaException.getMessage(), e); + } catch (IAIKRuntimeException e) { + MOAException moaException = IaikExceptionMapper.getInstance().map(e); + + responseBuilder.addError( + moaException.getMessageId(), + moaException.getMessage()); + Logger.warn(moaException.getMessage(), e); + } + + // swap back in the request as root document + if (signatureEnvironment != null) { + if (requestElement != signatureEnvironment.getElement()) { + requestElement.getOwnerDocument().replaceChild( + requestElement, + signatureEnvironment.getElement()); + signatureEnvironmentParent.appendChild( + signatureEnvironment.getElement()); + } + } + + } catch (MOAException e) { + responseBuilder.addError(e.getMessageId(), e.getMessage()); + Logger.warn(e.getMessage(), e); + } + + } + + return responseBuilder.getResponse(); + } + + /** + * Build the list of DataObjects from the given + * SingleSignatureInfo object. + * + *

+ * Only the following cases of DataObjects are + * valid in case of an enveloping signature: + * + *

    + *
  • Reference == null && Content != null: The + * Content will be used in the DataObject.
  • + *
  • Reference != null && Content == null: Resolve the + * Reference and use it as DataObject. + * Set the Reference in the DataObject as well.
  • + *
+ *

+ * + *

+ * Only the following cases of DataObjects are valid in case + * of a detached signature: + * + *

    + *
  • Reference != null && Content == null: Resolve the + * Reference and use it as DataObject. + * Set the Reference in the DataObject as well.
  • + *
  • Reference != null && Content != null: The + * Content will be used in the DataObject. + * Set the Reference in the DataObject as well.
  • + *
+ *

+ * + *

+ * All other cases will lead to an error. + *

+ * + * @param singleSignatureInfo The SingleSignatureInfo object + * containing the DataObjectInfo objects. + * @param createTransformsProfiles A list of objects of type {@link CreateTransformsInfoProfileExplicit}, + * each representing the transforms info profile information for the corresponding DataObject. + * @param signatureEnvironment The + * @param idGen The ID generator for DataObject references. + * @return The List of DataObjects contained in the + * given singleSignatureInfo. + * @throws MOASystemException A system error occurred building the data + * objects. + * @throws MOAApplicationException An error occurred building the data + * objects. + */ + private List buildDataObjectList( + SingleSignatureInfo singleSignatureInfo, + List createTransformsProfiles, + XMLDataObject signatureEnvironment, + IdGenerator idGen) + throws MOASystemException, MOAApplicationException { + + List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); + List dataObjects = new ArrayList(); + Iterator dtIter; + Iterator ctpIter = createTransformsProfiles.iterator(); + + for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) + { + DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); + String structure = dataObjInfo.getStructure(); + + CreateTransformsInfoProfileExplicit transformsProfile = + (CreateTransformsInfoProfileExplicit) ctpIter.next(); + MetaInfo finalDataMetaInfo = transformsProfile.getCreateTransformsInfo().getFinalDataMetaInfo(); + + if (DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure)) { + dataObjects.add( + buildEnvelopingDataObject( + dataObjInfo.getDataObject(), + finalDataMetaInfo, + idGen.uniqueId())); + } else if (DataObjectInfo.STRUCTURE_DETACHED.equals(structure)) { + dataObjects.add( + buildDetachedDataObject( + dataObjInfo.getDataObject(), + finalDataMetaInfo, + signatureEnvironment, + idGen.uniqueId())); + } else { + throw new MOAApplicationException("1103", new Object[] { structure }); + } + } + + return dataObjects; + + } + + /** + * Build a DataObject to be used in an enveloping + * signature. + * + * @param content The Content object containing the data object. + * ContentOptionalRefType. + * @param finalDataMetaInfo The meta information corresponding with content. + * @param referenceID The reference ID to use in the signature for the + * DataObject created. + * @return The DataObject representing the data contained in + * dataObjectElem. + * @throws MOAApplicationException An error occurred during the creation of + * the DataObject. + * @throws MOASystemException A system error occurred during the creation of + * the DataObject. + */ + private DataObject buildEnvelopingDataObject( + Content content, + MetaInfo finalDataMetaInfo, + String referenceID) + throws MOASystemException, MOAApplicationException { + + DataObjectFactory factory = DataObjectFactory.getInstance(); + DataObject dataObject; + + dataObject = + factory.createFromContentOptionalRefType( + content, + finalDataMetaInfo, + referenceID, + false, + false, + true, + false); + + return dataObject; + } + + /** + * Build a DataObject to be used in a detached signature. + * + * @param content The Content object containing an the data. + * @param finalDataMetaInfo The meta information corresponding with content. + * @param signatureEnvironment The signature environment where the signature + * will be inserted. + * @param referenceID The reference ID to use in the signature for the + * DataObject created. + * @return The DataObject representing the data contained in + * dataObjectElem. + * @throws MOAApplicationException An error occurred during the creation of + * the DataObject. + * @throws MOASystemException A system error occurred during the creation of + * the DataObject. + */ + private DataObject buildDetachedDataObject( + Content content, + MetaInfo finalDataMetaInfo, + XMLDataObject signatureEnvironment, + String referenceID) + throws MOASystemException, MOAApplicationException { + + String reference = content.getReference(); + DataObjectFactory factory = DataObjectFactory.getInstance(); + DataObject dataObject; + + if (reference == null) { + throw new MOAApplicationException("1102", null); + } else if ("".equals(reference) || reference.startsWith("#")) { + dataObject = + factory.createFromSignatureEnvironment( + signatureEnvironment.getElement(), + reference, + referenceID); + } else { + dataObject = + factory.createFromContentOptionalRefType( + content, + finalDataMetaInfo, + referenceID, + true, + false, + true, + false); + } + return dataObject; + } + + /** + * Build the signature parent element. + * + * @param signatureEnvironment The signature environment containing the + * document in which to insert the signature. + * @param singleSignatureInfo The SingleSignatureInfo + * containing the signature parent element. + * @return An XMLDataObject containing the signature parent + * element or null, if the CreateSignatureInfo is + * null. + * @throws MOAApplicationException An error occurred during the creation of + * the signature parent. + */ + private XMLDataObject buildSignatureParentElement( + Element signatureEnvironment, + SingleSignatureInfo singleSignatureInfo) + throws MOAApplicationException { + + CreateSignatureInfo createInfo = + singleSignatureInfo.getCreateSignatureInfo(); + + // evaluate the CreateSignatureLocation + if (createInfo != null) { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + CreateSignatureEnvironmentProfileExplicit createProfile = + ProfileMapper.mapCreateSignatureEnvironmentProfile( + createInfo.getCreateSignatureEnvironmentProfile(), + config); + CreateSignatureLocation location = + createProfile.getCreateSignatureLocation(); + Element signatureParent = + InvokerUtils.evaluateSignatureLocation(signatureEnvironment, location); + + return new XMLDataObjectImpl(signatureParent); + } else { + return null; + } + } + + /** + * Get the supplements contained in the + * CreateSignatureEnvironmentProfile of the given + * SingleSignatureInfo. + * + * @param singleSigInfo The SingleSignatureInfo from which + * to extract the supplements. + * @return A List of XMLDataObjectAssociations + * or null, if the singleSigInfo does not contain + * supplements. + * @throws MOAApplicationException An error occurred parsing the + * CreateSignatureEnvironmentProfile. + */ + private List getCreateSignatureEnvironmentProfileSupplements(SingleSignatureInfo singleSigInfo) + throws MOAApplicationException { + CreateSignatureInfo sigInfo = singleSigInfo.getCreateSignatureInfo(); + + if (sigInfo != null) { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + CreateSignatureEnvironmentProfileExplicit profile = + ProfileMapper.mapCreateSignatureEnvironmentProfile( + sigInfo.getCreateSignatureEnvironmentProfile(), + config); + List supplements = profile.getSupplements(); + + return supplements; + } + return null; + } + + /** + * Build the list of additional signed properties. + * + * Based on the generic configuration setting + * ConfigurationProvider.TEST_SIGNING_TIME_PROPERTY, a + * constant SigningTime will be added to the properties. + * + * @return The List of additional signed properties. + */ + private List buildAdditionalSignedProperties() { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + List additionalSignedProperties = Collections.EMPTY_LIST; + + return additionalSignedProperties; + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java new file mode 100644 index 000000000..7ac971da8 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java @@ -0,0 +1,455 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import iaik.server.modules.algorithms.HashAlgorithms; +import iaik.server.modules.keys.KeyEntryID; +import iaik.server.modules.keys.KeyModule; +import iaik.server.modules.keys.KeyModuleFactory; +import iaik.server.modules.xmlsign.SignatureStructureTypes; +import iaik.server.modules.xmlsign.XMLSignatureCreationProfile; +import iaik.server.modules.xmlsign.XMLSignatureInsertionLocation; + +import java.math.BigInteger; +import java.security.Principal; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry; +import at.gv.egovernment.moa.spss.server.iaik.xml.CanonicalizationImpl; +import at.gv.egovernment.moa.spss.server.iaik.xmlsign.DataObjectTreatmentImpl; +import at.gv.egovernment.moa.spss.server.iaik.xmlsign.XMLSignatureCreationProfileImpl; +import at.gv.egovernment.moa.spss.server.iaik.xmlsign.XMLSignatureInsertionLocationImpl; +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.spss.server.util.IdGenerator; +import at.gv.egovernment.moa.spss.util.MessageProvider; +import at.gv.egovernment.moa.util.Constants; + +/** + * A factory to create XMLSignatureCreationProfiles from a + * CreateXMLSignatureRequest, based on the current MOA + * configuration. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureCreationProfileFactory { + + private static Map HASH_ALGORITHM_MAPPING; + + static { + HASH_ALGORITHM_MAPPING = new HashMap(); + HASH_ALGORITHM_MAPPING.put(Constants.SHA1_URI, HashAlgorithms.SHA1); + } + + /** The CreateXMLSignatureRequest for which to create the + * profile.*/ + private CreateXMLSignatureRequest request; + /** How many profiles have been created based on the same request. */ + private int createProfileCount; + /** The Set of reserved object IDs.*/ + private Set reserved; + + /** + * Create a new XMLSignatureCreationProfileFactory. + * + * @param request The request for which to create profiles. + * @param reserved The Set of reserved object IDs. IDs will + * be added during signature creation. + */ + public XMLSignatureCreationProfileFactory( + CreateXMLSignatureRequest request, + Set reserved) { + this.request = request; + this.reserved = reserved; + createProfileCount = 1; + } + + /** + * Create a XMLSignatureCreationProfile for the given + * SingleSignatureInfo object.. + * + * @param singleSignatureInfo The SingleSignatureInfo object + * containing information about the creation of a signature. + * @param sigInfoReservedIDs The Set of reserved ID attribue values + * for the particular singleSignatureInfo. + * @return The XMLSignatureCreationProfile containing additional + * information for creating an XML signature. + * @throws MOASystemException A system error occurred during creation of the + * profile. See message for details + * @throws MOAApplicationException An application error occurred during + * creation of the profile. See message for details. + */ + public XMLSignatureCreationProfile createProfile(SingleSignatureInfo singleSignatureInfo, + Set sigInfoReservedIDs) throws MOASystemException, MOAApplicationException { + + HashSet allReservedIDs = new HashSet(reserved); + allReservedIDs.addAll(sigInfoReservedIDs); + + XMLSignatureCreationProfileImpl profile = + new XMLSignatureCreationProfileImpl(createProfileCount, allReservedIDs); + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + CanonicalizationImpl canonicalization; + List dataObjectTreatmentList; + String keyGroupID; + Set keySet; + List transformationSupplements; + List createTransformsProfiles; + + // build the transformation supplements + createTransformsProfiles = + getCreateTransformsInfoProfiles(singleSignatureInfo); + transformationSupplements = + buildTransformationSupplements(createTransformsProfiles); + + // build and set the data object treatment list + dataObjectTreatmentList = + buildDataObjectTreatmentList( + singleSignatureInfo, + createTransformsProfiles, + transformationSupplements, + allReservedIDs); + profile.setDataObjectTreatmentList(dataObjectTreatmentList); + + // set the key set + keyGroupID = request.getKeyIdentifier(); + keySet = buildKeySet(keyGroupID); + if (keySet == null) { + throw new MOAApplicationException("2231", null); + } else if (keySet.size() == 0) { + throw new MOAApplicationException("2232", null); + } + profile.setKeySet(keySet); + + // set the Security Layer manifest algorithm name + profile.setSecurityLayerManifestTypeURI(Constants.SL_MANIFEST_TYPE_URI); + + // set the structure type + if (singleSignatureInfo.getCreateSignatureInfo() != null) { + profile.setSignatureStructureType(SignatureStructureTypes.ENVELOPED); + } else { + profile.setSignatureStructureType(SignatureStructureTypes.DETACHED); + } + + // set insertion location + profile.setSignatureInsertionLocation( + getSignatureInsertionLocationIndex(singleSignatureInfo)); + + // set the canonicalization algorithm + canonicalization = + new CanonicalizationImpl(config.getCanonicalizationAlgorithmName()); + profile.setSignedInfoCanonicalization(canonicalization); + + // set the signed properties + profile.setSignedProperties(Collections.EMPTY_LIST); + + // set security layer conformity + profile.setSecurityLayerConform( + singleSignatureInfo.isSecurityLayerConform()); + + // update the createProfileCount + createProfileCount++; + + return profile; + } + + /** + * Get the List of all CreateTransformsInfoProfiles + * contained in all the DataObjectInfos of the given + * SingleSignatureInfo. + * + * @param singleSignatureInfo The SingleSignatureInfo object from + * which to extract the CreateTransformsInfoProfiles. + * @return All CreateTransformsInfoProfiles of all + * DataObjectInfos of singleSignatureInfo. + * @throws MOAApplicationException An error occurred creating one of the + * profiles. + */ + List getCreateTransformsInfoProfiles(SingleSignatureInfo singleSignatureInfo) + throws MOAApplicationException { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); + List profiles = new ArrayList(); + Iterator dtIter; + + for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) { + DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); + CreateTransformsInfoProfileExplicit profile = + ProfileMapper.mapCreateTransformsInfoProfile( + dataObjInfo.getCreateTransformsInfoProfile(), + config); + profiles.add(profile); + } + + return profiles; + } + + /** + * Build the List of transformation supplements contained in a + * SingleSignatureInfo object. + * + * @param createTransformsInfoProfiles The + * CreateTransformsInfoProfile object from which to extract the + * transformation supplements. + * @return A List of DataObjects containing the + * transformation supplements. + * @throws MOASystemException A system error occurred creating one of the + * transformation supplements. + * @throws MOAApplicationException An error occurred creating one of the + * transformation supplements. + */ + private List buildTransformationSupplements(List createTransformsInfoProfiles) + throws MOASystemException, MOAApplicationException { + + List transformationSupplements = new ArrayList(); + DataObjectFactory factory = DataObjectFactory.getInstance(); + Iterator iter; + + for (iter = createTransformsInfoProfiles.iterator(); iter.hasNext();) { + CreateTransformsInfoProfileExplicit profile = + (CreateTransformsInfoProfileExplicit) iter.next(); + List supplements = profile.getSupplements(); + + if (supplements != null) { + Iterator supplIter; + + for (supplIter = supplements.iterator(); supplIter.hasNext();) { + XMLDataObjectAssociation supplement = + (XMLDataObjectAssociation) supplIter.next(); + + transformationSupplements.add( + factory.createFromXmlDataObjectAssociation( + supplement, + false, + true)); + } + } + } + + return transformationSupplements; + } + + /** + * Build the List of DataObjectTreatments for the + * given SingleSignatureInfo object.. + * + * @param singleSignatureInfo The SingleSignatureInfo object + * from which to exctract the CreateTransformsInfoProfiles + * containing the data for the DataObjectTreatments. + * @param createTransformsInfoProfiles The + * CreateTransformsInfoProfiles contained in the + * singleSignatureInfo. + * @param transformationSupplements Additional parameters for + * transformations contained in DataObjectTreatments. + * @param reservedIDs The Set of reserved object IDs. + * @return A List of DataObjectTreatment objects. + * @throws MOAApplicationException An error occurred building one of the + * DataObjectTreatments. + * @throws MOASystemException A system error occurred building one of the + * DataObjectTreatments. + */ + private List buildDataObjectTreatmentList( + SingleSignatureInfo singleSignatureInfo, + List createTransformsInfoProfiles, + List transformationSupplements, + Set reservedIDs) + throws MOASystemException, MOAApplicationException { + + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + List treatments = new ArrayList(); + List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); + int dataObjectTreatmentCount = 1; + String hashAlgorithmName; + Iterator dtIter; + Iterator prIter; + + prIter = createTransformsInfoProfiles.iterator(); + for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) { + CreateTransformsInfoProfileExplicit profile = + (CreateTransformsInfoProfileExplicit) prIter.next(); + DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); + IdGenerator objIdGen = + new IdGenerator( + ("signed-data-" + createProfileCount) + + ("-" + dataObjectTreatmentCount++), + reservedIDs); + DataObjectTreatmentImpl treatment = new DataObjectTreatmentImpl(objIdGen); + + treatment.setFinalContentType( + profile.getCreateTransformsInfo().getFinalDataMetaInfo().getMimeType()); + treatment.setTransformationList(buildTransformationList(profile)); + treatment.setReferenceInManifest(dataObjInfo.isChildOfManifest()); + + hashAlgorithmName = + (String) HASH_ALGORITHM_MAPPING.get( + config.getDigestMethodAlgorithmName()); + if (hashAlgorithmName == null) { + error( + "config.17", + new Object[] { config.getDigestMethodAlgorithmName()}); + throw new MOASystemException("2900", null); + } + + treatment.setHashAlgorithmName(hashAlgorithmName); + treatment.setIncludedInSignature( + DataObjectInfo.STRUCTURE_ENVELOPING.equals(dataObjInfo.getStructure())); + treatment.setTransformationSupplements(transformationSupplements); + + treatments.add(treatment); + + } + + return treatments; + } + + /** + * Build the List of transformations contained in a + * CreateTransformsInfoProfile object. + * + * @param profile The CreateTransformsInfoProfile object + * from which to extract the Transforms. + * @return A List of Transformations contained in + * the given CreateTransformsInfoProfile. + * @throws MOAApplicationException An error occurred building one of the + * Transformations. + */ + private List buildTransformationList(CreateTransformsInfoProfileExplicit profile) + throws MOAApplicationException { + + TransformationFactory factory = TransformationFactory.getInstance(); + List transforms = profile.getCreateTransformsInfo().getTransforms(); + + return transforms != null + ? factory.createTransformationList(transforms) + : Collections.EMPTY_LIST; + } + + /** + * Build the set of KeyEntryIDs available to the given + * keyGroupID. + * + * @param keyGroupID The keygroup ID for which the available keys should be + * returned. + * @return The Set of KeyEntryIDs + * identifying the available keys. + */ + private Set buildKeySet(String keyGroupID) { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + Set keyGroupEntries; + + // get the KeyGroup entries from the configuration + if (context.getClientCertificate() != null) { + X509Certificate cert = context.getClientCertificate()[0]; + Principal issuer = cert.getIssuerDN(); + BigInteger serialNumber = cert.getSerialNumber(); + + keyGroupEntries = + config.getKeyGroupEntries(issuer, serialNumber, keyGroupID); + } else { + keyGroupEntries = config.getKeyGroupEntries(null, null, keyGroupID); + } + + // map the KeyGroup entries to a set of KeyEntryIDs + if (keyGroupEntries == null) { + return null; + } else if (keyGroupEntries.size() == 0) { + return Collections.EMPTY_SET; + } else { + KeyModule module = + KeyModuleFactory.getInstance( + new TransactionId(context.getTransactionID())); + Set keyEntryIDs = module.getPrivateKeyEntryIDs(); + Set keySet = new HashSet(); + Iterator iter; + + // filter out the keys that do not exist in the IAIK configuration + // by walking through the key entries and checking if the exist in the + // keyGroupEntries + for (iter = keyEntryIDs.iterator(); iter.hasNext();) { + KeyEntryID entryID = (KeyEntryID) iter.next(); + KeyGroupEntry entry = + new KeyGroupEntry( + entryID.getModuleID(), + entryID.getCertificateIssuer(), + entryID.getCertificateSerialNumber()); + if (keyGroupEntries.contains(entry)) { + keySet.add(entryID); + } + } + return keySet; + } + } + + /** + * Get the signature location index where the signature will be inserted into + * the signature parent element. + * + * @param singleSignatureInfo The SingleSignatureInfo object + * containing the CreateSignatureLocation. + * @return The index at which to insert the signature into the signature + * environment. + * @throws MOAApplicationException An error occurred parsing the + * CreateSignatureEnvironmentProfile. + */ + private XMLSignatureInsertionLocation getSignatureInsertionLocationIndex(SingleSignatureInfo singleSignatureInfo) + throws MOAApplicationException { + + CreateSignatureInfo createInfo = + singleSignatureInfo.getCreateSignatureInfo(); + + if (createInfo != null) { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + CreateSignatureEnvironmentProfileExplicit profile = + ProfileMapper.mapCreateSignatureEnvironmentProfile( + createInfo.getCreateSignatureEnvironmentProfile(), + config); + int index = profile.getCreateSignatureLocation().getIndex(); + + return new XMLSignatureInsertionLocationImpl(index); + } else { + return new XMLSignatureInsertionLocationImpl(0); + } + } + + /** + * Utility function to issue an error message to the log. + * + * @param messageId The ID of the message to log. + * @param parameters Additional message parameters. + */ + private static void error(String messageId, Object[] parameters) { + MessageProvider msg = MessageProvider.getInstance(); + + Logger.error(new LogMsg(msg.getMessage(messageId, parameters))); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java new file mode 100644 index 000000000..4642593eb --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvoker.java @@ -0,0 +1,675 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import iaik.IAIKException; +import iaik.IAIKRuntimeException; +import iaik.ixsil.exceptions.URIException; +import iaik.ixsil.util.URI; +import iaik.server.modules.xml.DataObject; +import iaik.server.modules.xml.XMLDataObject; +import iaik.server.modules.xml.XMLSignature; +import iaik.server.modules.xmlsign.XMLConstants; +import iaik.server.modules.xmlverify.DsigManifest; +import iaik.server.modules.xmlverify.ReferenceData; +import iaik.server.modules.xmlverify.SecurityLayerManifest; +import iaik.server.modules.xmlverify.XMLSignatureVerificationModule; +import iaik.server.modules.xmlverify.XMLSignatureVerificationModuleFactory; +import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; +import iaik.server.modules.xmlverify.XMLSignatureVerificationResult; +import iaik.x509.X509Certificate; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.CheckResult; +import at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResult; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferencesCheckResultInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameterHash; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.TrustProfile; +import at.gv.egovernment.moa.spss.server.iaik.xml.XMLSignatureImpl; +import at.gv.egovernment.moa.spss.server.logging.IaikLog; +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.spss.util.MessageProvider; +import at.gv.egovernment.moa.util.CollectionUtils; +import at.gv.egovernment.moa.util.Constants; + +/** + * A class providing a DOM based interface to the + * XMLSignatureVerificationModule. + * + * This class performs the invocation of the + * iaik.server.modules.xmlverify.XMLSignatureVerificationModule + * from a VerifyXMLSignatureRequest given as a DOM element. The + * result of the invocation is integrated into a + * VerifyXMLSignatureResponse and returned. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureVerificationInvoker { + + /** The single instance of this class. */ + private static XMLSignatureVerificationInvoker instance = null; + + private static Set FILTERED_REF_TYPES; + + static { + FILTERED_REF_TYPES = new HashSet(); + FILTERED_REF_TYPES.add(DsigManifest.XML_DSIG_MANIFEST_TYPE); + FILTERED_REF_TYPES.add(SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE); + FILTERED_REF_TYPES.add( + SecurityLayerManifest.SECURITY_LAYER_MANIFEST_TYPE_OLD); + FILTERED_REF_TYPES.add( + XMLConstants.NAMESPACE_ETSI_STRING + "SignedProperties"); + } + + /** + * Get the single instance of this class. + * + * @return The single instance of this class. + */ + public static synchronized XMLSignatureVerificationInvoker getInstance() { + if (instance == null) { + instance = new XMLSignatureVerificationInvoker(); + } + return instance; + } + + /** + * Create a new XMLSignatureCreationInvoker. + * + * Protected to disallow multiple instances. + */ + protected XMLSignatureVerificationInvoker() { + } + + /** + * Process the VerifyXMLSignatureRequest message and invoke the + * XMLSignatureVerificationModule. + * + * @param request A VerifyXMLSignatureRequest API object + * containing the data for verifying an XML signature. + * @return A VerifyXMLSignatureResponse containing the + * answert to the VerifyXMLSignatureRequest. + * MOA schema definition. + * @throws MOAException An error occurred during signature verification. + */ + public VerifyXMLSignatureResponse verifyXMLSignature(VerifyXMLSignatureRequest request) + throws MOAException { + + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + LoggingContext loggingCtx = + LoggingContextManager.getInstance().getLoggingContext(); + XMLSignatureVerificationProfileFactory profileFactory = + new XMLSignatureVerificationProfileFactory(request); + VerifyXMLSignatureResponseBuilder responseBuilder = + new VerifyXMLSignatureResponseBuilder(); + XMLSignatureVerificationResult result; + XMLSignatureVerificationProfile profile; + ReferencesCheckResult signatureManifestCheck; + DataObjectFactory dataObjFactory; + XMLDataObject signatureEnvironment; + Node signatureEnvironmentParent = null; + Element requestElement = null; + XMLSignature xmlSignature; + Date signingTime; + List supplements; + List dataObjectList; + + // get the supplements + supplements = getSupplements(request); + + // build XMLSignature + dataObjFactory = DataObjectFactory.getInstance(); + signatureEnvironment = + dataObjFactory.createSignatureEnvironment( + request.getSignatureInfo().getVerifySignatureEnvironment(), + supplements); + xmlSignature = buildXMLSignature(signatureEnvironment, request); + + // build the list of DataObjects + dataObjectList = buildDataObjectList(supplements); + + // build profile + profile = profileFactory.createProfile(); + + // get the signingTime + signingTime = request.getDateTime(); + + // make the signature environment the root of the document, if it is not a + // separate document anyway; this is done to assure that canonicalization + // of the signature environment contains the correct namespace declarations + requestElement = + signatureEnvironment.getElement().getOwnerDocument().getDocumentElement(); + if (requestElement != signatureEnvironment.getElement()) { + signatureEnvironmentParent = + signatureEnvironment.getElement().getParentNode(); + requestElement.getOwnerDocument().replaceChild( + signatureEnvironment.getElement(), + requestElement); + } + + // verify the signature + try { + XMLSignatureVerificationModule module = + XMLSignatureVerificationModuleFactory.getInstance(); + + module.setLog(new IaikLog(loggingCtx.getNodeID())); + + result = + module.verifySignature( + xmlSignature, + dataObjectList, + profile, + signingTime, + new TransactionId(context.getTransactionID())); + } catch (IAIKException e) { + MOAException moaException = IaikExceptionMapper.getInstance().map(e); + throw moaException; + } catch (IAIKRuntimeException e) { + MOAException moaException = IaikExceptionMapper.getInstance().map(e); + throw moaException; + } + + // swap back in the request as root document + if (requestElement != signatureEnvironment.getElement()) { + requestElement.getOwnerDocument().replaceChild( + requestElement, + signatureEnvironment.getElement()); + signatureEnvironmentParent.appendChild(signatureEnvironment.getElement()); + } + + // check the result + signatureManifestCheck = + validateSignatureManifest(request, result, profile); + + // Check if signer certificate is in trust profile's allowed signer certificates pool + TrustProfile trustProfile = context.getConfiguration().getTrustProfile(request.getTrustProfileId()); + CheckResult certificateCheck = validateSignerCertificate(result, trustProfile); + + // build the response + responseBuilder.setResult(result, profile, signatureManifestCheck, certificateCheck); + + return responseBuilder.getResponse(); + } + + /** + * Checks if the signer certificate matches one of the allowed signer certificates specified + * in the provided trustProfile. + * + * @param result The result produced by the XMLSignatureVerificationModule. + * + * @param trustProfile The trust profile the signer certificate is validated against. + * + * @return The overal result of the certificate validation for the signer certificate. + * + * @throws MOAException if one of the signer certificates specified in the trustProfile + * cannot be read from the file system. + */ + private CheckResult validateSignerCertificate(XMLSignatureVerificationResult result, TrustProfile trustProfile) + throws MOAException + { + MessageProvider msg = MessageProvider.getInstance(); + + int resultCode = result.getCertificateValidationResult().getValidationResultCode().intValue(); + if (resultCode == 0 && trustProfile.getSignerCertsUri() != null) + { + X509Certificate signerCertificate = (X509Certificate) result.getCertificateValidationResult().getCertificateChain().get(0); + + File signerCertsDir = null; + try + { + signerCertsDir = new File(new URI(trustProfile.getSignerCertsUri()).getPath()); + } + catch (URIException e) + { + throw new MOASystemException("2900", null, e); // Should not happen, already checked at loading the MOA configuration + } + + File[] files = signerCertsDir.listFiles(); + if (files == null) resultCode = 1; + int i; + for (i = 0; i < files.length; i++) + { + if (!files[i].isDirectory()) + { + FileInputStream currentFIS = null; + try + { + currentFIS = new FileInputStream(files[i]); + } + catch (FileNotFoundException e) { + throw new MOASystemException("2900", null, e); + } + + try + { + X509Certificate currentCert = new X509Certificate(currentFIS); + currentFIS.close(); + if (currentCert.equals(signerCertificate)) break; + } + catch (Exception e) + { + // Simply ignore file if it cannot be interpreted as certificate + String logMsg = msg.getMessage("invoker.03", new Object[]{trustProfile.getId(), files[i].getName()}); + Logger.warn(logMsg); + try + { + currentFIS.close(); + } + catch (IOException e1) { + // If clean-up fails, do nothing + } + } + } + } + if (i >= files.length) + { + resultCode = 1; // No signer certificate from the trustprofile pool matches the actual signer certificate + } + } + + SPSSFactory factory = SPSSFactory.getInstance(); + return factory.createCheckResult(resultCode, null); + } + + /** + * Select the dsig:Signature DOM element within the signature + * environment. + * + * @param signatureEnvironment The signature environment containing the + * dsig:Signature. + * @param request The VerifyXMLSignatureRequest containing the + * signature environment. + * @return The dsig:Signature element wrapped in a + * XMLSignature object. + * @throws MOAApplicationException An error occurred locating the + * dsig:Signature. + */ + private XMLSignature buildXMLSignature( + XMLDataObject signatureEnvironment, + VerifyXMLSignatureRequest request) + throws MOAApplicationException { + + VerifySignatureLocation signatureLocation = + request.getSignatureInfo().getVerifySignatureLocation(); + Element signatureParent; + + // evaluate the VerifySignatureLocation to get the signature parent + signatureParent = + InvokerUtils.evaluateSignatureLocation( + signatureEnvironment.getElement(), + signatureLocation); + + // check for signatureParent to be a dsig:Signature element + if (!"Signature".equals(signatureParent.getLocalName()) + || !Constants.DSIG_NS_URI.equals(signatureParent.getNamespaceURI())) { + throw new MOAApplicationException("2266", null); + } + + return new XMLSignatureImpl(signatureParent); + } + + /** + * Build the supplemental data objects contained in the + * VerifyXMLSignatureRequest. + * + * @param supplements A List of + * XMLDataObjectAssociations containing the supplement data. + * @return A List of DataObjects representing the + * supplemental data objects. + * @throws MOASystemException A system error occurred building one of the data + * objects. + * @throws MOAApplicationException An error occurred building one of the data + * objects. + */ + private List buildDataObjectList(List supplements) + throws MOASystemException, MOAApplicationException { + List dataObjectList = new ArrayList(); + + DataObjectFactory factory = DataObjectFactory.getInstance(); + DataObject dataObject; + Iterator iter; + + if (supplements != null) { + for (iter = supplements.iterator(); iter.hasNext();) { + XMLDataObjectAssociation supplement = + (XMLDataObjectAssociation) iter.next(); + dataObject = + factory.createFromXmlDataObjectAssociation(supplement, true, false); + dataObjectList.add(dataObject); + } + } + + return dataObjectList; + + } + + /** + * Get the supplemental data contained in the + * VerifyXMLSignatureRequest. + * + * @param request The VerifyXMLSignatureRequest containing the + * supplemental data. + * @return A List of XMLDataObjectAssociation + * objects containing the supplemental data. + * @throws MOAApplicationException An error occurred resolving one of the + * supplement profiles. + */ + private List getSupplements(VerifyXMLSignatureRequest request) + throws MOAApplicationException { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + List supplementProfiles = request.getSupplementProfiles(); + + List supplements = new ArrayList(); + + if (supplementProfiles != null) { + + List mappedProfiles = + ProfileMapper.mapSupplementProfiles(supplementProfiles, config); + Iterator iter; + + for (iter = mappedProfiles.iterator(); iter.hasNext();) { + SupplementProfileExplicit profile = + (SupplementProfileExplicit) iter.next(); + supplements.add(profile.getSupplementProfile()); + } + + } + return supplements; + } + + /** + * Perform additional validations of the + * XMLSignatureVerificationResult. + * + *

In particular, it is verified that: + *

    + *
  • Each ReferenceData object contains transformation + * chain that matches one of the Transforms given in the + * corresponding SignatureManifestCheckParams/ReferenceInfo
  • + *
  • The hash values of the TransformParameters are valid. + *
  • + *
+ *

+ * + * @param request The VerifyXMLSignatureRequest containing the + * signature to verify. + * @param result The result produced by + * XMLSignatureVerificationModule. + * @param profile The profile used for validating the request. + * @return The result of additional validations of the signature manifest. + * @throws MOAApplicationException Post-validation of the + * XMLSignatureVerificaitonResult failed. + */ + private ReferencesCheckResult validateSignatureManifest( + VerifyXMLSignatureRequest request, + XMLSignatureVerificationResult result, + XMLSignatureVerificationProfile profile) + throws MOAApplicationException { + + SPSSFactory factory = SPSSFactory.getInstance(); + MessageProvider msg = MessageProvider.getInstance(); + + // validate that each ReferenceData object contains transforms specified + // in the corresponding SignatureManifestCheckParams/ReferenceInfo + if (request.getSignatureManifestCheckParams() != null) { + List refInfos = + request.getSignatureManifestCheckParams().getReferenceInfos(); + List refDatas = filterReferenceInfos(result.getReferenceDataList()); + List failedReferencesList = new ArrayList(); + Iterator refInfoIter; + Iterator refDataIter; + + if (refInfos.size() != refDatas.size()) { + return factory.createReferencesCheckResult(1, null); + } + + refInfoIter = refInfos.iterator(); + refDataIter = + filterReferenceInfos(result.getReferenceDataList()).iterator(); + + while (refInfoIter.hasNext()) { + ReferenceInfo refInfo = (ReferenceInfo) refInfoIter.next(); + ReferenceData refData = (ReferenceData) refDataIter.next(); + List transforms = buildTransformsList(refInfo); + boolean found = false; + Iterator trIter; + + for (trIter = transforms.iterator(); trIter.hasNext() && !found;) { + found = trIter.next().equals(refData.getTransformationList()); + } + + if (!found) { + Integer refIndex = new Integer(refData.getReferenceIndex()); + String logMsg = + msg.getMessage("invoker.01", new Object[] { refIndex }); + + failedReferencesList.add(refIndex); + Logger.debug(new LogMsg(logMsg)); + } + } + + if (!failedReferencesList.isEmpty()) { + // at least one reference failed - return their indexes and check code 1 + int[] failedReferences = + CollectionUtils.toIntArray(failedReferencesList); + ReferencesCheckResultInfo checkInfo = + factory.createReferencesCheckResultInfo(null, failedReferences); + + return factory.createReferencesCheckResult(1, checkInfo); + } + } + + // validate the hashes contained in all the ReferenceInfo objects of the + // security layer manifest + if (request.getSignatureManifestCheckParams() != null + && result.containsSecurityLayerManifest()) { + Map hashValues = buildTransformParameterHashValues(request); + Set transformParameterURIs = + buildTransformParameterURIs(profile.getTransformationSupplements()); + List referenceInfoList = + result.getSecurityLayerManifest().getReferenceDataList(); + Iterator refIter; + + for (refIter = referenceInfoList.iterator(); refIter.hasNext();) { + iaik.server.modules.xmlverify.ReferenceInfo ref = + (iaik.server.modules.xmlverify.ReferenceInfo) refIter.next(); + byte[] hash = (byte[]) hashValues.get(ref.getURI()); + + if (!transformParameterURIs.contains(ref.getURI()) + || (hash != null && !Arrays.equals(hash, ref.getHashValue()))) { + + // the transform parameter doesn't exist or the hashs do not match + // return the index of the failed reference and check code 1 + int[] failedReferences = new int[] { ref.getReferenceIndex()}; + ReferencesCheckResultInfo checkInfo = + factory.createReferencesCheckResultInfo(null, failedReferences); + String logMsg = + msg.getMessage( + "invoker.02", + new Object[] { new Integer(ref.getReferenceIndex())}); + + Logger.debug(new LogMsg(logMsg)); + + return factory.createReferencesCheckResult(1, checkInfo); + } + } + } + + return factory.createReferencesCheckResult(0, null); + } + + /** + * Get all Transforms contained in all the + * VerifyTransformsInfoProfiles of the given + * ReferenceInfo. + * + * @param refInfo The ReferenceInfo object containing + * the transformations. + * @return A List of Lists. Each of the + * Lists contains Transformation objects. + * @throws MOAApplicationException An error occurred building one of the + * Transformations. + */ + private List buildTransformsList(ReferenceInfo refInfo) + throws MOAApplicationException { + + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + List profiles = refInfo.getVerifyTransformsInfoProfiles(); + List mappedProfiles = + ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config); + List transformsList = new ArrayList(); + TransformationFactory factory = TransformationFactory.getInstance(); + Iterator iter; + + for (iter = mappedProfiles.iterator(); iter.hasNext();) { + VerifyTransformsInfoProfileExplicit profile = + (VerifyTransformsInfoProfileExplicit) iter.next(); + List transforms = profile.getTransforms(); + + if (transforms != null) { + transformsList.add(factory.createTransformationList(transforms)); + } + } + + return transformsList; + } + + /** + * Build the Set of all TransformParameter URIs. + * + * @param transformParameters The List of + * TransformParameters, as provided to the verification. + * @return The Set of all TransformParameter URIs. + */ + private Set buildTransformParameterURIs(List transformParameters) { + Set uris = new HashSet(); + Iterator iter; + + for (iter = transformParameters.iterator(); iter.hasNext();) { + DataObject transformParameter = (DataObject) iter.next(); + uris.add(transformParameter.getURI()); + } + + return uris; + } + + /** + * Build a mapping between TransformParameter URIs (a + * String and dsig:HashValue (a + * byte[]). + * + * @param request The VerifyXMLSignatureRequest. + * @return Map The resulting mapping. + * @throws MOAApplicationException An error occurred accessing one of + * the profiles. + */ + private Map buildTransformParameterHashValues(VerifyXMLSignatureRequest request) + throws MOAApplicationException { + + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + Map hashValues = new HashMap(); + List refInfos = + request.getSignatureManifestCheckParams().getReferenceInfos(); + Iterator refIter; + + for (refIter = refInfos.iterator(); refIter.hasNext();) { + ReferenceInfo refInfo = (ReferenceInfo) refIter.next(); + List profiles = refInfo.getVerifyTransformsInfoProfiles(); + List mappedProfiles = + ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config); + Iterator prIter; + + for (prIter = mappedProfiles.iterator(); prIter.hasNext();) { + VerifyTransformsInfoProfileExplicit profile = + (VerifyTransformsInfoProfileExplicit) prIter.next(); + List trParameters = profile.getTransformParameters(); + Iterator trIter; + + for (trIter = trParameters.iterator(); trIter.hasNext();) { + TransformParameter transformParameter = + (TransformParameter) trIter.next(); + String uri = transformParameter.getURI(); + + if (transformParameter.getTransformParameterType() + == TransformParameter.HASH_TRANSFORMPARAMETER) { + hashValues.put( + uri, + ((TransformParameterHash) transformParameter).getDigestValue()); + } + + } + } + } + return hashValues; + } + + /** + * Filter the ReferenceInfos returned by the + * VerifyXMLSignatureResult for comparison with the + * ReferenceInfo elements in the request. + * + * @param referenceInfos The ReferenceInfos from the + * VerifyXMLSignatureResult. + * @return A List of all ReferenceInfos whose type + * is not a XMLDsig manifest, Security Layer manifest, or ETSI signed + * property. + */ + private List filterReferenceInfos(List referenceInfos) { + List filtered = new ArrayList(); + Iterator iter; + + for (iter = referenceInfos.iterator(); iter.hasNext();) { + iaik.server.modules.xmlverify.ReferenceInfo refInfo = + (iaik.server.modules.xmlverify.ReferenceInfo) iter.next(); + String refType = refInfo.getReferenceType(); + + if (refType == null || !FILTERED_REF_TYPES.contains(refType)) { + filtered.add(refInfo); + } + } + + return filtered; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java new file mode 100644 index 000000000..5df13a337 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationProfileFactory.java @@ -0,0 +1,144 @@ +package at.gv.egovernment.moa.spss.server.invoke; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import iaik.server.modules.xmlverify.XMLSignatureVerificationProfile; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; +import at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.pki.PKIProfileImpl; +import at.gv.egovernment.moa.spss.server.iaik.xmlverify.XMLSignatureVerificationProfileImpl; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * A factory to create a XMLSignatureVerificationProfile from a + * VerifyXMLSignatureRequest, based on the current MOA + * configuration. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureVerificationProfileFactory { + + /** The VerifyXMLSignatureRequest for which to create profile + * information. */ + private VerifyXMLSignatureRequest request; + + /** + * Create a new XMLSignatureVerificationProfileFactory. + * + * @param request The VerifyXMLSignatureRequest to extract + * profile data from. + */ + public XMLSignatureVerificationProfileFactory(VerifyXMLSignatureRequest request) { + this.request = request; + } + + /** + * Create a XMLSignatureCreationProfile from the + * VerifyXMLSignaturesRequest and the current MOA configuration. + * + * @return The XMLSignatureVerificationProfile containing + * additional information for verifying an XML signature. + * @throws MOASystemException A system error occurred building the profile. + * @throws MOAApplicationException An error occurred building the profile. + */ + public XMLSignatureVerificationProfile createProfile() + throws MOASystemException, MOAApplicationException { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + XMLSignatureVerificationProfileImpl profile = + new XMLSignatureVerificationProfileImpl(); + SignatureManifestCheckParams checkParams; + String trustProfileID; + + // set whether to check XMLDsig manifests + profile.setCheckXMLDsigManifests(true); + + // set the certificate validation profile + trustProfileID = request.getTrustProfileId(); + profile.setCertificateValidationProfile( + new PKIProfileImpl(config, trustProfileID)); + + // set whether hash input data is to be included + profile.setIncludeHashInputData(request.getReturnHashInputData()); + + // set the security layer manifest check parameters + // and transformation supplements (if present) + checkParams = request.getSignatureManifestCheckParams(); + profile.setCheckSecurityLayerManifest(true); + profile.setIncludeReferenceInputData(checkParams != null ? checkParams.getReturnReferenceInputData() : false); + if (checkParams != null) { + List transformationSupplements; + transformationSupplements = buildTransformationSupplements(); + profile.setTransformationSupplements(transformationSupplements); + } else { + profile.setTransformationSupplements(Collections.EMPTY_LIST); + } + + return profile; + } + + /** + * Build supplemental data objects used in the transformations. + * + * @return A List of DataObjects providing + * supplemental data to the transformations. + * @throws MOASystemException A system error occurred building one of the + * transformations. + * @throws MOAApplicationException An error occurred building one of the + * transformations. + */ + public List buildTransformationSupplements() + throws MOASystemException, MOAApplicationException { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ConfigurationProvider config = context.getConfiguration(); + SignatureManifestCheckParams checkParams = + request.getSignatureManifestCheckParams(); + List transformsProfiles = new ArrayList(); + List transformationSupplements = new ArrayList(); + DataObjectFactory factory = DataObjectFactory.getInstance(); + List refInfos = checkParams.getReferenceInfos(); + Iterator refIter; + Iterator prIter; + Iterator trIter; + + // build the list of all VerifyTransformsInfoProfiles in all ReferenceInfos + refInfos = checkParams.getReferenceInfos(); + for (refIter = refInfos.iterator(); refIter.hasNext();) { + ReferenceInfo refInfo = (ReferenceInfo) refIter.next(); + List profiles = refInfo.getVerifyTransformsInfoProfiles(); + + transformsProfiles.addAll( + ProfileMapper.mapVerifyTransformsInfoProfiles(profiles, config)); + } + + // build the DataObjects + for (prIter = transformsProfiles.iterator(); prIter.hasNext();) { + VerifyTransformsInfoProfileExplicit profile = + (VerifyTransformsInfoProfileExplicit) prIter.next(); + List transformParameters = profile.getTransformParameters(); + + for (trIter = transformParameters.iterator(); trIter.hasNext();) { + TransformParameter trParam = (TransformParameter) trIter.next(); + transformationSupplements.add( + factory.createFromTransformParameter(trParam)); + } + } + + return transformationSupplements; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java new file mode 100644 index 000000000..068fab5ca --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java @@ -0,0 +1,126 @@ +package at.gv.egovernment.moa.spss.server.logging; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import iaik.logging.TransactionId; + +/** + * An implementation of the iaik.logging.Log + * interface that is based on Jakarta Commons-Logging. + * + * @author Fatemeh Philippi + * @version $Id$ + */ +public class IaikLog implements iaik.logging.Log { + /** The hierarchy to log all IAIK output to. */ + public static final String IAIK_LOG_HIERARCHY = "iaik.server"; + /** The commons-loggin Log to use for logging the messages. */ + private static Log log = LogFactory.getLog(IAIK_LOG_HIERARCHY); + /** The node ID to use. */ + private String nodeId; + + /** + * Create a new IaikLog. + * + * @param nodeId The node ID for this Log object. + */ + public IaikLog(String nodeId) { + this.nodeId = nodeId; + } + + /** + * @see iaik.logging.Log#isDebugEnabled() + */ + public boolean isDebugEnabled() { + return log.isDebugEnabled(); + } + + /** + * @see iaik.logging.Log#debug(TransactionId, Object, Throwable) + */ + public void debug(TransactionId transactionId, Object message, Throwable t) { + IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); + + log.debug(msg, t); + } + + /** + * @see iaik.logging.Log#isInfoEnabled() + */ + public boolean isInfoEnabled() { + return log.isInfoEnabled(); + } + + /** + * @see iaik.logging.Log#info(TransactionId, Object, Throwable) + */ + public void info(TransactionId transactionId, Object message, Throwable t) { + IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); + + log.info(msg, t); + } + + /** + * @see iaik.logging.Log#isWarnEnabled() + */ + public boolean isWarnEnabled() { + return log.isWarnEnabled(); + } + + /** + * @see iaik.logging.Log#warn(TransactionId, Object, Throwable) + */ + public void warn(TransactionId transactionId, Object message, Throwable t) { + IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); + + log.warn(msg, t); + } + + /** + * @see iaik.logging.Log#isErrorEnabled() + */ + public boolean isErrorEnabled() { + return log.isErrorEnabled(); + } + + /** + * @see iaik.logging.Log#error(TransactionId, Object, Throwable) + */ + public void error(TransactionId transactionId, Object message, Throwable t) { + IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); + + log.error(msg, t); + } + + /** + * @see iaik.logging.Log#isFatalEnabled() + */ + public boolean isFatalEnabled() { + return log.isFatalEnabled(); + } + + /** + * @see iaik.logging.Log#fatal(TransactionId, Object, Throwable) + */ + public void fatal(TransactionId transactionId, Object message, Throwable t) { + IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message); + + log.fatal(msg, t); + } + + /** + * @see iaik.logging.Log#setNodeId(String) + */ + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + /** + * @see iaik.logging.Log#getNodeId() + */ + public String getNodeId() { + return nodeId; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java new file mode 100644 index 000000000..a0e4def86 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java @@ -0,0 +1,42 @@ +package at.gv.egovernment.moa.spss.server.logging; + +import iaik.logging.Log; +import iaik.logging.LogConfigurationException; +import iaik.logging.LogFactory; + +import at.gv.egovernment.moa.logging.LoggingContextManager; + +/** + * An implementation of the iaik.logging.LogFactory abstract + * class to log messages to the MOA logging subsystem. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IaikLogFactory extends LogFactory { + + public Log getInstance(Class clazz) throws LogConfigurationException { + return getInstanceImpl(); + } + + public Log getInstance(String name) throws LogConfigurationException { + return getInstanceImpl(); + } + + /** + * Return an instance of iaik.logging.Log. + * + * @return The iaik.logging.Log object to log messages to. + */ + private Log getInstanceImpl() { + String nodeID = + LoggingContextManager.getInstance().getLoggingContext().getNodeID(); + + return new IaikLog(nodeID); + } + + public void release() { + // we do not hold any resources + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java new file mode 100644 index 000000000..75fb388a9 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java @@ -0,0 +1,54 @@ +package at.gv.egovernment.moa.spss.server.logging; + +import iaik.logging.TransactionId; + +/** + * A unified message type to log messages from the IAIK subsystem. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IaikLogMsg { + + /** The transaction ID of this message. */ + private TransactionId transactionId; + /** The node ID of this message. */ + private String nodeId; + /** The message to log. */ + private Object message; + + /** + * Create a IaikLogMsg object. + * + * @param transactionId The transaction id of the transaction which + * generated this log message. May be null. + * @param nodeId The node id where this message was generated. May be + * null. + * @param message The actual message to log. May be null. + */ + public IaikLogMsg(TransactionId transactionId, String nodeId, Object message) { + this.transactionId = transactionId; + this.nodeId = nodeId; + this.message = message; + } + + + /** + * Convert this log message to a String. + * + * @return The String representation of this log message. + */ + public String toString() { + StringBuffer msg = new StringBuffer(); + + msg.append("TID="); + msg.append(transactionId != null ? transactionId.getLogID() : ""); + msg.append(" NID="); + msg.append(nodeId != null ? nodeId : ""); + msg.append(" MSG="); + msg.append(message != null ? message.toString() : ""); + + return msg.toString(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java new file mode 100644 index 000000000..9e0239464 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java @@ -0,0 +1,38 @@ +package at.gv.egovernment.moa.spss.server.logging; + +/** + * An implementation of the iaik.logging.TransactionId interface. + * + * @author Patrick Peck + * @version $Id$ + */ +public class TransactionId implements iaik.logging.TransactionId { + + /** The String representation for logging the transaction ID. */ + private String logID; + + /** + * Create a TransactionId object. + * + * @param logID The transaction id as it should be presented to the logging + * subsystem. + */ + public TransactionId(String logID) { + this.logID = logID; + } + + /** + * @see iaik.logging.TransactionId#getLogID() + */ + public String getLogID() { + return logID; + } + + /** + * @see java.lang.Object#toString() + */ + public String toString() { + return getLogID(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java new file mode 100644 index 000000000..befbd58dd --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java @@ -0,0 +1,382 @@ +package at.gv.egovernment.moa.spss.server.service; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.security.cert.X509Certificate; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.axis.AxisFault; +import org.apache.axis.Message; +import org.apache.axis.MessageContext; +import org.apache.axis.attachments.AttachmentPart; +import org.apache.axis.handlers.BasicHandler; +import org.apache.axis.transport.http.HTTPConstants; +import org.apache.axis.utils.Messages; +import org.apache.axis.utils.XMLUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.spss.server.transaction.TransactionIDGenerator; +import at.gv.egovernment.moa.spss.util.MessageProvider; +import at.gv.egovernment.moa.util.DOMUtils; + +/** + * An handler that is invoked on each web service request and performs some + * central message handling. + * + * Mainly sets up the TransactionContext for the current + * transaction (i.e. web service request). + * + * @author Patrick Peck + * @author Stefan Knirsch + * @version $Id$ + */ +public class AxisHandler extends BasicHandler { + + /** The resource names of the messages to load. */ + private static final String MOA_SPSS_WSDL_RESOURCE_ = "/resources/wsdl/MOA-SPSS-1.3.wsdl"; + + /** The property name for accessing the HTTP request. */ + private static final String REQUEST_PROPERTY = HTTPConstants.MC_HTTP_SERVLETREQUEST; + + /** The property name for accessing the X509 client certificate chain. */ + private static final String X509_CERTIFICATE_PROPERTY = "javax.servlet.request.X509Certificate"; + + /** The property name for accessing the SOAP action header. */ + private static final String SOAP_ACTION_HEADER = "soapaction"; + + /** URI of the SOAP XML namespace. */ + public static final String SOAP_NS_URI = "http://schemas.xmlsoap.org/soap/envelope/"; + + /** Prefix used for the SOAP XML namespace */ + public static final String SOAP_PREFIX = "soapenv"; + + /** Simple string contains the front part of the enveloping SOAP wrapping */ + private static final String SOAP_PART_PRE = ""; + + /** Simple string contains the post part of the enveloping SOAP wrapping */ + private static final String SOAP_PART_POST = ""; + + /** + * Handle an invocation of this handler. + * + * @param msgContext Information about this request/response. + * @throws AxisFault An error occurred during processing of the request. + * @see org.apache.axis.Handler#invoke(MessageContext) + */ + public void invoke(MessageContext msgContext) throws AxisFault { + if (!msgContext.getPastPivot()) { + handleRequest(msgContext); + } else { + handleResponse(msgContext); + } + } + + /** + * This method is called by invoke to handle incoming requests. + * + * @param msgContext The context as provided to invoke. + * @throws AxisFault An error occurred during processing of the request. + */ + private void handleRequest(MessageContext msgContext) throws AxisFault { + try { + // generate a unique transaction id and build the TransactionContext + // for this request + HttpServletRequest request = + (HttpServletRequest) msgContext.getProperty(REQUEST_PROPERTY); + + X509Certificate[] clientCert = + (X509Certificate[]) request.getAttribute(X509_CERTIFICATE_PROPERTY); + + //Configure Axis + //msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.FALSE); + + Message soapMessage = msgContext.getCurrentMessage(); + + ConfigurationProvider configuration = + ConfigurationProvider.getInstance(); + + Element xmlRequest = null; + Element soapPart = DOMUtils.parseDocument(new ByteArrayInputStream(soapMessage.getSOAPPartAsBytes()), false, null, null).getDocumentElement(); + if (soapPart!=null) { + NodeList soapBodies = soapPart.getElementsByTagNameNS(SOAP_NS_URI, "Body"); + if (soapBodies!=null && soapBodies.getLength()>0) { + xmlRequest = (Element) soapBodies.item(0).getFirstChild(); + } + //oder TODO: Evaluierung ob XPATH schneller + /* + HashMap nSMap = new HashMap(); + nSMap.put((String)SOAP_PREFIX, SOAP_NS_URI); + Element soapBody = (Element) XPathUtils.selectSingleNode(soapPart, nSMap, "/"+SOAP_PREFIX+":Envelope/"+SOAP_PREFIX+":Body"); + if (soapBody!=null) { + xmlRequest= (Element) soapBody.getFirstChild(); + } + */ + } + + TransactionContext context = + new TransactionContext( + TransactionIDGenerator.nextID(), + clientCert, + configuration, + xmlRequest, + null); + + String soapAction = (String) request.getHeader(SOAP_ACTION_HEADER); + if ("\"\"".equals(soapAction)) { + // if http soap action header is empty + soapAction = msgContext.getTargetService(); + } + context.setRequestName(soapAction); + + int attachmentCount = soapMessage.getAttachmentsImpl().getAttachmentCount(); + if (attachmentCount>0) { + + // add SOAP attachments to transaction context + Iterator iterator = soapMessage.getAttachments(); + while (iterator.hasNext()) { + AttachmentPart attachment = (AttachmentPart)iterator.next(); + String id = attachment.getContentId(); + String type = attachment.getContentType(); + + //Now get the InputStream (note: we could also get the content with Object content = attachment.getContent();) + InputStream is = null; + javax.activation.DataHandler datahandler = attachment.getDataHandler(); + org.apache.axis.attachments.ManagedMemoryDataSource mmds = (org.apache.axis.attachments.ManagedMemoryDataSource)datahandler.getDataSource(); + if (mmds!=null){ + is = mmds.getInputStream(); + } + debug("handler.06", new Object[] {id, type}); + context.addAttachment(id, type, mmds); + } + } + + setUpContexts(context); + + // log some information about the request + info( + "handler.00", + new Object[] { + context.getTransactionID(), + msgContext.getTargetService()}); + info("handler.01", new Object[] { request.getRemoteAddr()}); + if (clientCert != null) { + info( + "handler.02", + new Object[] { + clientCert[0].getSubjectDN(), + clientCert[0].getSerialNumber(), + clientCert[0].getIssuerDN()}); + + } else { + info("handler.03", null); + } + if (Logger.isDebugEnabled()) { + String msg = soapMessage.getSOAPPartAsString(); + Logger.debug(new LogMsg(msg)); + } + } catch (MOASystemException e) { + MOASystemException se = new MOASystemException("2900", null, e); + AxisFault fault = AxisFault.makeFault(se); + fault.setFaultDetail(new Element[] { se.toErrorResponse()}); + throw fault; + } catch (Throwable t) { + t.printStackTrace(); + Logger.info(new LogMsg(t.getStackTrace())); + MOASystemException e = new MOASystemException("2900", null, t); + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + throw fault; + } + } + + /** + * This method is called by invoke to handle outgoing + * responses. + * + * @param msgContext The context as provided to invoke. + * @throws AxisFault An error occurred during processing of the response. + */ + private void handleResponse(MessageContext msgContext) throws AxisFault { + String xmlResponseString = null; + String soapResponseString = null; + + TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); + Element xmlResponse = context.getResponse(); + + if (xmlResponse!=null) { + try { + xmlResponseString = DOMUtils.serializeNode(xmlResponse, true); + /* + Soll die Antwort nur \n enthalten, so gibt es 2 Möglichkeiten: + 1.) höhere Xalan Version und + xmlResponseString = DOMUtils.serializeNode(xmlResponse, true, "\n"); + 2.) + OutputFormat serializerFormat = new OutputFormat((Document) xmlResponse.getOwnerDocument()); + serializerFormat.setLineSeparator("\n"); + serializerFormat.setIndenting(false); + serializerFormat.setPreserveSpace(true); + serializerFormat.setOmitXMLDeclaration(true); + serializerFormat.setEncoding("UTF-8"); + ByteArrayOutputStream serializedBytes = new ByteArrayOutputStream(); + XMLSerializer serializer = new XMLSerializer(serializedBytes, serializerFormat); + serializer.serialize(xmlResponse); + serializedBytes.close(); + xmlResponseString = serializedBytes.toString("UTF-8"); + */ + soapResponseString = SOAP_PART_PRE + xmlResponseString + SOAP_PART_POST; + //override axis response-message + msgContext.setResponseMessage(new Message(soapResponseString)); + } catch (Throwable t) { + t.printStackTrace(); + Logger.info(new LogMsg(t.getStackTrace())); + MOASystemException e = new MOASystemException("2900", null, t); + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + throw fault; + } + + } else { + //Fallback: if functions do not set the resulting response in the transaction, the original one from axis will be used + soapResponseString = msgContext.getCurrentMessage().getSOAPPartAsString(); + } + + info("handler.04", null); + if (Logger.isDebugEnabled()) { + Logger.debug(new LogMsg(soapResponseString)); + } + tearDownContexts(); + } + + /** + * Called, when the processing of the web service fails. + * + * @param msgContext Information about the current request. + * @see org.apache.axis.Handler#onFault(org.apache.axis.MessageContext) + */ + public void onFault(MessageContext msgContext) { + info("handler.05", null); + tearDownContexts(); + } + + /** + * Set up the thread-local contexts (TransactionContext and + * LoggingContext). + * + * @param context The TransactionContext to set for the current + * request. + */ + private void setUpContexts(TransactionContext context) { + // set the transaction context in the TransactionContextManager + TransactionContextManager tcm = TransactionContextManager.getInstance(); + tcm.setTransactionContext(context); + + // set the logging context in the LoggingContextManager + LoggingContextManager lcm = LoggingContextManager.getInstance(); + LoggingContext lc = new LoggingContext(context.getTransactionID()); + lcm.setLoggingContext(lc); + } + + /** + * Tear down the thread-local contexts. + */ + private void tearDownContexts() { + TransactionContextManager tcm = TransactionContextManager.getInstance(); + + //delete temporary files + TransactionContext context = tcm.getTransactionContext(); + context.cleanAttachmentCache(); + + // unset the transaction context + tcm.setTransactionContext(null); + + // unset the logging context + LoggingContextManager lcm = LoggingContextManager.getInstance(); + lcm.setLoggingContext(null); + } + + /** + * Generate the WSDL into the msgContext. + * + * The code of this method is more or less copied from the + * org.apache.axis.handlers.soap.SOAPService class contained in + * the 1.1 release of Axis to allow for a missing wsdlFile (so + * that a resource by the same name is searched for in the classpath). The + * implementation of this method should be obsolete if Axis 1.1 or higher is + * used. + * + * @param msgContext The MessageContext that will contain the + * WSDL description of the current web service. + * @throws AxisFault An error occurred producing the WSDL. + */ + public void generateWSDL(MessageContext msgContext) throws AxisFault { + InputStream instream = null; + + try { + String filename = MOA_SPSS_WSDL_RESOURCE_; + File file = new File(filename); + if (file.exists()) { + //if this resolves to a file, load it + instream = new FileInputStream(filename); + } else { + //else load a named resource in our classloader. + instream = this.getClass().getResourceAsStream(filename); + if (instream == null) { + String errorText = Messages.getMessage("wsdlFileMissing", filename); + throw new AxisFault(errorText); + } + } + Document doc = XMLUtils.newDocument(instream); + msgContext.setProperty("WSDL", doc); + } catch (Exception e) { + throw AxisFault.makeFault(e); + } finally { + if (instream != null) { + try { + instream.close(); + } catch (IOException e) { + // ok to do nothing here + } + } + } + } + + /** + * Utility function to issue an info message to the log. + * + * @param messageId The ID of the message to log. + * @param parameters Additional message parameters. + */ + private static void info(String messageId, Object[] parameters) { + MessageProvider msg = MessageProvider.getInstance(); + + Logger.info(new LogMsg(msg.getMessage(messageId, parameters))); + } + + /** + * Utility function to issue an debug message to the log. + * + * @param messageId The ID of the message to log. + * @param parameters Additional message parameters. + */ + private static void debug(String messageId, Object[] parameters) { + MessageProvider msg = MessageProvider.getInstance(); + + Logger.debug(new LogMsg(msg.getMessage(messageId, parameters))); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java new file mode 100644 index 000000000..7783ed3f6 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ConfigurationServlet.java @@ -0,0 +1,120 @@ +package at.gv.egovernment.moa.spss.server.service; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; +import at.gv.egovernment.moa.spss.server.init.*; +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * A servlet to initialize and update the MOA configuration. + * + * @author Fatemeh Philippi + * @author Patrick Peck + * @version $Id$ + */ +public class ConfigurationServlet extends HttpServlet { + /** The document type of the HTML to generate. */ + private static final String DOC_TYPE = + "\n"; + + /** + * Handle a HTTP GET request, used to indicated that the MOA + * configuration needs to be updated (reloaded). + * + * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) + */ + public void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + MessageProvider msg = MessageProvider.getInstance(); + PrintWriter out; + + // set up a logging context for logging the reconfiguration + LoggingContextManager.getInstance().setLoggingContext( + new LoggingContext("configuration update")); + + response.setContentType("text/html"); + out = response.getWriter(); + out.println(DOC_TYPE); + out.println("MOA configuration update"); + out.println(""); + try { + // reconfigure the system + ConfigurationProvider config = ConfigurationProvider.reload(); + IaikConfigurator iaikConfigurator = new IaikConfigurator(); + + iaikConfigurator.configure(config); + + // print a status message + out.println("

" + msg.getMessage("config.06", null) + "

"); + Logger.info(new LogMsg(msg.getMessage("config.06", null))); + + if (!config.getWarnings().isEmpty()) { + // print the warnings + List allWarnings = new ArrayList(); + Iterator iter; + + allWarnings.addAll(config.getWarnings()); + allWarnings.addAll(iaikConfigurator.getWarnings()); + + out.println("

" + msg.getMessage("config.29", null) + "

"); + for (iter = allWarnings.iterator(); iter.hasNext();) { + out.println(iter.next() + "
"); + } + out.println("

" + msg.getMessage("config.28", null) + "

"); + } + + } catch (Throwable t) { + out.println("

" + msg.getMessage("config.20", null) + "

"); + out.println("

" + msg.getMessage("config.28", null) + "

"); + Logger.warn(new LogMsg(msg.getMessage("config.20", null)), t); + } + out.println(""); + + out.flush(); + out.close(); + + // tear down the logging context + LoggingContextManager.getInstance().setLoggingContext(null); + } + + /** + * Do the same as doGet. + * + * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) + */ + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + doGet(request, response); + } + + /** + * Perform some initial initialization tasks for the MOA web services + * application. + * + * Does an initial load of the MOA configuration to test if a working web + * service can be provided. + * + * @see javax.servlet.GenericServlet#init() + */ + public void init() throws ServletException { + SystemInitializer.init(); + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java new file mode 100644 index 000000000..26d79dbd8 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/RevocationArchiveCleaner.java @@ -0,0 +1,78 @@ +package at.gv.egovernment.moa.spss.server.service; + +import iaik.pki.revocation.RevocationSourceTypes; +import iaik.pki.store.revocation.archive.Archive; +import iaik.pki.store.revocation.archive.ArchiveFactory; + +import java.util.Date; + +import at.gv.egovernment.moa.logging.LogMsg; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.logging.TransactionId; +import at.gv.egovernment.moa.spss.util.MessageProvider; + +/** + * A Runnable for periodically cleaning up the revocation archive. + * @author Patrick Peck + * @version $Id$ + */ +public class RevocationArchiveCleaner implements Runnable { + + /** The inverval between two clean-ups of the revocation archive. */ + private long archiveCleanupInterval; + + /** + * Create a new RevocationArchiveCleaner. + * + * @param archiveCleanupInterval The interval between two clean-ups of the + * revocation archive. + */ + public RevocationArchiveCleaner(long archiveCleanupInterval) { + this.archiveCleanupInterval = archiveCleanupInterval; + } + + /** + * Run the RevocationArchiveCleaner in its own + * Thread. + */ + public void run() { + while (true) { + try { + ConfigurationProvider config = ConfigurationProvider.getInstance(); + boolean enableArchiving = config.getEnableRevocationArchiving(); + + if (enableArchiving) + { + Archive archive = ArchiveFactory.getInstance().getArchive(); + long archiveDurationMillis = + (long) config.getCRLArchiveDuration() * 86400000; + + // delete old archive data + if (archiveDurationMillis > 0) { + Date olderThan = + new Date(System.currentTimeMillis() - archiveDurationMillis); + + archive.deleteOldArchiveEntries( + RevocationSourceTypes.CRL, + olderThan, + new TransactionId("RevocationArchiveCleaner")); + } + } + + } catch (Exception e) { + MessageProvider msg = MessageProvider.getInstance(); + Logger.error(new LogMsg(msg.getMessage("init.02", null)), e); + } + + // sleep + try { + Thread.sleep(archiveCleanupInterval * 1000); + } catch (InterruptedException e) { + // ok to do nothing here + } + + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java new file mode 100644 index 000000000..4224f5665 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/ServiceUtils.java @@ -0,0 +1,72 @@ +package at.gv.egovernment.moa.spss.server.service; + +import java.io.ByteArrayInputStream; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.DOMUtils; + +import at.gv.egovernment.moa.spss.MOAApplicationException; + +/** + * Helper methods for the Service classes. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ServiceUtils { + + /** + * Schema-validate a request. + * + * @param request The request to validate. + * @throws MOAApplicationException An error occurred validating the requst. + */ + public static void validateRequest(Element[] request) + throws MOAApplicationException { + + // validate the request + try { + DOMUtils.validateElement( + request[0], + Constants.ALL_SCHEMA_LOCATIONS, + null); + } catch (Exception e) { + throw new MOAApplicationException( + "1100", + new Object[] { e.getMessage()}, + e); + } + } + + /** + * Reparse the request with schema-validation turned on so that ID references + * are resolved. + * + * @param request The request to reparse. + * @return The reparsed request. + * @throws MOAApplicationException An error occurred parsing the request. + */ + public static Element reparseRequest(Element request) + throws MOAApplicationException { + + try { + byte[] requestBytes = DOMUtils.serializeNode(request, "UTF-8"); + Document validatedRequest = + DOMUtils.parseDocument( + new ByteArrayInputStream(requestBytes), + true, + Constants.ALL_SCHEMA_LOCATIONS, + null); + return validatedRequest.getDocumentElement(); + } catch (Exception e) { + throw new MOAApplicationException( + "1100", + new Object[] { e.getMessage()}, + e); + } + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java new file mode 100644 index 000000000..2d548ea3a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java @@ -0,0 +1,104 @@ +package at.gv.egovernment.moa.spss.server.service; + +import java.util.Collections; + +import javax.xml.namespace.QName; + +import org.apache.axis.AxisFault; +import org.apache.axis.i18n.Messages; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureCreationInvoker; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.util.Constants; +import at.gv.egovernment.moa.util.StreamUtils; + +/** + * The service endpoint for the SignatureCreation web service. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SignatureCreationService { + + /** + * Handle a CreateXMLSignatureRequest. + * + * @param request The CreateXMLSignatureRequest to work on + * (contained in the 0th element of the array). + * @return A CreateXMLSignatureResponse as the only element of + * the Element array. + * @throws AxisFault An error occurred during handling of the message. + */ + public Element[] CreateXMLSignatureRequest(Element[] request) + throws AxisFault { + XMLSignatureCreationInvoker invoker = + XMLSignatureCreationInvoker.getInstance(); + Element[] response = new Element[1]; + + // check that we have a CreateXMLSignatureRequest; if not, create an + // AxisFault, just like the org.apache.axis.providers.java.MsgProvider + if (!Constants.MOA_SPSS_CREATE_XML_REQUEST.equals(request[0].getLocalName()) || + !Constants.MOA_NS_URI.equals(request[0].getNamespaceURI())) + { + QName qname = + new QName(request[0].getNamespaceURI(), request[0].getLocalName()); + throw new AxisFault( + Messages.getMessage("noOperationForQName", qname.toString())); // TODO GK Operation name does not make it into the error repsonse + } + + // handle the request + try { + // create a parser and builder for binding API objects to/from XML + CreateXMLSignatureRequestParser requestParser = + new CreateXMLSignatureRequestParser(); + CreateXMLSignatureResponseBuilder responseBuilder = + new CreateXMLSignatureResponseBuilder(); + Element reparsedReq; + CreateXMLSignatureRequest requestObj; + CreateXMLSignatureResponse responseObj; + + //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. + TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); + // validate the request + reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); + + // convert to API objects + requestObj = requestParser.parse(reparsedReq); + + // invoke the core logic + responseObj = + invoker.createXMLSignature(requestObj, Collections.EMPTY_SET); + + // map back to XML + response[0] = responseBuilder.build(responseObj).getDocumentElement(); + + // save response in transaction + context.setResponse(response[0]); + + } catch (MOAException e) { + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + Logger.debug("Anfrage zur Signaturerstellung wurde nicht erfolgreich beendet:" + + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); + throw fault; + } catch (Throwable t) { + MOASystemException e = new MOASystemException("2900", null, t); + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + Logger.debug("Anfrage zur Signaturerstellung wurde nicht erfolgreich beendet:" + + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); + throw fault; + } + + return response; + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java new file mode 100644 index 000000000..b335a6e23 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java @@ -0,0 +1,151 @@ +package at.gv.egovernment.moa.spss.server.service; + +import org.apache.axis.AxisFault; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.MOASystemException; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.spss.server.invoke.CMSSignatureVerificationInvoker; +import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureVerificationInvoker; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; +import at.gv.egovernment.moa.util.StreamUtils; + +/** + * The service endpoint for the SignatureVerification web service. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SignatureVerificationService { + + /** + * Handle a VerifyCMSSignatureRequest. + * + * @param request The VerifyCMSSignatureRequest to work on + * (contained in the 0th element of the array). + * @return A VerifyCMSSignatureResponse as the only element of + * the Element array. + * @throws AxisFault An error occurred during handling of the message. + */ + public Element[] VerifyCMSSignatureRequest(Element[] request) + throws AxisFault { + CMSSignatureVerificationInvoker invoker = + CMSSignatureVerificationInvoker.getInstance(); + Element[] response = new Element[1]; + + try { + // create a parser and builder for binding API objects to/from XML + VerifyCMSSignatureRequestParser requestParser = + new VerifyCMSSignatureRequestParser(); + VerifyCMSSignatureResponseBuilder responseBuilder = + new VerifyCMSSignatureResponseBuilder(); + Element reparsedReq; + VerifyCMSSignatureRequest requestObj; + VerifyCMSSignatureResponse responseObj; + + //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. + TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); + // validate the request + reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); + + // convert to API objects + requestObj = requestParser.parse(reparsedReq); + + // invoke the core logic + responseObj = invoker.verifyCMSSignature(requestObj); + + // map back to XML + response[0] = responseBuilder.build(responseObj).getDocumentElement(); + + // save response in transaction + context.setResponse(response[0]); + + } catch (MOAException e) { + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" + + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); + throw fault; + } catch (Throwable t) { + MOASystemException e = new MOASystemException("2900", null, t); + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" + + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); + throw fault; + } + + return response; + } + + /** + * Handle a VerifyXMLSignatureRequest. + * + * @param request The VerifyXMLSignatureRequest to work on + * (contained in the 0th element of the array). + * @return A VerifyXMLSignatureResponse as the only element of + * the Element array. + * @throws AxisFault An error occurred during handling of the message. + */ + public Element[] VerifyXMLSignatureRequest(Element[] request) + throws AxisFault { + XMLSignatureVerificationInvoker invoker = + XMLSignatureVerificationInvoker.getInstance(); + Element[] response = new Element[1]; + + try { + // create a parser and builder for binding API objects to/from XML + VerifyXMLSignatureRequestParser requestParser = + new VerifyXMLSignatureRequestParser(); + VerifyXMLSignatureResponseBuilder responseBuilder = + new VerifyXMLSignatureResponseBuilder(); + Element reparsedReq; + VerifyXMLSignatureRequest requestObj; + VerifyXMLSignatureResponse responseObj; + + //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. + TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); + // validate the request + reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); + + // convert to API objects + requestObj = requestParser.parse(reparsedReq); + + // invoke the core logic + responseObj = invoker.verifyXMLSignature(requestObj); + + // map back to XML + response[0] = responseBuilder.build(responseObj).getDocumentElement(); + + // save response in transaction + context.setResponse(response[0]); + + } catch (MOAException e) { + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" + + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); + throw fault; + } catch (Throwable t) { + MOASystemException e = new MOASystemException("2900", null, t); + AxisFault fault = AxisFault.makeFault(e); + fault.setFaultDetail(new Element[] { e.toErrorResponse()}); + Logger.debug("Anfrage zur Signaturpruefung wurde nicht erfolgreich beendet:" + + System.getProperty("line.separator") + StreamUtils.getStackTraceAsString(e)); + throw fault; + } + + return response; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java new file mode 100644 index 000000000..9fe17eae2 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java @@ -0,0 +1,242 @@ +package at.gv.egovernment.moa.spss.server.tools; + +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.security.cert.CertificateException; + +import iaik.asn1.structures.Name; +import iaik.pki.store.certstore.CertStoreException; +import iaik.pki.store.certstore.CertStoreTypes; +import iaik.pki.store.certstore.directory.DirectoryCertStore; +import iaik.pki.store.certstore.directory.DirectoryCertStoreParameters; +import iaik.pki.store.certstore.directory.DirectoryStoreException; +import iaik.security.ecc.provider.ECCProvider; +import iaik.security.provider.IAIK; +import iaik.utils.RFC2253NameParserException; +import iaik.x509.X509Certificate; + +/** + * A tool to support X509 certificate handling for configuring the MOA SP/SS + * service. + * + * This class provides functions for: + *
    + *
  • printing certificate information
  • + *
  • adding certificates to the cert store
  • + *
+ * + * @author Patrick Peck + * @version $Id$ + */ +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"; + + /** + * Main entry point of the tool. + * + * @param args The command line arguments. A single argument is expected, + * which is the file name of the X509 certificate to inspect. + */ + public static void main(String args[]) { + CertTool certTool = new CertTool(); + + if (args.length == 2 && "-info".equals(args[0])) { + initProviders(); + certTool.printCertInfo(args[1], System.out); + } else if (args.length == 3 && "-add".equals(args[0])) { + initProviders(); + certTool.addCertToCertStore(args[1], args[2]); + } else { + certTool.printUsage(System.err); + } + } + + /** + * Init the JCE providers, depending on the JDK used. + * + * Adds the IAIK JCE and IAIK ECC providers. + */ + private static void initProviders() { + if (System.getProperty("java.version").startsWith("1.3")) { + IAIK.addAsProvider(); + } else { + IAIK.addAsJDK14Provider(); + } + ECCProvider.addAsProvider(); + } + + /** + * Print the information about the certificate. + * + * This method will output information about the Subject DN, the Issuer DN and + * the serial number of the certificate. + * + * @param certFile The name of the certificate file to inspect. + * @param out The stream to print the information to. + */ + public void printCertInfo(String certFile, PrintStream out) { + try { + InputStream is = new BufferedInputStream(new FileInputStream(certFile)); + X509Certificate cert = new X509Certificate(is); + String issuerDN; + String serial; + String subjectDN; + + try { + subjectDN = ((Name) (cert.getSubjectDN())).getRFC2253String(); + } catch (RFC2253NameParserException e) { + subjectDN = ILLEGAL_RFC2253_NAME; + } + + try { + issuerDN = ((Name) (cert.getIssuerDN())).getRFC2253String(); + } catch (RFC2253NameParserException e) { + issuerDN = ILLEGAL_RFC2253_NAME; + } + + serial = cert.getSerialNumber().toString(); + + out.println("SubjectDN (RFC2253): " + subjectDN); + out.println("IssuerDN (RFC2253) : " + issuerDN); + out.println("Serial Number : " + serial); + } catch (FileNotFoundException e) { + System.err.println("Zertifikat nicht gefunden: " + certFile); + } catch (IOException e) { + System.err.println( + "I/O Fehler beim Lesen des Zertifikats: " + e.getMessage()); + } catch (CertificateException e) { + System.err.println( + "Fehler beim Lesen des Zertifikats: " + e.getMessage()); + } catch (Throwable t) { + System.err.println("Allgemeiner Fehler: " + t.getMessage()); + } + } + + /** + * Add a certificate to a directory certificate store. + * + * @param certFile The certificate to add. + * @param certStoreRoot The root directory of the certificate store. + */ + public void addCertToCertStore(String certFile, String certStoreRoot) { + try { + // read the certificate + InputStream is = new BufferedInputStream(new FileInputStream(certFile)); + X509Certificate cert = new X509Certificate(is); + + // initialize the DirectoryCertStore + DirectoryCertStore certStore = + new DirectoryCertStore( + new SimpleDirectoryCertStoreParameters(certStoreRoot), + null); + + certStore.storeCertificate(cert, null); + + System.out.println("\nDas Zertifikat wurde erfolreich hinzugefügt.\n"); + + } catch (FileNotFoundException e) { + System.err.println("Zertifikat nicht gefunden: " + certFile); + } catch (IOException e) { + System.err.println( + "I/O Fehler beim Lesen des Zertifikats: " + e.getMessage()); + } catch (CertificateException e) { + System.err.println( + "Fehler beim Lesen des Zertifikats: " + e.getMessage()); + } catch (DirectoryStoreException e) { + System.err.println( + "Fehler beim Öffnen des Zertifikatsspeichers: " + e.getMessage()); + } catch (CertStoreException e) { + System.err.println( + "Fehler beim Hinzufügen des Zertifikats: " + e.getMessage()); + } catch (Throwable t) { + System.err.println("Allgemeiner Fehler: " + t.getMessage()); + t.printStackTrace(); + } + } + + /** + * Print tool usage. + * + * @param out The PrintStream to print to. + */ + private void printUsage(PrintStream out) { + out.println("\nCerttool-Syntax:\n"); + out.println("-info "); + out.println("\n"); + } + +} + +/** + * Simple implementation of the DirectoryCertStoreParameters + * interface intelligent enough for setting up a simple + * DirectoryCertStore in the CertTool. + * + * @author Patrick Peck + * @version $Id$ + */ +class SimpleDirectoryCertStoreParameters + implements DirectoryCertStoreParameters { + + /** The cert store root directory. */ + private String rootDirectory; + + /** + * Create a new SimpleDirectoryCertStoreParameters object. + * + * @param rootDirectory The root directory of the cert store. + */ + public SimpleDirectoryCertStoreParameters(String rootDirectory) { + this.rootDirectory = rootDirectory; + } + + /** + * @return "MOA Directory CertStore" + * @see iaik.pki.store.certstore.CertStoreParameters#getId() + */ + public String getId() { + return "MOA Directory CertStore"; + } + + /** + * @return CertStoreTypes.DIRECTORY + * @see iaik.pki.store.certstore.CertStoreParameters#getType() + */ + public String getType() { + return CertStoreTypes.DIRECTORY; + } + + /** + * @return false + * @see iaik.pki.store.certstore.CertStoreParameters#isReadOnly() + */ + public boolean isReadOnly() { + return false; + } + + /** + * @return false + * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#createNew() + */ + public boolean createNew() { + return false; + } + + /** + * @return The root directory given at construction time. + * @see iaik.pki.store.certstore.directory.DirectoryCertStoreParameters#getRootDirectory() + */ + public String getRootDirectory() { + return rootDirectory; + } + +} \ No newline at end of file diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java new file mode 100644 index 000000000..d5c3b48c1 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/ConfigTool.java @@ -0,0 +1,59 @@ +package at.gv.egovernment.moa.spss.server.tools; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +/** + * A tool for converting a MOA SPSS Version 1.0 configuration file into + * a Version 1.3 configuration file. + * + * @author Gregor Karlinger + * @version $Id$ + */ +public class ConfigTool +{ + public static void main(String[] args) + { + if (args == null || args.length != 2) + { + System.out.println("Usage: ConfigTool "); + System.out.println(" ... Old config file to be transformed"); + System.out.println(" ... New config file resulting from the transform"); + System.exit(-1); + } + + try + { + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(new StreamSource( + ConfigTool.class.getResourceAsStream("/resources/tools/ConfigurationMapper.xsl"))); + transformer.transform(new StreamSource(args[0]), new StreamResult(new FileOutputStream(args[1]))); + + System.out.println("Successfully mapped configuration file."); + } + catch (TransformerConfigurationException e) + { + System.err.println("An error occurred during mapping the configuration file:"); + System.err.println(" Cannot initialize XSLT transform."); + System.err.println(" " + e.getMessage()); + } + catch (FileNotFoundException e) + { + System.err.println("An error occurred during mapping the configuration file:"); + System.err.println(" There is a problem with the filename for the new configuration file."); + System.err.println(" " + e.getMessage()); + } + catch (TransformerException e) + { + System.err.println("An error occurred during mapping the configuration file:"); + System.err.println(" " + e.getMessage()); + } + } +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java new file mode 100644 index 000000000..774880d26 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java @@ -0,0 +1,264 @@ +package at.gv.egovernment.moa.spss.server.transaction; + +import iaik.ixsil.util.URI; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.security.cert.X509Certificate; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Vector; +import java.util.Map.Entry; + +import org.apache.axis.attachments.ManagedMemoryDataSource; +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; + +/** + * Contains information about the current request. + * + * @author Stefan Knirsch + * @author Patrick Peck + */ +public class TransactionContext { + + /** The client certificate. */ + private X509Certificate[] clientCertificate = null; + /** The transaction ID. */ + private String transactionID = null; + /** The name of the request. */ + private String requestName = null; + /** The SOAP embedded request */ + private Element request; + /** The response which is to embed by SOAP */ + private Element response; + /** The map pointing to SOAP attachments needed by the request. */ + private HashMap attachments = null; + /** The configuration to use throughout the request. */ + private ConfigurationProvider configuration = null; + + /** + * Create a TransactionContext object. + * + * @param transactionID A unique ID for this TransactionContext. + * @param clientCertificate The client certificate chain. + * @param configuration The MOA configuration to use for this transaction. + */ + public TransactionContext( + String transactionID, + X509Certificate[] clientCertificate, + ConfigurationProvider configuration) { + + this.transactionID = transactionID; + this.clientCertificate = clientCertificate; + this.configuration = configuration; + } + + /** + * Create a TransactionContext object. + * + * @param transactionID A unique ID for this TransactionContext. + * @param clientCertificate The client certificate chain. + * @param configuration The MOA configuration to use for this transaction. + * @param attachments to use for this transaction. + */ + public TransactionContext( + String transactionID, + X509Certificate[] clientCertificate, + ConfigurationProvider configuration, + Element request, + HashMap attachments) { + + this.transactionID = transactionID; + this.clientCertificate = clientCertificate; + this.configuration = configuration; + this.request = request; + this.attachments = attachments; + } + + /** + * Returns the client certificate. + * + * @return The client certificate chain, if SSL client authentication has been + * configured in the web server and has been used by the client. The 0th + * element of the array contains the client certificate. null + * otherwise. + */ + public X509Certificate[] getClientCertificate() { + return clientCertificate; + } + + /** + * Returns the unique transaction ID. + * + * @return The transaction ID. + */ + public String getTransactionID() { + return transactionID; + } + + /** + * Returns the name of the request. + * + * @return The name of the request. + */ + public String getRequestName() { + return requestName; + } + + /** + * Sets the name of the request. + * + * @param requestName The request name to set. + */ + public void setRequestName(String requestName) { + this.requestName = requestName; + } + + /** + * Sets the the request. + * + * @param request The request to set. + */ + public void setRequest(Element request) { + this.request = request; + } + + /** + * Returns the request. + * + * @return The request. + */ + public Element getRequest() { + return request; + } + + /** + * Sets the the response. + * + * @param response The response to set. + */ + public void setResponse(Element response) { + this.response = response; + } + + /** + * Returns the response. + * + * @return The response. + */ + public Element getResponse() { + return response; + } + + /** + * Adds an attachment to the transactions list of SOAP attachments. + * + * @param referenceId Identification value for the SOAP attachment. + * @param contentType MIME type of the SOAP attachment. + * @param is Handle to the ManagedMemoryDataSource of the SOAP attachment. + */ + public void addAttachment(String referenceId, String contentType, ManagedMemoryDataSource is) { + if (this.attachments == null) this.attachments = new HashMap(); + Vector entry = new Vector(2); + entry.add(contentType); + entry.add(is); + this.attachments.put(referenceId, entry); + } + + /** + * Returns the ManagedMemoryDataSource to a specific SOAP attachment identified by referenceId. + * + * @param referenceId Identification value for the SOAP attachment. + */ + public ManagedMemoryDataSource getAttachment(String referenceId) { + if (attachments==null) { + return null; + } + Vector entry = (Vector) attachments.get(referenceId); + if (entry==null) { + return null; + } + //return (InputStream) ( ((ManagedMemoryDataSource)entry.get(1)).getInputStream()); + return (ManagedMemoryDataSource) entry.get(1); + } + + /** + * Returns the InputStream to a specific SOAP attachment identified by uri. + * + * @param uri Identification value for the SOAP attachment. + */ + public InputStream getAttachmentInputStream(URI uri) throws MOAApplicationException { + if (attachments==null) { + return null; + } + String referenceId = uri.getPath(); + Vector entry = (Vector) attachments.get(referenceId); + if (entry==null) { + return null; + } + + InputStream attachmentIs = null; + try { + attachmentIs = (InputStream) ( ((ManagedMemoryDataSource)entry.get(1)).getInputStream()); + } catch (IOException e) { + throw new MOAApplicationException("2208", new Object[] { uri }, e); + } + + return attachmentIs; + //If we would return the whole mmds: return (ManagedMemoryDataSource) entry.get(1); + } + + /** + * Returns the content type to a specific SOAP attachment identified by referenceId. + * + * @param referenceId Identification value for the SOAP attachment. + */ + public String getAttachmentContentType(String referenceId) { + Vector entry = (Vector) attachments.get(referenceId); + if (entry==null) { + return null; + } + return (String) entry.get(0); + } + + /** + * Delete the temporary attachment files. + */ +public void cleanAttachmentCache() { + if (null==attachments) { + return; + } + Iterator iterator = attachments.entrySet().iterator(); + while (iterator.hasNext()) { + Entry hmEntry = (Entry) iterator.next(); + Vector entry = (Vector)hmEntry.getValue(); + ManagedMemoryDataSource mmds = (ManagedMemoryDataSource)entry.get(1); + try { + if (mmds!=null) { + InputStream is = mmds.getInputStream(); + if (is!=null) is.close(); + File f = mmds.getDiskCacheFile(); + if (f!=null) f.delete(); + mmds.delete(); + } + } catch (IOException e) { + // ok to do nothing here + } + } + } + + /** + * Returns the ConfigurationProvider associated with this + * transaction. + * + * @return The ConfigurationProvider associated with this transaction. + */ + public ConfigurationProvider getConfiguration() { + return configuration; + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java new file mode 100644 index 000000000..13127c3ae --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContextManager.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.spss.server.transaction; + +/** + * Provides each thread with an instance of TransactionContext. + * + * The single instance of the TransactionContextManager should be + * used to access contextual information for each web service transaction, e.g. + * the transaction ID, MOA configuration, client certificate, etc. + * + * @author Stefan Knirsch + * @author Patrick Peck + */ +public class TransactionContextManager { + + /** The single instance of TransactionContextManager */ + private static TransactionContextManager instance = null; + + /** Contains a single TransactionContext for each thread. */ + private ThreadLocal context = null; + + /** + * Get the single instance of TransactionContextManager. + * + * @return The single instanc of TransactionContextManager. + */ + public static synchronized TransactionContextManager getInstance() { + if (instance == null) { + instance = new TransactionContextManager(); + } + return instance; + } + + /** + * Creates a new TransactionContextManager. + * + * Protected to disallow direct instantiation. + */ + protected TransactionContextManager() { + context = new ThreadLocal(); + } + + /** + * Set the TransactionContext for the current thread. + * + * @param txContext The TransactionContext for this thread. + */ + public void setTransactionContext(TransactionContext txContext) { + context.set(txContext); + } + + /** + * Get the TransactionContext for the current thread. + * + * @return The TransactionContext for the current thread or + * null, if none has been set (or if this method is being invoked + * outside the bounds of a transaction). + */ + public TransactionContext getTransactionContext() { + return (TransactionContext) context.get(); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java new file mode 100644 index 000000000..6eb07defe --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionIDGenerator.java @@ -0,0 +1,51 @@ +package at.gv.egovernment.moa.spss.server.transaction; + + +/** + * A generator for unique transaction IDs. + * + *

The transaction IDs are of the form "-", where: + *

    + *
  • base is initialized with the system time when this class is + * being loaded
  • + *
  • counter is incremented sequentially on each call to + * nextID()
  • + *
+ *

+ * + *

Assuming that it is highly unlikely that MOA servers are started at + * exactly the same time instant, the mechanism provided by this class should + * guarantee unique transaction IDs across multiple restarts and/or instances of + * the server.

+ * + * @author Patrick Peck + * @author Stefan Knirsch + */ +public class TransactionIDGenerator { + + /** Request sequence number. */ + private static long counter = 0; + /** The base value to which to append the sequence number. */ + private static String base = null; + + /** + * Set up the initial base value. + */ + static { + synchronized (TransactionIDGenerator.class) { + base = Long.toString(System.currentTimeMillis()); + } + } + + /** + * Returns the next transaction ID. + * + * @return The next transaction ID. + */ + public static synchronized String nextID() { + counter++; + + return (base + "-" + counter); + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/util/IdGenerator.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/util/IdGenerator.java new file mode 100644 index 000000000..2dfd22140 --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/util/IdGenerator.java @@ -0,0 +1,61 @@ +package at.gv.egovernment.moa.spss.server.util; + +import java.util.Set; + +/** + * Generate unique ID values for various objects in the response. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IdGenerator { + /** The base value to append the counter to. */ + private String base; + /** The Set of reserved ID values. */ + private Set reserved; + /** The sequence number. */ + private int count; + + /** + * Create a new IdGenerator. + * + * @param base A base value to append the IDs to. The creator of this object + * should provide a base value, so that appending the counter leads to unique + * IDs. + * @param reserved The Set of reserved IDs. A call to + * uniqueId() will respect the reserved IDs. + */ + public IdGenerator(String base, Set reserved) { + this.base = base; + this.reserved = reserved; + count = 1; + } + + /** + * Create the next ID value in the sequence. + * + * @return The next ID value in the sequence. + */ + protected String nextId() { + return base + "-" + count++; + } + + /** + * Create the next unique ID value which is unique in the reserved ID set. + * + * The created ID is added to the set of reserved IDs. + * + * @return The next ID value. + */ + public String uniqueId() { + String nextId; + + while (reserved.contains(nextId = nextId())); + + reserved.add(nextId); + + return nextId; + + } + +} diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/util/MessageProvider.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/util/MessageProvider.java new file mode 100644 index 000000000..a6f6c1d4a --- /dev/null +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/util/MessageProvider.java @@ -0,0 +1,65 @@ +package at.gv.egovernment.moa.spss.util; + +import java.util.Locale; + +import at.gv.egovernment.moa.util.Messages; + +/** + * Singleton wrapper around a Messages object. + * + * @author Patrick Peck + * @version $Id$ + */ +public class MessageProvider { + + /** The resource names of the messages to load. */ + private static final String[] DEFAULT_MESSAGE_RESOURCES = + { "resources/properties/spss_messages" }; + /** The corresponding message locales. */ + private static final Locale[] DEFAULT_MESSAGE_LOCALES = + new Locale[] { new Locale("de", "AT") }; + /** The single instance of this class. */ + private static MessageProvider instance; + + /** The messages provided by the MessageProvider. */ + private Messages messages; + + /** + * Return the single instance of the MessageProvider. + * + * Intialilizes the MessageProvider with the default message + * locations: /resources/properties/spss_messages. + * + * @return The single MessageProvider. + */ + public static synchronized MessageProvider getInstance() { + if (instance == null) { + instance = + new MessageProvider(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); + } + return instance; + } + + /** + * Create a MessageProvider. + * + * @param resourceNames The names of the resources containing the messages. + * @param locales The corresponding locales. + */ + protected MessageProvider(String[] resourceNames, Locale[] locales) { + this.messages = new Messages(resourceNames, locales); + } + + /** + * Get the message corresponding to a given message ID. + * + * @param messageId The ID of the message. + * @param parameters The parameters to fill in into the message arguments. + * @return The formatted message. + */ + public String getMessage(String messageId, Object[] parameters) { + return messages.getMessage(messageId, parameters); + } + + +} diff --git a/spss/server/serverlib/src/main/resources/properties/spss_messages_de.properties b/spss/server/serverlib/src/main/resources/properties/spss_messages_de.properties new file mode 100644 index 000000000..febcf01a9 --- /dev/null +++ b/spss/server/serverlib/src/main/resources/properties/spss_messages_de.properties @@ -0,0 +1,151 @@ +# This file contains exception messages in the standard Java properties +# format. The messages may contain formatting patterns as definied in the +# java.text.MessageFormat class. + +# +# Error messages: the key corresponds to the error code +# + +1100=Fehler beim Validieren der Anfrage: {0} +1101=Bei enveloping Datenobjekten muss entweder Content oder Reference übergeben werden +1102=Bei detached Datenobjekten darf das Attribut Reference nicht leer sein +1103=Ungültiger Wert für Attribut Structure im Element DataObjectInfo: {0} +1104=Ungültiger Wert für DateTime: {0} +1105=Ungültiger Wert für Attribut Index in Element CreateSignatureLocation: {0} +1106=Interner Fehler beim Parsen der XML-Daten +1107=Kein Kind-Element im Element XMLContent gefunden +1108=Ungültiger Wert für dsig:Algorithm: {0} +1109=XMLContent darf nur ein Kind-Element enthalten +1110=Entweder Content oder Reference muss gesetzt sein +1111=Reference muss gesetzt sein, wenn kein Content angegeben ist +1112=Bei leerer Reference muss CreateSignatureEnvironment vorhanden sein +1113=Der Endpunkt akzeptiert keine Anfragen vom Typ: {0} + +2200=Fehler beim Erzeugen der Antwort +2201=Transformations-Algorithmus unbekannt: {0} +2202=Kein XPath-Element für XPath-Transformation gefunden +2203=TrustProfileID unbekannt: {0} +2207=Ungültiges URI-Format: {0} +2208=Fehler beim Öffnen des Datenobjekts (URI={0}) +2209=Fehler beim Parsen der XML-Daten +2210=Fehler beim Lesen des Datenobjekts +2211=Referenzierte Daten können nicht als XML interpretiert werden (URI={0}) +2212=Fehler beim Auswerten des XPath-Ausdrucks: {0} +2213=Zugriff auf das Dateisystem verweigert (URI={0}) +2214=Ungültiges URL-Format: {0} +2215=Kein Stylesheet für XSLT-Transformation gefunden +2216=Kein XPath-Filter2 Element für XPath-Filter2-Transform gefunden +2217=Kein InclusiveNamespaces Element für Exclusive Canonicalization Transform gefunden +2218=Das Signature Environment enthält keine validen XML-Daten +2219=Fehler beim Lesen des Signature Environment +2220=Allgemeiner Fehler beim Erzeugen der Signatur [{0}] +2221=Fehler bei der Behandlung des Schlüssels [{0}] +2222=Fehler beim Erstellen des Manifests [{0}] +2223=Fehler beim Erstellen der Referenz [{0}] +2224=Hashwert nicht verfügbar [{0}] +2225=Signier-Algorithmus wird nicht unterstützt [{0}] +2226=Fehler beim Einbetten der Signatur [{0}] +2227=Fehler beim Berechnen des Signaturwertes [{0}] +2228=Fehler beim Behandeln der SignedProperties [{0}] +2229=Signator-Zertifikat nicht verfügbar [{0}] +2230=Fehler beim Auflösen eines Supplements [{0}] +2231=Die Schlüsselgruppe ist nicht verfügbar +2232=Die Schlüsselgruppe ist leer +2233=Fehler beim Durchführen der Transformation [{0}] +2234=CreateTransformsInfoProfileID nicht vorhanden (ID={0}) +2235=CreateSignatureEnvironment muss entweder Reference oder Content enthalten +2236=CreateSignatureEnvironmentProfileID nicht vorhanden (ID={0}) +2237=Fehler beim Auflösen der internen Referenz (URI={0}) +2238=Fehler beim Auflösen des Transformationsparameters (URI={0}) +2240=Allgemeiner Fehler beim Verifizieren der Signatur [{0}] +2241=Algorithmus wird nicht unterstützt [{0}] +2242=Fehler beim Parsen der CMS Signatur [{0}] +2243=Signator-Zertifikat nicht verfügbar [{0}] +2244=Fehler beim Lesen der Signatur-Daten +2245=Fehler beim Codieren des Signator-Zertifikats +2246=Fehler beim Umwandeln des SubjectDN des Signator-Zertifikats nach RFC2253: {0} +2247=Allgemeiner Fehler beim Verifizieren der Signatur [{0}] +2248=Fehler beim Vorbereiten der Daten [{0}] +2249=Das Attribut Signatories enthält einen ungültigen Index (Index={0}) +2262=Fehler beim Behandeln des Manifests [{0}] +2263=Fehler beim Parsen der Properties [{0}] +2264=Fehler beim Behandeln der Referenz [{0}] +2265=Fehler beim Durchführen der Transformation [{0}] +2266=Signatur ist kein dsig:Signature-Element +2267=SupplementProfileID nicht vorhanden (ID={0}) +2268=VerifyTransformsInfoProfileID nicht vorhanden (ID={0}) +2269=Fehler beim Parsen der Transformation [{0}] +2270=Fehler beim Decodieren des Hash-Wertes +2271=Falsche Anzahl an ReferenceInfo Elementen in SignatureManfestCheckParams +2280=Die Angabe XMLContent wird derzeit nicht unterstützt +2281=XML-Supplement kann nicht serialisiert werden (Reference="{0}") +2282=Datenobjekt mit der URI={0} wurde dem Request nicht bereit gestellt + + +2900=Interner Server-Fehler + +3201=Objekt kann nicht geladen werden (Reference="{0}", LocRef-URI="{1}") +3202=Supplement für Signaturumgebung kann nicht geladen werden (Reference="{0}", LocRef-URI="{1}") +3203=Signaturumgebung kann nicht geladen werden (Reference="{0}", LocRef-URI="{1}") + +9900=Nicht klassifizierter Fehler in Subsystem +9901=Nicht klassifizierter Laufzeitfehler in Subsystem +9999=Nicht klassifizierter Fehler + + +# +# Server internal messages +# + +init.00=Fehler beim Lesen der MOA SP/SS Konfiguration: das Service steht nicht zur Verfügung +init.01=MOA SP/SS Konfiguration erfolgreich geladen +init.02=Fehler beim Löschen der Archivdaten +init.03=Fehler beim Aktivieren des IAIK-JCE/JSSE/JDK1.3 Workaround: SSL ist möglicherweise nicht verfügbar +init.04=Fehler beim Initialisieren des Schema Pools + +config.00=Fehler beim Erstellen des KeyGroupMapping: KeyGroup mit id={0} unbekannt - die Erstellung des KeyGroupMapping wird fortgeführt +config.01=Fehler in der Konfiguration: Wert für maximale Archivierungsdauer von Widerrufsinformationen (ArchiveDuration) nicht konfiguriert oder ungültig +config.02=Fehler in der Konfiguration: {0} mit id={1}: falscher Profiltyp in Datei {2} +config.03=Fehler in der Konfiguration: {0} mit id={1} konnte nicht geladen werden +config.04=Fehler in der Konfiguration: {0} mit id={1} existiert bereits +config.05=Umgebungsvariable {0} nicht gesetzt: benutze Default-Konfiguration +config.06=Die MOA SP/SS Konfiguration wurde erfolgreich aktualisiert. +config.07=Fehler in der Konfiguration: Reason code {0} unbekannt +config.08=Fehler beim Konfigurieren der IAIK-Module +config.09=Fehler beim Öffnen der Schlüssel-Datei {0} +config.10=Fehler beim Einlesen der Konfiguration (siehe Log-Datei für Details) +config.11=Fehler biem Erstellen der Konfiguration (siehe Log-Datei für Details) +config.12=Fehler beim Einlesen des Profils +config.13=Fehler beim Erstellen des CRLDistributionPoint: CAIssuerDN={0} ungültig +config.14=Das Attribut {0} für das TrustProfile mit id={1} ist ungültig (Wert={2}) +config.15=Fehler beim Erstellen des TrustProfile id={0}: Name des Konfigurations-Verzeichnisses konnte nicht in eine URL umgewandet werden +config.16=Fehler beim Erstellen von X509IssuerSerial (IssuerName={0}, SerialNumber={1}) +config.17=DigestAlgorithmName unbekannt (AlgorithmName={0}) +config.18=Lade Keystore: {0} +config.19=Key ID={0} +config.20=Fehler beim Aktualisieren der MOA SP/SS Konfiguration. Die bestehende Konfiguration wird beibehalten +config.21=Lade Konfiguration von {0} +config.22=Lade {0} mit id={1} von Datei {2} +config.23=MOA SP/SS Konfiguration: {0} nicht gesetzt oder ungültiger Wert, verwende den Default-Wert: {1} +config.25=Fehler in der Konfiguration: Das SoftwareKeyModule mit id={0} konnte nicht geladen werden, da die Datei {1} nicht existiert oder ein Verzeichnis bezeichnet +config.26=Fehler beim Erstellen der KeyGroup mit id={0}: KeyModule mit id={1} unbekannt +config.27=Fehler in der Konfiguration: Das Attribut {0} des TrustProfiles mit id={1} zeigt nicht auf ein existierendes Verzeichnis +config.28=Einen detaillierten Fehlerbericht entnehmen Sie bitte der Log-Datei. +config.29=Es sind folgende leichte Fehler aufgetreten: +config.31=Fehler in der Konfiguration der KeyGroup mit id={0}: Der Schlüssel im KeyModule id={1} mit IssuerName={2} und SerialNumber={3} konnte nicht geladen werden +config.32=Fehler in der Konfiguration: Verzeichnisangabe für den Zertifikatsspeicher ist ungültig ({0}). + + +handler.00=Starte neue Transaktion: TID={0}, Service={1} +handler.01=Aufruf von Adresse={0} +handler.02=Client-Zertifikat: Subject={0}, Serial={1}, Issuer={2} +handler.03=Client-Zertifikat nicht verfügbar +handler.04=Anfrage erfolgreich abgearbeitet +handler.05=Fehler beim Abarbeiten der Anfrage +handler.06=SOAP Attachment mit der id={0} für Request hinterlegt (MIME Type des Attachments={1}) +handler.07=SOAP Request empfangen: Request={0} + +invoker.00=Das Signature Environment konnte nicht validierend geparst werden +invoker.01=Keine passende Transformationskette gefunden (Index={0}) +invoker.02=Der Hashwert der Transformation stimmt nicht überein (Index={0}) +invoker.03=Signatorzertifikat aus Trustprofile mit id={0} konnte nicht geparst werden (Dateiname={1}) diff --git a/spss/server/serverlib/src/main/resources/security/cacerts b/spss/server/serverlib/src/main/resources/security/cacerts new file mode 100644 index 000000000..6eeaba418 Binary files /dev/null and b/spss/server/serverlib/src/main/resources/security/cacerts differ diff --git a/spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl b/spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl new file mode 100644 index 000000000..c5cd8fc0f --- /dev/null +++ b/spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd b/spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd new file mode 100644 index 000000000..756b51279 --- /dev/null +++ b/spss/server/serverlib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd @@ -0,0 +1,469 @@ + + + + + + + + + + + + + + + + + + + + Ermöglichung der Stapelsignatur durch wiederholte Angabe dieses Elements + + + + + + + + + + + + + + + + + + + Auswahl: Entweder explizite Angabe des Signaturorts sowie ggf. sinnvoller Supplements im Zshg. mit der Signaturumgebung, oder Verweis auf ein benanntes Profil + + + + + + + + + + + + + + + + + + Kardinalität 1..oo erlaubt die Antwort auf eine Stapelsignatur-Anfrage + + + + Resultat, falls die Signaturerstellung erfolgreich war + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert + + + + + + + + + + + only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any;publicAuthority is included as X509Data/any + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pro dsig:Reference-Element in der zu überprüfenden XML-Signatur muss hier ein ReferenceInfo-Element erscheinen. Die Reihenfolge der einzelnen ReferenceInfo Elemente entspricht jener der dsig:Reference Elemente in der XML-Signatur. + + + + + + + + + + mit diesem Profil wird eine Menge von vertrauenswürdigen Wurzelzertifikaten spezifiziert + + + + + + + + + + + only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate is included as X509Data/any; PublicAuthority is included as X509Data/any + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Auswahl: Entweder explizite Angabe EINER Transformationskette inklusive ggf. sinnvoller Supplements oder Verweis auf ein benanntes Profil + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Resultat, falls die Signaturerstellung gescheitert ist + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ein oder mehrere Transformationswege können von der Applikation an MOA mitgeteilt werden. Die zu prüfende Signatur hat zumindest einem dieser Transformationswege zu entsprechen. Die Angabe kann explizit oder als Profilbezeichner erfolgen. + + + + + Profilbezeichner für einen Transformationsweg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Die Angabe des Transformationsparameters (explizit oder als Hashwert) kann unterlassen werden, wenn die Applikation von der Unveränderlichkeit des Inhalts der in "Transformationsparamter", Attribut "URI" angegebenen URI ausgehen kann. + + + + Der Transformationsparameter explizit angegeben. + + + + + Der Hashwert des Transformationsparameters. + + + + + + + + + + + + + + + + + + + + + + Explizite Angabe des Transformationswegs + + + + + + + Alle impliziten Transformationsparameter, die zum Durchlaufen der oben angeführten Transformationskette bekannt sein müssen, müssen hier angeführt werden. Das Attribut "URI" bezeichnet den Transformationsparameter in exakt jener Weise, wie er in der zu überprüfenden Signatur gebraucht wird. + + + + + + + + + + + + + + + + diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java new file mode 100644 index 000000000..c670b5e55 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/AllTests.java @@ -0,0 +1,40 @@ +package test.at.gv.egovernment.moa.spss; + +import test.at.gv.egovernment.moa.spss.server.iaik.config.ConfigurationDataImplTest; +import test.at.gv.egovernment.moa.spss.server.iaik.config.IaikConfiguratorTest; +import test.at.gv.egovernment.moa.spss.server.tools.CertToolTest; + +import junit.awtui.TestRunner; +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Test suite for all unit tests. + * + * @author Patrick Peck + * @version $Id$ + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(test.at.gv.egovernment.moa.spss.server.config.AllTests.class); + suite.addTestSuite(ConfigurationDataImplTest.class); + suite.addTestSuite(IaikConfiguratorTest.class); + suite.addTest( + test.at.gv.egovernment.moa.spss.server.invoke.AllTests.suite()); + suite.addTest(test.at.gv.egovernment.moa.spss.api.xmlbind.AllTests.suite()); + suite.addTestSuite(CertToolTest.class); + + return suite; + } + + public static void main(String[] args) { + try { + TestRunner.run(AllTests.class); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java new file mode 100644 index 000000000..a585e30a0 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/SPSSTestCase.java @@ -0,0 +1,82 @@ +package test.at.gv.egovernment.moa.spss; + +import java.security.Security; + +import test.at.gv.egovernment.moa.MOATestCase; + +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.logging.LoggingContext; +import at.gv.egovernment.moa.logging.LoggingContextManager; +import at.gv.egovernment.moa.util.MessageProvider; + +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * Base class for MOA test cases. + * + * Provides some utility functions. + * + * @author Patrick Peck + * @version $Id$ + */ +public class SPSSTestCase extends MOATestCase { + + protected static final String TESTDATA_ROOT = "data/test/"; + + /** + * Constructor for MOATestCase. + * @param arg0 + */ + public SPSSTestCase(String name) { + super(name); + } + + /** + * Set up a transaction context with a test configuration. + */ + protected void setUpTransactionContext() throws Exception { + System.setProperty( + ConfigurationProvider.CONFIG_PROPERTY_NAME, + "data/test/conf/moa-spss/MOA-SPSSConfiguration.xml"); + ConfigurationProvider config = ConfigurationProvider.getInstance(); + TransactionContext context = new TransactionContext("test", null, config); + TransactionContextManager.getInstance().setTransactionContext(context); + } + + protected void setUpLoggingContext() throws Exception { + LoggingContext context = new LoggingContext("test"); + LoggingContextManager.getInstance().setLoggingContext(context); + } + + /** + * Configure the IAIK modules with the current configuration. + * + * A TransactionContext must have been set up before. + */ + protected void setUpIaikConfiguration() throws Exception { + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + ClassLoader cl = getClass().getClassLoader(); + MessageProvider msg = MessageProvider.getInstance(); + + try { + cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar + } catch (ClassNotFoundException e) { + Logger.warn(msg.getMessage("init.03", null), e); + } + + new IaikConfigurator().configure(context.getConfiguration()); + } + + protected void setUpSSL() throws Exception { + //System.setProperty("javax.net.debug", "all"); + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty( + "java.protocol.handler.pkgs", + "com.sun.net.ssl.internal.www.protocol"); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java new file mode 100644 index 000000000..28f79729e --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/AllTests.java @@ -0,0 +1,24 @@ +package test.at.gv.egovernment.moa.spss.api.xmlbind; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Runs all tests in this package. + * + * @author Patrick Peck + * @version $Id$ + */ +public class AllTests { + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(CreateXMLSignatureRequestParserTest.class); + suite.addTestSuite(TransformParserTest.class); + suite.addTestSuite(VerifyCMSSignatureRequestParserTest.class); + suite.addTestSuite(VerifyXMLSignatureRequestParserTest.class); + + return suite; + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java new file mode 100644 index 000000000..7ce705b01 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/CreateXMLSignatureRequestParserTest.java @@ -0,0 +1,71 @@ +package test.at.gv.egovernment.moa.spss.api.xmlbind; + +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; +import at.gv.egovernment.moa.spss.api.xmlsign.SingleSignatureInfo; + +/** + * Test the CreateXMLSignatureRequestParser. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CreateXMLSignatureRequestParserTest extends SPSSTestCase { + private static final String TESTDATA_BASE = + TESTDATA_ROOT + "xml/CreateXMLSignature/"; + + private CreateXMLSignatureRequestParser requestParser; + + public CreateXMLSignatureRequestParserTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + requestParser = new CreateXMLSignatureRequestParser(); + } + + public void testParse() throws Exception { + Element requestElem = + parseXml(TESTDATA_BASE + "TestGeneratorCX2.001.Req.xml") + .getDocumentElement(); + CreateXMLSignatureRequest request = requestParser.parse(requestElem); + SingleSignatureInfo sigInfo; + DataObjectInfo dataObjInfo; + CreateTransformsInfoProfileExplicit transProfile; + CreateSignatureEnvironmentProfileExplicit envProfile; + + assertNotNull(request); + assertEquals("PKCS12RSAKey1", request.getKeyIdentifier()); + assertEquals(1, request.getSingleSignatureInfos().size()); + + sigInfo = (SingleSignatureInfo) request.getSingleSignatureInfos().get(0); + assertEquals(1, sigInfo.getDataObjectInfos().size()); + assertFalse(sigInfo.isSecurityLayerConform()); + + dataObjInfo = (DataObjectInfo) sigInfo.getDataObjectInfos().get(0); + assertNotNull(dataObjInfo.getDataObject()); + + transProfile = + (CreateTransformsInfoProfileExplicit) dataObjInfo + .getCreateTransformsInfoProfile(); + assertNotNull( + transProfile.getCreateTransformsInfo().getFinalDataMetaInfo()); + + envProfile = + (CreateSignatureEnvironmentProfileExplicit) sigInfo + .getCreateSignatureInfo() + .getCreateSignatureEnvironmentProfile(); + assertEquals( + "//data:Document", + envProfile.getCreateSignatureLocation().getXPathExpression()); + assertEquals(0, envProfile.getCreateSignatureLocation().getIndex()); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java new file mode 100644 index 000000000..f580f86bc --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/TransformParserTest.java @@ -0,0 +1,113 @@ +package test.at.gv.egovernment.moa.spss.api.xmlbind; + +import java.util.List; + +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.spss.api.common.CanonicalizationTransform; +import at.gv.egovernment.moa.spss.api.common.EnvelopedSignatureTransform; +import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; +import at.gv.egovernment.moa.spss.api.common.XPathFilter2Transform; +import at.gv.egovernment.moa.spss.api.common.XPathTransform; +import at.gv.egovernment.moa.spss.api.common.XSLTTransform; +import at.gv.egovernment.moa.spss.api.xmlbind.TransformParser; + +/** + * Test the TransformParser. + * + * @author Patrick Peck + * @version $Id$ + */ +public class TransformParserTest extends SPSSTestCase { + private static String TESTDATA_BASE = TESTDATA_ROOT + "xml/dsigTransform/"; + + private TransformParser transformParser; + + public TransformParserTest(String name) { + super(name); + } + + protected void setUp() { + transformParser = new TransformParser(); + } + + public void testParseTransforms() throws Exception { + Element transformsElem = + parseXml(TESTDATA_BASE + "transforms.xml").getDocumentElement(); + List transforms = transformParser.parseTransforms(transformsElem); + + assertNotNull(transforms); + assertEquals(3, transforms.size()); + + } + + public void testParseCanonicalizationTransform() throws Exception { + Element transformElem = + parseXml(TESTDATA_BASE + "canonicalization.xml").getDocumentElement(); + CanonicalizationTransform transform = + (CanonicalizationTransform) transformParser.parseTransform(transformElem); + + assertNotNull(transform); + assertEquals( + CanonicalizationTransform.CANONICAL_XML, + transform.getAlgorithmURI()); + } + + public void testParseExclCanonicalizationTransform() throws Exception { + Element transformElem = + parseXml(TESTDATA_BASE + "exclusiveCanonicalization.xml") + .getDocumentElement(); + ExclusiveCanonicalizationTransform transform = + (ExclusiveCanonicalizationTransform) transformParser.parseTransform( + transformElem); + + assertNotNull(transform); + assertEquals( + ExclusiveCanonicalizationTransform.EXCLUSIVE_CANONICAL_XML, + transform.getAlgorithmURI()); + assertEquals(3, transform.getInclusiveNamespacePrefixes().size()); + } + + public void testParseEnvelopedTransform() throws Exception { + Element transformElem = + parseXml(TESTDATA_BASE + "enveloped.xml").getDocumentElement(); + EnvelopedSignatureTransform transform = + (EnvelopedSignatureTransform) transformParser.parseTransform( + transformElem); + + assertNotNull(transform); + } + + public void testParseXPathTransform() throws Exception { + Element transformElem = + parseXml(TESTDATA_BASE + "xpath.xml").getDocumentElement(); + XPathTransform transform = + (XPathTransform) transformParser.parseTransform(transformElem); + + assertNotNull(transform); + assertEquals("//ToBeSigned/Data", transform.getXPathExpression()); + assertEquals(1, transform.getNamespaceDeclarations().size()); + } + + public void testParseXPathFilter2Transform() throws Exception { + Element transformElem = + parseXml(TESTDATA_BASE + "xpath2.xml").getDocumentElement(); + XPathFilter2Transform transform = + (XPathFilter2Transform) transformParser.parseTransform(transformElem); + + assertNotNull(transform); + assertEquals(3, transform.getFilters().size()); + } + + public void testParseXSLTTransform() throws Exception { + Element transformElem = + parseXml(TESTDATA_BASE + "xslt.xml").getDocumentElement(); + XSLTTransform transform = + (XSLTTransform) transformParser.parseTransform(transformElem); + + assertNotNull(transform); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java new file mode 100644 index 000000000..4be7667eb --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyCMSSignatureRequestParserTest.java @@ -0,0 +1,61 @@ +package test.at.gv.egovernment.moa.spss.api.xmlbind; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.util.DateTimeUtils; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.spss.api.cmsverify.CMSContentExcplicit; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureRequestParser; + +/** + * Test the VerifyCMSSignatureRequestParserTest. + * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyCMSSignatureRequestParserTest extends SPSSTestCase { + private static String TESTDATA_BASE = + TESTDATA_ROOT + "xml/VerifyCMSSignature/"; + + private VerifyCMSSignatureRequestParser requestParser; + + public VerifyCMSSignatureRequestParserTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + requestParser = new VerifyCMSSignatureRequestParser(); + } + + public void testParse() throws Exception { + Element requestElem = + parseXml(TESTDATA_BASE + "TestGeneratorVC0.001.Req.xml") + .getDocumentElement(); + VerifyCMSSignatureRequest request = requestParser.parse(requestElem); + MetaInfo metaInfo; + CMSContentExcplicit content; + + assertNotNull(request); + assertEquals(1, request.getSignatories()[0]); + assertEquals( + DateTimeUtils.parseDateTime("2003-04-04T09:30:47-05:00"), + request.getDateTime()); + assertNotNull(request.getCMSSignature()); + assertNotNull(request.getDataObject()); + assertEquals("TrustProfile1", request.getTrustProfileId()); + + metaInfo = request.getDataObject().getMetaInfo(); + assertNotNull(metaInfo); + assertEquals("text/plain", metaInfo.getMimeType()); + assertEquals("http://10.16.46.109/TestDatenGenerator/resources/testDaten.txt", metaInfo.getDescription()); + + content = (CMSContentExcplicit) request.getDataObject().getContent(); + assertNotNull(content.getBinaryContent()); + + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java new file mode 100644 index 000000000..3b8e8b00e --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/api/xmlbind/VerifyXMLSignatureRequestParserTest.java @@ -0,0 +1,81 @@ +package test.at.gv.egovernment.moa.spss.api.xmlbind; + +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.util.DateTimeUtils; + +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlverify.ReferenceInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.SignatureManifestCheckParams; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureInfo; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifySignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; + +/** + * Test the VerifyXMLSignatureRequestParserTest. + * + * @author Patrick Peck + * @version $Id$ + */ +public class VerifyXMLSignatureRequestParserTest extends SPSSTestCase { + private static String TESTDATA_BASE = + TESTDATA_ROOT + "xml/VerifyXMLSignature/"; + + private VerifyXMLSignatureRequestParser parser; + + public VerifyXMLSignatureRequestParserTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + parser = new VerifyXMLSignatureRequestParser(); + } + + public void testParse() throws Exception { + Element requestElem = + parseXml(TESTDATA_BASE + "TestGeneratorVX.201.Req.xml") + .getDocumentElement(); + VerifyXMLSignatureRequest request = parser.parse(requestElem); + VerifySignatureInfo verifySignatureInfo; + VerifySignatureLocation verifyLocation; + SignatureManifestCheckParams checkParams; + ReferenceInfo refInfo; + VerifyTransformsInfoProfileExplicit transformsProfile; + + assertNotNull(request); + assertEquals( + DateTimeUtils.parseDateTime("2003-04-01T12:53:57+01:00"), + request.getDateTime()); + assertFalse(request.getReturnHashInputData()); + assertEquals("TrustProfile1", request.getTrustProfileId()); + + verifySignatureInfo = request.getSignatureInfo(); + assertNotNull(verifySignatureInfo); + assertNotNull(verifySignatureInfo.getVerifySignatureEnvironment()); + + verifyLocation = verifySignatureInfo.getVerifySignatureLocation(); + assertNotNull(verifyLocation); + assertEquals("//dsig:Signature", verifyLocation.getXPathExpression()); + assertEquals(3, verifyLocation.getNamespaceDeclarations().size()); + + checkParams = request.getSignatureManifestCheckParams(); + assertNotNull(checkParams); + assertEquals(true, checkParams.getReturnReferenceInputData()); + assertEquals(1, checkParams.getReferenceInfos().size()); + + refInfo = (ReferenceInfo) checkParams.getReferenceInfos().get(0); + assertEquals(1, refInfo.getVerifyTransformsInfoProfiles().size()); + + transformsProfile = + (VerifyTransformsInfoProfileExplicit) refInfo + .getVerifyTransformsInfoProfiles() + .get(0); + assertEquals(1, transformsProfile.getTransforms().size()); + assertEquals(1, transformsProfile.getTransformParameters().size()); + + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java new file mode 100644 index 000000000..131f38c19 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/AllTests.java @@ -0,0 +1,20 @@ +package test.at.gv.egovernment.moa.spss.server.config; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * @author Gregor Karlinger + * @version $Id$ + */ +public class AllTests +{ + public static Test suite() + { + TestSuite suite = new TestSuite(); + suite.addTestSuite(ConfigurationProviderTest1.class); + suite.addTestSuite(ConfigurationProviderTest2.class); + suite.addTestSuite(ConfigurationProviderTest3.class); + return suite; + } +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java new file mode 100644 index 000000000..474a387ad --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest1.java @@ -0,0 +1,377 @@ +package test.at.gv.egovernment.moa.spss.server.config; + +import iaik.asn1.structures.Name; +import iaik.pki.pathvalidation.ChainingModes; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; +import iaik.x509.X509Certificate; + +import java.math.BigInteger; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import junit.framework.TestCase; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.server.config.CRLDistributionPoint; +import at.gv.egovernment.moa.spss.server.config.ConfigurationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.HardwareCryptoModule; +import at.gv.egovernment.moa.spss.server.config.HardwareKeyModule; +import at.gv.egovernment.moa.spss.server.config.KeyGroup; +import at.gv.egovernment.moa.spss.server.config.KeyGroupEntry; +import at.gv.egovernment.moa.spss.server.config.OCSPDistributionPoint; +import at.gv.egovernment.moa.spss.server.config.SoftwareKeyModule; +import at.gv.egovernment.moa.spss.server.config.TrustProfile; +import at.gv.egovernment.moa.util.Constants; + +/** + * @author Gregor Karlinger + * @version $Id$ + */ +public class ConfigurationProviderTest1 extends TestCase +{ + private static final String CONFIG_BASE_ = + "e:/cio/projekte/basismodule/wartung/projekt/spss.server/res/test/resources/config/"; + + static at.gv.egovernment.moa.spss.server.config.ConfigurationProvider provider_; + + static + { + System.setProperty( + "log4j.configuration", + "file:/" + CONFIG_BASE_ + "log4j.properties"); + System.setProperty( + at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.CONFIG_PROPERTY_NAME, + CONFIG_BASE_ + "moa.spss.complete-config.xml"); + try + { + ConfigurationProvider.reload(); + provider_ = at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.getInstance(); + } + catch (ConfigurationException e) + { + throw new RuntimeException("Fehler beim Setup des Tests: " + e.getMessage()); + } + } + + /** + * Constructor for ConfigurationProvider. + * @param arg0 + */ + public ConfigurationProviderTest1() throws MOAException + { + super("ConfigurationProvider"); + } + + public void testGetWarnings() + { + assertEquals(0, provider_.getWarnings().size()); + } + + public void testGetDigestMethodAlgorithmName() + { + assertEquals( + Constants.SHA1_URI, + provider_.getDigestMethodAlgorithmName()); + } + + public void testGetCanonicalizationAlgorithmName() + { + assertEquals( + Constants.C14N_WITH_COMMENTS_URI, + provider_.getCanonicalizationAlgorithmName()); + } + + public void testGetHardwareCryptoModules() + { + List hwcms = provider_.getHardwareCryptoModules(); + assertEquals(2, hwcms.size()); + + HardwareCryptoModule hwc1 = (HardwareCryptoModule) hwcms.get(0); + assertEquals("HWC1_Name", hwc1.getName()); + assertEquals("HWC1_SlotId", hwc1.getSlotID()); + assertEquals("HWC1_UserPIN", hwc1.getUserPIN()); + + HardwareCryptoModule hwc2 = (HardwareCryptoModule) hwcms.get(1); + assertEquals("HWC2_Name", hwc2.getName()); + assertNull(hwc2.getSlotID()); + assertEquals("HWC2_UserPIN", hwc2.getUserPIN()); + } + + public void testGetHardwareKeyModules() + { + List hwkms = provider_.getHardwareKeyModules(); + assertEquals(2, hwkms.size()); + + HardwareKeyModule hwk1 = (HardwareKeyModule) hwkms.get(0); + assertEquals("HWK1_Id", hwk1.getId()); + assertEquals("HWK1_Name", hwk1.getName()); + assertEquals("HWK1_SlotId", hwk1.getSlotID()); + assertEquals("HWK1_UserPIN", hwk1.getUserPIN()); + + HardwareKeyModule hwk2 = (HardwareKeyModule) hwkms.get(1); + assertEquals("HWK2_Id", hwk2.getId()); + assertEquals("HWK2_Name", hwk2.getName()); + assertNull(hwk2.getSlotID()); + assertEquals("HWK2_UserPIN", hwk2.getUserPIN()); + } + + public void testGetSoftwareKeyModules() + { + List swkms = provider_.getSoftwareKeyModules(); + assertEquals(2, swkms.size()); + + SoftwareKeyModule swk1 = (SoftwareKeyModule) swkms.get(0); + assertEquals("SWK1_Id", swk1.getId()); + assertEquals(CONFIG_BASE_ + "swk/SWK1_FileName.txt", swk1.getFileName().replace('\\', '/')); + assertEquals("SWK1_Password", swk1.getPassWord()); + + SoftwareKeyModule swk2 = (SoftwareKeyModule) swkms.get(1); + assertEquals("SWK2_Id", swk2.getId()); + assertEquals(CONFIG_BASE_ + "swk/SWK2_FileName.txt", swk2.getFileName().replace('\\', '/')); + assertNull(swk2.getPassWord()); + } + + public void testGetKeyGroups() + { + Map keyGroups = provider_.getKeyGroups(); + assertEquals(2, keyGroups.size()); + + KeyGroup kg1 = (KeyGroup) keyGroups.get("KG1_Id"); + assertNotNull(kg1); + assertEquals("KG1_Id", kg1.getId()); + + Set kg1Entries = kg1.getKeyGroupEntries(); + assertEquals(2, kg1Entries.size()); + + Iterator kg1EntriesIt = kg1Entries.iterator(); + while(kg1EntriesIt.hasNext()) + { + KeyGroupEntry currentEntry = (KeyGroupEntry)kg1EntriesIt.next(); + if ("HWK1_Id".equals(currentEntry.getModuleID())) + { + assertEquals("CN=HWK1_Issuer", currentEntry.getIssuerDN()); + assertEquals(0, currentEntry.getSerialNumber().intValue()); + } + else if ("HWK2_Id".equals(currentEntry.getModuleID())) + { + assertEquals("CN=HWK2_Issuer", currentEntry.getIssuerDN()); + assertEquals(1, currentEntry.getSerialNumber().intValue()); + } + else fail("Invalid module identifer found."); + } + + KeyGroup kg2 = (KeyGroup) keyGroups.get("KG2_Id"); + assertNotNull(kg2); + assertEquals("KG2_Id", kg2.getId()); + + Set kg2Entries = kg2.getKeyGroupEntries(); + assertEquals(2, kg2Entries.size()); + + Iterator kg2EntriesIt = kg1Entries.iterator(); + while(kg1EntriesIt.hasNext()) + { + KeyGroupEntry currentEntry = (KeyGroupEntry)kg2EntriesIt.next(); + if ("SWK1_Id".equals(currentEntry.getModuleID())) + { + assertEquals("CN=CN=SWK1_Issuer", currentEntry.getIssuerDN()); + assertEquals(2, currentEntry.getSerialNumber().intValue()); + } + else if ("SWK2_Id".equals(currentEntry.getModuleID())) + { + assertEquals("CN=SWK2_Issuer", currentEntry.getIssuerDN()); + assertEquals(3, currentEntry.getSerialNumber().intValue()); + } + else fail("Invalid module identifer found."); + } + } + + public void testGetKeyGroupEntries() throws RFC2253NameParserException + { + RFC2253NameParser parser = new RFC2253NameParser("CN=Customer1_Issuer"); + Name name = parser.parse(); + Set kgEntries = provider_.getKeyGroupEntries(name, BigInteger.valueOf(4), "KG1_Id"); + assertEquals(2, kgEntries.size()); + + Iterator kgEntriesIt = kgEntries.iterator(); + while (kgEntriesIt.hasNext()) + { + KeyGroupEntry currentEntry = (KeyGroupEntry) kgEntriesIt.next(); + if (!"HWK1_Id".equals(currentEntry.getModuleID()) && !"HWK2_Id".equals(currentEntry.getModuleID())) + { + fail("Invalid module identifier found."); + } + } + } + + public void testGetChainingMode() throws RFC2253NameParserException + { + X509Certificate cert = new X509Certificate(); + RFC2253NameParser parser = new RFC2253NameParser("CN=Unknown"); + Name name = parser.parse(); + cert.setIssuerDN(name); + cert.setSerialNumber(BigInteger.valueOf(0)); + assertEquals(ChainingModes.PKIX_MODE, provider_.getChainingMode(cert)); // Default chaining mode + + parser = new RFC2253NameParser("CN=TA1_Issuer"); + name = parser.parse(); + cert.setIssuerDN(name); + cert.setSerialNumber(BigInteger.valueOf(5)); + assertEquals(ChainingModes.CHAIN_MODE, provider_.getChainingMode(cert)); + } + + public void testGetDistributionPoints() throws RFC2253NameParserException + { + X509Certificate cert = new X509Certificate(); + RFC2253NameParser parser = new RFC2253NameParser("CN=DP1_Issuer"); + Name name = parser.parse(); + cert.setIssuerDN(name); + + Set dps = provider_.getDistributionPoints(cert); + assertEquals(2, dps.size()); + + Iterator dpIt = dps.iterator(); + while (dpIt.hasNext()) + { + CRLDistributionPoint currentDP = (CRLDistributionPoint)dpIt.next(); + if ("http://crl.myca.org".equals(currentDP.getUri())) + { + int reasonCodes = + iaik.asn1.structures.DistributionPoint.unused | + iaik.asn1.structures.DistributionPoint.keyCompromise | + iaik.asn1.structures.DistributionPoint.cACompromise | + iaik.asn1.structures.DistributionPoint.affiliationChanged | + iaik.asn1.structures.DistributionPoint.superseded | + iaik.asn1.structures.DistributionPoint.cessationOfOperation | + iaik.asn1.structures.DistributionPoint.certificateHold | + iaik.asn1.structures.DistributionPoint.privilegeWithdrawn | + iaik.asn1.structures.DistributionPoint.aACompromise; + assertEquals(reasonCodes, currentDP.getReasonCodes()); + } + else if ("http://crl.myotherca.org".equals(currentDP.getUri())) + { + int reasonCodes = + iaik.asn1.structures.DistributionPoint.aACompromise | + iaik.asn1.structures.DistributionPoint.affiliationChanged; + assertEquals(reasonCodes, currentDP.getReasonCodes()); + } + else fail("Invalid CRL DP URI found: " + currentDP.getUri()); + } + + parser = new RFC2253NameParser("CN=DP2_Issuer"); + name = parser.parse(); + cert.setIssuerDN(name); + + dps = provider_.getDistributionPoints(cert); + assertEquals(1, dps.size()); + + OCSPDistributionPoint dpo = (OCSPDistributionPoint) dps.toArray()[0]; + assertEquals("http://crl.yetanotherca.org", dpo.getUri()); + } + + public void testGetCRLArchiveDuration() + { + assertEquals(730, provider_.getCRLArchiveDuration()); + } + + public void testGetEnableRevocationArchiving() + { + assertFalse(provider_.getEnableRevocationArchiving()); + } + + public void testGetCertStoreLocation() + { + assertEquals( + CONFIG_BASE_ + "certstore_test", + provider_.getCertStoreLocation().replace('\\', '/')); + } + + public void testGetCreateTransformsInfoProfile() + { + Element ctip1 = provider_.getCreateTransformsInfoProfile("CTIP_1"); + assertEquals("CreateTransformsInfoProfile", ctip1.getLocalName()); + + Element ctip2 = provider_.getCreateTransformsInfoProfile("CTIP_2"); + assertEquals("CreateTransformsInfoProfile", ctip2.getLocalName()); + } + + public void testGetCreateSignatureEnvironmentProfile() + { + Element csep = provider_.getCreateSignatureEnvironmentProfile("CSEP_1"); + assertEquals("CreateSignatureEnvironmentProfile", csep.getLocalName()); + } + + public void testGetVerifyTransformsInfoProfile() + { + Element vtip = provider_.getVerifyTransformsInfoProfile("VTIP_1"); + assertEquals("VerifyTransformsInfoProfile", vtip.getLocalName()); + } + + public void testGetSupplementProfile() + { + Element sp = provider_.getSupplementProfile("SP_1"); + assertEquals("SupplementProfile", sp.getLocalName()); + } + + public void testGetTrustProfile() + { + TrustProfile tp1 = provider_.getTrustProfile("TP1_Id"); + assertEquals( + "file:/" + CONFIG_BASE_ + "trustprofiles/tp1/anchors", + tp1.getUri()); + assertEquals( + "file:/" + CONFIG_BASE_ + "trustprofiles/tp1/signercerts", + tp1.getSignerCertsUri()); + + TrustProfile tp2 = provider_.getTrustProfile("TP2_Id"); + assertEquals( + "file:" + CONFIG_BASE_ + "trustprofiles/tp2/anchors", + tp2.getUri()); + assertEquals( + "file:" + CONFIG_BASE_ + "trustprofiles/tp2/signercerts", + tp2.getSignerCertsUri()); + } + + public void testGetRevocationArchiveJDBCURL() + { + assertEquals("jdbc://dummy", provider_.getRevocationArchiveJDBCURL()); + } + + public void testGetRevocationArchiveJDBCDriverClass() + { + assertEquals("fully.qualified.classname", provider_.getRevocationArchiveJDBCDriverClass()); + } + + public void testGetEnableRevocationChecking() + { + assertFalse(provider_.getEnableRevocationChecking()); + } + + public void testGetMaxRevocationAge() + { + assertEquals(10000, provider_.getMaxRevocationAge()); + } + + public void testGetServiceOrder() + { + String[] serviceOrder = provider_.getServiceOrder(); + assertEquals(2, serviceOrder.length); + assertEquals("crl", serviceOrder[0]); + assertEquals("ocsp", serviceOrder[1]); + } + + public void testGetAutoAddCertificates() + { + assertFalse(provider_.getAutoAddCertificates()); + } + + public void testGetUseAuthorityInfoAccess() + { + assertFalse(provider_.getUseAuthorityInfoAccess()); + } +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java new file mode 100644 index 000000000..adf02809b --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest2.java @@ -0,0 +1,225 @@ +package test.at.gv.egovernment.moa.spss.server.config; + +import iaik.asn1.structures.Name; +import iaik.pki.pathvalidation.ChainingModes; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; +import iaik.x509.X509Certificate; + +import java.math.BigInteger; +import java.util.List; +import java.util.Set; + +import junit.framework.TestCase; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.spss.server.config.TrustProfile; +import at.gv.egovernment.moa.util.Constants; + +/** + * @author Gregor Karlinger + * @version $Id$ + */ +public class ConfigurationProviderTest2 extends TestCase +{ + private static final String CONFIG_BASE_ = + "e:/cio/projekte/basismodule/wartung/projekt/spss.server/res/test/resources/config/"; + + static at.gv.egovernment.moa.spss.server.config.ConfigurationProvider provider_; + + static + { + System.setProperty( + "log4j.configuration", + "file:/" + CONFIG_BASE_ + "log4j.properties"); + System.setProperty( + at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.CONFIG_PROPERTY_NAME, + CONFIG_BASE_ + "moa.ss.noopts-config.xml"); + try + { + ConfigurationProvider.reload(); + provider_ = at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.getInstance(); + } + catch (ConfigurationException e) + { + throw new RuntimeException("Fehler beim Setup des Tests: " + e.getMessage()); + } + } + + + /** + * Constructor for ConfigurationProvider. + * @param arg0 + */ + public ConfigurationProviderTest2() throws MOAException + { + super("ConfigurationProvider"); + } + + public void testGetWarnings() + { + // 3 Warnings should be collected: C14N not found, DigestMethod not found, ArchiveDuration not found + assertEquals(3, provider_.getWarnings().size()); + } + + public void testGetDigestMethodAlgorithmName() + { + // Element is missing in config file, check if default value is returned + assertEquals( + Constants.SHA1_URI, + provider_.getDigestMethodAlgorithmName()); + } + + public void testGetCanonicalizationAlgorithmName() + { + // Element is missing in config file, check if default value is returned + assertEquals( + Constants.C14N_URI, + provider_.getCanonicalizationAlgorithmName()); + } + + public void testGetHardwareCryptoModules() + { + // No hardware crypto modules in config file, check for empty list + List hwcms = provider_.getHardwareCryptoModules(); + assertEquals(0, hwcms.size()); + } + + public void testGetHardwareKeyModules() + { + List hwkms = provider_.getHardwareKeyModules(); + assertEquals(1, hwkms.size()); + } + + public void testGetSoftwareKeyModules() + { + // No software key modules in config file, check for empty list + List swkms = provider_.getSoftwareKeyModules(); + assertEquals(0, swkms.size()); + } + + public void testGetChainingMode() throws RFC2253NameParserException + { + // Default Chaining Mode not set in configuration, check for default value + X509Certificate cert = new X509Certificate(); + RFC2253NameParser parser = new RFC2253NameParser("CN=Unknown"); + Name name = parser.parse(); + cert.setIssuerDN(name); + cert.setSerialNumber(BigInteger.valueOf(0)); + assertEquals(ChainingModes.PKIX_MODE, provider_.getChainingMode(cert)); + } + + public void testGetDistributionPoints() throws RFC2253NameParserException + { + // Element is missing in config file, check if emty list is returned + X509Certificate cert = new X509Certificate(); + RFC2253NameParser parser = new RFC2253NameParser("CN=DP1_Issuer"); + Name name = parser.parse(); + cert.setIssuerDN(name); + + Set dps = provider_.getDistributionPoints(cert); + assertEquals(0, dps.size()); + } + + public void testGetCRLArchiveDuration() + { + // Element is missing in config file, check if default value is returned + assertEquals(0, provider_.getCRLArchiveDuration()); + } + + public void testGetEnableRevocationArchiving() + { + // Element is missing in config file, check if default value is returned + assertFalse(provider_.getEnableRevocationArchiving()); + } + + public void testGetCertStoreLocation() + { + // Element is missing in config file, check if default value is returned + assertEquals( + CONFIG_BASE_ + "certstore", + provider_.getCertStoreLocation().replace('\\', '/')); + } + + public void testGetCreateTransformsInfoProfile() + { + // No profile in config file, check for null + Element ctip1 = provider_.getCreateTransformsInfoProfile("CTIP_1"); + assertNull(ctip1); + } + + public void testGetCreateSignatureEnvironmentProfile() + { + // No profile in config file, check for null + Element csep = provider_.getCreateSignatureEnvironmentProfile("CSEP_1"); + assertNull(csep); + } + + public void testGetVerifyTransformsInfoProfile() + { + // No profile in config file, check for null + Element vtip = provider_.getVerifyTransformsInfoProfile("VTIP_1"); + assertNull(vtip); + } + + public void testGetSupplementProfile() + { + // No profile in config file, check for null + Element sp = provider_.getSupplementProfile("SP_1"); + assertNull(sp); + } + + public void testGetTrustProfile() + { + // No trust profiles config file, check for null + TrustProfile tp1 = provider_.getTrustProfile("TP1_Id"); + assertNull(tp1); + } + + public void testGetRevocationArchiveJDBCURL() + { + // Element is missing in config file, check for null + assertNull(provider_.getRevocationArchiveJDBCURL()); + } + + public void testGetRevocationArchiveJDBCDriverClass() + { + // Element is missing in config file, check for null + assertNull(provider_.getRevocationArchiveJDBCDriverClass()); + } + + public void testGetEnableRevocationChecking() + { + // Element is missing in config file, check for default value + assertFalse(provider_.getEnableRevocationChecking()); + } + + public void testGetMaxRevocationAge() + { + // Element is missing in config file, check for default value + assertEquals(0, provider_.getMaxRevocationAge()); + } + + public void testGetServiceOrder() + { + // Element is missing in config file, check for empty array + String[] serviceOrder = provider_.getServiceOrder(); + assertEquals(0, serviceOrder.length); + } + + public void testGetAutoAddCertificates() + { + // Element is missing in config file, check for default value + assertFalse(provider_.getAutoAddCertificates()); + } + + public void testGetUseAuthorityInfoAccess() + { + // Element is missing in config file, check for default value + assertFalse(provider_.getUseAuthorityInfoAccess()); + } +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java new file mode 100644 index 000000000..7da2165cb --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/config/ConfigurationProviderTest3.java @@ -0,0 +1,166 @@ +package test.at.gv.egovernment.moa.spss.server.config; + +import iaik.asn1.structures.Name; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; +import iaik.x509.X509Certificate; + +import java.util.List; +import java.util.Set; + +import junit.framework.TestCase; + +import org.w3c.dom.Element; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationException; +import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; +import at.gv.egovernment.moa.util.Constants; + +/** + * @author Gregor Karlinger + * @version $Id$ + */ +public class ConfigurationProviderTest3 extends TestCase +{ + private static final String CONFIG_BASE_ = + "e:/cio/projekte/basismodule/wartung/projekt/spss.server/res/test/resources/config/"; + + static at.gv.egovernment.moa.spss.server.config.ConfigurationProvider provider_; + + static + { + System.setProperty( + "log4j.configuration", + "file:/" + CONFIG_BASE_ + "log4j.properties"); + System.setProperty( + at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.CONFIG_PROPERTY_NAME, + CONFIG_BASE_ + "moa.sp.noopts-config.xml"); + try + { + ConfigurationProvider.reload(); + provider_ = at.gv.egovernment.moa.spss.server.config.ConfigurationProvider.getInstance(); + } + catch (ConfigurationException e) + { + throw new RuntimeException("Fehler beim Setup des Tests: " + e.getMessage()); + } + } + + /** + * Constructor for ConfigurationProvider. + * @param arg0 + */ + public ConfigurationProviderTest3() throws MOAException + { + super("ConfigurationProvider"); + } + + public void testGetWarnings() + { + // 3 Warnings should be collected: C14N not found, DigestMethod not found, ArchiveDuration not found + assertEquals(3, provider_.getWarnings().size()); + } + + public void testGetDigestMethodAlgorithmName() + { + // Element is missing in config file, check if default value is returned + assertEquals( + Constants.SHA1_URI, + provider_.getDigestMethodAlgorithmName()); + } + + public void testGetCanonicalizationAlgorithmName() + { + // Element is missing in config file, check if default value is returned + assertEquals( + Constants.C14N_URI, + provider_.getCanonicalizationAlgorithmName()); + } + + public void testGetHardwareCryptoModules() + { + // No hardware crypto modules in config file, check for empty list + List hwcms = provider_.getHardwareCryptoModules(); + assertEquals(0, hwcms.size()); + } + + public void testGetHardwareKeyModules() + { + // No hardware key modules in config file, check for empty list + List hwkms = provider_.getHardwareKeyModules(); + assertEquals(0, hwkms.size()); + } + + public void testGetSoftwareKeyModules() + { + // No software key modules in config file, check for empty list + List swkms = provider_.getSoftwareKeyModules(); + assertEquals(0, swkms.size()); + } + + public void testGetDistributionPoints() throws RFC2253NameParserException + { + // No distribution points in config file, check for emtpy set + X509Certificate cert = new X509Certificate(); + RFC2253NameParser parser = new RFC2253NameParser("CN=DP1_Issuer"); + Name name = parser.parse(); + cert.setIssuerDN(name); + + Set dps = provider_.getDistributionPoints(cert); + assertEquals(0, dps.size()); + } + + public void testGetCRLArchiveDuration() + { + // No archive duration in config file, check for default value + assertEquals(0, provider_.getCRLArchiveDuration()); + } + + public void testGetCreateTransformsInfoProfile() + { + // No profile in config file, check for null + Element ctip1 = provider_.getCreateTransformsInfoProfile("CTIP_1"); + assertNull(ctip1); + } + + public void testGetCreateSignatureEnvironmentProfile() + { + // No profile in config file, check for null + Element csep = provider_.getCreateSignatureEnvironmentProfile("CSEP_1"); + assertNull(csep); + } + + public void testGetVerifyTransformsInfoProfile() + { + // No profile in config file, check for null + Element vtip = provider_.getVerifyTransformsInfoProfile("VTIP_1"); + assertNull(vtip); + } + + public void testGetSupplementProfile() + { + // No profile in config file, check for null + Element sp = provider_.getSupplementProfile("SP_1"); + assertNull(sp); + } + + public void testGetRevocationArchiveJDBCURL() + { + // No archive in config file, check for null + assertNull(provider_.getRevocationArchiveJDBCURL()); + } + + public void testGetRevocationArchiveJDBCDriverClass() + { + // No archive in config file, check for null + assertNull(provider_.getRevocationArchiveJDBCDriverClass()); + } + + public void testGetServiceOrder() + { + // Element is missing in config file, check for empty array + String[] serviceOrder = provider_.getServiceOrder(); + assertEquals(0, serviceOrder.length); + } +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java new file mode 100644 index 000000000..be1090e4a --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/ConfigurationDataImplTest.java @@ -0,0 +1,149 @@ +package test.at.gv.egovernment.moa.spss.server.iaik.config; + +import java.io.FileInputStream; +import java.security.KeyStore; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import iaik.asn1.structures.DistributionPoint; +import iaik.pki.PKIConfiguration; +import iaik.pki.pathvalidation.ChainingModes; +import iaik.pki.pathvalidation.ValidationConfiguration; +import iaik.pki.revocation.CRLDistributionPoint; +import iaik.pki.revocation.RevocationConfiguration; +import iaik.pki.store.certstore.CertStoreConfiguration; +import iaik.pki.store.certstore.CertStoreTypes; +import iaik.pki.store.revocation.archive.ArchiveConfiguration; +import iaik.pki.store.revocation.archive.db.DataBaseArchiveParameter; +import iaik.server.ConfigurationData; +import iaik.server.modules.keys.HardwareKeyModuleConfiguration; +import iaik.server.modules.keys.SoftwareKeyModuleConfiguration; + +import at.gv.egovernment.moa.spss.server.iaik.config.ConfigurationDataImpl; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * Tests the ConfigurationDataImpl. + * + * @author Patrick Peck + * @version $Id$ + */ +public class ConfigurationDataImplTest extends SPSSTestCase { + + private ConfigurationData config; + private X509Certificate iaikCert; + + public ConfigurationDataImplTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + TransactionContext context; + + setUpTransactionContext(); + context = TransactionContextManager.getInstance().getTransactionContext(); + + config = new ConfigurationDataImpl(context.getConfiguration()); + + KeyStore ks = KeyStore.getInstance("JKS", "SUN"); + ks.load( + new FileInputStream(TESTDATA_ROOT + "security/server.keystore"), + "changeit".toCharArray()); + + CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); + Collection certs = + certFactory.generateCertificates( + new FileInputStream( + TESTDATA_ROOT + + "conf/moa-spss/trustprofiles/TrustProfile1/IAIKRoot.cer")); + iaikCert = (X509Certificate) certs.toArray()[0]; + + } + + public void testGetPKIConfiguration() { + PKIConfiguration pkiConfig = config.getPKIConfiguration(); + ArchiveConfiguration archiveConfig = pkiConfig.getArchiveConfiguration(); + CertStoreConfiguration certStoreConfig = + pkiConfig.getCertStoreConfiguration(); + RevocationConfiguration revocationConfig = + pkiConfig.getRevocationConfiguration(); + ValidationConfiguration validationConfig = + pkiConfig.getValidationConfiguration(); + DataBaseArchiveParameter archiveParam; + Set distributionPoints; + Iterator iter; + boolean found; + + // test archive parameters + archiveParam = + (DataBaseArchiveParameter) archiveConfig.getArchiveParameters(); + assertEquals( + archiveParam.getJDBCUrl(), + "jdbc:postgresql://10.16.46.108/moa?user=moa&password=moatest"); + + // test cert store configuration + assertEquals(1, certStoreConfig.getParameters().length); + assertEquals( + CertStoreTypes.DIRECTORY, + certStoreConfig.getParameters()[0].getType()); + + // test revocation configuration + distributionPoints = + revocationConfig.getAlternativeDistributionPoints(iaikCert, null, new Date()); + assertEquals(3, distributionPoints.size()); + found = false; + for (iter = distributionPoints.iterator(); iter.hasNext();) { + CRLDistributionPoint dp = (CRLDistributionPoint) iter.next(); + if (dp.getUri().equals("http://www.iaik.at/testCA/iaik_test_sig.crl")) { + found = + dp.getReasonCodes() + == (DistributionPoint.keyCompromise + | DistributionPoint.affiliationChanged); + } + } + assertTrue(found); + + // test validation configuration + assertEquals( + ChainingModes.PKIX_MODE, + validationConfig.getChainingMode(iaikCert)); + } + + /* + public void testGetCryptoModuleConfigurations() { + List cryptoConfigs = config.getCryptoModuleConfigurations(); + HardwareCryptoModuleConfiguration moduleConfig; + + assertEquals(2, cryptoConfigs.size()); + moduleConfig = (HardwareCryptoModuleConfiguration) cryptoConfigs.get(0); + assertEquals("Module1", moduleConfig.getModuleName()); + assertEquals("Slot1", moduleConfig.getSlotID()); + assertEquals("PIN1", new String(moduleConfig.getUserPIN())); + } + */ + + public void testGetKeyModuleConfigurations() { + List keyConfigs = config.getKeyModuleConfigurations(); + HardwareKeyModuleConfiguration hwKey; + SoftwareKeyModuleConfiguration swKey; + + assertEquals(7, keyConfigs.size()); + hwKey = (HardwareKeyModuleConfiguration) keyConfigs.get(0); + assertEquals("cryptoki.dll", hwKey.getModuleName()); + assertEquals("0", hwKey.getSlotID()); + assertEquals("0000", new String(hwKey.getUserPIN())); + swKey = (SoftwareKeyModuleConfiguration) keyConfigs.get(1); + assertEquals( + "buergerkarte", + new String(swKey.getKeyStoreAuthenticationData())); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java new file mode 100644 index 000000000..3b403dc19 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfiguratorTest.java @@ -0,0 +1,36 @@ +package test.at.gv.egovernment.moa.spss.server.iaik.config; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.spss.server.iaik.config.IaikConfigurator; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; + +/** + * Tests the IaikConfigurator. + * + * @author Patrick Peck + * @version $Id$ + */ +public class IaikConfiguratorTest extends SPSSTestCase { + + public IaikConfiguratorTest(String name) { + super(name); + } + + /** + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUpTransactionContext(); + } + + public void testConfigure() throws Exception { + IaikConfigurator configurator = new IaikConfigurator(); + TransactionContext context = + TransactionContextManager.getInstance().getTransactionContext(); + + configurator.configure(context.getConfiguration()); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java new file mode 100644 index 000000000..65fa2bf72 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/AllTests.java @@ -0,0 +1,25 @@ +package test.at.gv.egovernment.moa.spss.server.invoke; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Runs all tests in this package. + * + * @author Patrick Peck + * @version $Id$ + */ +public class AllTests { + public static Test suite() { + TestSuite suite = new TestSuite(); + + suite.addTestSuite(DataObjectFactoryTest.class); + suite.addTestSuite(TransformationFactoryTest.class); + suite.addTestSuite(XMLSignatureCreationInvokerTest.class); + suite.addTestSuite(CMSSignatureVerificationInvokerTest.class); + suite.addTestSuite(XMLSignatureVerificationInvokerTest.class); + + return suite; + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java new file mode 100644 index 000000000..3024730f4 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/CMSSignatureVerificationInvokerTest.java @@ -0,0 +1,63 @@ +package test.at.gv.egovernment.moa.spss.server.invoke; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.util.DOMUtils; + +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureRequest; +import at.gv.egovernment.moa.spss.api.cmsverify.VerifyCMSSignatureResponse; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyCMSSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.server.invoke.CMSSignatureVerificationInvoker; + +/** + * Mainly a smoke test for debugging the CMSSignatureVerificationInvoker. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CMSSignatureVerificationInvokerTest extends SPSSTestCase { + private static final String TESTDATA_BASE = + TESTDATA_ROOT + "xml/VerifyCMSSignature/"; + + /** + * Constructor for CMSSignatureVerificationInvokerTest. + * @param name + */ + public CMSSignatureVerificationInvokerTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + setUpTransactionContext(); + setUpLoggingContext(); + setUpIaikConfiguration(); + } + + public void testVerifyCMSSignature() throws Exception { + try { + CMSSignatureVerificationInvoker invoker = + CMSSignatureVerificationInvoker.getInstance(); + VerifyCMSSignatureRequestParser requestParser = + new VerifyCMSSignatureRequestParser(); + Document doc = + SPSSTestCase.parseXmlValidating( + TESTDATA_BASE + "TestGeneratorVC0.001.Req.xml"); + VerifyCMSSignatureRequest request = + requestParser.parse(doc.getDocumentElement()); + VerifyCMSSignatureResponse response = invoker.verifyCMSSignature(request); + VerifyCMSSignatureResponseBuilder responseBuilder = + new VerifyCMSSignatureResponseBuilder(); + Element result = responseBuilder.build(response).getDocumentElement(); + + System.out.println(DOMUtils.serializeNode(result)); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java new file mode 100644 index 000000000..7de2add33 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java @@ -0,0 +1,180 @@ +package test.at.gv.egovernment.moa.spss.server.invoke; + +import java.io.InputStream; +import java.security.Security; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import iaik.server.modules.xml.BinaryDataObject; +import iaik.server.modules.xml.DataObject; +import iaik.server.modules.xml.XMLDataObject; + +import at.gv.egovernment.moa.util.Base64Utils; + +import at.gv.egovernment.moa.spss.MOAException; +import at.gv.egovernment.moa.spss.api.SPSSFactory; +import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.server.iaik.xml.ByteArrayDataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.ByteStreamDataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XMLDataObjectImpl; +import at.gv.egovernment.moa.spss.server.iaik.xml.XMLNodeListDataObjectImpl; +import at.gv.egovernment.moa.spss.server.invoke.DataObjectFactory; + +/** + * Test cases for the DataObjectFactory class. + * + * @author Patrick Peck + * @version $Id$ + */ +public class DataObjectFactoryTest extends SPSSTestCase { + + private static final String HTTP_BINARY_CONTENT_URL = "http://www.google.com"; + private static final String HTTP_XML_CONTENT_URL = + "http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"; + private static final String HTTPS_BINARY_CONTENT_URL = + "https://businessnet.ba-ca.com"; + private static final String HTTPS_UNTRUSTED_URL = + "https://heribert.anecon.com"; + private static final String HTTP_UNKNOWN_HOST_URL = "http://uurjmjmruuw.com"; + private static final String MALFORMED_URL = "//hsld///ddd"; + private static final String FILE_BINARY_CONTENT_URL = "file:/C:/boot.ini"; + private static final String XML_CONTENT = + "" + + " " + + " " + + ""; + private static final String BASE64_CONTENT = "U3Zlbg=="; + + private SPSSFactory spssFactory = SPSSFactory.getInstance(); + private DataObjectFactory factory; + + /** + * Constructor for DataObjectFactoryTest. + * @param name + */ + public DataObjectFactoryTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + factory = DataObjectFactory.getInstance(); + + // set up SSL + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + System.setProperty( + "java.protocol.handler.pkgs", + "com.sun.net.ssl.internal.www.protocol"); + /* + System.setProperty( + "javax.net.ssl.keyStore", + "data/test/security/client.keystore"); + System.setProperty("javax.net.ssl.keyStorePassword", "changeit"); + System.setProperty( + "javax.net.ssl.trustStore", + "data/test/security/client.keystore"); + System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); + */ + } + + public void testCreateFromURIWithBinaryHttp() throws Exception { + DataObject dataObject = + factory.createFromURI(HTTP_BINARY_CONTENT_URL, false); + + assertNotNull(dataObject); + assertTrue(dataObject instanceof ByteStreamDataObjectImpl); + assertNotNull(((BinaryDataObject) dataObject).getInputStream()); + } + + public void testCreateFromURIWithXmlHttp() throws Exception { + DataObject dataObject = factory.createFromURI(HTTP_XML_CONTENT_URL, false); + Element element; + + assertNotNull(dataObject); + assertTrue(dataObject instanceof XMLDataObjectImpl); + element = ((XMLDataObject) dataObject).getElement(); + assertNotNull(element); + assertEquals("schema", element.getTagName()); + } + + public void testCreateFromURIWithMalformedURI() throws Exception { + try { + factory.createFromURI(MALFORMED_URL, false); + fail(); + } catch (MOAException e) { + } + } + + public void testCreateFromURIWithNonExistingHttpURL() throws Exception { + try { + factory.createFromURI(HTTP_UNKNOWN_HOST_URL, false); + fail(); + } catch (MOAException e) { + } + } + + public void testCreateFromURIWithHttps() throws Exception { + DataObject dataObject = + factory.createFromURI(HTTPS_BINARY_CONTENT_URL, false); + assertNotNull(dataObject); + assertTrue(dataObject instanceof BinaryDataObject); + } + + public void testCreateFromURIWithUntrustedHttps() throws Exception { + try { + factory.createFromURI(HTTPS_UNTRUSTED_URL, false); + fail(); + } catch (MOAException e) { + + } + } + + public void testCreateFromURIWithFile() throws Exception { + try { + factory.createFromURI(FILE_BINARY_CONTENT_URL, false); + fail(); + } catch (MOAException e) { + } + } + + public void testCreateFromContentOptionalRefTypeWithXmlContent() + throws Exception { + Document doc = parseXmlString(XML_CONTENT); + Content content = + spssFactory.createContent( + doc.getDocumentElement().getChildNodes(), + "http://data"); + DataObject dataObject = + factory.createFromContentOptionalRefType( + content, + null, + null, + true, + false, + true, + false); + + assertTrue(dataObject instanceof XMLNodeListDataObjectImpl); + } + + public void testCreateFromContentOptionalRefTypeWithBase64Content() + throws Exception { + InputStream is = Base64Utils.decodeToStream(BASE64_CONTENT, true); + Content content = spssFactory.createContent(is, "http://data"); + DataObject dataObject = + factory.createFromContentOptionalRefType( + content, + null, + null, + false, + false, + true, + false); + + assertNotNull(dataObject); + assertTrue(dataObject instanceof ByteArrayDataObjectImpl); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java new file mode 100644 index 000000000..13a80cbf1 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/TransformationFactoryTest.java @@ -0,0 +1,201 @@ +package test.at.gv.egovernment.moa.spss.server.invoke; + +import java.util.List; +import java.util.Map; + +import org.w3c.dom.Document; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import iaik.ixsil.init.IXSILInit; +import iaik.ixsil.util.URI; +import iaik.server.modules.xml.Base64Transformation; +import iaik.server.modules.xml.Canonicalization; +import iaik.server.modules.xml.EnvelopedSignatureTransformation; +import iaik.server.modules.xml.Transformation; +import iaik.server.modules.xml.XPath2Transformation; +import iaik.server.modules.xml.XPathTransformation; +import iaik.server.modules.xml.XSLTTransformation; + +import at.gv.egovernment.moa.util.Constants; + +import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.api.common.Transform; +import at.gv.egovernment.moa.spss.api.xmlbind.TransformParser; +import at.gv.egovernment.moa.spss.server.invoke.TransformationFactory; + +/** + * Test cases for the TransformationFactory class. + * + * @author Patrick Peck + * @version $Id$ + */ +public class TransformationFactoryTest extends SPSSTestCase { + + private static final String TESTDATA_BASE = + TESTDATA_ROOT + "xml/dsigTransform/"; + private TransformationFactory factory = TransformationFactory.getInstance(); + private TransformParser transformParser = new TransformParser(); + + /** + * Constructor for TransformationFactoryTest. + * @param name + */ + public TransformationFactoryTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + IXSILInit.init(new URI("init/properties/init.properties")); + //IXSILInit.init(new URI("file:data/deploy/ixsil/init/properties/init.properties")); + + } + + public void testCreateCanonicalization() throws Exception { + Document transform = parseXml(TESTDATA_BASE + "canonicalization.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + Transformation t = factory.createTransformation(tr); + + assertTrue(t instanceof Canonicalization); + assertEquals( + "http://www.w3.org/TR/2001/REC-xml-c14n-20010315", + t.getAlgorithmURI()); + } + + public void testCreateCanonicalizationWithComments() throws Exception { + Document transform = + parseXml(TESTDATA_BASE + "canonicalizationWithComments.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + Transformation t = factory.createTransformation(tr); + + assertTrue(t instanceof Canonicalization); + assertEquals( + "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments", + t.getAlgorithmURI()); + } + + public void testCreateBase64Decode() throws Exception { + Document transform = parseXml(TESTDATA_BASE + "base64.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + Transformation t = factory.createTransformation(tr); + assertTrue(t instanceof Base64Transformation); + } + + public void testCreateEnvelopedSignature() throws Exception { + Document transform = parseXml(TESTDATA_BASE + "enveloped.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + Transformation t = factory.createTransformation(tr); + assertTrue(t instanceof EnvelopedSignatureTransformation); + } + + public void testXPathTransformation() throws Exception { + Document transform = parseXml(TESTDATA_BASE + "xpath.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + Transformation t = factory.createTransformation(tr); + Map nsDecls; + + assertTrue(t instanceof XPathTransformation); + nsDecls = ((XPathTransformation) t).getNamespaceDeclarations(); + assertEquals(1, nsDecls.size()); + assertEquals(Constants.DSIG_NS_URI, nsDecls.get("dsig")); + } + + public void testCreateXPath2Transformation() throws Exception { + Document transform = parseXml(TESTDATA_BASE + "xpath2.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + Transformation t = factory.createTransformation(tr); + assertTrue(t instanceof XPath2Transformation); + } + + public void testCreateXSLTTransformation() throws Exception { + Document transform = parseXml(TESTDATA_BASE + "xslt.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + XSLTTransformation t = + (XSLTTransformation) factory.createTransformation(tr); + assertNotNull(t.getStylesheetElement()); + } + + public void testCreateWithIllegalAlgorithm() throws Exception { + try { + Document transform = parseXml(TESTDATA_BASE + "illegalAlgorithm.xml"); + Transform tr = + transformParser.parseTransform(transform.getDocumentElement()); + factory.createTransformation(tr); + fail(); + } catch (MOAApplicationException e) { + } + } + + public void testEqualsXslt() throws Exception { + Document xslt = parseXml(TESTDATA_BASE + "xslt.xml"); + Transform tr = transformParser.parseTransform(xslt.getDocumentElement()); + Transformation trXslt = factory.createTransformation(tr); + + Document xsltEqu = parseXml(TESTDATA_BASE + "xsltEqual.xml"); + tr = transformParser.parseTransform(xsltEqu.getDocumentElement()); + Transformation trXsltEqu = factory.createTransformation(tr); + + Document xsltDiff = parseXml(TESTDATA_BASE + "xsltDifferent.xml"); + tr = transformParser.parseTransform(xsltDiff.getDocumentElement()); + Transformation trXsltDiff = factory.createTransformation(tr); + + Document canonicalization = + parseXml(TESTDATA_BASE + "canonicalization.xml"); + + assertTrue(trXslt.equals(trXsltEqu)); + assertFalse(trXslt.equals(trXsltDiff)); + assertFalse(trXsltEqu.equals(trXsltDiff)); + assertEquals(trXslt.hashCode(), trXsltEqu.hashCode()); + assertFalse(trXslt.hashCode() == trXsltDiff.hashCode()); + assertFalse(trXsltEqu.hashCode() == trXsltDiff.hashCode()); + assertFalse(trXslt.equals(canonicalization)); + } + + public void testEqualsXPath() throws Exception { + Document xpath = parseXml(TESTDATA_BASE + "xpath.xml"); + Transform tr = transformParser.parseTransform(xpath.getDocumentElement()); + Transformation trXpath = factory.createTransformation(tr); + Transformation trXpathEqu = factory.createTransformation(tr); + + Document xpathDiff = parseXml(TESTDATA_BASE + "xpathDifferent.xml"); + tr = transformParser.parseTransform(xpathDiff.getDocumentElement()); + Transformation trXpathDiff = factory.createTransformation(tr); + + assertTrue(trXpath.equals(trXpathEqu)); + assertEquals(trXpath.hashCode(), trXpathEqu.hashCode()); + assertFalse(trXpath.equals(trXpathDiff)); + assertFalse(trXpath.hashCode() == trXpathDiff.hashCode()); + } + + public void testEqualsXPath2() throws Exception { + Document xpath2 = parseXml(TESTDATA_BASE + "xpath2.xml"); + Transform tr = transformParser.parseTransform(xpath2.getDocumentElement()); + Transformation trXpath2 = factory.createTransformation(tr); + Transformation trXpath2Equ = factory.createTransformation(tr); + + Document xpath2Diff = parseXml(TESTDATA_BASE + "xpath2Different.xml"); + tr = transformParser.parseTransform(xpath2Diff.getDocumentElement()); + Transformation trXpath2Diff = factory.createTransformation(tr); + + assertTrue(trXpath2.equals(trXpath2Equ)); + assertEquals(trXpath2.hashCode(), trXpath2Equ.hashCode()); + assertFalse(trXpath2.equals(trXpath2Diff)); + assertFalse(trXpath2.hashCode() == trXpath2Diff.hashCode()); + } + + public void testCreateTransformationList() throws Exception { + Document transforms = parseXml(TESTDATA_BASE + "transforms.xml"); + List trs = transformParser.parseTransforms(transforms.getDocumentElement()); + List transformationList = factory.createTransformationList(trs); + + assertEquals(3, transformationList.size()); + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java new file mode 100644 index 000000000..28cd3805a --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvokerTest.java @@ -0,0 +1,63 @@ +package test.at.gv.egovernment.moa.spss.server.invoke; + +import java.util.Collections; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.util.DOMUtils; + +import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.CreateXMLSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; +import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureCreationInvoker; + +/** + * Mainly a smoke test for debugging the XMLSignatureCreationInvoker. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureCreationInvokerTest extends SPSSTestCase { + private static final String TESTDATA_BASE = + TESTDATA_ROOT + "xml/CreateXMLSignature/"; + + public XMLSignatureCreationInvokerTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + setUpTransactionContext(); + setUpLoggingContext(); + setUpIaikConfiguration(); + setUpSSL(); + } + + public void testCreateXMLSignature() throws Exception { + try { + XMLSignatureCreationInvoker invoker = + XMLSignatureCreationInvoker.getInstance(); + CreateXMLSignatureRequestParser requestParser = + new CreateXMLSignatureRequestParser(); + Document doc = + SPSSTestCase.parseXmlValidating( + TESTDATA_BASE + "TestGeneratorCX2.004.Req.xml"); + CreateXMLSignatureRequest request = + requestParser.parse(doc.getDocumentElement()); + CreateXMLSignatureResponse response = + invoker.createXMLSignature(request, Collections.EMPTY_SET); + CreateXMLSignatureResponseBuilder responseBuilder = + new CreateXMLSignatureResponseBuilder(); + Element result = responseBuilder.build(response).getDocumentElement(); + + System.out.println(DOMUtils.serializeNode(result)); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java new file mode 100644 index 000000000..56e3d541b --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureVerificationInvokerTest.java @@ -0,0 +1,61 @@ +package test.at.gv.egovernment.moa.spss.server.invoke; + +import org.w3c.dom.Document; + +import test.at.gv.egovernment.moa.spss.SPSSTestCase; + +import at.gv.egovernment.moa.util.DOMUtils; + +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; +import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureResponseBuilder; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureRequest; +import at.gv.egovernment.moa.spss.api.xmlverify.VerifyXMLSignatureResponse; +import at.gv.egovernment.moa.spss.server.invoke.XMLSignatureVerificationInvoker; + +/** + * Mainly a smoke test for debugging the XMLSignatureVerificationInvoker. + * + * @author Patrick Peck + * @version $Id$ + */ +public class XMLSignatureVerificationInvokerTest extends SPSSTestCase { + private static final String TESTDATA_BASE = + TESTDATA_ROOT + "xml/VerifyXMLSignature/"; + + public XMLSignatureVerificationInvokerTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + setUpTransactionContext(); + setUpLoggingContext(); + setUpIaikConfiguration(); + } + + public void testVerifyXMLSignature() throws Exception { + try { + XMLSignatureVerificationInvoker invoker = + XMLSignatureVerificationInvoker.getInstance(); + VerifyXMLSignatureRequestParser requestParser = + new VerifyXMLSignatureRequestParser(); + VerifyXMLSignatureResponseBuilder responseBuilder = + new VerifyXMLSignatureResponseBuilder(); + Document doc = + SPSSTestCase.parseXmlValidating( + TESTDATA_BASE + "TestGeneratorVX.201.Req.xml"); + + VerifyXMLSignatureRequest request = + requestParser.parse(doc.getDocumentElement()); + VerifyXMLSignatureResponse response; + + response = invoker.verifyXMLSignature(request); + System.out.println( + DOMUtils.serializeNode(responseBuilder.build(response))); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + + +} diff --git a/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java new file mode 100644 index 000000000..b46c20086 --- /dev/null +++ b/spss/server/serverlib/src/test/at/gv/egovernment/moa/spss/server/tools/CertToolTest.java @@ -0,0 +1,50 @@ +package test.at.gv.egovernment.moa.spss.server.tools; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import at.gv.egovernment.moa.spss.server.tools.CertTool; + +import test.at.gv.egovernment.moa.MOATestCase; + +/** + * Tests for the CertTool. + * + * @author Patrick Peck + * @version $Id$ + */ +public class CertToolTest extends MOATestCase { + + private static final String EXPECTED_RESULT = + "SubjectDN (RFC2253):" + + " CN=Patrick Peck,OU=MOA Team,O=BRZ,L=Vienna,ST=Vienna,C=AT\r\n" + + "IssuerDN (RFC2253) :" + + " CN=Patrick Peck,OU=MOA Team,O=BRZ,L=Vienna,ST=Vienna,C=AT\r\n" + + "Serial Number :" + + " 1047548672\r\n"; + private CertTool certTool; + + /** + * Constructor for CertToolTest. + * @param name + */ + public CertToolTest(String name) { + super(name); + } + + protected void setUp() { + certTool = new CertTool(); + } + + public void testPrintCertInfo() { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(bos); + String result; + + certTool.printCertInfo(TESTDATA_ROOT + "security/server.cer", ps); + result = new String(bos.toByteArray()); + System.out.println(result); + assertEquals(EXPECTED_RESULT, result); + } + +} diff --git a/spss/server/serverws/spec/MOA-SPSS-1.3.doc b/spss/server/serverws/spec/MOA-SPSS-1.3.doc new file mode 100644 index 000000000..fabc4248e Binary files /dev/null and b/spss/server/serverws/spec/MOA-SPSS-1.3.doc differ diff --git a/spss/server/serverws/src/main/webapp/WEB-INF/server-config.wsdd b/spss/server/serverws/src/main/webapp/WEB-INF/server-config.wsdd new file mode 100644 index 000000000..088fe76fd --- /dev/null +++ b/spss/server/serverws/src/main/webapp/WEB-INF/server-config.wsdd @@ -0,0 +1,48 @@ + + + + + + + + + + + http://reference.e-government.gv.at/namespace/moa/20020822# + + + /resources/wsdl/MOA-SPSS-1.3.wsdl + + + + + + + + + + http://reference.e-government.gv.at/namespace/moa/20020822# + + + /resources/wsdl/MOA-SPSS-1.3.wsdl + + + + + + + + + + + + + + + + diff --git a/spss/server/serverws/src/main/webapp/WEB-INF/web.xml b/spss/server/serverws/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..b68ee850e --- /dev/null +++ b/spss/server/serverws/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,55 @@ + + + + + + MOA SP-SS + MOA Signature Creation and Verification Services + + ConfigurationServlet + MOA Configuration Servlet + + at.gv.egovernment.moa.spss.server.service.ConfigurationServlet + + 0 + + + AxisServlet + Apache-Axis Servlet + + org.apache.axis.transport.http.AxisServlet + + + + AxisServlet + /services/* + + + ConfigurationServlet + /ConfigurationUpdate + + + + + ConfigurationUpdate + /ConfigurationUpdate + + + moa-admin + + + + + BASIC + UserDatabase + + + + + The role that is required to log in to the moa Application + + moa-admin + + diff --git a/spss/server/serverws/tools/ConfigurationMapper.xsl b/spss/server/serverws/tools/ConfigurationMapper.xsl new file mode 100644 index 000000000..fd47cbf84 --- /dev/null +++ b/spss/server/serverws/tools/ConfigurationMapper.xsl @@ -0,0 +1,343 @@ + + + + + + + + MOA SPSS 1.3 Configuration File created by MOA SPSS Configuration Mapper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.w3.org/TR/2001/REC-xml-c14n-20010315 + + + + + + + + http://www.w3.org/2000/09/xmldsig#sha1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pkix + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CRL + OCSP + + + + + + + + + + + + + + 365 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + + + unused + + + keyCompromise + + + cACompromise + + + affiliationChanged + + + superseded + + + cessationOfOperation + + + certificateHold + + + privilegeWithdrawn + + + aACompromise + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3