From dd43264f702c5e0351cc63835862c55f3e847634 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 29 Oct 2013 12:08:29 +0100 Subject: Some changes --- pdf-as-cli/build.gradle | 1 + .../src/main/java/at/gv/egiz/pdfas/cli/Main.java | 285 +++++++++++++ .../java/at/gv/egiz/pdfas/cli/ModeOfOperation.java | 7 + .../main/resources/messages/cli_args.properties | 1 + .../java/at/gv/egiz/pdfas/wrapper/PdfAsObject.java | 2 +- .../moa/_20020822/ContentOptionalRefType.java | 125 ++++++ .../_20020822/ManifestRefsCheckResultInfoType.java | 0 .../moa/_20020822/PublicAuthorityType.java | 120 ++++++ .../_20020822/VerifyCMSSignatureResponseType.java | 195 +++++++++ .../_20020822/VerifyXMLSignatureResponseType.java | 394 +++++++++++++++++ pdf-as-lib/bin/wsdl/MOA-SPSS-1.3.wsdl | 46 ++ pdf-as-lib/bin/wsdl/MOA-SPSS-1.3.xsd | 469 +++++++++++++++++++++ pdf-as-lib/bin/wsdl/xml.xsd | 146 +++++++ pdf-as-lib/bin/wsdl/xmldsig-core-schema.xsd | 318 ++++++++++++++ pdf-as-lib/build.gradle | 44 ++ .../at/gv/egiz/pdfas/lib/api/PdfAsFactory.java | 7 + .../egiz/pdfas/lib/api/verify/VerifyParameter.java | 5 +- .../egiz/pdfas/lib/impl/VerifyParameterImpl.java | 11 + .../src/main/resources/wsdl/MOA-SPSS-1.3.wsdl | 46 ++ .../src/main/resources/wsdl/MOA-SPSS-1.3.xsd | 469 +++++++++++++++++++++ pdf-as-lib/src/main/resources/wsdl/xml.xsd | 146 +++++++ .../main/resources/wsdl/xmldsig-core-schema.xsd | 318 ++++++++++++++ 22 files changed, 3152 insertions(+), 3 deletions(-) create mode 100644 pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java create mode 100644 pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/ModeOfOperation.java create mode 100644 pdf-as-cli/src/main/resources/messages/cli_args.properties create mode 100644 pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ContentOptionalRefType.java create mode 100644 pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ManifestRefsCheckResultInfoType.java create mode 100644 pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/PublicAuthorityType.java create mode 100644 pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyCMSSignatureResponseType.java create mode 100644 pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyXMLSignatureResponseType.java create mode 100644 pdf-as-lib/bin/wsdl/MOA-SPSS-1.3.wsdl create mode 100644 pdf-as-lib/bin/wsdl/MOA-SPSS-1.3.xsd create mode 100644 pdf-as-lib/bin/wsdl/xml.xsd create mode 100644 pdf-as-lib/bin/wsdl/xmldsig-core-schema.xsd create mode 100644 pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl create mode 100644 pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd create mode 100644 pdf-as-lib/src/main/resources/wsdl/xml.xsd create mode 100644 pdf-as-lib/src/main/resources/wsdl/xmldsig-core-schema.xsd diff --git a/pdf-as-cli/build.gradle b/pdf-as-cli/build.gradle index f66529ec..09de729f 100644 --- a/pdf-as-cli/build.gradle +++ b/pdf-as-cli/build.gradle @@ -16,6 +16,7 @@ dependencies { compile project (':stamper:stmp-itext') compile project (':signature-standards:sigs-pcks7detached') compile group: 'commons-collections', name: 'commons-collections', version: '3.2' + compile group: 'commons-cli', name: 'commons-cli', version: '1.2' testCompile group: 'junit', name: 'junit', version: '4.+' } diff --git a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java new file mode 100644 index 00000000..09f0f9ce --- /dev/null +++ b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/Main.java @@ -0,0 +1,285 @@ +package at.gv.egiz.pdfas.cli; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +import at.gv.egiz.pdfas.common.utils.StreamUtils; +import at.gv.egiz.pdfas.lib.api.ByteArrayDataSink; +import at.gv.egiz.pdfas.lib.api.ByteArrayDataSource; +import at.gv.egiz.pdfas.lib.api.Configuration; +import at.gv.egiz.pdfas.lib.api.DataSink; +import at.gv.egiz.pdfas.lib.api.DataSource; +import at.gv.egiz.pdfas.lib.api.PdfAs; +import at.gv.egiz.pdfas.lib.api.PdfAsFactory; +import at.gv.egiz.pdfas.lib.api.sign.SignParameter; +import at.gv.egiz.pdfas.lib.api.sign.SignResult; +import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter; +import at.gv.egiz.pdfas.lib.api.verify.VerifyResult; + +public class Main { + + public static final String CLI_ARG_MODE_SHORT = "m"; + public static final String CLI_ARG_MODE = "mode"; + + public static final String CLI_ARG_HELP_SHORT = "h"; + public static final String CLI_ARG_HELP = "help"; + + public static final String CLI_ARG_CONNECTOR_SHORT = "c"; + public static final String CLI_ARG_CONNECTOR = "connector"; + + public static final String CLI_ARG_OUTPUT_SHORT = "o"; + public static final String CLI_ARG_OUTPUT = "output"; + + public static final String CLI_ARG_PROFILE_SHORT = "p"; + public static final String CLI_ARG_PROFILE = "profile"; + + public static final String CLI_ARG_POSITION_SHORT = "pos"; + public static final String CLI_ARG_POSITION = "position"; + + public static final String CLI_ARG_CONF_SHORT = "conf"; + public static final String CLI_ARG_CONF = "configuration"; + + public static final String CLI_ARG_VERIFY_WHICH_SHORT = "vw"; + public static final String CLI_ARG_VERIFY_WHICH = "verify_which"; + + public static final String STANDARD_CONFIG_LOCATION = System + .getProperty("user.home") + "/.pdfas/cfg/"; + + public static final String STANDARD_POSITION_STRING = "x:auto;y:auto;w:auto;p:auto;f:0"; + + private static Options createOptions() { + Options cliOptions = new Options(); + + Option modeOption = new Option(CLI_ARG_MODE_SHORT, CLI_ARG_MODE, true, + "Mode of operation"); + // modeOption.setRequired(true); + cliOptions.addOption(modeOption); + + Option helpOption = new Option(CLI_ARG_HELP_SHORT, CLI_ARG_HELP, false, + "Shows this help message"); + cliOptions.addOption(helpOption); + + Option connectorOption = new Option(CLI_ARG_CONNECTOR_SHORT, + CLI_ARG_CONNECTOR, true, "Connector to use"); + cliOptions.addOption(connectorOption); + + Option profileOption = new Option(CLI_ARG_PROFILE_SHORT, + CLI_ARG_PROFILE, true, "Signature profile to use"); + cliOptions.addOption(profileOption); + + Option positionOption = new Option( + CLI_ARG_POSITION_SHORT, + CLI_ARG_POSITION, + true, + "Position string: position has the format [x:x_algo];[y:y_algo];[w:w_algo][p:p_algo];[f:f_algo]"); + cliOptions.addOption(positionOption); + + Option confOption = new Option(CLI_ARG_CONF_SHORT, CLI_ARG_CONF, true, + "Configuration file to use"); + cliOptions.addOption(confOption); + + Option verifywhichOption = new Option( + CLI_ARG_VERIFY_WHICH_SHORT, + CLI_ARG_VERIFY_WHICH, + true, + "[optional] zero based number of the signature to be verified. If omitted, all signatures are verified."); + cliOptions.addOption(verifywhichOption); + + Option outputOption = new Option(CLI_ARG_OUTPUT_SHORT, CLI_ARG_OUTPUT, + true, "The output file"); + cliOptions.addOption(outputOption); + + return cliOptions; + } + + private static void usage() { + HelpFormatter formater = new HelpFormatter(); + formater.printHelp("pdf-as [OPTIONS] ", createOptions()); + } + + public static void main(String[] args) { + // create the command line parser + CommandLineParser parser = new GnuParser(); + ModeOfOperation mode = ModeOfOperation.INVALID; + try { + CommandLine cli = parser.parse(createOptions(), args); + + if (cli.hasOption(CLI_ARG_MODE_SHORT)) { + String modevalue = cli.getOptionValue(CLI_ARG_MODE_SHORT); + if (modevalue.toLowerCase().trim().equals("sign")) { + mode = ModeOfOperation.SIGN; + } else if (modevalue.toLowerCase().trim().equals("verify")) { + mode = ModeOfOperation.VERIFY; + } else { + throw new ParseException("Invalid value for option " + + CLI_ARG_MODE_SHORT + ": " + modevalue); + } + } + + if (cli.hasOption(CLI_ARG_HELP_SHORT)) { + usage(); + System.exit(0); + } + + if (mode == ModeOfOperation.INVALID) { + throw new ParseException("Missing required option: " + + CLI_ARG_MODE_SHORT); + } else if (mode == ModeOfOperation.SIGN) { + perform_sign(cli); + } else if (mode == ModeOfOperation.VERIFY) { + perform_verify(cli); + } + + } catch (ParseException e) { + System.err.println("Invalid arguments: " + e.getMessage()); + usage(); + System.exit(-1); + } catch (Exception e) { + System.err.println("PDF-AS Error: " + e.getMessage()); + System.exit(-1); + } + } + + private static void perform_sign(CommandLine cli) throws Exception { + + String configurationFile = null; + + if (cli.hasOption(CLI_ARG_CONF_SHORT)) { + configurationFile = cli.getOptionValue(CLI_ARG_CONF_SHORT); + } else { + configurationFile = STANDARD_CONFIG_LOCATION; + } + + String positionString = null; + + if (cli.hasOption(CLI_ARG_POSITION_SHORT)) { + positionString = cli.getOptionValue(CLI_ARG_POSITION_SHORT); + } else { + positionString = STANDARD_POSITION_STRING; + } + + String profilID = null; + + if (cli.hasOption(CLI_ARG_PROFILE_SHORT)) { + profilID = cli.getOptionValue(CLI_ARG_PROFILE_SHORT); + } + + String pdfFile = null; + + pdfFile = cli.getArgs()[cli.getArgs().length - 1]; + + File inputFile = new File(pdfFile); + + if (!inputFile.exists()) { + throw new Exception("Input file does not exists"); + } + + DataSource dataSource = new ByteArrayDataSource( + StreamUtils.inputStreamToByteArray(new FileInputStream( + inputFile))); + + DataSink dataSink = new ByteArrayDataSink(); + + PdfAs pdfAs = null; + + pdfAs = PdfAsFactory.createPdfAs(new File(configurationFile)); + + Configuration configuration = pdfAs.getConfiguration(); + + SignParameter signParameter = PdfAsFactory.createSignParameter( + configuration, dataSource); + + signParameter.setOutput(dataSink); + + signParameter.setDataSource(dataSource); + signParameter.setSignaturePosition(positionString); + signParameter.setSignatureProfileId(profilID); + + // Set SL Signer! This will need connector value from cli + // signParameter.setPlainSigner(signer); + + SignResult result = pdfAs.sign(signParameter); + + // TODO write result to file + } + + private static void perform_verify(CommandLine cli) throws Exception { + + String configurationFile = null; + + if (cli.hasOption(CLI_ARG_CONF_SHORT)) { + configurationFile = cli.getOptionValue(CLI_ARG_CONF_SHORT); + } else { + configurationFile = STANDARD_CONFIG_LOCATION; + } + + int which = -1; + + if (cli.hasOption(CLI_ARG_VERIFY_WHICH_SHORT)) { + String whichValue = cli.getOptionValue(CLI_ARG_VERIFY_WHICH_SHORT); + which = Integer.parseInt(whichValue); + } + + String pdfFile = null; + + pdfFile = cli.getArgs()[cli.getArgs().length - 1]; + + File inputFile = new File(pdfFile); + + if (!inputFile.exists()) { + throw new Exception("Input file does not exists"); + } + + DataSource dataSource = new ByteArrayDataSource( + StreamUtils.inputStreamToByteArray(new FileInputStream( + inputFile))); + + PdfAs pdfAs = null; + + pdfAs = PdfAsFactory.createPdfAs(new File(configurationFile)); + + Configuration configuration = pdfAs.getConfiguration(); + + VerifyParameter verifyParameter = + PdfAsFactory.createVerifyParameter(configuration, dataSource); + + verifyParameter.setDataSource(dataSource); + verifyParameter.setConfiguration(configuration); + verifyParameter.setWhichSignature(which); + + List results = pdfAs.verify(verifyParameter); + + Iterator resultIterator = results.iterator(); + + while(resultIterator.hasNext()) { + VerifyResult verifyResult = resultIterator.next(); + dumpVerifyResult(verifyResult); + } + } + + private static void dumpVerifyResult(VerifyResult verifyResult) { + System.out.println("Verification Result:"); + System.out.println("\tValue Check: " + + verifyResult.getValueCheckCode().getMessage() + + " [" + verifyResult.getValueCheckCode().getCode() + "]"); + System.out.println("\tCertificate Check: " + + verifyResult.getCertificateCheck().getMessage() + + " [" + verifyResult.getCertificateCheck().getCode() + "]"); + System.out.println("\tQualified Certificate: " + + verifyResult.isQualifiedCertificate()); + System.out.println("\tVerification done: " + + verifyResult.isVerificationDone()); + } +} diff --git a/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/ModeOfOperation.java b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/ModeOfOperation.java new file mode 100644 index 00000000..7d41b802 --- /dev/null +++ b/pdf-as-cli/src/main/java/at/gv/egiz/pdfas/cli/ModeOfOperation.java @@ -0,0 +1,7 @@ +package at.gv.egiz.pdfas.cli; + +public enum ModeOfOperation { + SIGN, + VERIFY, + INVALID +} diff --git a/pdf-as-cli/src/main/resources/messages/cli_args.properties b/pdf-as-cli/src/main/resources/messages/cli_args.properties new file mode 100644 index 00000000..7fafe47a --- /dev/null +++ b/pdf-as-cli/src/main/resources/messages/cli_args.properties @@ -0,0 +1 @@ +cli.args.mode=Mode of operation ('sign' for signing, 'verify' for verifikation) \ No newline at end of file diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/PdfAsObject.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/PdfAsObject.java index 067021b2..fafeb037 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/PdfAsObject.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/PdfAsObject.java @@ -46,7 +46,7 @@ public class PdfAsObject implements PdfAs { public SignResult sign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation) throws PdfAsException { - + // Create the signature .... // TODO wait for SL wrapper implementation diff --git a/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ContentOptionalRefType.java b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ContentOptionalRefType.java new file mode 100644 index 00000000..ebf93f7d --- /dev/null +++ b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ContentOptionalRefType.java @@ -0,0 +1,125 @@ +/** + * ContentOptionalRefType.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package at.gv.e_government.reference.namespace.moa._20020822; + +public class ContentOptionalRefType extends at.gv.e_government.reference.namespace.moa._20020822.ContentBaseType implements java.io.Serializable { + private org.apache.axis.types.URI reference; // attribute + + public ContentOptionalRefType() { + } + + public ContentOptionalRefType( + byte[] base64Content, + at.gv.e_government.reference.namespace.moa._20020822.XMLContentType XMLContent, + org.apache.axis.types.URI locRefContent, + org.apache.axis.types.URI reference) { + super( + base64Content, + XMLContent, + locRefContent); + this.reference = reference; + } + + + /** + * Gets the reference value for this ContentOptionalRefType. + * + * @return reference + */ + public org.apache.axis.types.URI getReference() { + return reference; + } + + + /** + * Sets the reference value for this ContentOptionalRefType. + * + * @param reference + */ + public void setReference(org.apache.axis.types.URI reference) { + this.reference = reference; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ContentOptionalRefType)) return false; + ContentOptionalRefType other = (ContentOptionalRefType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = super.equals(obj) && + ((this.reference==null && other.getReference()==null) || + (this.reference!=null && + this.reference.equals(other.getReference()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = super.hashCode(); + if (getReference() != null) { + _hashCode += getReference().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ContentOptionalRefType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "ContentOptionalRefType")); + org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("reference"); + attrField.setXmlName(new javax.xml.namespace.QName("", "Reference")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyURI")); + typeDesc.addFieldDesc(attrField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ManifestRefsCheckResultInfoType.java b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/ManifestRefsCheckResultInfoType.java new file mode 100644 index 00000000..e69de29b diff --git a/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/PublicAuthorityType.java b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/PublicAuthorityType.java new file mode 100644 index 00000000..cf0fdeca --- /dev/null +++ b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/PublicAuthorityType.java @@ -0,0 +1,120 @@ +/** + * PublicAuthorityType.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package at.gv.e_government.reference.namespace.moa._20020822; + +public class PublicAuthorityType implements java.io.Serializable { + private java.lang.String code; + + public PublicAuthorityType() { + } + + public PublicAuthorityType( + java.lang.String code) { + this.code = code; + } + + + /** + * Gets the code value for this PublicAuthorityType. + * + * @return code + */ + public java.lang.String getCode() { + return code; + } + + + /** + * Sets the code value for this PublicAuthorityType. + * + * @param code + */ + public void setCode(java.lang.String code) { + this.code = code; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof PublicAuthorityType)) return false; + PublicAuthorityType other = (PublicAuthorityType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.code==null && other.getCode()==null) || + (this.code!=null && + this.code.equals(other.getCode()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getCode() != null) { + _hashCode += getCode().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(PublicAuthorityType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "PublicAuthorityType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("code"); + elemField.setXmlName(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "Code")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyCMSSignatureResponseType.java b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyCMSSignatureResponseType.java new file mode 100644 index 00000000..f4be37ee --- /dev/null +++ b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyCMSSignatureResponseType.java @@ -0,0 +1,195 @@ +/** + * VerifyCMSSignatureResponseType.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package at.gv.e_government.reference.namespace.moa._20020822; + +public class VerifyCMSSignatureResponseType implements java.io.Serializable { + /* only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate + * is included as X509Data/any;publicAuthority is included as X509Data/any */ + private org.w3.www._2000._09.xmldsig.KeyInfoType signerInfo; + + private at.gv.e_government.reference.namespace.moa._20020822.CheckResultType signatureCheck; + + private at.gv.e_government.reference.namespace.moa._20020822.CheckResultType certificateCheck; + + public VerifyCMSSignatureResponseType() { + } + + public VerifyCMSSignatureResponseType( + org.w3.www._2000._09.xmldsig.KeyInfoType signerInfo, + at.gv.e_government.reference.namespace.moa._20020822.CheckResultType signatureCheck, + at.gv.e_government.reference.namespace.moa._20020822.CheckResultType certificateCheck) { + this.signerInfo = signerInfo; + this.signatureCheck = signatureCheck; + this.certificateCheck = certificateCheck; + } + + + /** + * Gets the signerInfo value for this VerifyCMSSignatureResponseType. + * + * @return signerInfo * only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate + * is included as X509Data/any;publicAuthority is included as X509Data/any + */ + public org.w3.www._2000._09.xmldsig.KeyInfoType getSignerInfo() { + return signerInfo; + } + + + /** + * Sets the signerInfo value for this VerifyCMSSignatureResponseType. + * + * @param signerInfo * only ds:X509Data and RetrievalMethod is supported; QualifiedCertificate + * is included as X509Data/any;publicAuthority is included as X509Data/any + */ + public void setSignerInfo(org.w3.www._2000._09.xmldsig.KeyInfoType signerInfo) { + this.signerInfo = signerInfo; + } + + + /** + * Gets the signatureCheck value for this VerifyCMSSignatureResponseType. + * + * @return signatureCheck + */ + public at.gv.e_government.reference.namespace.moa._20020822.CheckResultType getSignatureCheck() { + return signatureCheck; + } + + + /** + * Sets the signatureCheck value for this VerifyCMSSignatureResponseType. + * + * @param signatureCheck + */ + public void setSignatureCheck(at.gv.e_government.reference.namespace.moa._20020822.CheckResultType signatureCheck) { + this.signatureCheck = signatureCheck; + } + + + /** + * Gets the certificateCheck value for this VerifyCMSSignatureResponseType. + * + * @return certificateCheck + */ + public at.gv.e_government.reference.namespace.moa._20020822.CheckResultType getCertificateCheck() { + return certificateCheck; + } + + + /** + * Sets the certificateCheck value for this VerifyCMSSignatureResponseType. + * + * @param certificateCheck + */ + public void setCertificateCheck(at.gv.e_government.reference.namespace.moa._20020822.CheckResultType certificateCheck) { + this.certificateCheck = certificateCheck; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof VerifyCMSSignatureResponseType)) return false; + VerifyCMSSignatureResponseType other = (VerifyCMSSignatureResponseType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.signerInfo==null && other.getSignerInfo()==null) || + (this.signerInfo!=null && + this.signerInfo.equals(other.getSignerInfo()))) && + ((this.signatureCheck==null && other.getSignatureCheck()==null) || + (this.signatureCheck!=null && + this.signatureCheck.equals(other.getSignatureCheck()))) && + ((this.certificateCheck==null && other.getCertificateCheck()==null) || + (this.certificateCheck!=null && + this.certificateCheck.equals(other.getCertificateCheck()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getSignerInfo() != null) { + _hashCode += getSignerInfo().hashCode(); + } + if (getSignatureCheck() != null) { + _hashCode += getSignatureCheck().hashCode(); + } + if (getCertificateCheck() != null) { + _hashCode += getCertificateCheck().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(VerifyCMSSignatureResponseType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "VerifyCMSSignatureResponseType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("signerInfo"); + elemField.setXmlName(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "SignerInfo")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2000/09/xmldsig#", "KeyInfoType")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("signatureCheck"); + elemField.setXmlName(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "SignatureCheck")); + elemField.setXmlType(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "CheckResultType")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("certificateCheck"); + elemField.setXmlName(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "CertificateCheck")); + elemField.setXmlType(new javax.xml.namespace.QName("http://reference.e-government.gv.at/namespace/moa/20020822#", "CheckResultType")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyXMLSignatureResponseType.java b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyXMLSignatureResponseType.java new file mode 100644 index 00000000..c7fd41e9 --- /dev/null +++ b/pdf-as-lib/ /home/afitzek/devel/pdf-as-4/src/pdf-as-4/pdf-as-lib/src/main/java/at/gv/e_government/reference/namespace/moa/_20020822/VerifyXMLSignatureResponseType.java @@ -0,0 +1,394 @@ +/** + * VerifyXMLSignatureResponseType.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package at.gv.e_government.reference.namespace.moa._20020822; + +public class VerifyXMLSignatureResponseType implements java.io.Serializable { + /* only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate + * is included as X509Data/any; PublicAuthority is included as X509Data/any */ + private org.w3.www._2000._09.xmldsig.KeyInfoType signerInfo; + + private at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] hashInputData; + + private at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] referenceInputData; + + private at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType signatureCheck; + + private at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType signatureManifestCheck; + + private at.gv.e_government.reference.namespace.moa._20020822.ManifestRefsCheckResultType[] XMLDSIGManifestCheck; + + private at.gv.e_government.reference.namespace.moa._20020822.CheckResultType certificateCheck; + + public VerifyXMLSignatureResponseType() { + } + + public VerifyXMLSignatureResponseType( + org.w3.www._2000._09.xmldsig.KeyInfoType signerInfo, + at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] hashInputData, + at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] referenceInputData, + at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType signatureCheck, + at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType signatureManifestCheck, + at.gv.e_government.reference.namespace.moa._20020822.ManifestRefsCheckResultType[] XMLDSIGManifestCheck, + at.gv.e_government.reference.namespace.moa._20020822.CheckResultType certificateCheck) { + this.signerInfo = signerInfo; + this.hashInputData = hashInputData; + this.referenceInputData = referenceInputData; + this.signatureCheck = signatureCheck; + this.signatureManifestCheck = signatureManifestCheck; + this.XMLDSIGManifestCheck = XMLDSIGManifestCheck; + this.certificateCheck = certificateCheck; + } + + + /** + * Gets the signerInfo value for this VerifyXMLSignatureResponseType. + * + * @return signerInfo * only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate + * is included as X509Data/any; PublicAuthority is included as X509Data/any + */ + public org.w3.www._2000._09.xmldsig.KeyInfoType getSignerInfo() { + return signerInfo; + } + + + /** + * Sets the signerInfo value for this VerifyXMLSignatureResponseType. + * + * @param signerInfo * only ds:X509Data and ds:RetrievalMethod is supported; QualifiedCertificate + * is included as X509Data/any; PublicAuthority is included as X509Data/any + */ + public void setSignerInfo(org.w3.www._2000._09.xmldsig.KeyInfoType signerInfo) { + this.signerInfo = signerInfo; + } + + + /** + * Gets the hashInputData value for this VerifyXMLSignatureResponseType. + * + * @return hashInputData + */ + public at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] getHashInputData() { + return hashInputData; + } + + + /** + * Sets the hashInputData value for this VerifyXMLSignatureResponseType. + * + * @param hashInputData + */ + public void setHashInputData(at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] hashInputData) { + this.hashInputData = hashInputData; + } + + public at.gv.e_government.reference.namespace.moa._20020822.InputDataType getHashInputData(int i) { + return this.hashInputData[i]; + } + + public void setHashInputData(int i, at.gv.e_government.reference.namespace.moa._20020822.InputDataType _value) { + this.hashInputData[i] = _value; + } + + + /** + * Gets the referenceInputData value for this VerifyXMLSignatureResponseType. + * + * @return referenceInputData + */ + public at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] getReferenceInputData() { + return referenceInputData; + } + + + /** + * Sets the referenceInputData value for this VerifyXMLSignatureResponseType. + * + * @param referenceInputData + */ + public void setReferenceInputData(at.gv.e_government.reference.namespace.moa._20020822.InputDataType[] referenceInputData) { + this.referenceInputData = referenceInputData; + } + + public at.gv.e_government.reference.namespace.moa._20020822.InputDataType getReferenceInputData(int i) { + return this.referenceInputData[i]; + } + + public void setReferenceInputData(int i, at.gv.e_government.reference.namespace.moa._20020822.InputDataType _value) { + this.referenceInputData[i] = _value; + } + + + /** + * Gets the signatureCheck value for this VerifyXMLSignatureResponseType. + * + * @return signatureCheck + */ + public at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType getSignatureCheck() { + return signatureCheck; + } + + + /** + * Sets the signatureCheck value for this VerifyXMLSignatureResponseType. + * + * @param signatureCheck + */ + public void setSignatureCheck(at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType signatureCheck) { + this.signatureCheck = signatureCheck; + } + + + /** + * Gets the signatureManifestCheck value for this VerifyXMLSignatureResponseType. + * + * @return signatureManifestCheck + */ + public at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType getSignatureManifestCheck() { + return signatureManifestCheck; + } + + + /** + * Sets the signatureManifestCheck value for this VerifyXMLSignatureResponseType. + * + * @param signatureManifestCheck + */ + public void setSignatureManifestCheck(at.gv.e_government.reference.namespace.moa._20020822.ReferencesCheckResultType signatureManifestCheck) { + this.signatureManifestCheck = signatureManifestCheck; + } + + + /** + * Gets the XMLDSIGManifestCheck value for this VerifyXMLSignatureResponseType. + * + * @return XMLDSIGManifestCheck + */ + public at.gv.e_government.reference.namespace.moa._20020822.ManifestRefsCheckResultType[] getXMLDSIGManifestCheck() { + return XMLDSIGManifestCheck; + } + + + /** + * Sets the XMLDSIGManifestCheck value for this VerifyXMLSignatureResponseType. + * + * @param XMLDSIGManifestCheck + */ + public void setXMLDSIGManifestCheck(at.gv.e_government.reference.namespace.moa._20020822.ManifestRefsCheckResultType[] XMLDSIGManifestCheck) { + this.XMLDSIGManifestCheck = XMLDSIGManifestCheck; + } + + public at.gv.e_government.reference.namespace.moa._20020822.ManifestRefsCheckResultType getXMLDSIGManifestCheck(int i) { + return this.XMLDSIGManifestCheck[i]; + } + + public void setXMLDSIGManifestCheck(int i, at.gv.e_government.reference.namespace.moa._20020822.ManifestRefsCheckResultType _value) { + this.XMLDSIGManifestCheck[i] = _value; + } + + + /** + * Gets the certificateCheck value for this VerifyXMLSignatureResponseType. + * + * @return certificateCheck + */ + public at.gv.e_government.reference.namespace.moa._20020822.CheckResultType getCertificateCheck() { + return certificateCheck; + } + + + /** + * Sets the certificateCheck value for this VerifyXMLSignatureResponseType. + * + * @param certificateCheck + */ + public void setCertificateCheck(at.gv.e_government.reference.namespace.moa._20020822.CheckResultType certificateCheck) { + this.certificateCheck = certificateCheck; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof VerifyXMLSignatureResponseType)) return false; + VerifyXMLSignatureResponseType other = (VerifyXMLSignatureResponseType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.signerInfo==null && other.getSignerInfo()==null) || + (this.signerInfo!=null && + this.signerInfo.equals(other.getSignerInfo()))) && + ((this.hashInputData==null && other.getHashInputData()==null) || + (this.hashInputData!=null && + java.util.Arrays.equals(this.hashInputData, other.getHashInputData()))) && + ((this.referenceInputData==null && other.getReferenceInputData()==null) || + (this.referenceInputData!=null && + java.util.Arrays.equals(this.referenceInputData, other.getReferenceInputData()))) && + ((this.signatureCheck==null && other.getSignatureCheck()==null) || + (this.signatureCheck!=null && + this.signatureCheck.equals(other.getSignatureCheck()))) && + ((this.signatureManifestCheck==null && other.getSignatureManifestCheck()==null) || + (this.signatureManifestCheck!=null && + this.signatureManifestCheck.equals(other.getSignatureManifestCheck()))) && + ((this.XMLDSIGManifestCheck==null && other.getXMLDSIGManifestCheck()==null) || + (this.XMLDSIGManifestCheck!=null && + java.util.Arrays.equals(this.XMLDSIGManifestCheck, other.getXMLDSIGManifestCheck()))) && + ((this.certificateCheck==null && other.getCertificateCheck()==null) || + (this.certificateCheck!=null && + this.certificateCheck.equals(other.getCertificateCheck()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getSignerInfo() != null) { + _hashCode += getSignerInfo().hashCode(); + } + if (getHashInputData() != null) { + for (int i=0; + i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pdf-as-lib/bin/wsdl/MOA-SPSS-1.3.xsd b/pdf-as-lib/bin/wsdl/MOA-SPSS-1.3.xsd new file mode 100644 index 00000000..a902c201 --- /dev/null +++ b/pdf-as-lib/bin/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/pdf-as-lib/bin/wsdl/xml.xsd b/pdf-as-lib/bin/wsdl/xml.xsd new file mode 100644 index 00000000..07d6934f --- /dev/null +++ b/pdf-as-lib/bin/wsdl/xml.xsd @@ -0,0 +1,146 @@ + + + + + + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + + Note that local names in this namespace are intended to be defined + only by the World Wide Web Consortium or its subgroups. The + following names are currently defined in this namespace and should + not be used with conflicting semantics by any Working Group, + specification, or document instance: + + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. + + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + The xml:id specification is not yet a W3C Recommendation, + but this attribute is included here to facilitate experimentation + with the mechanisms it proposes. Note that it is _not_ included + in the specialAttrs attribute group. + + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. + + space (as an attribute name): denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. + + Father (in any context at all): denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father + + + + + This schema defines attributes and an attribute group + suitable for use by + schemas wishing to allow xml:base, xml:lang, xml:space or xml:id + 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/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/2005/08/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, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2005/08/xml.xsd will not change. + + + + + + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. + + + + + + + + + + + + + + + + + + + + + + + + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. + + + + + + See http://www.w3.org/TR/xml-id/ for + information about this attribute. + + + + + + + + + + diff --git a/pdf-as-lib/bin/wsdl/xmldsig-core-schema.xsd b/pdf-as-lib/bin/wsdl/xmldsig-core-schema.xsd new file mode 100644 index 00000000..25be27ca --- /dev/null +++ b/pdf-as-lib/bin/wsdl/xmldsig-core-schema.xsd @@ -0,0 +1,318 @@ + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pdf-as-lib/build.gradle b/pdf-as-lib/build.gradle index fd7c00fc..a6693841 100644 --- a/pdf-as-lib/build.gradle +++ b/pdf-as-lib/build.gradle @@ -7,6 +7,41 @@ jar { } } +buildscript { + repositories { + mavenLocal() + mavenCentral() + } + dependencies { + classpath("commons-io:commons-io:2.4") + } +} + +configurations { + generateJavaFromWsdlDeps +} + +task generateJavaFromWsdl(type: JavaExec) { + classpath configurations.generateJavaFromWsdlDeps + //main "org.apache.cxf.tools.wsdlto.WSDLToJava" + main "org.apache.axis.wsdl.WSDL2Java" + args "-o " + projectDir + "/src/main/java", "-v", "" + projectDir + "/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl" + + compileJava.dependsOn += name + + def branch = new org.apache.commons.io.output.ByteArrayOutputStream() + errorOutput = new org.apache.commons.io.output.TeeOutputStream(System.err, branch) + doLast { + def str = branch.toString() + if (str.contains('Usage : wsdl2java') || str.contains('WSDLToJava Error')) { + throw new TaskExecutionException( + tasks[name], + new IOException("WSDLToJava has failed, please see output") + ) + } + } +} + repositories { mavenLocal() mavenCentral() @@ -26,6 +61,15 @@ dependencies { compile group: 'eu.europa.ec.joinup.egovlabs.pdf-as.iaik', name: 'iaik_jce_eval_signed', version: '4.0' compile group: 'eu.europa.ec.joinup.egovlabs.pdf-as.iaik', name: 'iaik_ecc_eval_signed', version: '2.19' testCompile group: 'junit', name: 'junit', version: '4.+' + generateJavaFromWsdlDeps('org.apache.axis:axis:1.4') + generateJavaFromWsdlDeps('org.apache.axis:axis-jaxrpc:1.4') + generateJavaFromWsdlDeps('axis:axis-wsdl4j:1.5.1') + generateJavaFromWsdlDeps('commons-codec:commons-codec:1.3') + generateJavaFromWsdlDeps('commons-logging:commons-logging:1.1.1') + generateJavaFromWsdlDeps('commons-discovery:commons-discovery:0.2') + /*generateJavaFromWsdlDeps('org.apache.cxf:cxf-tools-wsdlto-core:2.7.0') + generateJavaFromWsdlDeps('org.apache.cxf:cxf-tools-wsdlto-frontend-jaxws:2.7.0') + generateJavaFromWsdlDeps('org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb:2.7.0')*/ } test { diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java index 518f458d..e8865d3e 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java @@ -5,8 +5,10 @@ import java.io.File; import org.apache.log4j.PropertyConfigurator; import at.gv.egiz.pdfas.lib.api.sign.SignParameter; +import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter; import at.gv.egiz.pdfas.lib.impl.PdfAsImpl; import at.gv.egiz.pdfas.lib.impl.SignParameterImpl; +import at.gv.egiz.pdfas.lib.impl.VerifyParameterImpl; public class PdfAsFactory { @@ -22,4 +24,9 @@ public class PdfAsFactory { SignParameter param = new SignParameterImpl(configuration, dataSource); return param; } + + public static VerifyParameter createVerifyParameter(Configuration configuration, DataSource dataSource) { + VerifyParameter param = new VerifyParameterImpl(configuration, dataSource); + return param; + } } diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/verify/VerifyParameter.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/verify/VerifyParameter.java index 914838ed..d319e373 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/verify/VerifyParameter.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/verify/VerifyParameter.java @@ -3,7 +3,8 @@ package at.gv.egiz.pdfas.lib.api.verify; import at.gv.egiz.pdfas.lib.api.PdfAsParameter; public interface VerifyParameter extends PdfAsParameter { - - + public int getWhichSignature(); + + public void setWhichSignature(int which); } diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/VerifyParameterImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/VerifyParameterImpl.java index a82daba8..3b264938 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/VerifyParameterImpl.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/VerifyParameterImpl.java @@ -5,8 +5,19 @@ import at.gv.egiz.pdfas.lib.api.DataSource; import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter; public class VerifyParameterImpl extends PdfAsParameterImpl implements VerifyParameter { + + protected int which = - 1; + public VerifyParameterImpl(Configuration configuration, DataSource dataSource) { super(configuration, dataSource); } + + public int getWhichSignature() { + return which; + } + + public void setWhichSignature(int which) { + this.which = which; + } } diff --git a/pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl b/pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl new file mode 100644 index 00000000..b6a3588a --- /dev/null +++ b/pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd b/pdf-as-lib/src/main/resources/wsdl/MOA-SPSS-1.3.xsd new file mode 100644 index 00000000..a902c201 --- /dev/null +++ b/pdf-as-lib/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/pdf-as-lib/src/main/resources/wsdl/xml.xsd b/pdf-as-lib/src/main/resources/wsdl/xml.xsd new file mode 100644 index 00000000..07d6934f --- /dev/null +++ b/pdf-as-lib/src/main/resources/wsdl/xml.xsd @@ -0,0 +1,146 @@ + + + + + + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + + Note that local names in this namespace are intended to be defined + only by the World Wide Web Consortium or its subgroups. The + following names are currently defined in this namespace and should + not be used with conflicting semantics by any Working Group, + specification, or document instance: + + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. + + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + The xml:id specification is not yet a W3C Recommendation, + but this attribute is included here to facilitate experimentation + with the mechanisms it proposes. Note that it is _not_ included + in the specialAttrs attribute group. + + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. + + space (as an attribute name): denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. + + Father (in any context at all): denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father + + + + + This schema defines attributes and an attribute group + suitable for use by + schemas wishing to allow xml:base, xml:lang, xml:space or xml:id + 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/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/2005/08/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, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2005/08/xml.xsd will not change. + + + + + + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. + + + + + + + + + + + + + + + + + + + + + + + + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. + + + + + + See http://www.w3.org/TR/xml-id/ for + information about this attribute. + + + + + + + + + + diff --git a/pdf-as-lib/src/main/resources/wsdl/xmldsig-core-schema.xsd b/pdf-as-lib/src/main/resources/wsdl/xmldsig-core-schema.xsd new file mode 100644 index 00000000..25be27ca --- /dev/null +++ b/pdf-as-lib/src/main/resources/wsdl/xmldsig-core-schema.xsd @@ -0,0 +1,318 @@ + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3