From 9b787d3409e629f292a98d0b5a0aad036b7421c7 Mon Sep 17 00:00:00 2001 From: mcentner Date: Fri, 17 Aug 2007 08:47:35 +0000 Subject: Improved and updated maven build process. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@919 d688527b-c9ab-4aba-bd8d-4036d912da1d --- spss/server/serverlib/pom.xml | 197 +++++++++++------ .../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 -- .../java/at/gv/egovernment/moa/spss/overview.htm | 155 ------------- .../moa/spss/server/tools/CertTool.java | 242 --------------------- .../moa/spss/server/tools/ConfigTool.java | 59 ----- .../serverlib/src/main/javadoc/overview.html | 155 +++++++++++++ 9 files changed, 282 insertions(+), 616 deletions(-) delete mode 100644 spss/server/serverlib/resources/data/deploy/tools/certtool.bat delete mode 100644 spss/server/serverlib/resources/data/deploy/tools/certtool.sh delete mode 100644 spss/server/serverlib/resources/data/deploy/tools/configtool.bat delete mode 100644 spss/server/serverlib/resources/data/deploy/tools/configtool.sh delete mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/overview.htm delete mode 100644 spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java delete 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/javadoc/overview.html (limited to 'spss/server/serverlib') diff --git a/spss/server/serverlib/pom.xml b/spss/server/serverlib/pom.xml index 50b6fc411..edf27d123 100644 --- a/spss/server/serverlib/pom.xml +++ b/spss/server/serverlib/pom.xml @@ -2,86 +2,70 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> MOA.spss - server + moa-spss 1.4.0 4.0.0 MOA.spss.server - serverlib + moa-spss-lib jar 1.4.0 - MOA SPSS Serverlibrary + MOA SP/SS API - - ${basedir}/../../../buildhelper - + + ${basedir}/../../../repository + axis axis - - saaj - saaj - - - commons-discovery - commons-discovery - + + + + + + + + commons-logging commons-logging - - - - javax.activation activation - - jaxen - jaxen - - - jaxp - dom - - - jaxp - jaxp-api - - - jaxp - sax - + + + + + + + + + + + + + + + + - - org.w3c.dom - dom - - - sax - sax - - - jsse - jsse - - - jsse - jnet - - - jsse - jcert - + + + + + + + + junit junit @@ -112,7 +96,7 @@ iaik.prod - iaik_moa_full + iaik_moa iaik.prod @@ -126,33 +110,106 @@ iaik.prod iaik_ecc + compile iaik.prod iaik_Pkcs11Provider + runtime iaik.prod iaik_Pkcs11Wrapper + runtime - - iaik.win32 - Pkcs11Wrapper - dll - 1.0 - - - MOA - common - - - + + + + + + + MOA - common-test - system - ${basedir}/../../../common-test/target + moa-common + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.2 + + true + false + false + true + at.gv.egovernment.moa.spss.server.*;at.gv.egovernment.moa.spss.api.impl.*;at.gv.egovernment.moa.spss.impl.* + + + pre + a + Preconditions: + + + post + a + Postconfitions: + + + + + API Factory and Services + at.gv.egovernment.moa.spss.api + + + Exceptions + at.gv.egovernment.moa.spss + + + API Objects for Signature Creation + at.gv.egovernment.moa.spss.api.xmlsign + + + API Objects for CMS Signature Verification + at.gv.egovernment.moa.spss.api.cmsverify + + + API Objects for XML Signature Verification + at.gv.egovernment.moa.spss.api.xmlverify + + + Common API Objects + at.gv.egovernment.moa.spss.api.common + + + Builders and Parsers to convert API Objects to and from XML + at.gv.egovernment.moa.spss.api.xmlbind + + + Utilities + at.gv.egovernment.moa.util + at.gv.egovernment.moa.spss.util + + + Logging + at.gv.egovernment.moa.logging + + + http://java.sun.com/j2se/1.4/docs/api/ + + + + generate-javadoc + package + + jar + + + + + + diff --git a/spss/server/serverlib/resources/data/deploy/tools/certtool.bat b/spss/server/serverlib/resources/data/deploy/tools/certtool.bat deleted file mode 100644 index 0504211b8..000000000 --- a/spss/server/serverlib/resources/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/serverlib/resources/data/deploy/tools/certtool.sh b/spss/server/serverlib/resources/data/deploy/tools/certtool.sh deleted file mode 100644 index c7ff374f4..000000000 --- a/spss/server/serverlib/resources/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/serverlib/resources/data/deploy/tools/configtool.bat b/spss/server/serverlib/resources/data/deploy/tools/configtool.bat deleted file mode 100644 index 868df11f0..000000000 --- a/spss/server/serverlib/resources/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/serverlib/resources/data/deploy/tools/configtool.sh b/spss/server/serverlib/resources/data/deploy/tools/configtool.sh deleted file mode 100644 index f7f29bae1..000000000 --- a/spss/server/serverlib/resources/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/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 deleted file mode 100644 index 9b17bbf91..000000000 --- a/spss/server/serverlib/src/main/java/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: -

- -

-

-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: - -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/tools/CertTool.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/tools/CertTool.java deleted file mode 100644 index 9fe17eae2..000000000 --- a/spss/server/serverlib/src/main/java/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: - * - * - * @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 deleted file mode 100644 index d5c3b48c1..000000000 --- a/spss/server/serverlib/src/main/java/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/serverlib/src/main/javadoc/overview.html b/spss/server/serverlib/src/main/javadoc/overview.html new file mode 100644 index 000000000..9b17bbf91 --- /dev/null +++ b/spss/server/serverlib/src/main/javadoc/overview.html @@ -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 -- cgit v1.2.3