= verify_only}
+ * @author Datentechnik Innovation GmbH
+ */
+ public static final int SIGNATURE_PROFILE_IS_NOT_ALLOWED_FOR_SIGNATURE = 234;
+
+ public static final int INVALID_SIGNATURE_POSITION = 224;
+ public static final int NO_TEXTUAL_CONTENT = 251;
+
+ public static final int SIGNATURE_COULDNT_BE_CREATED = 300;
+ public static final int SIGNED_TEXT_EMPTY = 301;
+ public static final int PROFILE_NOT_DEFINED = 302;
+ public static final int SERIAL_NUMBER_INVALID = 303;
+ public static final int SIG_CERTIFICATE_CANNOT_BE_READ = 304;
+ public static final int PROFILE_NOT_USABLE_FOR_TEXT = 305;
+
+ public static final int COULDNT_VERIFY = 310;
+
+ public static final int CERTIFICATE_NOT_FOUND = 313;
+ public static final int NOT_SEMANTICALLY_EQUAL = 314;
+
+ public static final int MODIFIED_AFTER_SIGNATION = 316;
+ public static final int NON_BINARY_SIGNATURES_PRESENT = 317;
+
+ public static final int UNSUPPORTED_REPLACES_NAME = 318;
+ public static final int UNSUPPORTED_SIGNATURE = 319;
+
+ public static final int DETACHED_SIGNATURE_NOT_SUPPORTED = 370;
+
+ public static final int SIGNATURE_VERIFICATION_NOT_SUPPORTED = 371;
+ public static final int INVALID_SIGNING_TIME = 372;
+
+ public static final int BKU_NOT_SUPPORTED = 373;
+
+ public static final int WEB_EXCEPTION = 330;
+ public static final int UNABLE_TO_RECEIVE_SUITABLE_RESPONSE = 340;
+
+
+ public static final int NORMALIZER_EXCEPTION = 400;
+
+ public static final int SESSION_EXPIRED = 600;
+
+ public static final int PLACEHOLDER_EXCEPTION = 700;
+ public static final int CAPTION_NOT_FOUND_EXCEPTION = 701;
+
+ public static final int UNABLE_TO_PARSE_ID = 800;
+ public static final int CORRECTOR_EXCEPTION = 801;
+ public static final int EXTERNAL_CORRECTOR_TIMEOUT_REACHED = 802;
+
+ public static final int WRAPPED_ERROR_CODE = 998;
+ public static final int FUNCTION_NOT_AVAILABLE = 999;
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsException.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsException.java
index fb602934..e20301e5 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsException.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsException.java
@@ -1,99 +1,122 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.exceptions;
-
-/**
- * This exception is the base for all PDF-AS exceptions.
- *
- *
- * Every PDF-AS Exception has an error code.
- *
- *
- * @author wprinz
- */
-@Deprecated
-public class PdfAsException extends Exception
-{
- /**
- * The error code.
- */
- protected int errorCode = -1;
-
- /**
- * Constructor.
- *
- * @param errorCode
- * The error code.
- * @param message
- * The detail message.
- */
- public PdfAsException(int errorCode, String message)
- {
- super(message);
-
- this.errorCode = errorCode;
- }
-
- /**
- * Constructor.
- *
- * @param errorCode
- * The error code.
- * @param message
- * The detail message.
- * @param cause
- * The cause.
- */
- public PdfAsException(int errorCode, String message, Throwable cause)
- {
- super(message, cause);
-
- this.errorCode = errorCode;
- }
-
- /**
- * Constructor.
- *
- * @param errorCode
- * The error code.
- * @param cause
- * The cause.
- */
- public PdfAsException(int errorCode, Throwable cause)
- {
- super(cause);
-
- this.errorCode = errorCode;
- }
-
- /**
- * Returns the error code of this exception.
- *
- * @return Returns the error code of this exception.
- */
- public int getErrorCode()
- {
- return this.errorCode;
- }
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.exceptions;
+
+/**
+ * This exception is the base for all PDF-AS exceptions.
+ *
+ *
+ * Every PDF-AS Exception has an error code.
+ *
+ *
+ * @author wprinz
+ */
+@Deprecated
+public class PdfAsException extends Exception
+{
+ /**
+ * The error code.
+ */
+ protected int errorCode = -1;
+
+ /**
+ * Constructor.
+ *
+ * @param errorCode
+ * The error code.
+ * @param message
+ * The detail message.
+ */
+ public PdfAsException(int errorCode, String message)
+ {
+ super(message);
+
+ this.errorCode = errorCode;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param errorCode
+ * The error code.
+ * @param message
+ * The detail message.
+ * @param cause
+ * The cause.
+ */
+ public PdfAsException(int errorCode, String message, Throwable cause)
+ {
+ super(message, cause);
+
+ this.errorCode = errorCode;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param errorCode
+ * The error code.
+ * @param cause
+ * The cause.
+ */
+ public PdfAsException(int errorCode, Throwable cause)
+ {
+ super(cause);
+
+ this.errorCode = errorCode;
+ }
+
+ /**
+ * Returns the error code of this exception.
+ *
+ * @return Returns the error code of this exception.
+ */
+ public int getErrorCode()
+ {
+ return this.errorCode;
+ }
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsWrappedException.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsWrappedException.java
index c5fb3fd3..d8ea2825 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsWrappedException.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/exceptions/PdfAsWrappedException.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.api.exceptions;
@Deprecated
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSink.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSink.java
index 5163822d..9c0b6b09 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSink.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSink.java
@@ -1,99 +1,122 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.io;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * Output document data sink.
- *
- *
- * Actually, the DataSink can be seen as a factory for creating OutputStreams
- * with mime type and character encoding provided. This allows the API user to
- * decide how data is to be stored (e.g. in a file, in a byte array, etc.).
- *
- *
- * @author wprinz
- */
-@Deprecated
-public interface DataSink
-{
- /**
- * Creates an OutputStream for binary data.
- *
- *
- * Note that the stream may be written only once. Creating another stream
- * overwrites the existing one.
- *
- *
- * @param mimeType
- * The mime type of the output data.
- * @return Returns the created output stream.
- * @throws IOException
- * Thrown if the stream cannot be created.
- */
- public OutputStream createOutputStream(String mimeType) throws IOException;
-
- /**
- * Creates an OutputStream for character data.
- *
- *
- * This is basically the same as {@link #createOutputStream(String)}, but
- * allows to specify the character encoding.
- *
- *
- * @param mimeType
- * The mime type of the output data.
- * @param characterEncoding
- * The character encoding of the data.
- * @return Returns the created output stream.
- * @throws IOException
- * Thrown if the stream cannot be created.
- */
- public OutputStream createOutputStream(String mimeType, String characterEncoding) throws IOException;
-
- /**
- * Returns the mime type of the data stream.
- *
- *
- * This is only valid after a stream has been created.
- *
- *
- * @return Returns the mime type of the data stream.
- */
- public String getMimeType();
-
- /**
- * Returns the character encoding of the data stream.
- *
- *
- * This is only valid after a stream has been created. Null means that no
- * character encoding was specified for the data (e.g. if the data is binary).
- *
- *
- * @return Returns the character encoding of the data stream.
- */
- public String getCharacterEncoding();
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.io;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Output document data sink.
+ *
+ *
+ * Actually, the DataSink can be seen as a factory for creating OutputStreams
+ * with mime type and character encoding provided. This allows the API user to
+ * decide how data is to be stored (e.g. in a file, in a byte array, etc.).
+ *
+ *
+ * @author wprinz
+ */
+@Deprecated
+public interface DataSink
+{
+ /**
+ * Creates an OutputStream for binary data.
+ *
+ *
+ * Note that the stream may be written only once. Creating another stream
+ * overwrites the existing one.
+ *
+ *
+ * @param mimeType
+ * The mime type of the output data.
+ * @return Returns the created output stream.
+ * @throws IOException
+ * Thrown if the stream cannot be created.
+ */
+ public OutputStream createOutputStream(String mimeType) throws IOException;
+
+ /**
+ * Creates an OutputStream for character data.
+ *
+ *
+ * This is basically the same as {@link #createOutputStream(String)}, but
+ * allows to specify the character encoding.
+ *
+ *
+ * @param mimeType
+ * The mime type of the output data.
+ * @param characterEncoding
+ * The character encoding of the data.
+ * @return Returns the created output stream.
+ * @throws IOException
+ * Thrown if the stream cannot be created.
+ */
+ public OutputStream createOutputStream(String mimeType, String characterEncoding) throws IOException;
+
+ /**
+ * Returns the mime type of the data stream.
+ *
+ *
+ * This is only valid after a stream has been created.
+ *
+ *
+ * @return Returns the mime type of the data stream.
+ */
+ public String getMimeType();
+
+ /**
+ * Returns the character encoding of the data stream.
+ *
+ *
+ * This is only valid after a stream has been created. Null means that no
+ * character encoding was specified for the data (e.g. if the data is binary).
+ *
+ *
+ * @return Returns the character encoding of the data stream.
+ */
+ public String getCharacterEncoding();
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSource.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSource.java
index dfeb6261..0bd8966a 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSource.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/DataSource.java
@@ -1,95 +1,118 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.io;
-
-import java.io.InputStream;
-
-/**
- * Input document data source.
- *
- *
- * This allows the holder of the data to decide how the data is to be stored (e.g. in a File or in a byte array).
- *
- *
- * @author wprinz
- *
- */
-@Deprecated
-public interface DataSource
-{
- /**
- * Creates a new InputStream that allows to read out the document's binary
- * data from the beginning.
- *
- * @return Returns the InputStream with the binary data.
- */
- public InputStream createInputStream();
-
- /**
- * Returns the length (number of bytes) of the stream.
- *
- * @return Returns the length (number of bytes) of the stream.
- */
- public int getLength();
-
- /**
- * Returns the data of this DataSource as a byte array for random read only access.
- *
- *
- * Calling this method indicates that you need a byte array for random
- * read only access. The DataSource implementation should of
- * course cache this byte array to avoid too much memory usage.
- *
- *
- * Performance analysis has shown that the libraries internally convert the
- * streams to byte arrays and that file system access is very slow.
- *
- *
- * Never write to this byte array!
- *
- *
- * @return Returns the data of this DataSource as a byte array for random read only access.
- */
- public byte[] getAsByteArray();
-
- /**
- * Returns the mime type of the data.
- *
- * @return Returns the mime type of the data.
- */
- public String getMimeType();
-
- /**
- * Returns the character encoding of the data.
- *
- *
- * This makes only sense for character based mime types.
- *
- *
- * @return Returns the character encoding of the data or null if no encoding
- * is applicable (e.g. if the data is binary).
- */
- public String getCharacterEncoding();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.io;
+
+import java.io.InputStream;
+
+/**
+ * Input document data source.
+ *
+ *
+ * This allows the holder of the data to decide how the data is to be stored (e.g. in a File or in a byte array).
+ *
+ *
+ * @author wprinz
+ *
+ */
+@Deprecated
+public interface DataSource
+{
+ /**
+ * Creates a new InputStream that allows to read out the document's binary
+ * data from the beginning.
+ *
+ * @return Returns the InputStream with the binary data.
+ */
+ public InputStream createInputStream();
+
+ /**
+ * Returns the length (number of bytes) of the stream.
+ *
+ * @return Returns the length (number of bytes) of the stream.
+ */
+ public int getLength();
+
+ /**
+ * Returns the data of this DataSource as a byte array for random read only access.
+ *
+ *
+ * Calling this method indicates that you need a byte array for random
+ * read only access. The DataSource implementation should of
+ * course cache this byte array to avoid too much memory usage.
+ *
+ *
+ * Performance analysis has shown that the libraries internally convert the
+ * streams to byte arrays and that file system access is very slow.
+ *
+ *
+ * Never write to this byte array!
+ *
+ *
+ * @return Returns the data of this DataSource as a byte array for random read only access.
+ */
+ public byte[] getAsByteArray();
+
+ /**
+ * Returns the mime type of the data.
+ *
+ * @return Returns the mime type of the data.
+ */
+ public String getMimeType();
+
+ /**
+ * Returns the character encoding of the data.
+ *
+ *
+ * This makes only sense for character based mime types.
+ *
+ *
+ * @return Returns the character encoding of the data or null if no encoding
+ * is applicable (e.g. if the data is binary).
+ */
+ public String getCharacterEncoding();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/FileBased.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/FileBased.java
index c09f480b..c2a7b25f 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/FileBased.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/FileBased.java
@@ -1,52 +1,75 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.io;
-
-import java.io.File;
-
-/**
- * Tells that the IO element (DataSink or DataSource) is backed by a file in the local file system.
- *
- *
- * This is a hint that may be used by PDF-AS to optimize data access.
- *
- *
- * @author wprinz
- */
-@Deprecated
-public interface FileBased
-{
-
- /**
- * Returns the File "behind" this io element.
- *
- *
- * This is usually used to determine the file name itself.
- *
- *
- * @return Returns the File "behind" this io element.
- */
- public File getFile ();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.io;
+
+import java.io.File;
+
+/**
+ * Tells that the IO element (DataSink or DataSource) is backed by a file in the local file system.
+ *
+ *
+ * This is a hint that may be used by PDF-AS to optimize data access.
+ *
+ *
+ * @author wprinz
+ */
+@Deprecated
+public interface FileBased
+{
+
+ /**
+ * Returns the File "behind" this io element.
+ *
+ *
+ * This is usually used to determine the file name itself.
+ *
+ *
+ * @return Returns the File "behind" this io element.
+ */
+ public File getFile ();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/TextBased.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/TextBased.java
index 9e3987ba..fadd8bbf 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/TextBased.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/io/TextBased.java
@@ -1,51 +1,74 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.io;
-
-/**
- * Tells, that the IO Element (DataSink - but mostly DataSource) is based upon
- * character data.
- *
- *
- * This can be used to retrieve the character text directly with the correct
- * encoding etc.
- *
- *
- * This makes most sense for text DataSources.
- *
- *
- * @author wprinz
- */
-@Deprecated
-public interface TextBased
-{
-
- /**
- * Returns the text.
- *
- * @return Returns the text.
- */
- public String getText();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.io;
+
+/**
+ * Tells, that the IO Element (DataSink - but mostly DataSource) is based upon
+ * character data.
+ *
+ *
+ * This can be used to retrieve the character text directly with the correct
+ * encoding etc.
+ *
+ *
+ * This makes most sense for text DataSources.
+ *
+ *
+ * @author wprinz
+ */
+@Deprecated
+public interface TextBased
+{
+
+ /**
+ * Returns the text.
+ *
+ * @return Returns the text.
+ */
+ public String getText();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
index 62b48227..5466d596 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
@@ -1,394 +1,417 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign;
-
-import java.util.Properties;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.api.io.DataSink;
-import at.gv.egiz.pdfas.api.io.DataSource;
-import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning;
-import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
-import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
-
-/**
- * Parameter object that holds the sign parameters.
- *
- * @author wprinz
- */
-@Deprecated
-public class SignParameters
-{
-// 23.11.2010 changed by exthex - added parameters for placeholder handling
-
- /**
- * The document to be signed.
- *
- *
- * The DataSource implementation encapsulates the actual representaion of the
- * data. E.g. the DataSource may be File based or byte array based. See
- * package at.gv.egiz.pdfas.framework.input and at.gv.pdfas.impl.input
- *
- */
- protected DataSource document = null;
-
- /**
- * The type of the signature.
- *
- *
- * May be {@link Constants#SIGNATURE_TYPE_BINARY} or
- * {@link Constants#SIGNATURE_TYPE_TEXTUAL}.
- *
- */
- protected String signatureType = Constants.DEFAULT_SIGNATURE_TYPE;
-
- /**
- * The signature device to perform the actual signature.
- *
- *
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- *
- */
- protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
-
- /**
- * The signature profile identifier identifying the profile to be used in the
- * config file.
- *
- *
- * Note: In near future it will be possible to provide a full specified
- * profile here instead of the profile id.
- *
- */
- protected String signatureProfileId = null;
-
- /**
- * The signature key identifier specifying which signature key should be used
- * by the signature device to perform the signature.
- *
- *
- * Providing a null value (default) means that no explicit signature key
- * identifier is provided. The selected signature device will then use its
- * default mechanism for retrieving this information (which is usually to read
- * the key from the provided signature profile).
- *
- *
- * Note that not all signature devices may support this parameter.
- * If a signature device doesn't support this parameter the value should be null.
- *
- *
- * This key is usually passed straight through to the signature device and
- * thereby has to contain an appropriate value for the signature device
- * chosen.
- *
- *
- * Currently, only the {@link Constants#SIGNATURE_DEVICE_MOA} signature device
- * evaluates this parameter and passes the provided String to MOA as the MOA
- * key group identifier. If null is provided, the MOA signature device will
- * determine the signature key identifier to be used from the provided profile
- * and, if not specified there either, from the MOA default configuration.
- *
- */
- protected String signatureKeyIdentifier = null;
-
- /**
- * The signature position. Consult the PDF-AS documentation section
- * Commandline.
- */
- protected SignaturePositioning signaturePositioning = null;
-
- /**
- * The output DataSink that will receive the signed document.
- */
- protected DataSink output = null;
-
- protected TimeStamper timeStamperImpl;
-
- /**
- * The flag to de-/activate placeholder search
- */
- protected Boolean checkForPlaceholder = null;
-
- /**
- * The id of the placeholder which should be replaced.
- */
- protected String placeholderId;
-
- /**
- * The matching mode for placeholder extraction.
- * If a {@link SignParameters#placeholderId} is set, the match mode determines what is to be done, if no matching placeholder is found in the document.
- *
- * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.
- */
- protected int placeholderMatchMode = Constants.PLACEHOLDER_MATCH_MODE_MODERATE;
-
- protected Properties overrideProps = new Properties();
-
-
-
-
-
- /**
- * {@link #setTimeStamperImpl(TimeStamper)}
- * @return
- */
- public TimeStamper getTimeStamperImpl() {
- return this.timeStamperImpl;
- }
-
- /**
- * Set a {@link TimeStamper} to create a timestamp on the signature value. Will be
- * called after sign. For binary signatures only. Timestamp will be embedded in egiz dict /TimeStamp.
- * @param timeStamperImpl
- */
- public void setTimeStamperImpl(TimeStamper timeStamperImpl) {
- this.timeStamperImpl = timeStamperImpl;
- }
-
-/**
- * @return the document
- */
- public DataSource getDocument()
- {
- return document;
- }
-
- /**
- * @param document
- * the document to set
- */
- public void setDocument(DataSource document)
- {
- this.document = document;
- }
-
- /**
- * @return the signatureType
- */
- public String getSignatureType()
- {
- return signatureType;
- }
-
- /**
- * @param signatureType
- * the signatureType to set
- */
- public void setSignatureType(String signatureType)
- {
- this.signatureType = signatureType;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return signatureDevice;
- }
-
- /**
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-
- /**
- * @return the signatureProfileId
- */
- public String getSignatureProfileId()
- {
- return signatureProfileId;
- }
-
- /**
- * @param signatureProfileId
- * the signatureProfileId to set
- */
- public void setSignatureProfileId(String signatureProfileId)
- {
- this.signatureProfileId = signatureProfileId;
- }
-
- /**
- * @return the signaturePositioning
- */
- public SignaturePositioning getSignaturePositioning()
- {
- return this.signaturePositioning;
- }
-
- /**
- * @param signaturePositioning
- * the signaturePositioning to set
- */
- public void setSignaturePositioning(SignaturePositioning signaturePositioning)
- {
- this.signaturePositioning = signaturePositioning;
- }
-
- /**
- * @return the output
- */
- public DataSink getOutput()
- {
- return output;
- }
-
- /**
- * @param output
- * the output to set
- */
- public void setOutput(DataSink output)
- {
- this.output = output;
- }
-
- /**
- * @return the signatureKeyIdentifier
- */
- public String getSignatureKeyIdentifier()
- {
- return this.signatureKeyIdentifier;
- }
-
- /**
- * @param signatureKeyIdentifier the signatureKeyIdentifier to set
- */
- public void setSignatureKeyIdentifier(String signatureKeyIdentifier)
- {
- this.signatureKeyIdentifier = signatureKeyIdentifier;
- }
-
- /**
- * Override user defined values from the used signature profile like "value.SIG_META".
- * You cannot override pre defined values like SIG_VALUE, SIG_DATE {@link SignatureTypes#REQUIRED_SIG_KEYS}.
- * The override values are bound to the {@link SignParameters} instance.
- *
- * Sample usage:
- *
- SignParameters sp = new SignParameters();
- . . .
-
- sp.setSignatureProfileId("SIGNATURBLOCK_DE");
-
- // expressions do not work on binary signature fields without phlength setting!!
- sp.setProfileOverrideValue("SIG_META", "It's nice to be important, but it is more important to be nice ${subject.L}");;
- sp.setProfileOverrideValue("SIG_LABEL", "./images/signatur-logo_en.png");
-
- // execute sign using the overrides
- pdfAs.sign(sp);
-
- *
- * @param key the name of the setting to override e.g. "SIG_META"
- * @param value The new value
- */
- public void setProfileOverrideValue(String key, String value) {
- if (SignatureTypes.isRequredSigTypeKey(key)) {
- throw new RuntimeException("cannot set value for pre defined signature field names");
- }
- this.overrideProps.put(key, value);
- }
-
- /**
- * Get override values created via {@link #setProfileOverrideValue(String, String)}
- * @return
- */
- public Properties getProfileOverrideProperties() {
- return this.overrideProps;
-
- }
-
- /**
- * Get the value of the checkForPlaceholder flag.
- *
- * @return
- */
- public Boolean isCheckForPlaceholder() {
- return this.checkForPlaceholder;
- }
-
- /**
- * Set this to true, if you want a search for placeholder images to be performed and
- * appropriate images to be replaced.
- * If this is not set, a search will only be performed if the configuration property "enable_placeholder_search" is set to true.
- *
- * @param check
- */
- public void setCheckForPlaceholder(Boolean searchForPlaceHolder) {
- this.checkForPlaceholder = searchForPlaceHolder;
- }
-
- /**
- * Set an explicit placeholder id.
- * Only placeholder images that have a matching ID property embedded will be considered for replacement.
- *
- * @param placeholderId
- */
- public void setPlaceholderId(String placeholderId) {
- this.placeholderId = placeholderId;
- }
-
- /**
- * The id of the placeholder to replace.
- *
- * @return the placeholderId
- */
- public String getPlaceholderId() {
- return placeholderId;
- }
-
- /**
- * Set the behavior if no exactly matching placeholder could be found.
- * Exactly matching meaning:
- * - If a placeholderId is set: a placeholder which has exactly this id embedded
- * - If no placeholderId is set: a placeholder without an embedded id is found
- *
- * @see Constants#PLACEHOLDER_MATCH_MODE_LENIENT
- * @see Constants#PLACEHOLDER_MATCH_MODE_MODERATE
- * @see Constants#PLACEHOLDER_MATCH_MODE_STRICT
- *
- * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.
- *
- * @param placeholderMatchMode
- */
- public void setPlaceholderMatchMode(int placeholderMatchMode) {
- this.placeholderMatchMode = placeholderMatchMode;
- }
-
- /**
- * Get the placeholder matching mode.
- *
- * @see SignParameters#getPlaceholderMatchMode()
- * @return the placeholderMatchMode
- */
- public int getPlaceholderMatchMode() {
- return this.placeholderMatchMode;
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign;
+
+import java.util.Properties;
+
+import at.gv.egiz.pdfas.api.commons.Constants;
+import at.gv.egiz.pdfas.api.io.DataSink;
+import at.gv.egiz.pdfas.api.io.DataSource;
+import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning;
+import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
+import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
+
+/**
+ * Parameter object that holds the sign parameters.
+ *
+ * @author wprinz
+ */
+@Deprecated
+public class SignParameters
+{
+// 23.11.2010 changed by exthex - added parameters for placeholder handling
+
+ /**
+ * The document to be signed.
+ *
+ *
+ * The DataSource implementation encapsulates the actual representaion of the
+ * data. E.g. the DataSource may be File based or byte array based. See
+ * package at.gv.egiz.pdfas.framework.input and at.gv.pdfas.impl.input
+ *
+ */
+ protected DataSource document = null;
+
+ /**
+ * The type of the signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_TYPE_BINARY} or
+ * {@link Constants#SIGNATURE_TYPE_TEXTUAL}.
+ *
+ */
+ protected String signatureType = Constants.DEFAULT_SIGNATURE_TYPE;
+
+ /**
+ * The signature device to perform the actual signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
+ * {@link Constants#SIGNATURE_DEVICE_BKU}.
+ *
+ */
+ protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
+
+ /**
+ * The signature profile identifier identifying the profile to be used in the
+ * config file.
+ *
+ *
+ * Note: In near future it will be possible to provide a full specified
+ * profile here instead of the profile id.
+ *
+ */
+ protected String signatureProfileId = null;
+
+ /**
+ * The signature key identifier specifying which signature key should be used
+ * by the signature device to perform the signature.
+ *
+ *
+ * Providing a null value (default) means that no explicit signature key
+ * identifier is provided. The selected signature device will then use its
+ * default mechanism for retrieving this information (which is usually to read
+ * the key from the provided signature profile).
+ *
+ *
+ * Note that not all signature devices may support this parameter.
+ * If a signature device doesn't support this parameter the value should be null.
+ *
+ *
+ * This key is usually passed straight through to the signature device and
+ * thereby has to contain an appropriate value for the signature device
+ * chosen.
+ *
+ *
+ * Currently, only the {@link Constants#SIGNATURE_DEVICE_MOA} signature device
+ * evaluates this parameter and passes the provided String to MOA as the MOA
+ * key group identifier. If null is provided, the MOA signature device will
+ * determine the signature key identifier to be used from the provided profile
+ * and, if not specified there either, from the MOA default configuration.
+ *
+ */
+ protected String signatureKeyIdentifier = null;
+
+ /**
+ * The signature position. Consult the PDF-AS documentation section
+ * Commandline.
+ */
+ protected SignaturePositioning signaturePositioning = null;
+
+ /**
+ * The output DataSink that will receive the signed document.
+ */
+ protected DataSink output = null;
+
+ protected TimeStamper timeStamperImpl;
+
+ /**
+ * The flag to de-/activate placeholder search
+ */
+ protected Boolean checkForPlaceholder = null;
+
+ /**
+ * The id of the placeholder which should be replaced.
+ */
+ protected String placeholderId;
+
+ /**
+ * The matching mode for placeholder extraction.
+ * If a {@link SignParameters#placeholderId} is set, the match mode determines what is to be done, if no matching placeholder is found in the document.
+ *
+ * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.
+ */
+ protected int placeholderMatchMode = Constants.PLACEHOLDER_MATCH_MODE_MODERATE;
+
+ protected Properties overrideProps = new Properties();
+
+
+
+
+
+ /**
+ * {@link #setTimeStamperImpl(TimeStamper)}
+ * @return
+ */
+ public TimeStamper getTimeStamperImpl() {
+ return this.timeStamperImpl;
+ }
+
+ /**
+ * Set a {@link TimeStamper} to create a timestamp on the signature value. Will be
+ * called after sign. For binary signatures only. Timestamp will be embedded in egiz dict /TimeStamp.
+ * @param timeStamperImpl
+ */
+ public void setTimeStamperImpl(TimeStamper timeStamperImpl) {
+ this.timeStamperImpl = timeStamperImpl;
+ }
+
+/**
+ * @return the document
+ */
+ public DataSource getDocument()
+ {
+ return document;
+ }
+
+ /**
+ * @param document
+ * the document to set
+ */
+ public void setDocument(DataSource document)
+ {
+ this.document = document;
+ }
+
+ /**
+ * @return the signatureType
+ */
+ public String getSignatureType()
+ {
+ return signatureType;
+ }
+
+ /**
+ * @param signatureType
+ * the signatureType to set
+ */
+ public void setSignatureType(String signatureType)
+ {
+ this.signatureType = signatureType;
+ }
+
+ /**
+ * @return the signatureDevice
+ */
+ public String getSignatureDevice()
+ {
+ return signatureDevice;
+ }
+
+ /**
+ * @param signatureDevice
+ * the signatureDevice to set
+ */
+ public void setSignatureDevice(String signatureDevice)
+ {
+ this.signatureDevice = signatureDevice;
+ }
+
+ /**
+ * @return the signatureProfileId
+ */
+ public String getSignatureProfileId()
+ {
+ return signatureProfileId;
+ }
+
+ /**
+ * @param signatureProfileId
+ * the signatureProfileId to set
+ */
+ public void setSignatureProfileId(String signatureProfileId)
+ {
+ this.signatureProfileId = signatureProfileId;
+ }
+
+ /**
+ * @return the signaturePositioning
+ */
+ public SignaturePositioning getSignaturePositioning()
+ {
+ return this.signaturePositioning;
+ }
+
+ /**
+ * @param signaturePositioning
+ * the signaturePositioning to set
+ */
+ public void setSignaturePositioning(SignaturePositioning signaturePositioning)
+ {
+ this.signaturePositioning = signaturePositioning;
+ }
+
+ /**
+ * @return the output
+ */
+ public DataSink getOutput()
+ {
+ return output;
+ }
+
+ /**
+ * @param output
+ * the output to set
+ */
+ public void setOutput(DataSink output)
+ {
+ this.output = output;
+ }
+
+ /**
+ * @return the signatureKeyIdentifier
+ */
+ public String getSignatureKeyIdentifier()
+ {
+ return this.signatureKeyIdentifier;
+ }
+
+ /**
+ * @param signatureKeyIdentifier the signatureKeyIdentifier to set
+ */
+ public void setSignatureKeyIdentifier(String signatureKeyIdentifier)
+ {
+ this.signatureKeyIdentifier = signatureKeyIdentifier;
+ }
+
+ /**
+ * Override user defined values from the used signature profile like "value.SIG_META".
+ * You cannot override pre defined values like SIG_VALUE, SIG_DATE {@link SignatureTypes#REQUIRED_SIG_KEYS}.
+ * The override values are bound to the {@link SignParameters} instance.
+ *
+ * Sample usage:
+ *
+ SignParameters sp = new SignParameters();
+ . . .
+
+ sp.setSignatureProfileId("SIGNATURBLOCK_DE");
+
+ // expressions do not work on binary signature fields without phlength setting!!
+ sp.setProfileOverrideValue("SIG_META", "It's nice to be important, but it is more important to be nice ${subject.L}");;
+ sp.setProfileOverrideValue("SIG_LABEL", "./images/signatur-logo_en.png");
+
+ // execute sign using the overrides
+ pdfAs.sign(sp);
+
+ *
+ * @param key the name of the setting to override e.g. "SIG_META"
+ * @param value The new value
+ */
+ public void setProfileOverrideValue(String key, String value) {
+ if (SignatureTypes.isRequredSigTypeKey(key)) {
+ throw new RuntimeException("cannot set value for pre defined signature field names");
+ }
+ this.overrideProps.put(key, value);
+ }
+
+ /**
+ * Get override values created via {@link #setProfileOverrideValue(String, String)}
+ * @return
+ */
+ public Properties getProfileOverrideProperties() {
+ return this.overrideProps;
+
+ }
+
+ /**
+ * Get the value of the checkForPlaceholder flag.
+ *
+ * @return
+ */
+ public Boolean isCheckForPlaceholder() {
+ return this.checkForPlaceholder;
+ }
+
+ /**
+ * Set this to true, if you want a search for placeholder images to be performed and
+ * appropriate images to be replaced.
+ * If this is not set, a search will only be performed if the configuration property "enable_placeholder_search" is set to true.
+ *
+ * @param check
+ */
+ public void setCheckForPlaceholder(Boolean searchForPlaceHolder) {
+ this.checkForPlaceholder = searchForPlaceHolder;
+ }
+
+ /**
+ * Set an explicit placeholder id.
+ * Only placeholder images that have a matching ID property embedded will be considered for replacement.
+ *
+ * @param placeholderId
+ */
+ public void setPlaceholderId(String placeholderId) {
+ this.placeholderId = placeholderId;
+ }
+
+ /**
+ * The id of the placeholder to replace.
+ *
+ * @return the placeholderId
+ */
+ public String getPlaceholderId() {
+ return placeholderId;
+ }
+
+ /**
+ * Set the behavior if no exactly matching placeholder could be found.
+ * Exactly matching meaning:
+ * - If a placeholderId is set: a placeholder which has exactly this id embedded
+ * - If no placeholderId is set: a placeholder without an embedded id is found
+ *
+ * @see Constants#PLACEHOLDER_MATCH_MODE_LENIENT
+ * @see Constants#PLACEHOLDER_MATCH_MODE_MODERATE
+ * @see Constants#PLACEHOLDER_MATCH_MODE_STRICT
+ *
+ * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.
+ *
+ * @param placeholderMatchMode
+ */
+ public void setPlaceholderMatchMode(int placeholderMatchMode) {
+ this.placeholderMatchMode = placeholderMatchMode;
+ }
+
+ /**
+ * Get the placeholder matching mode.
+ *
+ * @see SignParameters#getPlaceholderMatchMode()
+ * @return the placeholderMatchMode
+ */
+ public int getPlaceholderMatchMode() {
+ return this.placeholderMatchMode;
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java
index ad9b6cf8..e18d8105 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java
@@ -1,85 +1,108 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign;
-
-import java.security.cert.X509Certificate;
-import java.util.List;
-
-import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
-import at.gv.egiz.pdfas.api.io.DataSink;
-import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
-
-/**
- * The result of a sign operation.
- *
- * @author wprinz
- */
-@Deprecated
-public interface SignResult
-{
-
- /**
- * Returns the filled output data sink.
- *
- * @return Returns the filled output data sink.
- */
- public DataSink getOutputDocument();
-
- /**
- * Returns the certificate of the signer.
- *
- * @return Returns the certificate of the signer.
- */
- public X509Certificate getSignerCertificate();
-
- /**
- * Returns the position where the signature is finally placed.
- *
- *
- * This information can be useful for post-processing the document.
- *
- *
- *
- * Consult the PDF-AS documentation section Commandline for further
- * information about positioning.
- *
- *
- * @return Returns the position where the signature is finally placed. May
- * return null if no position information is available.
- */
- public SignaturePosition getSignaturePosition();
-
- /**
- * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document.
- * Only available for textual signatures. Show this to the user who signed the textual content only!
- * @return List<{@link NonTextObjectInfo} or null of not available (binary signature)
- */
- public List getNonTextualObjects();
-
- /**
- * Returns if pdf has non textual objects (only for textual signature available).
- * @return
- */
- public boolean hasNonTextualObjects();
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign;
+
+import java.security.cert.X509Certificate;
+import java.util.List;
+
+import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
+import at.gv.egiz.pdfas.api.io.DataSink;
+import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
+
+/**
+ * The result of a sign operation.
+ *
+ * @author wprinz
+ */
+@Deprecated
+public interface SignResult
+{
+
+ /**
+ * Returns the filled output data sink.
+ *
+ * @return Returns the filled output data sink.
+ */
+ public DataSink getOutputDocument();
+
+ /**
+ * Returns the certificate of the signer.
+ *
+ * @return Returns the certificate of the signer.
+ */
+ public X509Certificate getSignerCertificate();
+
+ /**
+ * Returns the position where the signature is finally placed.
+ *
+ *
+ * This information can be useful for post-processing the document.
+ *
+ *
+ *
+ * Consult the PDF-AS documentation section Commandline for further
+ * information about positioning.
+ *
+ *
+ * @return Returns the position where the signature is finally placed. May
+ * return null if no position information is available.
+ */
+ public SignaturePosition getSignaturePosition();
+
+ /**
+ * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document.
+ * Only available for textual signatures. Show this to the user who signed the textual content only!
+ * @return List<{@link NonTextObjectInfo} or null of not available (binary signature)
+ */
+ public List getNonTextualObjects();
+
+ /**
+ * Returns if pdf has non textual objects (only for textual signature available).
+ * @return
+ */
+ public boolean hasNonTextualObjects();
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java
index b4bba9a3..11b063ed 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java
@@ -1,148 +1,171 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign;
-
-import java.security.cert.X509Certificate;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
-import at.gv.egiz.pdfas.api.io.DataSource;
-import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
-
-/**
- * A container for all relevant signature related data.
- *
- * @author exthex
- */
-@Deprecated
-public interface SignatureDetailInformation
-{
- public DataSource getSignatureData();
-
- /**
- * Returns the position where the signature table was actually placed.
- *
- * @return Returns the position where the signature table was actually placed.
- */
- public SignaturePosition getSignaturePosition();
-
- /**
- * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document.
- * Only available for textual signatures. Show this to the user who signed the textual content only!
- * @return List<{@link NonTextObjectInfo} or null of not available (binary signature)
- */
- public List getNonTextualObjects();
-
- /**
- * Returns the date of signature extracted from the signature.
- * @return
- */
- public Date getSignDate();
-
- /**
- * Get the name of the issuer.
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuer()#getName()}
- *
- * @return
- */
- public String getIssuer();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuerDNMap()}
- *
- * @return
- */
- public Map getIssuerDNMap();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectName()#toString()}
- *
- * @return
- */
- public String getSubjectName();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getSerialNumber()#toString()}
- *
- * @return
- */
- public String getSerialNumber();
-
- /**
- * Get the algorithm the signature was created with.
- * @return
- */
- public String getSigAlgorithm();
-
- /**
- *
- * @return the signature id.
- */
- public String getSigID();
-
- /**
- *
- * @return the signature method.
- */
- public String getSigKZ();
-
- /**
- *
- * @return the signature value.
- */
- public String getSignatureValue();
-
- /**
- *
- * @return the signature time stamp.
- */
- public String getSigTimeStamp();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectDNMap()}
- *
- * @return
- */
- public Map getSubjectDNMap();
-
- /**
- *
- * @return the certificate used for signature.
- */
- public X509Certificate getX509Certificate();
-
- /**
- *
- * @return true if the signature is textual, false otherwise.
- */
- public boolean isTextual();
-
- /**
- *
- * @return true if this signature is binary, false otherwise.
- */
- public boolean isBinary();
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign;
+
+import java.security.cert.X509Certificate;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
+import at.gv.egiz.pdfas.api.io.DataSource;
+import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
+
+/**
+ * A container for all relevant signature related data.
+ *
+ * @author exthex
+ */
+@Deprecated
+public interface SignatureDetailInformation
+{
+ public DataSource getSignatureData();
+
+ /**
+ * Returns the position where the signature table was actually placed.
+ *
+ * @return Returns the position where the signature table was actually placed.
+ */
+ public SignaturePosition getSignaturePosition();
+
+ /**
+ * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document.
+ * Only available for textual signatures. Show this to the user who signed the textual content only!
+ * @return List<{@link NonTextObjectInfo} or null of not available (binary signature)
+ */
+ public List getNonTextualObjects();
+
+ /**
+ * Returns the date of signature extracted from the signature.
+ * @return
+ */
+ public Date getSignDate();
+
+ /**
+ * Get the name of the issuer.
+ * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuer()#getName()}
+ *
+ * @return
+ */
+ public String getIssuer();
+
+ /**
+ * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuerDNMap()}
+ *
+ * @return
+ */
+ public Map getIssuerDNMap();
+
+ /**
+ * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectName()#toString()}
+ *
+ * @return
+ */
+ public String getSubjectName();
+
+ /**
+ * Short for {@link SignatureDetailInformation#getX509Certificate()#getSerialNumber()#toString()}
+ *
+ * @return
+ */
+ public String getSerialNumber();
+
+ /**
+ * Get the algorithm the signature was created with.
+ * @return
+ */
+ public String getSigAlgorithm();
+
+ /**
+ *
+ * @return the signature id.
+ */
+ public String getSigID();
+
+ /**
+ *
+ * @return the signature method.
+ */
+ public String getSigKZ();
+
+ /**
+ *
+ * @return the signature value.
+ */
+ public String getSignatureValue();
+
+ /**
+ *
+ * @return the signature time stamp.
+ */
+ public String getSigTimeStamp();
+
+ /**
+ * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectDNMap()}
+ *
+ * @return
+ */
+ public Map getSubjectDNMap();
+
+ /**
+ *
+ * @return the certificate used for signature.
+ */
+ public X509Certificate getX509Certificate();
+
+ /**
+ *
+ * @return true if the signature is textual, false otherwise.
+ */
+ public boolean isTextual();
+
+ /**
+ *
+ * @return true if this signature is binary, false otherwise.
+ */
+ public boolean isBinary();
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java
index f16d2ffb..ce73039f 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java
@@ -1,73 +1,96 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos;
-
-/**
- * Holds the actual, absolute signature position where a signature was placed.
- *
- *
- * This is usually returned after signing.
- *
- *
- * @author wprinz
- */
-@Deprecated
-public interface SignaturePosition
-{
- /**
- * Returns the page on which the signature was placed.
- *
- * @return Returns the page on which the signature was placed.
- */
- public int getPage();
-
- /**
- * Returns the x position.
- *
- * @return Returns the x position.
- */
- public float getX();
-
- /**
- * Returns the y position.
- *
- * @return Returns the y position.
- */
- public float getY();
-
- /**
- * Returns the width of the signature.
- *
- * @return Returns the width of the signature.
- */
- public float getWidth();
-
- /**
- * Returns the height of the signature.
- *
- * @return Returns the height of the signature.
- */
- public float getHeight();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos;
+
+/**
+ * Holds the actual, absolute signature position where a signature was placed.
+ *
+ *
+ * This is usually returned after signing.
+ *
+ *
+ * @author wprinz
+ */
+@Deprecated
+public interface SignaturePosition
+{
+ /**
+ * Returns the page on which the signature was placed.
+ *
+ * @return Returns the page on which the signature was placed.
+ */
+ public int getPage();
+
+ /**
+ * Returns the x position.
+ *
+ * @return Returns the x position.
+ */
+ public float getX();
+
+ /**
+ * Returns the y position.
+ *
+ * @return Returns the y position.
+ */
+ public float getY();
+
+ /**
+ * Returns the width of the signature.
+ *
+ * @return Returns the width of the signature.
+ */
+ public float getWidth();
+
+ /**
+ * Returns the height of the signature.
+ *
+ * @return Returns the height of the signature.
+ */
+ public float getHeight();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
index 029d9022..ab5bb652 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
@@ -1,337 +1,360 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos;
-
-import java.io.Serializable;
-import java.util.StringTokenizer;
-
-import at.gv.egiz.pdfas.api.exceptions.ErrorCode;
-import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
-import at.gv.egiz.pdfas.api.sign.pos.axis.AbsoluteAxisAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.axis.AutoAxisAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.axis.AxisAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.AbsolutePageAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.AutoPageAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.NewPageAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.PageAlgorithm;
-
-/**
- * Defines how the signature positioning is to be performed.
- *
- *
- * This positioning allows to select the location where the signature block is
- * placed in the document.
- *
- *
- * @author wprinz
- */
-public class SignaturePositioning implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * The x axis algorithm.
- *
- *
- * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
- *
- */
- protected AxisAlgorithm xAlgorithm = new AutoAxisAlgorithm();
-
- /**
- * The y axis algorithm.
- *
- *
- * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
- *
- */
- protected AxisAlgorithm yAlgorithm = new AutoAxisAlgorithm();
-
- /**
- * The width algorithm.
- *
- *
- * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
- *
- */
- protected AxisAlgorithm widthAlgorithm = new AutoAxisAlgorithm();
-
- /**
- * The page algorithm.
- *
- *
- * May be {@link AutoPageAlgorithm}, {@link AbsolutePageAlgorithm} or
- * {@link NewPageAlgorithm}
- *
- */
- protected PageAlgorithm pageAlgorithm = new AutoPageAlgorithm();
-
- /**
- * Provides the position of the footline.
- *
- *
- * Only used if the pageAlgorithm is {@link AutoPageAlgorithm} and the
- * yAlgorithm is {@link AutoAxisAlgorithm}
- *
- */
- protected float footerLine = 0.0f;
-
- protected void checkAxisAlgorithm(AxisAlgorithm algorithm)
- {
- if (algorithm == null)
- {
- throw new IllegalArgumentException("The algorithm must not be null.");
- }
- if (!(algorithm instanceof AutoAxisAlgorithm) && !(algorithm instanceof AbsoluteAxisAlgorithm))
- {
- throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
- }
- }
-
- protected void checkPageAlgorithm(PageAlgorithm algorithm)
- {
- if (algorithm == null)
- {
- throw new IllegalArgumentException("The algorithm must not be null.");
- }
- if (!(algorithm instanceof AutoPageAlgorithm) && !(algorithm instanceof AbsolutePageAlgorithm) && !(algorithm instanceof NewPageAlgorithm))
- {
- throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
- }
-
- }
-
- /**
- * @return the xAlgorithm
- */
- public AxisAlgorithm getXAlgorithm()
- {
- return this.xAlgorithm;
- }
-
- /**
- * @param algorithm
- * the xAlgorithm to set
- */
- public void setXAlgorithm(AxisAlgorithm algorithm)
- {
- checkAxisAlgorithm(algorithm);
- xAlgorithm = algorithm;
- }
-
- /**
- * @return the yAlgorithm
- */
- public AxisAlgorithm getYAlgorithm()
- {
- return this.yAlgorithm;
- }
-
- /**
- * @param algorithm
- * the yAlgorithm to set
- */
- public void setYAlgorithm(AxisAlgorithm algorithm)
- {
- checkAxisAlgorithm(algorithm);
-
- yAlgorithm = algorithm;
- }
-
- /**
- * @return the widthAlgorithm
- */
- public AxisAlgorithm getWidthAlgorithm()
- {
- return this.widthAlgorithm;
- }
-
- /**
- * @param widthAlgorithm
- * the widthAlgorithm to set
- */
- public void setWidthAlgorithm(AxisAlgorithm widthAlgorithm)
- {
- checkAxisAlgorithm(widthAlgorithm);
-
- this.widthAlgorithm = widthAlgorithm;
- }
-
- /**
- * @return the pageAlgorithm
- */
- public PageAlgorithm getPageAlgorithm()
- {
- return this.pageAlgorithm;
- }
-
- /**
- * @param pageAlgorithm
- * the pageAlgorithm to set
- */
- public void setPageAlgorithm(PageAlgorithm pageAlgorithm)
- {
- checkPageAlgorithm(pageAlgorithm);
- this.pageAlgorithm = pageAlgorithm;
- }
-
- /**
- * @return the footerLine
- */
- public float getFooterLine()
- {
- return this.footerLine;
- }
-
- /**
- * @param footerLine
- * the footerLine to set
- */
- public void setFooterLine(float footerLine)
- {
- this.footerLine = footerLine;
- }
-
- public SignaturePositioning() {
- }
-
- public SignaturePositioning(String position) throws PdfAsException {
- if (position != null) {
- StringTokenizer tokenizer = new StringTokenizer(position, ";");
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken().replaceAll(" ", "");
- String[] sToken = token.split(":");
- if (sToken == null || sToken.length != 2 || sToken[0].length() != 1) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- char cmd = sToken[0].toLowerCase().charAt(0);
- String value = sToken[1];
- switch (cmd) {
- case 'x':
- if ("auto".equalsIgnoreCase(value)) {
- this.setXAlgorithm(new AutoAxisAlgorithm());
- } else {
- try {
- this.setXAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'y':
- if ("auto".equalsIgnoreCase(value)) {
- this.setYAlgorithm(new AutoAxisAlgorithm());
- } else {
- try {
- this.setYAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'w':
- if ("auto".equalsIgnoreCase(value)) {
- this.setWidthAlgorithm(new AutoAxisAlgorithm());
- } else {
- try {
- this.setWidthAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'p':
- if ("auto".equalsIgnoreCase(value)) {
- this.setPageAlgorithm(new AutoPageAlgorithm());
- } else if ("new".equalsIgnoreCase(value)) {
- this.setPageAlgorithm(new NewPageAlgorithm());
- } else {
- try {
- this.setPageAlgorithm(new AbsolutePageAlgorithm(Integer.parseInt(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'f':
- try {
- this.setFooterLine(Float.parseFloat(value));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- break;
- default:
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- }
- }
-
- public String getPositionString() {
- StringBuilder sb = new StringBuilder();
- AxisAlgorithm xAlgo = getXAlgorithm();
-
- if(xAlgo instanceof AutoAxisAlgorithm) {
- sb.append("x:auto;");
- } else if(xAlgo instanceof AbsoluteAxisAlgorithm) {
- sb.append("x:" + ((AbsoluteAxisAlgorithm)xAlgo).getAbsoluteValue() + ";");
- }
-
- AxisAlgorithm yAlgo = getXAlgorithm();
-
- if(yAlgo instanceof AutoAxisAlgorithm) {
- sb.append("y:auto;");
- } else if(yAlgo instanceof AbsoluteAxisAlgorithm) {
- sb.append("y:" + ((AbsoluteAxisAlgorithm)yAlgo).getAbsoluteValue() + ";");
- }
-
- AxisAlgorithm wAlgo = getWidthAlgorithm();
-
- if(wAlgo instanceof AutoAxisAlgorithm) {
- sb.append("w:auto;");
- } else if(wAlgo instanceof AbsoluteAxisAlgorithm) {
- sb.append("w:" + ((AbsoluteAxisAlgorithm)wAlgo).getAbsoluteValue() + ";");
- }
-
- PageAlgorithm pAlgo = getPageAlgorithm();
-
- if(pAlgo instanceof AutoPageAlgorithm) {
- sb.append("p:auto;");
- } else if(pAlgo instanceof NewPageAlgorithm) {
- sb.append("p:new;");
- }
-
- float footerLine = getFooterLine();
-
- sb.append("f:" + + footerLine);
-
- return sb.toString();
- }
-
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos;
+
+import java.io.Serializable;
+import java.util.StringTokenizer;
+
+import at.gv.egiz.pdfas.api.exceptions.ErrorCode;
+import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
+import at.gv.egiz.pdfas.api.sign.pos.axis.AbsoluteAxisAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.axis.AutoAxisAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.axis.AxisAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.AbsolutePageAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.AutoPageAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.NewPageAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.PageAlgorithm;
+
+/**
+ * Defines how the signature positioning is to be performed.
+ *
+ *
+ * This positioning allows to select the location where the signature block is
+ * placed in the document.
+ *
+ *
+ * @author wprinz
+ */
+public class SignaturePositioning implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The x axis algorithm.
+ *
+ *
+ * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
+ *
+ */
+ protected AxisAlgorithm xAlgorithm = new AutoAxisAlgorithm();
+
+ /**
+ * The y axis algorithm.
+ *
+ *
+ * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
+ *
+ */
+ protected AxisAlgorithm yAlgorithm = new AutoAxisAlgorithm();
+
+ /**
+ * The width algorithm.
+ *
+ *
+ * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
+ *
+ */
+ protected AxisAlgorithm widthAlgorithm = new AutoAxisAlgorithm();
+
+ /**
+ * The page algorithm.
+ *
+ *
+ * May be {@link AutoPageAlgorithm}, {@link AbsolutePageAlgorithm} or
+ * {@link NewPageAlgorithm}
+ *
+ */
+ protected PageAlgorithm pageAlgorithm = new AutoPageAlgorithm();
+
+ /**
+ * Provides the position of the footline.
+ *
+ *
+ * Only used if the pageAlgorithm is {@link AutoPageAlgorithm} and the
+ * yAlgorithm is {@link AutoAxisAlgorithm}
+ *
+ */
+ protected float footerLine = 0.0f;
+
+ protected void checkAxisAlgorithm(AxisAlgorithm algorithm)
+ {
+ if (algorithm == null)
+ {
+ throw new IllegalArgumentException("The algorithm must not be null.");
+ }
+ if (!(algorithm instanceof AutoAxisAlgorithm) && !(algorithm instanceof AbsoluteAxisAlgorithm))
+ {
+ throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
+ }
+ }
+
+ protected void checkPageAlgorithm(PageAlgorithm algorithm)
+ {
+ if (algorithm == null)
+ {
+ throw new IllegalArgumentException("The algorithm must not be null.");
+ }
+ if (!(algorithm instanceof AutoPageAlgorithm) && !(algorithm instanceof AbsolutePageAlgorithm) && !(algorithm instanceof NewPageAlgorithm))
+ {
+ throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
+ }
+
+ }
+
+ /**
+ * @return the xAlgorithm
+ */
+ public AxisAlgorithm getXAlgorithm()
+ {
+ return this.xAlgorithm;
+ }
+
+ /**
+ * @param algorithm
+ * the xAlgorithm to set
+ */
+ public void setXAlgorithm(AxisAlgorithm algorithm)
+ {
+ checkAxisAlgorithm(algorithm);
+ xAlgorithm = algorithm;
+ }
+
+ /**
+ * @return the yAlgorithm
+ */
+ public AxisAlgorithm getYAlgorithm()
+ {
+ return this.yAlgorithm;
+ }
+
+ /**
+ * @param algorithm
+ * the yAlgorithm to set
+ */
+ public void setYAlgorithm(AxisAlgorithm algorithm)
+ {
+ checkAxisAlgorithm(algorithm);
+
+ yAlgorithm = algorithm;
+ }
+
+ /**
+ * @return the widthAlgorithm
+ */
+ public AxisAlgorithm getWidthAlgorithm()
+ {
+ return this.widthAlgorithm;
+ }
+
+ /**
+ * @param widthAlgorithm
+ * the widthAlgorithm to set
+ */
+ public void setWidthAlgorithm(AxisAlgorithm widthAlgorithm)
+ {
+ checkAxisAlgorithm(widthAlgorithm);
+
+ this.widthAlgorithm = widthAlgorithm;
+ }
+
+ /**
+ * @return the pageAlgorithm
+ */
+ public PageAlgorithm getPageAlgorithm()
+ {
+ return this.pageAlgorithm;
+ }
+
+ /**
+ * @param pageAlgorithm
+ * the pageAlgorithm to set
+ */
+ public void setPageAlgorithm(PageAlgorithm pageAlgorithm)
+ {
+ checkPageAlgorithm(pageAlgorithm);
+ this.pageAlgorithm = pageAlgorithm;
+ }
+
+ /**
+ * @return the footerLine
+ */
+ public float getFooterLine()
+ {
+ return this.footerLine;
+ }
+
+ /**
+ * @param footerLine
+ * the footerLine to set
+ */
+ public void setFooterLine(float footerLine)
+ {
+ this.footerLine = footerLine;
+ }
+
+ public SignaturePositioning() {
+ }
+
+ public SignaturePositioning(String position) throws PdfAsException {
+ if (position != null) {
+ StringTokenizer tokenizer = new StringTokenizer(position, ";");
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken().replaceAll(" ", "");
+ String[] sToken = token.split(":");
+ if (sToken == null || sToken.length != 2 || sToken[0].length() != 1) {
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ char cmd = sToken[0].toLowerCase().charAt(0);
+ String value = sToken[1];
+ switch (cmd) {
+ case 'x':
+ if ("auto".equalsIgnoreCase(value)) {
+ this.setXAlgorithm(new AutoAxisAlgorithm());
+ } else {
+ try {
+ this.setXAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
+ } catch (NumberFormatException e) {
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ }
+ break;
+ case 'y':
+ if ("auto".equalsIgnoreCase(value)) {
+ this.setYAlgorithm(new AutoAxisAlgorithm());
+ } else {
+ try {
+ this.setYAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
+ } catch (NumberFormatException e) {
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ }
+ break;
+ case 'w':
+ if ("auto".equalsIgnoreCase(value)) {
+ this.setWidthAlgorithm(new AutoAxisAlgorithm());
+ } else {
+ try {
+ this.setWidthAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
+ } catch (NumberFormatException e) {
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ }
+ break;
+ case 'p':
+ if ("auto".equalsIgnoreCase(value)) {
+ this.setPageAlgorithm(new AutoPageAlgorithm());
+ } else if ("new".equalsIgnoreCase(value)) {
+ this.setPageAlgorithm(new NewPageAlgorithm());
+ } else {
+ try {
+ this.setPageAlgorithm(new AbsolutePageAlgorithm(Integer.parseInt(value)));
+ } catch (NumberFormatException e) {
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ }
+ break;
+ case 'f':
+ try {
+ this.setFooterLine(Float.parseFloat(value));
+ } catch (NumberFormatException e) {
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ break;
+ default:
+ throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
+ }
+ }
+ }
+ }
+
+ public String getPositionString() {
+ StringBuilder sb = new StringBuilder();
+ AxisAlgorithm xAlgo = getXAlgorithm();
+
+ if(xAlgo instanceof AutoAxisAlgorithm) {
+ sb.append("x:auto;");
+ } else if(xAlgo instanceof AbsoluteAxisAlgorithm) {
+ sb.append("x:" + ((AbsoluteAxisAlgorithm)xAlgo).getAbsoluteValue() + ";");
+ }
+
+ AxisAlgorithm yAlgo = getXAlgorithm();
+
+ if(yAlgo instanceof AutoAxisAlgorithm) {
+ sb.append("y:auto;");
+ } else if(yAlgo instanceof AbsoluteAxisAlgorithm) {
+ sb.append("y:" + ((AbsoluteAxisAlgorithm)yAlgo).getAbsoluteValue() + ";");
+ }
+
+ AxisAlgorithm wAlgo = getWidthAlgorithm();
+
+ if(wAlgo instanceof AutoAxisAlgorithm) {
+ sb.append("w:auto;");
+ } else if(wAlgo instanceof AbsoluteAxisAlgorithm) {
+ sb.append("w:" + ((AbsoluteAxisAlgorithm)wAlgo).getAbsoluteValue() + ";");
+ }
+
+ PageAlgorithm pAlgo = getPageAlgorithm();
+
+ if(pAlgo instanceof AutoPageAlgorithm) {
+ sb.append("p:auto;");
+ } else if(pAlgo instanceof NewPageAlgorithm) {
+ sb.append("p:new;");
+ }
+
+ float footerLine = getFooterLine();
+
+ sb.append("f:" + + footerLine);
+
+ return sb.toString();
+ }
+
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java
index ea2143dd..7d550ddc 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java
@@ -1,62 +1,85 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.axis;
-
-import java.io.Serializable;
-
-/**
- * An absolute positioned element.
- * @author wprinz
- */
-public class AbsoluteAxisAlgorithm extends AxisAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * The absolute positioning value on the axis.
- */
- protected float absoluteValue = 0.0f;
-
- /**
- * Constructor.
- * @param absoluteValue The absolute positioning value on the axis.
- */
- public AbsoluteAxisAlgorithm (float absoluteValue)
- {
- this.absoluteValue = absoluteValue;
- }
-
- /**
- * Returns absolute positioning value on the axis.
- * @return the absoluteValue Returns absolute positioning value on the axis.
- */
- public float getAbsoluteValue()
- {
- return this.absoluteValue;
- }
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.axis;
+
+import java.io.Serializable;
+
+/**
+ * An absolute positioned element.
+ * @author wprinz
+ */
+public class AbsoluteAxisAlgorithm extends AxisAlgorithm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The absolute positioning value on the axis.
+ */
+ protected float absoluteValue = 0.0f;
+
+ /**
+ * Constructor.
+ * @param absoluteValue The absolute positioning value on the axis.
+ */
+ public AbsoluteAxisAlgorithm (float absoluteValue)
+ {
+ this.absoluteValue = absoluteValue;
+ }
+
+ /**
+ * Returns absolute positioning value on the axis.
+ * @return the absoluteValue Returns absolute positioning value on the axis.
+ */
+ public float getAbsoluteValue()
+ {
+ return this.absoluteValue;
+ }
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java
index a9857b42..e0fa101d 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java
@@ -1,41 +1,64 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.axis;
-
-import java.io.Serializable;
-
-/**
- * Auto positioning for this element.
- *
- * @author wprinz
- */
-public class AutoAxisAlgorithm extends AxisAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-// empty
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.axis;
+
+import java.io.Serializable;
+
+/**
+ * Auto positioning for this element.
+ *
+ * @author wprinz
+ */
+public class AutoAxisAlgorithm extends AxisAlgorithm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+// empty
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java
index dd1d1700..c43bca89 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java
@@ -1,41 +1,64 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.axis;
-
-import java.io.Serializable;
-
-/**
- * Determines how a certain position is chosen on the axis (x, y, width).
- *
- * @author wprinz
- */
-public abstract class AxisAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-// base class
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.axis;
+
+import java.io.Serializable;
+
+/**
+ * Determines how a certain position is chosen on the axis (x, y, width).
+ *
+ * @author wprinz
+ */
+public abstract class AxisAlgorithm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+// base class
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java
index c4f24440..8703b27d 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
/**
*
*/
@@ -5,4 +28,4 @@
* @author afitzek
*
*/
-package at.gv.egiz.pdfas.api.sign.pos.axis;
\ No newline at end of file
+package at.gv.egiz.pdfas.api.sign.pos.axis;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java
index 80914293..1dbd22eb 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
/**
*
*/
@@ -5,4 +28,4 @@
* @author afitzek
*
*/
-package at.gv.egiz.pdfas.api.sign.pos;
\ No newline at end of file
+package at.gv.egiz.pdfas.api.sign.pos;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java
index 434c20c4..ed17954f 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java
@@ -1,64 +1,87 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * The page is selected absolutely by giving the page number directly.
- *
- * @author wprinz
- */
-public class AbsolutePageAlgorithm extends PageAlgorithm implements Serializable
-{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * The page.
- */
- protected int page = -1;
-
- /**
- * Constructor.
- *
- * @param page
- * The page.
- */
- public AbsolutePageAlgorithm(int page)
- {
- this.page = page;
- }
-
- /**
- * @return the page
- */
- public int getPage()
- {
- return this.page;
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.page;
+
+import java.io.Serializable;
+
+/**
+ * The page is selected absolutely by giving the page number directly.
+ *
+ * @author wprinz
+ */
+public class AbsolutePageAlgorithm extends PageAlgorithm implements Serializable
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The page.
+ */
+ protected int page = -1;
+
+ /**
+ * Constructor.
+ *
+ * @param page
+ * The page.
+ */
+ public AbsolutePageAlgorithm(int page)
+ {
+ this.page = page;
+ }
+
+ /**
+ * @return the page
+ */
+ public int getPage()
+ {
+ return this.page;
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java
index fffcbad0..54365613 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java
@@ -1,47 +1,70 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * The page for placing the signature is selected automatically.
- *
- *
- * The algorithm first tries to place the signature on the free space of the
- * last page (considering the footer). If there is not enough space on the last
- * page, a new page is appended and the signature is placed there.
- *
- *
- * @author wprinz
- */
-public class AutoPageAlgorithm extends PageAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-// empty
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.page;
+
+import java.io.Serializable;
+
+/**
+ * The page for placing the signature is selected automatically.
+ *
+ *
+ * The algorithm first tries to place the signature on the free space of the
+ * last page (considering the footer). If there is not enough space on the last
+ * page, a new page is appended and the signature is placed there.
+ *
+ *
+ * @author wprinz
+ */
+public class AutoPageAlgorithm extends PageAlgorithm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+// empty
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java
index ded9f618..e3f4b9cc 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java
@@ -1,41 +1,64 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * Places the signature on a new Page.
- *
- * @author wprinz
- */
-public class NewPageAlgorithm extends PageAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // empty block
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.page;
+
+import java.io.Serializable;
+
+/**
+ * Places the signature on a new Page.
+ *
+ * @author wprinz
+ */
+public class NewPageAlgorithm extends PageAlgorithm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // empty block
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java
index 16aa72ca..64840d90 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java
@@ -1,41 +1,64 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * Determines how the page on which the signature is to be placed is selected.
- *
- * @author wprinz
- */
-public abstract class PageAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // empty
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.sign.pos.page;
+
+import java.io.Serializable;
+
+/**
+ * Determines how the page on which the signature is to be placed is selected.
+ *
+ * @author wprinz
+ */
+public abstract class PageAlgorithm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ // empty
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java
index fec6dbea..9ac906ec 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
/**
*
*/
@@ -5,4 +28,4 @@
* @author afitzek
*
*/
-package at.gv.egiz.pdfas.api.sign.pos.page;
\ No newline at end of file
+package at.gv.egiz.pdfas.api.sign.pos.page;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/DummyTimeStamper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/DummyTimeStamper.java
index 0245a7ca..ffad7790 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/DummyTimeStamper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/DummyTimeStamper.java
@@ -1,63 +1,86 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.timestamp;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Dummy/test implementation of the timestamper. Logs and stores test-timestamp for assertion {@link #getLastTimeStamp()}
- *
- * @author dferbas
- *
- */
-public class DummyTimeStamper implements TimeStamper {
- private static Log log = LogFactory.getLog(DummyTimeStamper.class);
-
- private String lastTimeStamp;
-
- public String applyTimeStamp(String b64SignatureValue) {
- log.debug("Applying dummy timestamp on signature value: " + b64SignatureValue);
- SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSSZ");
- String ts = formater.format(new Date());
- log.debug("Timestamp: " + ts);
- ts = new String(Base64.encodeBase64(ts.getBytes()));
- log.debug("Timestamp value (base64): " + ts);
- this.lastTimeStamp = ts;
- return ts;
- }
-
- public String getLastTimeStamp() {
- return this.lastTimeStamp;
- }
-
- public void setLastTimeStamp(String lastTimeStamp) {
- this.lastTimeStamp = lastTimeStamp;
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.timestamp;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Dummy/test implementation of the timestamper. Logs and stores test-timestamp for assertion {@link #getLastTimeStamp()}
+ *
+ * @author dferbas
+ *
+ */
+public class DummyTimeStamper implements TimeStamper {
+ private static Log log = LogFactory.getLog(DummyTimeStamper.class);
+
+ private String lastTimeStamp;
+
+ public String applyTimeStamp(String b64SignatureValue) {
+ log.debug("Applying dummy timestamp on signature value: " + b64SignatureValue);
+ SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSSZ");
+ String ts = formater.format(new Date());
+ log.debug("Timestamp: " + ts);
+ ts = new String(Base64.encodeBase64(ts.getBytes()));
+ log.debug("Timestamp value (base64): " + ts);
+ this.lastTimeStamp = ts;
+ return ts;
+ }
+
+ public String getLastTimeStamp() {
+ return this.lastTimeStamp;
+ }
+
+ public void setLastTimeStamp(String lastTimeStamp) {
+ this.lastTimeStamp = lastTimeStamp;
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/TimeStamper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/TimeStamper.java
index 99bda3a7..b8cb3974 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/TimeStamper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/TimeStamper.java
@@ -1,41 +1,64 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.timestamp;
-
-/**
- * Interface for timestamper implementations/handlers
- *
- * @author dferbas
- *
- */
-public interface TimeStamper {
-
- /**
- * Implement timestamp in this method.
- * @param b64SignatureValue signature value, base64 encoded
- * @return timestamp to be embedded in egiz dictionary base64 encoded (following RFC3161).
- */
- public String applyTimeStamp(String b64SignatureValue);
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.timestamp;
+
+/**
+ * Interface for timestamper implementations/handlers
+ *
+ * @author dferbas
+ *
+ */
+public interface TimeStamper {
+
+ /**
+ * Implement timestamp in this method.
+ * @param b64SignatureValue signature value, base64 encoded
+ * @return timestamp to be embedded in egiz dictionary base64 encoded (following RFC3161).
+ */
+ public String applyTimeStamp(String b64SignatureValue);
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/package-info.java
index 30b76e0c..32c3fe67 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/package-info.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/timestamp/package-info.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
/**
*
*/
@@ -5,4 +28,4 @@
* @author afitzek
*
*/
-package at.gv.egiz.pdfas.api.timestamp;
\ No newline at end of file
+package at.gv.egiz.pdfas.api.timestamp;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/SignatureCheck.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/SignatureCheck.java
index c1690774..2b38819a 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/SignatureCheck.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/SignatureCheck.java
@@ -1,51 +1,74 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.verify;
-
-/**
- * The result of a signature check performed by a verification device.
- *
- * @see VerifyResult
- *
- * @author wprinz
- */
-public interface SignatureCheck
-{
- /**
- * Returns the response code of the check.
- *
- * @return Returns the response code of the check.
- */
- public int getCode();
-
- /**
- * Returns the textual response message of the check (corresponding to the
- * code).
- *
- * @return Returns the textual response message of the check (corresponding to
- * the code).
- */
- public String getMessage();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.verify;
+
+/**
+ * The result of a signature check performed by a verification device.
+ *
+ * @see VerifyResult
+ *
+ * @author wprinz
+ */
+public interface SignatureCheck
+{
+ /**
+ * Returns the response code of the check.
+ *
+ * @return Returns the response code of the check.
+ */
+ public int getCode();
+
+ /**
+ * Returns the textual response message of the check (corresponding to the
+ * code).
+ *
+ * @return Returns the textual response message of the check (corresponding to
+ * the code).
+ */
+ public String getMessage();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java
index 8b9e2c6a..62b7e7e4 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java
@@ -1,166 +1,189 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.verify;
-
-import java.util.Date;
-
-import at.gv.egiz.pdfas.api.analyze.AnalyzeResult;
-import at.gv.egiz.pdfas.api.commons.Constants;
-
-/**
- * Parameter object that holds the verify after analysis parameters.
- *
- * @author wprinz
- */
-public class VerifyAfterAnalysisParameters
-{
-
- /**
- * The list of signatures to be verified.
- */
- protected AnalyzeResult analyzeResult = null;
-
- /**
- * The signature device to perform the actual signature.
- *
- *
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- *
- */
- protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
-
- /**
- * Allows to pass a VerificationTime to the signature device.
- */
- protected Date verificationTime = null;
-
- /**
- * Tells the signature device (e.g. MOA) to return the signature hash input
- * data (which is the probably transformed signed data).
- *
- *
- * Note that this forces MOA to return the potentially large signature data to
- * be returned in the result XML, which may result in very bad performance.
- *
- */
- protected boolean returnHashInputData = false;
-
- /**
- * The index of the signature to be verified. A value < 0 indicates to verify all signatures.
- */
- protected int verifySignatureIndex = -1;
-
- /**
- * @return the analyzeResult
- */
- public AnalyzeResult getAnalyzeResult()
- {
- return this.analyzeResult;
- }
-
- /**
- * @param analyzeResult
- * the analyzeResult to set
- */
- public void setAnalyzeResult(AnalyzeResult analyzeResult)
- {
- this.analyzeResult = analyzeResult;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return this.signatureDevice;
- }
-
- /**
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-
- /**
- * @return the verificationTime
- */
- public Date getVerificationTime()
- {
- return this.verificationTime;
- }
-
- /**
- * @param verificationTime the verificationTime to set
- */
- public void setVerificationTime(Date verificationTime)
- {
- this.verificationTime = verificationTime;
- }
-
- /**
- * @return the returnHashInputData
- */
- public boolean isReturnHashInputData()
- {
- return this.returnHashInputData;
- }
-
- /**
- * @param returnHashInputData
- * the returnHashInputData to set
- */
- public void setReturnHashInputData(boolean returnHashInputData)
- {
- this.returnHashInputData = returnHashInputData;
- }
-
- /**
- * Set the index of the signature to verify (index starting at 0). A value < 0 indicates to verify all values.
- * @param verify_which
- */
- public void setVerifySignatureIndex(int verify_which) {
- this.verifySignatureIndex = verify_which;
- }
-
- public int getVerifySignatureIndex() {
- return verifySignatureIndex;
- }
-
- /**
- * @see VerifyParameters#setSuppressVerifyExceptions(boolean)
- * @param suppress
- */
- public void setSuppressVerifyExceptions(boolean suppress) {
- VerifyParameters.setSuppressVerify(suppress);
- }
-
- public boolean isSuppressVerifyExceptions() {
- return VerifyParameters.isSuppressVerifyExceptions();
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.verify;
+
+import java.util.Date;
+
+import at.gv.egiz.pdfas.api.analyze.AnalyzeResult;
+import at.gv.egiz.pdfas.api.commons.Constants;
+
+/**
+ * Parameter object that holds the verify after analysis parameters.
+ *
+ * @author wprinz
+ */
+public class VerifyAfterAnalysisParameters
+{
+
+ /**
+ * The list of signatures to be verified.
+ */
+ protected AnalyzeResult analyzeResult = null;
+
+ /**
+ * The signature device to perform the actual signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
+ * {@link Constants#SIGNATURE_DEVICE_BKU}.
+ *
+ */
+ protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
+
+ /**
+ * Allows to pass a VerificationTime to the signature device.
+ */
+ protected Date verificationTime = null;
+
+ /**
+ * Tells the signature device (e.g. MOA) to return the signature hash input
+ * data (which is the probably transformed signed data).
+ *
+ *
+ * Note that this forces MOA to return the potentially large signature data to
+ * be returned in the result XML, which may result in very bad performance.
+ *
+ */
+ protected boolean returnHashInputData = false;
+
+ /**
+ * The index of the signature to be verified. A value < 0 indicates to verify all signatures.
+ */
+ protected int verifySignatureIndex = -1;
+
+ /**
+ * @return the analyzeResult
+ */
+ public AnalyzeResult getAnalyzeResult()
+ {
+ return this.analyzeResult;
+ }
+
+ /**
+ * @param analyzeResult
+ * the analyzeResult to set
+ */
+ public void setAnalyzeResult(AnalyzeResult analyzeResult)
+ {
+ this.analyzeResult = analyzeResult;
+ }
+
+ /**
+ * @return the signatureDevice
+ */
+ public String getSignatureDevice()
+ {
+ return this.signatureDevice;
+ }
+
+ /**
+ * @param signatureDevice
+ * the signatureDevice to set
+ */
+ public void setSignatureDevice(String signatureDevice)
+ {
+ this.signatureDevice = signatureDevice;
+ }
+
+ /**
+ * @return the verificationTime
+ */
+ public Date getVerificationTime()
+ {
+ return this.verificationTime;
+ }
+
+ /**
+ * @param verificationTime the verificationTime to set
+ */
+ public void setVerificationTime(Date verificationTime)
+ {
+ this.verificationTime = verificationTime;
+ }
+
+ /**
+ * @return the returnHashInputData
+ */
+ public boolean isReturnHashInputData()
+ {
+ return this.returnHashInputData;
+ }
+
+ /**
+ * @param returnHashInputData
+ * the returnHashInputData to set
+ */
+ public void setReturnHashInputData(boolean returnHashInputData)
+ {
+ this.returnHashInputData = returnHashInputData;
+ }
+
+ /**
+ * Set the index of the signature to verify (index starting at 0). A value < 0 indicates to verify all values.
+ * @param verify_which
+ */
+ public void setVerifySignatureIndex(int verify_which) {
+ this.verifySignatureIndex = verify_which;
+ }
+
+ public int getVerifySignatureIndex() {
+ return verifySignatureIndex;
+ }
+
+ /**
+ * @see VerifyParameters#setSuppressVerifyExceptions(boolean)
+ * @param suppress
+ */
+ public void setSuppressVerifyExceptions(boolean suppress) {
+ VerifyParameters.setSuppressVerify(suppress);
+ }
+
+ public boolean isSuppressVerifyExceptions() {
+ return VerifyParameters.isSuppressVerifyExceptions();
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java
index 8f8d17c7..d5b04e43 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java
@@ -1,169 +1,192 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.verify;
-
-import java.util.Date;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.api.xmldsig.ReconstructXMLDsigResult;
-
-/**
- * This class represents the parameters needed for verify after reconstructXMLDsig has already been executed.
- *
- * @author exthex
- *
- */
-public class VerifyAfterReconstructXMLDsigParameters {
-
- /**
- * The list of signatures to be verified.
- */
- protected ReconstructXMLDsigResult reconstructXMLDsigResult = null;
-
- /**
- * The signature device to perform the actual signature.
- *
- *
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- *
- */
- protected String signatureDevice;
-
- /**
- * Allows to pass a VerificationTime to the signature device.
- */
- protected Date verificationTime = null;
-
- /**
- * Tells the signature device (e.g. MOA) to return the signature hash input
- * data (which is the probably transformed signed data).
- *
- *
- * Note that this forces MOA to return the potentially large signature data to
- * be returned in the result XML, which may result in very bad performance.
- *
- */
- protected boolean returnHashInputData = false;
-
- /**
- * The index of the signature to be verified. A value < 0 indicates to verify all signatures.
- */
- protected int verifySignatureIndex = -1;
-
- /**
- * @return the reconstructXMLDsigResult
- */
- public ReconstructXMLDsigResult getReconstructXMLDsigResult()
- {
- return this.reconstructXMLDsigResult;
- }
-
- /**
- * @param reconstructXMLDsigResult
- * the reconstructXMLDsigResult to set
- */
- public void setReconstructXMLDsigResult(ReconstructXMLDsigResult reconstructXMLDsigResult)
- {
- this.reconstructXMLDsigResult = reconstructXMLDsigResult;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return this.signatureDevice;
- }
-
- /**
- * Set the signature device to use for verification.
- * If none is set here, the signature device that was used for reconstructXMLDsig will be used.
- *
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-
- /**
- * @return the verificationTime
- */
- public Date getVerificationTime()
- {
- return this.verificationTime;
- }
-
- /**
- * @param verificationTime the verificationTime to set
- */
- public void setVerificationTime(Date verificationTime)
- {
- this.verificationTime = verificationTime;
- }
-
- /**
- * @return the returnHashInputData
- */
- public boolean isReturnHashInputData()
- {
- return this.returnHashInputData;
- }
-
- /**
- * @param returnHashInputData
- * the returnHashInputData to set
- */
- public void setReturnHashInputData(boolean returnHashInputData)
- {
- this.returnHashInputData = returnHashInputData;
- }
-
- /**
- * Set the index of the signature to verify (index starting at 0). A value < 0 indicates to verify all values.
- * @param verify_which
- */
- public void setVerifySignatureIndex(int verify_which) {
- this.verifySignatureIndex = verify_which;
- }
-
- public int getVerifySignatureIndex() {
- return verifySignatureIndex;
- }
-
- /**
- * @see VerifyParameters#setSuppressVerifyExceptions(boolean)
- * @param suppress
- */
- public void setSuppressVerifyExceptions(boolean suppress) {
- VerifyParameters.setSuppressVerify(suppress);
- }
-
- public boolean isSuppressVerifyExceptions() {
- return VerifyParameters.isSuppressVerifyExceptions();
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.verify;
+
+import java.util.Date;
+
+import at.gv.egiz.pdfas.api.commons.Constants;
+import at.gv.egiz.pdfas.api.xmldsig.ReconstructXMLDsigResult;
+
+/**
+ * This class represents the parameters needed for verify after reconstructXMLDsig has already been executed.
+ *
+ * @author exthex
+ *
+ */
+public class VerifyAfterReconstructXMLDsigParameters {
+
+ /**
+ * The list of signatures to be verified.
+ */
+ protected ReconstructXMLDsigResult reconstructXMLDsigResult = null;
+
+ /**
+ * The signature device to perform the actual signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
+ * {@link Constants#SIGNATURE_DEVICE_BKU}.
+ *
+ */
+ protected String signatureDevice;
+
+ /**
+ * Allows to pass a VerificationTime to the signature device.
+ */
+ protected Date verificationTime = null;
+
+ /**
+ * Tells the signature device (e.g. MOA) to return the signature hash input
+ * data (which is the probably transformed signed data).
+ *
+ *
+ * Note that this forces MOA to return the potentially large signature data to
+ * be returned in the result XML, which may result in very bad performance.
+ *
+ */
+ protected boolean returnHashInputData = false;
+
+ /**
+ * The index of the signature to be verified. A value < 0 indicates to verify all signatures.
+ */
+ protected int verifySignatureIndex = -1;
+
+ /**
+ * @return the reconstructXMLDsigResult
+ */
+ public ReconstructXMLDsigResult getReconstructXMLDsigResult()
+ {
+ return this.reconstructXMLDsigResult;
+ }
+
+ /**
+ * @param reconstructXMLDsigResult
+ * the reconstructXMLDsigResult to set
+ */
+ public void setReconstructXMLDsigResult(ReconstructXMLDsigResult reconstructXMLDsigResult)
+ {
+ this.reconstructXMLDsigResult = reconstructXMLDsigResult;
+ }
+
+ /**
+ * @return the signatureDevice
+ */
+ public String getSignatureDevice()
+ {
+ return this.signatureDevice;
+ }
+
+ /**
+ * Set the signature device to use for verification.
+ * If none is set here, the signature device that was used for reconstructXMLDsig will be used.
+ *
+ * @param signatureDevice
+ * the signatureDevice to set
+ */
+ public void setSignatureDevice(String signatureDevice)
+ {
+ this.signatureDevice = signatureDevice;
+ }
+
+ /**
+ * @return the verificationTime
+ */
+ public Date getVerificationTime()
+ {
+ return this.verificationTime;
+ }
+
+ /**
+ * @param verificationTime the verificationTime to set
+ */
+ public void setVerificationTime(Date verificationTime)
+ {
+ this.verificationTime = verificationTime;
+ }
+
+ /**
+ * @return the returnHashInputData
+ */
+ public boolean isReturnHashInputData()
+ {
+ return this.returnHashInputData;
+ }
+
+ /**
+ * @param returnHashInputData
+ * the returnHashInputData to set
+ */
+ public void setReturnHashInputData(boolean returnHashInputData)
+ {
+ this.returnHashInputData = returnHashInputData;
+ }
+
+ /**
+ * Set the index of the signature to verify (index starting at 0). A value < 0 indicates to verify all values.
+ * @param verify_which
+ */
+ public void setVerifySignatureIndex(int verify_which) {
+ this.verifySignatureIndex = verify_which;
+ }
+
+ public int getVerifySignatureIndex() {
+ return verifySignatureIndex;
+ }
+
+ /**
+ * @see VerifyParameters#setSuppressVerifyExceptions(boolean)
+ * @param suppress
+ */
+ public void setSuppressVerifyExceptions(boolean suppress) {
+ VerifyParameters.setSuppressVerify(suppress);
+ }
+
+ public boolean isSuppressVerifyExceptions() {
+ return VerifyParameters.isSuppressVerifyExceptions();
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java
index e7301dc4..56e11ca1 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyParameters.java
@@ -1,249 +1,272 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.verify;
-
-import java.util.Date;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.api.io.DataSource;
-
-/**
- * Parameter object that holds the verify parameters.
- *
- * @author wprinz
- */
-public class VerifyParameters
-{
- // This would be a perfect point for multiple inheritance in Java.
- // VerifyParameters extends AnalyzeParameters, VerifyAfterAnalysisParameters
- // Then a lot of code could be easily reused in the PdfAsObject's check*Parameters methods.
-
- /**
- * The document to be verified.
- */
- protected DataSource document = null;
-
- /**
- * The signature device to perform the actual signature.
- *
- *
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- *
- */
- protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
-
- /**
- * The mode of operation how the document is analyzed.
- *
- *
- * May be {@link Constants#VERIFY_MODE_BINARY_ONLY} to check the document for
- * binary signatures only (very fast). Or may be
- * {@link Constants#VERIFY_MODE_SEMI_CONSERVATIVE} to perform a semi
- * conservative (optimized) text and binary verification (slow). Or may be
- * {@link Constants#VERIFY_MODE_FULL_CONSERVATIVE} to perform a full
- * conservative text and binary verification (very slow).
- *
- */
- protected String verifyMode = Constants.VERIFY_MODE_FULL_CONSERVATIVE;
-
- /**
- * The (zero based) index of the signature to verify.
- *
- *
- * This allows to verify only one found signature instead of all. {@link Constants#VERIFY_ALL} means to
- * verify all found signatures.
- *
- */
- protected int signatureToVerify = Constants.VERIFY_ALL;
-
- /**
- * Allows to pass a VerificationTime to the verification device.
- *
- *
- * Note that the actual usage of this parameter depends on the verification device.
- *
- */
- protected Date verificationTime = null;
-
- /**
- * Tells the signature device (e.g. MOA) to return the signature hash input
- * data (which is the probably transformed signed data).
- *
- *
- * Note that this forces MOA to return the potentially large signature data to
- * be returned in the result XML, which may result in very bad performance.
- *
- */
- protected boolean returnHashInputData = false;
-
- protected boolean returnNonTextualObjects = false;
-
- private static ThreadLocal suppressVerifyExceptions = new ThreadLocal();
-
-
- public VerifyParameters() {
- suppressVerifyExceptions.set(Boolean.FALSE);
- }
- /**
- * @return the document
- */
- public DataSource getDocument()
- {
- return this.document;
- }
-
- /**
- * @param document
- * the document to set
- */
- public void setDocument(DataSource document)
- {
- this.document = document;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return this.signatureDevice;
- }
-
- /**
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-
- /**
- * @return the verifyMode
- */
- public String getVerifyMode()
- {
- return this.verifyMode;
- }
-
- /**
- * @param verifyMode
- * the verifyMode to set
- */
- public void setVerifyMode(String verifyMode)
- {
- this.verifyMode = verifyMode;
- }
-
- /**
- * @return the signatureToVerify
- */
- public int getSignatureToVerify()
- {
- return this.signatureToVerify;
- }
-
- /**
- * @param signatureToVerify
- * the signatureToVerify to set
- */
- public void setSignatureToVerify(int signatureToVerify)
- {
- this.signatureToVerify = signatureToVerify;
- }
-
- /**
- * @return the verificationTime
- */
- public Date getVerificationTime()
- {
- return this.verificationTime;
- }
-
- /**
- * @param verificationTime
- * the verificationTime to set
- */
- public void setVerificationTime(Date verificationTime)
- {
- this.verificationTime = verificationTime;
- }
-
- /**
- * @return the returnHashInputData
- */
- public boolean isReturnHashInputData()
- {
- return this.returnHashInputData;
- }
-
- /**
- * @param returnHashInputData
- * the returnHashInputData to set
- */
- public void setReturnHashInputData(boolean returnHashInputData)
- {
- this.returnHashInputData = returnHashInputData;
- }
-
- public boolean isReturnNonTextualObjects() {
- return this.returnNonTextualObjects;
- }
-
- /**
- * Tells if non text object of the signed pdf should be extracted and returned.
- * One should show this to the user, especially in case of textual signature.
- * Defaults to false
- *
- * @param returnNonTextualObjects
- */
- public void setReturnNonTextualObjects(boolean returnNonTextualObjects) {
- this.returnNonTextualObjects = returnNonTextualObjects;
- }
-
- /**
- * Set if verify exceptions (because of unknown signatures) are suppressed or not (default).
- * Suppressing can be helpful for multiple signatures if you want to verify the working rest. Unsupported
- * Signatures are reported without throwing an exception via {@link VerifyResult#getVerificationException()}
- * @param suppress
- */
- public void setSuppressVerifyExceptions(boolean suppress) {
- setSuppressVerify(suppress);
- }
-
- /**
- * See {@link #setSuppressVerifyExceptions(boolean)}
- * @return
- */
- public static boolean isSuppressVerifyExceptions() {
- if (suppressVerifyExceptions.get() == null) return false;
- return ((Boolean) suppressVerifyExceptions.get()).booleanValue();
- }
-
- static void setSuppressVerify(boolean suppress) {
- suppressVerifyExceptions.set(new Boolean(suppress));
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.verify;
+
+import java.util.Date;
+
+import at.gv.egiz.pdfas.api.commons.Constants;
+import at.gv.egiz.pdfas.api.io.DataSource;
+
+/**
+ * Parameter object that holds the verify parameters.
+ *
+ * @author wprinz
+ */
+public class VerifyParameters
+{
+ // This would be a perfect point for multiple inheritance in Java.
+ // VerifyParameters extends AnalyzeParameters, VerifyAfterAnalysisParameters
+ // Then a lot of code could be easily reused in the PdfAsObject's check*Parameters methods.
+
+ /**
+ * The document to be verified.
+ */
+ protected DataSource document = null;
+
+ /**
+ * The signature device to perform the actual signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
+ * {@link Constants#SIGNATURE_DEVICE_BKU}.
+ *
+ */
+ protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
+
+ /**
+ * The mode of operation how the document is analyzed.
+ *
+ *
+ * May be {@link Constants#VERIFY_MODE_BINARY_ONLY} to check the document for
+ * binary signatures only (very fast). Or may be
+ * {@link Constants#VERIFY_MODE_SEMI_CONSERVATIVE} to perform a semi
+ * conservative (optimized) text and binary verification (slow). Or may be
+ * {@link Constants#VERIFY_MODE_FULL_CONSERVATIVE} to perform a full
+ * conservative text and binary verification (very slow).
+ *
+ */
+ protected String verifyMode = Constants.VERIFY_MODE_FULL_CONSERVATIVE;
+
+ /**
+ * The (zero based) index of the signature to verify.
+ *
+ *
+ * This allows to verify only one found signature instead of all. {@link Constants#VERIFY_ALL} means to
+ * verify all found signatures.
+ *
+ */
+ protected int signatureToVerify = Constants.VERIFY_ALL;
+
+ /**
+ * Allows to pass a VerificationTime to the verification device.
+ *
+ *
+ * Note that the actual usage of this parameter depends on the verification device.
+ *
+ */
+ protected Date verificationTime = null;
+
+ /**
+ * Tells the signature device (e.g. MOA) to return the signature hash input
+ * data (which is the probably transformed signed data).
+ *
+ *
+ * Note that this forces MOA to return the potentially large signature data to
+ * be returned in the result XML, which may result in very bad performance.
+ *
+ */
+ protected boolean returnHashInputData = false;
+
+ protected boolean returnNonTextualObjects = false;
+
+ private static ThreadLocal suppressVerifyExceptions = new ThreadLocal();
+
+
+ public VerifyParameters() {
+ suppressVerifyExceptions.set(Boolean.FALSE);
+ }
+ /**
+ * @return the document
+ */
+ public DataSource getDocument()
+ {
+ return this.document;
+ }
+
+ /**
+ * @param document
+ * the document to set
+ */
+ public void setDocument(DataSource document)
+ {
+ this.document = document;
+ }
+
+ /**
+ * @return the signatureDevice
+ */
+ public String getSignatureDevice()
+ {
+ return this.signatureDevice;
+ }
+
+ /**
+ * @param signatureDevice
+ * the signatureDevice to set
+ */
+ public void setSignatureDevice(String signatureDevice)
+ {
+ this.signatureDevice = signatureDevice;
+ }
+
+ /**
+ * @return the verifyMode
+ */
+ public String getVerifyMode()
+ {
+ return this.verifyMode;
+ }
+
+ /**
+ * @param verifyMode
+ * the verifyMode to set
+ */
+ public void setVerifyMode(String verifyMode)
+ {
+ this.verifyMode = verifyMode;
+ }
+
+ /**
+ * @return the signatureToVerify
+ */
+ public int getSignatureToVerify()
+ {
+ return this.signatureToVerify;
+ }
+
+ /**
+ * @param signatureToVerify
+ * the signatureToVerify to set
+ */
+ public void setSignatureToVerify(int signatureToVerify)
+ {
+ this.signatureToVerify = signatureToVerify;
+ }
+
+ /**
+ * @return the verificationTime
+ */
+ public Date getVerificationTime()
+ {
+ return this.verificationTime;
+ }
+
+ /**
+ * @param verificationTime
+ * the verificationTime to set
+ */
+ public void setVerificationTime(Date verificationTime)
+ {
+ this.verificationTime = verificationTime;
+ }
+
+ /**
+ * @return the returnHashInputData
+ */
+ public boolean isReturnHashInputData()
+ {
+ return this.returnHashInputData;
+ }
+
+ /**
+ * @param returnHashInputData
+ * the returnHashInputData to set
+ */
+ public void setReturnHashInputData(boolean returnHashInputData)
+ {
+ this.returnHashInputData = returnHashInputData;
+ }
+
+ public boolean isReturnNonTextualObjects() {
+ return this.returnNonTextualObjects;
+ }
+
+ /**
+ * Tells if non text object of the signed pdf should be extracted and returned.
+ * One should show this to the user, especially in case of textual signature.
+ * Defaults to false
+ *
+ * @param returnNonTextualObjects
+ */
+ public void setReturnNonTextualObjects(boolean returnNonTextualObjects) {
+ this.returnNonTextualObjects = returnNonTextualObjects;
+ }
+
+ /**
+ * Set if verify exceptions (because of unknown signatures) are suppressed or not (default).
+ * Suppressing can be helpful for multiple signatures if you want to verify the working rest. Unsupported
+ * Signatures are reported without throwing an exception via {@link VerifyResult#getVerificationException()}
+ * @param suppress
+ */
+ public void setSuppressVerifyExceptions(boolean suppress) {
+ setSuppressVerify(suppress);
+ }
+
+ /**
+ * See {@link #setSuppressVerifyExceptions(boolean)}
+ * @return
+ */
+ public static boolean isSuppressVerifyExceptions() {
+ if (suppressVerifyExceptions.get() == null) return false;
+ return ((Boolean) suppressVerifyExceptions.get()).booleanValue();
+ }
+
+ static void setSuppressVerify(boolean suppress) {
+ suppressVerifyExceptions.set(new Boolean(suppress));
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResult.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResult.java
index fb48e5ee..ca8ee7c4 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResult.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResult.java
@@ -1,179 +1,202 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.verify;
-
-import java.util.Date;
-import java.util.List;
-
-import at.gv.egiz.pdfas.api.PdfAs;
-import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
-import at.gv.egiz.pdfas.api.commons.SignatureInformation;
-import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
-import at.gv.egiz.pdfas.api.xmldsig.XMLDsigData;
-
-/**
- * Encapsulates the data of a verification of one signature.
- *
- * @author wprinz
- */
-public interface VerifyResult extends SignatureInformation
-{
- /**
- * Returns if the verification was possible or could not even be startet. see {@link #getVerificationException()} for details.
- * @return
- */
- public boolean isVerificationDone();
-
- /**
- * Returns a verification exception if any. Shows that the verification could not be started. See {@link #isVerificationDone()}.
- * @return
- */
- public PdfAsException getVerificationException();
-
- /**
- * Returns the result of the certificate check.
- *
- * @return Returns the result of the certificate check.
- */
- public SignatureCheck getCertificateCheck();
-
- /**
- * Returns the result of the value (and hash) check.
- *
- * @return Returns the result of the value (and hash) check.
- */
- public SignatureCheck getValueCheckCode();
-
- /**
- * Returns the result of the manifest check.
- *
- * @return Returns the result of the manifest check.
- */
- public SignatureCheck getManifestCheckCode();
-
- /**
- * Returns true, if the signer's certificate is a qualified certificate.
- *
- * @return Returns true, if the signer's certificate is a qualified
- * certificate.
- */
- public boolean isQualifiedCertificate();
-
- /**
- * Returns {@code true} if public authority is indicated.
- * @return {@code true} if public authority.
- */
- public boolean isPublicAuthority();
-
- /**
- * Returns the public authority code or {@code null}.
- * @return The public authority code or {@code null}.
- */
- public String getPublicAuthorityCode();
-
- /**
- * Returns a list of Strings each stating one public property of the
- * certificate.
- *
- *
- * Such public properties are certificate extensions each being assigned an
- * own OID. For example the public property "Verwaltungseigenschaft" has the
- * OID "1.2.40.0.10.1.1.1".
- *
- *
- * @return Returns the list of Strings representing the public properties of
- * this certificate, if any.
- */
- public List getPublicProperties();
-
- /**
- * Returns the verification time, which is the time when the signature was
- * verified.
- *
- *
- * Note that this is actually the Date passed to the verify methods over
- * {@link VerifyParameters#setVerificationTime(Date)} or
- * {@link VerifyAfterAnalysisParameters#setVerificationTime(Date)}. The
- * signature devices don't respond the actual verification time so there is no
- * guarantee that the set verification time was actually used as time of
- * verification. Please consult the device's documentation for more
- * information.
- *
- *
- * If the verification device does not return a verification time and no
- * verification time was set in the
- * {@link VerifyParameters#setVerificationTime(Date)} or
- * {@link VerifyAfterAnalysisParameters#setVerificationTime(Date)}, the time
- * returned by this method will be equal to the signing time (
- * {@link SignatureInformation#getSigningTime()}).
- *
- *
- * @return Returns the verification time, which is the time when the signature
- * was verified.
- */
- public Date getVerificationTime();
-
- /**
- * Returns the hash input data as returned by MOA as Base64-encoded String.
- *
- *
- * This will only return a value other than null if the corresponding
- * {@link VerifyParameters} has been set to true.
- *
- *
- * Note that the HashInputData does not necessarily have to be exactly the
- * same as the signed data return by the
- * {@link SignatureInformation#getSignedData()} method.
- *
- *
- * @return Returns the base64 encoded hash input data as returned by MOA.
- *
- * @see SignatureInformation#getSignedData()
- */
- public String getHashInputData();
-
- /**
- * Returns a list<{@link NonTextObjectInfo}> of non textual objects in the pdf document.
- * Only available for textual signatures. Show this to the user who signed the textual content only!
- * @return List<{@link NonTextObjectInfo} or null of not available (binary signature)
- */
- public List getNonTextualObjects();
-
-
- /**
- * Returns true
if non textual objects have been found, false
if not.
- * @return true
if non textual objects have been found, false
if not.
- */
- public boolean hasNonTextualObjects();
-
- /**
- * Get the reconstructed xmldsig XML data. The reconstruction is done during the verification process.
- *
- * @see PdfAs#reconstructXMLDSIG(at.gv.egiz.pdfas.api.xmldsig.ReconstructXMLDsigParameters)
- * @see PdfAs#reconstructXMLDSIG(at.gv.egiz.pdfas.api.xmldsig.ReconstructXMLDsigAfterAnalysisParameters)
- * @return
- */
- public XMLDsigData getReconstructedXMLDsig();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.verify;
+
+import java.util.Date;
+import java.util.List;
+
+import at.gv.egiz.pdfas.api.PdfAs;
+import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
+import at.gv.egiz.pdfas.api.commons.SignatureInformation;
+import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
+import at.gv.egiz.pdfas.api.xmldsig.XMLDsigData;
+
+/**
+ * Encapsulates the data of a verification of one signature.
+ *
+ * @author wprinz
+ */
+public interface VerifyResult extends SignatureInformation
+{
+ /**
+ * Returns if the verification was possible or could not even be startet. see {@link #getVerificationException()} for details.
+ * @return
+ */
+ public boolean isVerificationDone();
+
+ /**
+ * Returns a verification exception if any. Shows that the verification could not be started. See {@link #isVerificationDone()}.
+ * @return
+ */
+ public PdfAsException getVerificationException();
+
+ /**
+ * Returns the result of the certificate check.
+ *
+ * @return Returns the result of the certificate check.
+ */
+ public SignatureCheck getCertificateCheck();
+
+ /**
+ * Returns the result of the value (and hash) check.
+ *
+ * @return Returns the result of the value (and hash) check.
+ */
+ public SignatureCheck getValueCheckCode();
+
+ /**
+ * Returns the result of the manifest check.
+ *
+ * @return Returns the result of the manifest check.
+ */
+ public SignatureCheck getManifestCheckCode();
+
+ /**
+ * Returns true, if the signer's certificate is a qualified certificate.
+ *
+ * @return Returns true, if the signer's certificate is a qualified
+ * certificate.
+ */
+ public boolean isQualifiedCertificate();
+
+ /**
+ * Returns {@code true} if public authority is indicated.
+ * @return {@code true} if public authority.
+ */
+ public boolean isPublicAuthority();
+
+ /**
+ * Returns the public authority code or {@code null}.
+ * @return The public authority code or {@code null}.
+ */
+ public String getPublicAuthorityCode();
+
+ /**
+ * Returns a list of Strings each stating one public property of the
+ * certificate.
+ *
+ *
+ * Such public properties are certificate extensions each being assigned an
+ * own OID. For example the public property "Verwaltungseigenschaft" has the
+ * OID "1.2.40.0.10.1.1.1".
+ *
+ *
+ * @return Returns the list of Strings representing the public properties of
+ * this certificate, if any.
+ */
+ public List getPublicProperties();
+
+ /**
+ * Returns the verification time, which is the time when the signature was
+ * verified.
+ *
+ *
+ * Note that this is actually the Date passed to the verify methods over
+ * {@link VerifyParameters#setVerificationTime(Date)} or
+ * {@link VerifyAfterAnalysisParameters#setVerificationTime(Date)}. The
+ * signature devices don't respond the actual verification time so there is no
+ * guarantee that the set verification time was actually used as time of
+ * verification. Please consult the device's documentation for more
+ * information.
+ *
+ *
+ * If the verification device does not return a verification time and no
+ * verification time was set in the
+ * {@link VerifyParameters#setVerificationTime(Date)} or
+ * {@link VerifyAfterAnalysisParameters#setVerificationTime(Date)}, the time
+ * returned by this method will be equal to the signing time (
+ * {@link SignatureInformation#getSigningTime()}).
+ *
+ *
+ * @return Returns the verification time, which is the time when the signature
+ * was verified.
+ */
+ public Date getVerificationTime();
+
+ /**
+ * Returns the hash input data as returned by MOA as Base64-encoded String.
+ *
+ *
+ * This will only return a value other than null if the corresponding
+ * {@link VerifyParameters} has been set to true.
+ *
+ *
+ * Note that the HashInputData does not necessarily have to be exactly the
+ * same as the signed data return by the
+ * {@link SignatureInformation#getSignedData()} method.
+ *
+ *
+ * @return Returns the base64 encoded hash input data as returned by MOA.
+ *
+ * @see SignatureInformation#getSignedData()
+ */
+ public String getHashInputData();
+
+ /**
+ * Returns a list<{@link NonTextObjectInfo}> of non textual objects in the pdf document.
+ * Only available for textual signatures. Show this to the user who signed the textual content only!
+ * @return List<{@link NonTextObjectInfo} or null of not available (binary signature)
+ */
+ public List getNonTextualObjects();
+
+
+ /**
+ * Returns true
if non textual objects have been found, false
if not.
+ * @return true
if non textual objects have been found, false
if not.
+ */
+ public boolean hasNonTextualObjects();
+
+ /**
+ * Get the reconstructed xmldsig XML data. The reconstruction is done during the verification process.
+ *
+ * @see PdfAs#reconstructXMLDSIG(at.gv.egiz.pdfas.api.xmldsig.ReconstructXMLDsigParameters)
+ * @see PdfAs#reconstructXMLDSIG(at.gv.egiz.pdfas.api.xmldsig.ReconstructXMLDsigAfterAnalysisParameters)
+ * @return
+ */
+ public XMLDsigData getReconstructedXMLDsig();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java
index 44b62a78..3e0f4ee0 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyResults.java
@@ -1,48 +1,71 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.verify;
-
-import java.util.List;
-
-/**
- * The result of the verification of a document.
- *
- *
- * Currently, this is not more than a list of VerifyResult objects, one for each
- * verified signature. There may be additional items in future PDF-AS versions.
- *
- *
- * @author wprinz
- */
-public interface VerifyResults
-{
- /**
- * Returns the List of VerifyResult objects, one for each verified signature.
- *
- * @return Returns the List of VerifyResult objects, one for each verified
- * signature.
- */
- public List getResults();
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.verify;
+
+import java.util.List;
+
+/**
+ * The result of the verification of a document.
+ *
+ *
+ * Currently, this is not more than a list of VerifyResult objects, one for each
+ * verified signature. There may be additional items in future PDF-AS versions.
+ *
+ *
+ * @author wprinz
+ */
+public interface VerifyResults
+{
+ /**
+ * Returns the List of VerifyResult objects, one for each verified signature.
+ *
+ * @return Returns the List of VerifyResult objects, one for each verified
+ * signature.
+ */
+ public List getResults();
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/package-info.java
index be2cc3d4..e18d1b92 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/package-info.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/verify/package-info.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
/**
*
*/
@@ -5,4 +28,4 @@
* @author afitzek
*
*/
-package at.gv.egiz.pdfas.api.verify;
\ No newline at end of file
+package at.gv.egiz.pdfas.api.verify;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ExtendedSignatureInformation.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ExtendedSignatureInformation.java
index df12b529..f2cd3598 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ExtendedSignatureInformation.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ExtendedSignatureInformation.java
@@ -1,69 +1,92 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.xmldsig;
-
-import at.gv.egiz.pdfas.api.commons.SignatureInformation;
-
-/**
- * A wrapper to combine {@link SignatureInformation} and {@link XMLDsigData}
- *
- * @author exthex
- *
- */
-public class ExtendedSignatureInformation {
-
- private final SignatureInformation signatureInformation;
-
- private final XMLDsigData xmlDsigData;
-
- /**
- * Constructor.
- *
- * @param siginfo
- * The signature information
- * @param dsigData
- * The matching xmldsig to the signature information.
- */
- public ExtendedSignatureInformation(SignatureInformation siginfo, XMLDsigData dsigData) {
- this.signatureInformation = siginfo;
- this.xmlDsigData = dsigData;
- }
-
- /**
- *
- * @return the signatureInformation
- */
- public SignatureInformation getSignatureInformation() {
- return signatureInformation;
- }
-
- /**
- *
- * @return the xmlDsigData
- */
- public XMLDsigData getXmlDsigData() {
- return xmlDsigData;
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.xmldsig;
+
+import at.gv.egiz.pdfas.api.commons.SignatureInformation;
+
+/**
+ * A wrapper to combine {@link SignatureInformation} and {@link XMLDsigData}
+ *
+ * @author exthex
+ *
+ */
+public class ExtendedSignatureInformation {
+
+ private final SignatureInformation signatureInformation;
+
+ private final XMLDsigData xmlDsigData;
+
+ /**
+ * Constructor.
+ *
+ * @param siginfo
+ * The signature information
+ * @param dsigData
+ * The matching xmldsig to the signature information.
+ */
+ public ExtendedSignatureInformation(SignatureInformation siginfo, XMLDsigData dsigData) {
+ this.signatureInformation = siginfo;
+ this.xmlDsigData = dsigData;
+ }
+
+ /**
+ *
+ * @return the signatureInformation
+ */
+ public SignatureInformation getSignatureInformation() {
+ return signatureInformation;
+ }
+
+ /**
+ *
+ * @return the xmlDsigData
+ */
+ public XMLDsigData getXmlDsigData() {
+ return xmlDsigData;
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigAfterAnalysisParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigAfterAnalysisParameters.java
index 229fba04..62815fb8 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigAfterAnalysisParameters.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigAfterAnalysisParameters.java
@@ -1,86 +1,109 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.xmldsig;
-
-import at.gv.egiz.pdfas.api.analyze.AnalyzeResult;
-import at.gv.egiz.pdfas.api.commons.Constants;
-
-/**
- * Parameters for the reconstructXMLDsig method which is to be called after a analyze call.
- *
- * @author exthex
- *
- */
-public class ReconstructXMLDsigAfterAnalysisParameters {
-
-
- /**
- * The list of signatures to be verified.
- */
- protected AnalyzeResult analyzeResult = null;
-
- /**
- * The signature device to perform the actual signature.
- *
- *
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- *
- */
- protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
-
- /**
- * @return the analyzeResult
- */
- public AnalyzeResult getAnalyzeResult()
- {
- return this.analyzeResult;
- }
-
- /**
- * @param analyzeResult
- * the analyzeResult to set
- */
- public void setAnalyzeResult(AnalyzeResult analyzeResult)
- {
- this.analyzeResult = analyzeResult;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return this.signatureDevice;
- }
-
- /**
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.xmldsig;
+
+import at.gv.egiz.pdfas.api.analyze.AnalyzeResult;
+import at.gv.egiz.pdfas.api.commons.Constants;
+
+/**
+ * Parameters for the reconstructXMLDsig method which is to be called after a analyze call.
+ *
+ * @author exthex
+ *
+ */
+public class ReconstructXMLDsigAfterAnalysisParameters {
+
+
+ /**
+ * The list of signatures to be verified.
+ */
+ protected AnalyzeResult analyzeResult = null;
+
+ /**
+ * The signature device to perform the actual signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
+ * {@link Constants#SIGNATURE_DEVICE_BKU}.
+ *
+ */
+ protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
+
+ /**
+ * @return the analyzeResult
+ */
+ public AnalyzeResult getAnalyzeResult()
+ {
+ return this.analyzeResult;
+ }
+
+ /**
+ * @param analyzeResult
+ * the analyzeResult to set
+ */
+ public void setAnalyzeResult(AnalyzeResult analyzeResult)
+ {
+ this.analyzeResult = analyzeResult;
+ }
+
+ /**
+ * @return the signatureDevice
+ */
+ public String getSignatureDevice()
+ {
+ return this.signatureDevice;
+ }
+
+ /**
+ * @param signatureDevice
+ * the signatureDevice to set
+ */
+ public void setSignatureDevice(String signatureDevice)
+ {
+ this.signatureDevice = signatureDevice;
+ }
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigParameters.java
index 445d7ae4..03b77f1c 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigParameters.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigParameters.java
@@ -1,218 +1,241 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.xmldsig;
-
-import java.util.Date;
-
-import at.gv.egiz.pdfas.api.PdfAs;
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.api.io.DataSource;
-
-/**
- * Parameters for the {@link PdfAs#reconstructXMLDSIG(ReconstructXMLDsigParameters)} method.
- * No need to call analyze before calling this method.
- *
- * @author exthex
- *
- */
-public class ReconstructXMLDsigParameters {
-
- /**
- * The document to be verified.
- */
- protected DataSource document = null;
-
- /**
- * The signature device to perform the actual signature.
- *
- *
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- *
- */
- protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
-
- /**
- * The mode of operation how the document is analyzed.
- *
- *
- * May be {@link Constants#VERIFY_MODE_BINARY_ONLY} to check the document for
- * binary signatures only (very fast). Or may be
- * {@link Constants#VERIFY_MODE_SEMI_CONSERVATIVE} to perform a semi
- * conservative (optimized) text and binary verification (slow). Or may be
- * {@link Constants#VERIFY_MODE_FULL_CONSERVATIVE} to perform a full
- * conservative text and binary verification (very slow).
- *
- */
- protected String verifyMode = Constants.VERIFY_MODE_FULL_CONSERVATIVE;
-
- /**
- * The (zero based) index of the signature to verify.
- *
- *
- * This allows to verify only one found signature instead of all. {@link Constants#VERIFY_ALL} means to
- * verify all found signatures.
- *
- */
- protected int signatureToVerify = Constants.VERIFY_ALL;
-
- /**
- * Allows to pass a VerificationTime to the verification device.
- *
- *
- * Note that the actual usage of this parameter depends on the verification device.
- *
- */
- protected Date verificationTime = null;
-
- /**
- * Tells the signature device (e.g. MOA) to return the signature hash input
- * data (which is the probably transformed signed data).
- *
- *
- * Note that this forces MOA to return the potentially large signature data to
- * be returned in the result XML, which may result in very bad performance.
- *
- */
- protected boolean returnHashInputData = false;
-
- protected boolean returnNonTextualObjects = false;
-
- /**
- * @return the document
- */
- public DataSource getDocument()
- {
- return this.document;
- }
-
- /**
- * @param document
- * the document to set
- */
- public void setDocument(DataSource document)
- {
- this.document = document;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return this.signatureDevice;
- }
-
- /**
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-
- /**
- * @return the verifyMode
- */
- public String getVerifyMode()
- {
- return this.verifyMode;
- }
-
- /**
- * @param verifyMode
- * the verifyMode to set
- */
- public void setVerifyMode(String verifyMode)
- {
- this.verifyMode = verifyMode;
- }
-
- /**
- * @return the signatureToVerify
- */
- public int getSignatureToVerify()
- {
- return this.signatureToVerify;
- }
-
- /**
- * @param signatureToVerify
- * the signatureToVerify to set
- */
- public void setSignatureToVerify(int signatureToVerify)
- {
- this.signatureToVerify = signatureToVerify;
- }
-
- /**
- * @return the verificationTime
- */
- public Date getVerificationTime()
- {
- return this.verificationTime;
- }
-
- /**
- * @param verificationTime
- * the verificationTime to set
- */
- public void setVerificationTime(Date verificationTime)
- {
- this.verificationTime = verificationTime;
- }
-
- /**
- * @return the returnHashInputData
- */
- public boolean isReturnHashInputData()
- {
- return this.returnHashInputData;
- }
-
- /**
- * @param returnHashInputData
- * the returnHashInputData to set
- */
- public void setReturnHashInputData(boolean returnHashInputData)
- {
- this.returnHashInputData = returnHashInputData;
- }
-
- public boolean isReturnNonTextualObjects() {
- return this.returnNonTextualObjects;
- }
-
- /**
- * Tells if non text object of the signed pdf should be extracted and returned.
- * One should show this to the user, especially in case of textual signature.
- * Defaults to false
- *
- * @param returnNonTextualObjects
- */
- public void setReturnNonTextualObjects(boolean returnNonTextualObjects) {
- this.returnNonTextualObjects = returnNonTextualObjects;
- }
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.xmldsig;
+
+import java.util.Date;
+
+import at.gv.egiz.pdfas.api.PdfAs;
+import at.gv.egiz.pdfas.api.commons.Constants;
+import at.gv.egiz.pdfas.api.io.DataSource;
+
+/**
+ * Parameters for the {@link PdfAs#reconstructXMLDSIG(ReconstructXMLDsigParameters)} method.
+ * No need to call analyze before calling this method.
+ *
+ * @author exthex
+ *
+ */
+public class ReconstructXMLDsigParameters {
+
+ /**
+ * The document to be verified.
+ */
+ protected DataSource document = null;
+
+ /**
+ * The signature device to perform the actual signature.
+ *
+ *
+ * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
+ * {@link Constants#SIGNATURE_DEVICE_BKU}.
+ *
+ */
+ protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
+
+ /**
+ * The mode of operation how the document is analyzed.
+ *
+ *
+ * May be {@link Constants#VERIFY_MODE_BINARY_ONLY} to check the document for
+ * binary signatures only (very fast). Or may be
+ * {@link Constants#VERIFY_MODE_SEMI_CONSERVATIVE} to perform a semi
+ * conservative (optimized) text and binary verification (slow). Or may be
+ * {@link Constants#VERIFY_MODE_FULL_CONSERVATIVE} to perform a full
+ * conservative text and binary verification (very slow).
+ *
+ */
+ protected String verifyMode = Constants.VERIFY_MODE_FULL_CONSERVATIVE;
+
+ /**
+ * The (zero based) index of the signature to verify.
+ *
+ *
+ * This allows to verify only one found signature instead of all. {@link Constants#VERIFY_ALL} means to
+ * verify all found signatures.
+ *
+ */
+ protected int signatureToVerify = Constants.VERIFY_ALL;
+
+ /**
+ * Allows to pass a VerificationTime to the verification device.
+ *
+ *
+ * Note that the actual usage of this parameter depends on the verification device.
+ *
+ */
+ protected Date verificationTime = null;
+
+ /**
+ * Tells the signature device (e.g. MOA) to return the signature hash input
+ * data (which is the probably transformed signed data).
+ *
+ *
+ * Note that this forces MOA to return the potentially large signature data to
+ * be returned in the result XML, which may result in very bad performance.
+ *
+ */
+ protected boolean returnHashInputData = false;
+
+ protected boolean returnNonTextualObjects = false;
+
+ /**
+ * @return the document
+ */
+ public DataSource getDocument()
+ {
+ return this.document;
+ }
+
+ /**
+ * @param document
+ * the document to set
+ */
+ public void setDocument(DataSource document)
+ {
+ this.document = document;
+ }
+
+ /**
+ * @return the signatureDevice
+ */
+ public String getSignatureDevice()
+ {
+ return this.signatureDevice;
+ }
+
+ /**
+ * @param signatureDevice
+ * the signatureDevice to set
+ */
+ public void setSignatureDevice(String signatureDevice)
+ {
+ this.signatureDevice = signatureDevice;
+ }
+
+ /**
+ * @return the verifyMode
+ */
+ public String getVerifyMode()
+ {
+ return this.verifyMode;
+ }
+
+ /**
+ * @param verifyMode
+ * the verifyMode to set
+ */
+ public void setVerifyMode(String verifyMode)
+ {
+ this.verifyMode = verifyMode;
+ }
+
+ /**
+ * @return the signatureToVerify
+ */
+ public int getSignatureToVerify()
+ {
+ return this.signatureToVerify;
+ }
+
+ /**
+ * @param signatureToVerify
+ * the signatureToVerify to set
+ */
+ public void setSignatureToVerify(int signatureToVerify)
+ {
+ this.signatureToVerify = signatureToVerify;
+ }
+
+ /**
+ * @return the verificationTime
+ */
+ public Date getVerificationTime()
+ {
+ return this.verificationTime;
+ }
+
+ /**
+ * @param verificationTime
+ * the verificationTime to set
+ */
+ public void setVerificationTime(Date verificationTime)
+ {
+ this.verificationTime = verificationTime;
+ }
+
+ /**
+ * @return the returnHashInputData
+ */
+ public boolean isReturnHashInputData()
+ {
+ return this.returnHashInputData;
+ }
+
+ /**
+ * @param returnHashInputData
+ * the returnHashInputData to set
+ */
+ public void setReturnHashInputData(boolean returnHashInputData)
+ {
+ this.returnHashInputData = returnHashInputData;
+ }
+
+ public boolean isReturnNonTextualObjects() {
+ return this.returnNonTextualObjects;
+ }
+
+ /**
+ * Tells if non text object of the signed pdf should be extracted and returned.
+ * One should show this to the user, especially in case of textual signature.
+ * Defaults to false
+ *
+ * @param returnNonTextualObjects
+ */
+ public void setReturnNonTextualObjects(boolean returnNonTextualObjects) {
+ this.returnNonTextualObjects = returnNonTextualObjects;
+ }
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigResult.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigResult.java
index 580f3af6..01156143 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigResult.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/ReconstructXMLDsigResult.java
@@ -1,74 +1,97 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.xmldsig;
-
-import java.util.List;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.api.commons.SignatureInformation;
-
-/**
- * The result of a reconstructXMLDsig call.
- * This is just a wrapper for a list of {@link ExtendedSignatureInformation}s
- *
- *
- * @author exthex
- */
-public class ReconstructXMLDsigResult {
-
- private List extendedSignatures;
-
- private String device;
-
- /**
- *
- * @param extendedSignatureInfos
- * @param signatureDevice
- */
- public ReconstructXMLDsigResult(List extendedSignatureInfos, String signatureDevice) {
- this.extendedSignatures = extendedSignatureInfos;
- this.device = signatureDevice;
- }
-
- /**
- * Get the signature device that was used to create this result.
- *
- * @return {@link Constants#SIGNATURE_DEVICE_MOA} or {@link Constants#SIGNATURE_DEVICE_BKU}
- */
- public String getDevice() {
- return device;
- }
-
- /**
- * Returns the list of found signatures.
- *
- * @return Returns a list of {@link ExtendedSignatureInformation} objects representing all
- * found signatures + {@link XMLDsigData}.
- * @see SignatureInformation
- */
- public List getExtendedSignatures() {
- return this.extendedSignatures;
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.xmldsig;
+
+import java.util.List;
+
+import at.gv.egiz.pdfas.api.commons.Constants;
+import at.gv.egiz.pdfas.api.commons.SignatureInformation;
+
+/**
+ * The result of a reconstructXMLDsig call.
+ * This is just a wrapper for a list of {@link ExtendedSignatureInformation}s
+ *
+ *
+ * @author exthex
+ */
+public class ReconstructXMLDsigResult {
+
+ private List extendedSignatures;
+
+ private String device;
+
+ /**
+ *
+ * @param extendedSignatureInfos
+ * @param signatureDevice
+ */
+ public ReconstructXMLDsigResult(List extendedSignatureInfos, String signatureDevice) {
+ this.extendedSignatures = extendedSignatureInfos;
+ this.device = signatureDevice;
+ }
+
+ /**
+ * Get the signature device that was used to create this result.
+ *
+ * @return {@link Constants#SIGNATURE_DEVICE_MOA} or {@link Constants#SIGNATURE_DEVICE_BKU}
+ */
+ public String getDevice() {
+ return device;
+ }
+
+ /**
+ * Returns the list of found signatures.
+ *
+ * @return Returns a list of {@link ExtendedSignatureInformation} objects representing all
+ * found signatures + {@link XMLDsigData}.
+ * @see SignatureInformation
+ */
+ public List getExtendedSignatures() {
+ return this.extendedSignatures;
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/XMLDsigData.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/XMLDsigData.java
index 0449cfa2..4f39b599 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/XMLDsigData.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/XMLDsigData.java
@@ -1,83 +1,106 @@
-/**
- * Copyright 2006 by Know-Center, Graz, Austria
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.xmldsig;
-
-/**
- * A container for XMLDsig data.
- *
- * @author exthex
- *
- */
-public class XMLDsigData {
-
- private String xmlDsig;
-
- private boolean detached;
-
- /**
- * Constructor.
- *
- * @param xmldsig the xml string of the xmldsig.
- * @param detached true if detached, false otherwise
- */
- public XMLDsigData(String xmldsig, boolean detached) {
- this.xmlDsig = xmldsig;
- this.detached = detached;
- }
-
- /**
- * Get the xmldsig string
- * @return
- */
- public String getXmlDsig() {
- return xmlDsig;
- }
-
- /**
- * Set the xmldsig string.
- *
- * @param xmlDsig
- */
- public void setXmlDsig(String xmlDsig) {
- this.xmlDsig = xmlDsig;
- }
-
- /**
- *
- * @return true if detached, false otherwise
- */
- public boolean isDetached() {
- return detached;
- }
-
- /**
- * Set the detached.
- *
- * @param detached
- */
- public void setDetached(boolean detached) {
- this.detached = detached;
- }
-
-}
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
+/**
+ * Copyright 2006 by Know-Center, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egiz.pdfas.api.xmldsig;
+
+/**
+ * A container for XMLDsig data.
+ *
+ * @author exthex
+ *
+ */
+public class XMLDsigData {
+
+ private String xmlDsig;
+
+ private boolean detached;
+
+ /**
+ * Constructor.
+ *
+ * @param xmldsig the xml string of the xmldsig.
+ * @param detached true if detached, false otherwise
+ */
+ public XMLDsigData(String xmldsig, boolean detached) {
+ this.xmlDsig = xmldsig;
+ this.detached = detached;
+ }
+
+ /**
+ * Get the xmldsig string
+ * @return
+ */
+ public String getXmlDsig() {
+ return xmlDsig;
+ }
+
+ /**
+ * Set the xmldsig string.
+ *
+ * @param xmlDsig
+ */
+ public void setXmlDsig(String xmlDsig) {
+ this.xmlDsig = xmlDsig;
+ }
+
+ /**
+ *
+ * @return true if detached, false otherwise
+ */
+ public boolean isDetached() {
+ return detached;
+ }
+
+ /**
+ * Set the detached.
+ *
+ * @param detached
+ */
+ public void setDetached(boolean detached) {
+ this.detached = detached;
+ }
+
+}
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/package-info.java
index a34405a8..7ea150ff 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/package-info.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/xmldsig/package-info.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
/**
*
*/
@@ -5,4 +28,4 @@
* @author afitzek
*
*/
-package at.gv.egiz.pdfas.api.xmldsig;
\ No newline at end of file
+package at.gv.egiz.pdfas.api.xmldsig;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSink_OLD.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSink_OLD.java
index bb39a322..95316937 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSink_OLD.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSink_OLD.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.io.ByteArrayOutputStream;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSource_OLD.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSource_OLD.java
index ad494acd..152f4053 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSource_OLD.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/ByteArrayDataSource_OLD.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.io.ByteArrayInputStream;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/FileDataSource.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/FileDataSource.java
index 19394f0a..fa64f7bd 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/FileDataSource.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/FileDataSource.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.io.ByteArrayInputStream;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/LegacyMainTest.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/LegacyMainTest.java
index b64bb4c7..8838834e 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/LegacyMainTest.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/LegacyMainTest.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.io.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 ecd3c031..005e3963 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
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import iaik.x509.X509Certificate;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignParameterWrapper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignParameterWrapper.java
index 87278c85..9d0f45d7 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignParameterWrapper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignParameterWrapper.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.io.OutputStream;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignResultImpl.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignResultImpl.java
index f8d36869..60711717 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignResultImpl.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignResultImpl.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.security.cert.X509Certificate;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureCheckWrapper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureCheckWrapper.java
index 04b0dd3c..743a7bf2 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureCheckWrapper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureCheckWrapper.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import at.gv.egiz.pdfas.api.verify.SignatureCheck;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureDetailInformationWrapper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureDetailInformationWrapper.java
index 5192ffe4..fa036c8f 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureDetailInformationWrapper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignatureDetailInformationWrapper.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.security.cert.X509Certificate;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignaturePositionImpl.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignaturePositionImpl.java
index 2d950643..82da0d59 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignaturePositionImpl.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/SignaturePositionImpl.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyParameterWrapper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyParameterWrapper.java
index 44f9aa6c..e8e89cb4 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyParameterWrapper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyParameterWrapper.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import at.gv.egiz.pdfas.api.verify.VerifyParameters;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultWrapper.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultWrapper.java
index 7b35ef6c..770e7f3b 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultWrapper.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultWrapper.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.io.InputStream;
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultsImpl.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultsImpl.java
index d20da58b..d99db8bb 100644
--- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultsImpl.java
+++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/wrapper/VerifyResultsImpl.java
@@ -1,3 +1,26 @@
+/*******************************************************************************
+ * Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria
+ * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
+ * joint initiative of the Federal Chancellery Austria and Graz University of
+ * Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ ******************************************************************************/
package at.gv.egiz.pdfas.wrapper;
import java.util.List;
--
cgit v1.2.3