From 73c30d3a15a33d02f7ea675e267b39310913ba4d Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 6 Dec 2010 17:02:56 +0000 Subject: Necessary changes for separation of pdf-as-web and rest of the project git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@680 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/gv/egiz/pdfas/api/PdfAs.java | 39 ++++++ .../egiz/pdfas/api/commons/SignatureProfile.java | 5 + .../gv/egiz/pdfas/api/internal/LocalBKUParams.java | 41 ++++++ .../gv/egiz/pdfas/api/internal/PdfAsInternal.java | 138 +++++++++++++++++++++ .../gv/egiz/pdfas/api/internal/SignatureEntry.java | 131 +++++++++++++++++++ .../pdfas/api/sign/SignatureDetailInformation.java | 127 +++++++++++++++++++ .../pdfas/api/sign/pos/SignaturePositioning.java | 9 +- .../api/sign/pos/axis/AbsoluteAxisAlgorithm.java | 9 +- .../pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java | 9 +- .../pdfas/api/sign/pos/axis/AxisAlgorithm.java | 9 +- .../api/sign/pos/page/AbsolutePageAlgorithm.java | 9 +- .../pdfas/api/sign/pos/page/AutoPageAlgorithm.java | 9 +- .../pdfas/api/sign/pos/page/NewPageAlgorithm.java | 9 +- .../pdfas/api/sign/pos/page/PageAlgorithm.java | 9 +- .../api/verify/VerifyAfterAnalysisParameters.java | 17 +++ .../VerifyAfterReconstructXMLDsigParameters.java | 17 +++ 16 files changed, 579 insertions(+), 8 deletions(-) create mode 100644 src/main/java/at/gv/egiz/pdfas/api/internal/LocalBKUParams.java create mode 100644 src/main/java/at/gv/egiz/pdfas/api/internal/PdfAsInternal.java create mode 100644 src/main/java/at/gv/egiz/pdfas/api/internal/SignatureEntry.java create mode 100644 src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java (limited to 'src/main/java/at/gv/egiz/pdfas/api') diff --git a/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java b/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java index a488bcd..66035db 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java +++ b/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java @@ -13,6 +13,7 @@ import at.gv.egiz.pdfas.api.commons.SignatureProfile; import at.gv.egiz.pdfas.api.exceptions.PdfAsException; import at.gv.egiz.pdfas.api.sign.SignParameters; import at.gv.egiz.pdfas.api.sign.SignResult; +import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation; import at.gv.egiz.pdfas.api.verify.VerifyAfterAnalysisParameters; import at.gv.egiz.pdfas.api.verify.VerifyAfterReconstructXMLDsigParameters; import at.gv.egiz.pdfas.api.verify.VerifyParameters; @@ -39,6 +40,7 @@ public interface PdfAs // reconstructXMLDSIG(ReconstructXMLDsigAfterAnalysisParameters reconstructXMLDsigParameters) // verify(VerifyAfterReconstructXMLDsigParameters verifyAfterReconstructXMLDsigParameters) + /** * Signs a PDF document using PDF-AS. * @@ -53,6 +55,23 @@ public interface PdfAs */ public SignResult sign(SignParameters signParameters) throws PdfAsException; + /** + * Signs a PDF document using PDF-AS.
+ * This uses the {@link SignatorInformation} which was obtained by a call to {@link PdfAs#prepareSign(SignParameters)} + * + * @param signParameters + * The sign parameters. + * @param signatureDetailInformation + * The signature information which was previously obtained by a call to {@link PdfAs#prepareSign(SignParameters)} + * @return Returns the signed document plus additional information. + * @throws PdfAsException + * Thrown, if an error occurs. + * + * @see SignParameters + * @see SignResult + */ + public SignResult sign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation) throws PdfAsException; + /** * Verifies a document with (potentially multiple) PDF-AS signatures. * @@ -210,4 +229,24 @@ public interface PdfAs * @return the signature profile or null if not found. */ public DynamicSignatureProfile loadDynamicSignatureProfile(String profileName); + + /** + * TODO doc + * + * @param signParameters + * @return + * @throws PdfAsException + */ + public SignatureDetailInformation prepareSign(SignParameters signParameters) throws PdfAsException; + + /** + * TODO doc + * + * @param signParameters + * @param signatureDetailInformation + * @return + * @throws PdfAsException + */ + public SignResult finishSign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation) throws PdfAsException; + } diff --git a/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureProfile.java b/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureProfile.java index d018050..c806822 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureProfile.java +++ b/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureProfile.java @@ -48,4 +48,9 @@ public interface SignatureProfile { */ public String getProfileDescription(); + /** + * True only if this is the default profile according to config. + * @return + */ + public boolean isDefault(); } diff --git a/src/main/java/at/gv/egiz/pdfas/api/internal/LocalBKUParams.java b/src/main/java/at/gv/egiz/pdfas/api/internal/LocalBKUParams.java new file mode 100644 index 0000000..114788c --- /dev/null +++ b/src/main/java/at/gv/egiz/pdfas/api/internal/LocalBKUParams.java @@ -0,0 +1,41 @@ +package at.gv.egiz.pdfas.api.internal; + + +/** + * Parameter container for local BKUs. (BKU, Mocca) + * + * @author exthex + * + */ +public class LocalBKUParams { + + private String server; + private String userAgent; + private String signatureLayout; + + public LocalBKUParams(String server, String userAgent, String signatureLayout) { + this.server = server; + this.userAgent = userAgent; + this.signatureLayout = signatureLayout; + } + + public String getServer() { + return server; + } + public void setServer(String server) { + this.server = server; + } + public String getUserAgent() { + return userAgent; + } + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + public String getSignatureLayout() { + return signatureLayout; + } + public void setSignatureLayout(String signatureLayout) { + this.signatureLayout = signatureLayout; + } + +} diff --git a/src/main/java/at/gv/egiz/pdfas/api/internal/PdfAsInternal.java b/src/main/java/at/gv/egiz/pdfas/api/internal/PdfAsInternal.java new file mode 100644 index 0000000..f3a4962 --- /dev/null +++ b/src/main/java/at/gv/egiz/pdfas/api/internal/PdfAsInternal.java @@ -0,0 +1,138 @@ +package at.gv.egiz.pdfas.api.internal; + +import java.util.Map; + +import at.gv.egiz.pdfas.api.PdfAs; +import at.gv.egiz.pdfas.api.analyze.AnalyzeResult; +import at.gv.egiz.pdfas.api.commons.SignatureInformation; +import at.gv.egiz.pdfas.api.exceptions.PdfAsException; +import at.gv.egiz.pdfas.api.sign.SignParameters; +import at.gv.egiz.pdfas.api.sign.SignResult; +import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation; +import at.gv.egiz.pdfas.api.verify.VerifyResult; +import at.knowcenter.wag.egov.egiz.exceptions.ConnectorException; +import at.knowcenter.wag.egov.egiz.exceptions.ConnectorFactoryException; +import at.knowcenter.wag.egov.egiz.exceptions.NormalizeException; +import at.knowcenter.wag.egov.egiz.exceptions.SettingsException; +import at.knowcenter.wag.egov.egiz.exceptions.SignatureException; +import at.knowcenter.wag.egov.egiz.exceptions.SignatureTypesException; + +/** + * The methods of this interface are used by the pdf-as-web project and are not for external use.
+ * Using this API is inadvisable as its functionality might change without notice from release to release. + * + * @author exthex + * + */ +public interface PdfAsInternal { + + /** + * Check if a BKU with the given parameters is supported. + * + * @param bkuParams + * @throws ConnectorException if the BKU is not supported + * @throws SettingsException if the BKU is not supported + */ + public void verifyBKUSupport(LocalBKUParams bkuParams) throws ConnectorException, SettingsException; + + /** + * Finish the sign process. + * + * @param pdfAs + * @param signParameters + * @param sdi This info will most likely come from a {@link PdfAs#prepareSign(SignParameters)} call + * @param bkuParams + * @param xmlResponse the SecurityLayer response from the BKU + * @return the signed document + additional info + * @throws PdfAsException + */ + public SignResult finishLocalSign(PdfAs pdfAs, SignParameters signParameters, SignatureDetailInformation sdi, LocalBKUParams bkuParams, String xmlResponse) throws PdfAsException; + + /** + * Get the security layer address for the given connector. (zB: http://127.0.0.1:3495/http-security-layer-request) + * + * @param profile + * @param device + * @return + * @throws SettingsException + */ + public String getLocalServiceAddress(String profile, String device) throws SettingsException; + + /** + * Get the CreateXMLSignatureRequest for the given parameters. + * + * @param signParameters the sign parameters. {@link SignParameters#getSignatureDevice()} determines the connector to use. + * @param loc_ref_url the URL where to retrieve the PDF to sign + * @param sdi {@link SignatureDetailInformation#getSignatureData()} provides the data to be signed. + * @return + * @throws ConnectorException + */ + public String prepareLocalSignRequest(SignParameters signParameters, String loc_ref_url, SignatureDetailInformation sdi) throws ConnectorException; + + /** + * Create an AnalyzeResult from raw text, instead of a PDF. + * + * @param rawText + * @param sigValues the signature values + * @return + * @throws SignatureException + * @throws SettingsException + * @throws SignatureTypesException + * @throws NormalizeException + */ + public AnalyzeResult analyzeFromRawText(String rawText, Map sigValues) throws SignatureException, SettingsException, SignatureTypesException, NormalizeException; + + /** + * Create the SecurityLayer VerifyXMLSignatureRequest for the given parameters. + * + * @param sigInfo + * @param connector + * @param profile + * @param loc_ref_url + * @return + * @throws SignatureException + * @throws ConnectorException + */ + public String prepareLocalVerifyRequest(SignatureInformation sigInfo, String connector, String profile, String loc_ref_url) throws SignatureException, ConnectorException; + + /** + * Parse the given xml_response - must be a VerifyXMLSignatureResponse - from the BKU or Mocca and generates a VerifyResult from it. + * + * @param sigInfo + * @param connector + * @param profile + * @param loc_ref_url + * @param xmlResponse + * @return + * @throws SignatureException + * @throws ConnectorException + */ + public VerifyResult finishLocalVerify(SignatureInformation sigInfo, String connector, String profile, String loc_ref_url, String xmlResponse) throws SignatureException, ConnectorException; + + /** + * Get the {@link SignatureEntry} corresponding to a given {@link SignatureInformation} + * + * @param key + * @param sigInfo + * @return + */ + public SignatureEntry getSignatureEntryFromSignatureInformation(String key, SignatureInformation sigInfo); + + /** + * Get the signed text for a given sigInfo.
+ * If this signature is not text based this method will return null. + * + * @param sigInfo + * @return + */ + public String getSignedText(SignatureInformation sigInfo); + + /** + * Get a map of all connectors available for web. + * The key is the connector id, the value is the description. + * + * @return + * @throws ConnectorFactoryException + */ + public Map getConnectorsAvailableForWeb() throws ConnectorFactoryException; +} diff --git a/src/main/java/at/gv/egiz/pdfas/api/internal/SignatureEntry.java b/src/main/java/at/gv/egiz/pdfas/api/internal/SignatureEntry.java new file mode 100644 index 0000000..3b039ab --- /dev/null +++ b/src/main/java/at/gv/egiz/pdfas/api/internal/SignatureEntry.java @@ -0,0 +1,131 @@ +/* + * + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE + * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, + * OR NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES + * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING + * THIS SOFTWARE OR ITS DERIVATIVES. + * + * $Id: SignatureEntry.java,v 1.3 2006/08/25 17:09:41 wprinz Exp $ + */ +package at.gv.egiz.pdfas.api.internal; + +import java.io.Serializable; + +/** + * A container for signature entries. + * Copied to internal api from {@link at.knowcenter.wag.egov.egiz.sig.SignatureEntry} + * + * @author exthex + * @see at.knowcenter.wag.egov.egiz.sig.SignatureEntry + */ +public class SignatureEntry implements Serializable { + + /** + * SVUID. + */ + private static final long serialVersionUID = -1L; + + /** + * The signature key. + */ + private String key_ = null; + /** + * The signature caption for the key found or set in the signature text. + */ + private String caption_ = null; + /** + * The signature value for the key found or set in the signature text. + */ + private String value_ = null; + + /** + * The empty constructor. + */ + public SignatureEntry() { + } + + /** + * A new SignatureEntry init with the key. + * + * @param key + */ + public SignatureEntry(String key) { + key_ = key; + } + + /** + * Returns the caption off the current key. + * + * @return Returns the caption. + */ + public String getCaption() { + return caption_; + } + + /** + * Set the caption of the current key. + * + * @param caption The caption to set. + */ + public void setCaption(String caption) { + caption_ = caption; + } + + /** + * Return the current key. + * + * @return Returns the key. + */ + public String getKey() { + return key_; + } + + /** + * Set the current key. + * + * @param key The key to set. + */ + public void setKey(String key) { + key_ = key; + } + + /** + * Return the value of the current key. + * + * @return Returns the value. + */ + public String getValue() { + return value_; + } + + /** + * Set the value of the current key. + * + * @param value The value to set. + */ + public void setValue(String value) { + value_ = value; + } + + /** + * The toString method, used for tests or debugging. + */ + public String toString() { + String the_string = ""; + the_string += "\n Key:" + key_; + the_string += "\nCaption:" + caption_; + the_string += "\n Value:" + value_; +// the_string += "\nStart I:" + startIndex_; + return the_string; + } +} \ No newline at end of file diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java b/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java new file mode 100644 index 0000000..0865be1 --- /dev/null +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java @@ -0,0 +1,127 @@ +/** + * + */ +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 + */ +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/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java index 42b02eb..1368fcd 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java @@ -3,6 +3,7 @@ */ package at.gv.egiz.pdfas.api.sign.pos; +import java.io.Serializable; import java.util.StringTokenizer; import at.gv.egiz.pdfas.api.sign.pos.axis.AbsoluteAxisAlgorithm; @@ -25,8 +26,14 @@ import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException; * * @author wprinz */ -public class SignaturePositioning +public class SignaturePositioning implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + /** * The x axis algorithm. * diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java index 234484c..3e8bc04 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java @@ -3,13 +3,20 @@ */ package at.gv.egiz.pdfas.api.sign.pos.axis; +import java.io.Serializable; + /** * An absolute positioned element. * @author wprinz */ -public class AbsoluteAxisAlgorithm extends AxisAlgorithm +public class AbsoluteAxisAlgorithm extends AxisAlgorithm implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + /** * The absolute positioning value on the axis. */ diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java index 4c5459f..0d1f80d 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java @@ -3,12 +3,19 @@ */ 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 +public class AutoAxisAlgorithm extends AxisAlgorithm implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; // empty } diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java index a4baac6..40f614d 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java @@ -3,12 +3,19 @@ */ 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 +public abstract class AxisAlgorithm implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; // base class } diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java index 206aa19..5940031 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java @@ -3,13 +3,20 @@ */ 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 +public class AbsolutePageAlgorithm extends PageAlgorithm implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + /** * The page. */ diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java index 0070d5e..dff678c 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java @@ -3,6 +3,8 @@ */ package at.gv.egiz.pdfas.api.sign.pos.page; +import java.io.Serializable; + /** * The page for placing the signature is selected automatically. * @@ -14,7 +16,12 @@ package at.gv.egiz.pdfas.api.sign.pos.page; * * @author wprinz */ -public class AutoPageAlgorithm extends PageAlgorithm +public class AutoPageAlgorithm extends PageAlgorithm implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; // empty } diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java index 2a8f67c..050be91 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java @@ -3,12 +3,19 @@ */ 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 +public class NewPageAlgorithm extends PageAlgorithm implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; // empty block } diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java index 9b0fe8a..14bd02e 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java +++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java @@ -3,12 +3,19 @@ */ 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 +public abstract class PageAlgorithm implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; // empty } diff --git a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java index dd50d79..836bc13 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java +++ b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterAnalysisParameters.java @@ -47,6 +47,11 @@ public class VerifyAfterAnalysisParameters */ 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 */ @@ -114,4 +119,16 @@ public class VerifyAfterAnalysisParameters 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; + } + } diff --git a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java index 11ddb28..24bba20 100644 --- a/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java +++ b/src/main/java/at/gv/egiz/pdfas/api/verify/VerifyAfterReconstructXMLDsigParameters.java @@ -44,6 +44,11 @@ public class VerifyAfterReconstructXMLDsigParameters { */ 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 */ @@ -111,4 +116,16 @@ public class VerifyAfterReconstructXMLDsigParameters { 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; + } + } -- cgit v1.2.3