aboutsummaryrefslogtreecommitdiff
path: root/DocumentService
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2014-06-05 19:39:27 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2014-06-05 19:39:27 +0200
commitdccc8304cbe2b10ddb703fa52895dbc09dd70643 (patch)
tree323ac614040c26e0944c215e33cdc8373e995ae5 /DocumentService
parentf81b3716ac27094ab1845668cb38a1fe6a2d5f8c (diff)
downloadmoa-id-spss-dccc8304cbe2b10ddb703fa52895dbc09dd70643.tar.gz
moa-id-spss-dccc8304cbe2b10ddb703fa52895dbc09dd70643.tar.bz2
moa-id-spss-dccc8304cbe2b10ddb703fa52895dbc09dd70643.zip
DTL support added (incoming)
Diffstat (limited to 'DocumentService')
-rw-r--r--DocumentService/pom.xml9
-rw-r--r--DocumentService/src/eu/stork/documentservice/DocumentServiceImpl.java2
-rw-r--r--DocumentService/src/eu/stork/documentservice/utils/Bootstrap.java31
-rw-r--r--DocumentService/src/eu/stork/documentservice/utils/GetDSSFileAction.java15
4 files changed, 53 insertions, 4 deletions
diff --git a/DocumentService/pom.xml b/DocumentService/pom.xml
index c93a901ca..be2252137 100644
--- a/DocumentService/pom.xml
+++ b/DocumentService/pom.xml
@@ -69,6 +69,15 @@
<version>2.2.8</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.4.01</version>
+</dependency>
+<!-- <dependency> -->
+<!-- <groupId>org.opensaml</groupId> -->
+<!-- <artifactId>opensaml</artifactId> -->
+<!-- </dependency> -->
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
diff --git a/DocumentService/src/eu/stork/documentservice/DocumentServiceImpl.java b/DocumentService/src/eu/stork/documentservice/DocumentServiceImpl.java
index 74519dfee..913c2f704 100644
--- a/DocumentService/src/eu/stork/documentservice/DocumentServiceImpl.java
+++ b/DocumentService/src/eu/stork/documentservice/DocumentServiceImpl.java
@@ -29,7 +29,7 @@ public class DocumentServiceImpl implements DocumentService
private DatabaseConnector conn;
private Properties props = new Properties();
private static final Logger LOG = Logger.getLogger(DocumentServiceImpl.class.getName());
-
+
@Override
public String addDocument(byte[] document, String xmlRequest, String destinationCountry, String SpId, String mimeType, String receiverCert) {
String returnMessage = "";
diff --git a/DocumentService/src/eu/stork/documentservice/utils/Bootstrap.java b/DocumentService/src/eu/stork/documentservice/utils/Bootstrap.java
new file mode 100644
index 000000000..72da74e52
--- /dev/null
+++ b/DocumentService/src/eu/stork/documentservice/utils/Bootstrap.java
@@ -0,0 +1,31 @@
+package eu.stork.documentservice.utils;
+
+import org.opensaml.DefaultBootstrap;
+import org.opensaml.xml.ConfigurationException;
+
+public class Bootstrap extends DefaultBootstrap {
+
+ static boolean initializied = false;
+ public static synchronized void bootstrap() throws ConfigurationException {
+
+ if(!initializied)
+ {
+ initializeXMLSecurity();
+
+ initializeXMLTooling();
+
+// initializeArtifactBuilderFactories();
+//
+// initializeGlobalSecurityConfiguration();
+//
+// initializeParserPool();
+//
+// initializeESAPI();
+ }
+ else
+ {
+ System.out.println("Skipping initialization...");
+ }
+ }
+
+}
diff --git a/DocumentService/src/eu/stork/documentservice/utils/GetDSSFileAction.java b/DocumentService/src/eu/stork/documentservice/utils/GetDSSFileAction.java
index b80c63dc2..2fce0165d 100644
--- a/DocumentService/src/eu/stork/documentservice/utils/GetDSSFileAction.java
+++ b/DocumentService/src/eu/stork/documentservice/utils/GetDSSFileAction.java
@@ -16,6 +16,7 @@ package eu.stork.documentservice.utils;
import org.apache.log4j.Logger;
import org.bouncycastle.util.encoders.UrlBase64;
+import org.opensaml.xml.ConfigurationException;
import eu.stork.peps.auth.commons.IPersonalAttributeList;
import eu.stork.peps.auth.commons.PEPSUtil;
@@ -59,8 +60,10 @@ public final class GetDSSFileAction {
final PersonalAttribute sdoc = pal.get("docRequest");
if (sdoc != null)
{
- String docId = sdoc.getValue().get(0);
- return docId;
+ String docId = sdoc.getValue().get(0);//remove countries from beginning
+ docId = docId.substring(docId.indexOf("/")+1);
+ docId = docId.substring(docId.indexOf('/')+1);
+ return docId.replace("/", "");
}
} catch (final STORKSAMLEngineException e) {
e.printStackTrace();
@@ -73,7 +76,13 @@ public final class GetDSSFileAction {
// fetch the samlToken from the request
final byte[] samlToken = UrlBase64.decode(samlRequest);
-
+ //System.out.println("SAML Engine DokumentService init");
+ try {
+ Bootstrap.bootstrap();
+ } catch (ConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
final STORKSAMLEngine engine = STORKSAMLEngine.getInstance(SAML_INSTANCE);
final STORKAttrQueryRequest attrData= engine.validateSTORKAttrQueryRequest(samlToken);