aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-12-12 17:00:00 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-12-12 17:00:00 +0100
commite5316db083e46c8ae9e4b07bff57812d9314200b (patch)
tree6e027cf0f62b7018ca2c08caafa6be1fa8ce1fa2 /pdf-as-lib/src/main/java/at/gv/egiz/pdfas
parent7f38c0767cafa16f882fd7737269697b93b47af1 (diff)
downloadpdf-as-4-e5316db083e46c8ae9e4b07bff57812d9314200b.tar.gz
pdf-as-4-e5316db083e46c8ae9e4b07bff57812d9314200b.tar.bz2
pdf-as-4-e5316db083e46c8ae9e4b07bff57812d9314200b.zip
MOA SS integration OK
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
index 5f9d2b03..48d15b4d 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
@@ -139,11 +139,12 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
public List<VerifyResult> verify(VerifyParameter parameter)
throws PdfAsException {
+ PDDocument doc = null;
try {
List<VerifyResult> result = new ArrayList<VerifyResult>();
ISettings settings = (ISettings) parameter.getConfiguration();
VerifierDispatcher verifier = new VerifierDispatcher(settings);
- PDDocument doc = PDDocument.load(new ByteArrayInputStream(parameter
+ doc = PDDocument.load(new ByteArrayInputStream(parameter
.getDataSource().getByteData()));
COSDictionary trailer = doc.getDocument().getTrailer();
@@ -210,6 +211,14 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
} catch (PdfAsException e) {
logger.error("Failed to verify document", e);
throw new PdfAsException("error.pdf.verify.02", e);
+ } finally {
+ if(doc != null) {
+ try {
+ doc.close();
+ } catch (IOException e) {
+ logger.info("Failed to close doc");
+ }
+ }
}
}
@@ -236,7 +245,7 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
status);
status.setRequestedSignature(requestedSignature);
-
+
request.setStatus(status);
request.setNeedCertificate(true);