From 61a2d23ef72630934c603fe9ffb96ebebff6ee09 Mon Sep 17 00:00:00 2001 From: netconomy Date: Thu, 29 Nov 2007 12:00:22 +0000 Subject: PDF-AS API git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@233 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../pdfas/api/commons/SignatureInformation.java | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/main/java/at/gv/egiz/pdfas/api/commons/SignatureInformation.java (limited to 'src/main/java/at/gv/egiz/pdfas/api/commons/SignatureInformation.java') diff --git a/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureInformation.java b/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureInformation.java new file mode 100644 index 0000000..d8c2a34 --- /dev/null +++ b/src/main/java/at/gv/egiz/pdfas/api/commons/SignatureInformation.java @@ -0,0 +1,97 @@ +/** + * 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: SignatureHolder.java,v 1.3 2006/10/11 07:57:58 wprinz Exp $ + */ +package at.gv.egiz.pdfas.api.commons; + +import java.security.cert.X509Certificate; +import java.util.Date; + +import at.gv.egiz.pdfas.api.io.DataSource; + +/** + * Holds the information of one found signature block, which is the signed data + * and the corresponding signature information. + * + * @author wprinz + */ +public interface SignatureInformation +{ + /** + * Returns the type of this signature (binary/textual). + * + *

+ * May be {@link Constants#SIGNATURE_TYPE_BINARY} or + * {@link Constants#SIGNATURE_TYPE_TEXTUAL}. + *

+ * + * @return Returns the type of this signature (binary/textual). + */ + public String getSignatureType(); + + /** + * Returns the DataSource providing the data that was signed. + * + *

+ * Note that this is the signed data as sent to the verification device by + * PDF-AS. The verification device (e.g. MOA) may perform several other + * transformations on the data before feeding it to the signature hash + * function. To get the actual hashed data use the ReturnHashInputData mechanism (which is very slow). + *

+ * + * @return Returns the DataSource providing the data that was signed. + * + * @see at.gv.egiz.pdfas.api.verify.VerifyParameters#setReturnHashInputData(boolean) + * @see at.gv.egiz.pdfas.api.verify.VerifyResult#getHashInputData() + * + */ + public DataSource getSignedData(); + + /** + * Returns the certificate of the signer. + * + *

+ * Information like subject name, issuer name or serial number can be + * retrieved form this certificate. + *

+ * + * @return Returns the certificate of the signer. + */ + public X509Certificate getSignerCertificate(); + + /** + * Returns the signing time, which is the time when the signature was created. + * + * @return Returns the signing time, which is the time when the signature was + * created. + */ + public Date getSigningTime(); + + /** + * Returns additional, internal information about the found signature. + * + *

+ * Note that this provides a way for developers to gather core information + * about the signature. What information is returned strongly depends on the + * core implementation. + *

+ * + * @return Returns additional, internal information about the signature. Null + * means that no additional information is available. + */ + public Object getInternalSignatureInformation(); + +} \ No newline at end of file -- cgit v1.2.3