summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-10-25 17:13:56 +0200
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2016-10-25 17:13:56 +0200
commitf2628d686bc18f84fc740741634b03908aa28d4f (patch)
tree87133913aed5bb6ad0e257800a36e414992a49ed /pdf-over-gui/src
parentb2aa9ee20c719530cebebd6778ccedde292e6df2 (diff)
downloadpdf-over-f2628d686bc18f84fc740741634b03908aa28d4f.tar.gz
pdf-over-f2628d686bc18f84fc740741634b03908aa28d4f.tar.bz2
pdf-over-f2628d686bc18f84fc740741634b03908aa28d4f.zip
Check emblem hash for placeholder cache
Diffstat (limited to 'pdf-over-gui/src')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java
index 306f74b7..6dc93ae9 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SignaturePlaceholderCache.java
@@ -69,15 +69,18 @@ public class SignaturePlaceholderCache {
final String sigLangProp = "LANG"; //$NON-NLS-1$
final String sigEmblProp = "EMBL"; //$NON-NLS-1$
+ final String sigEHshProp = "EHSH"; //$NON-NLS-1$
final String sigPdfAProp = "PDFA"; //$NON-NLS-1$
final String sigNoteProp = "NOTE"; //$NON-NLS-1$
String sigLang = param.getSignatureLanguage();
String sigEmbl = ""; //$NON-NLS-1$
+ String sigEHsh = ""; //$NON-NLS-1$
if (param.getEmblem() != null) {
Emblem embl = param.getEmblem();
if (embl instanceof CachedFileNameEmblem) {
sigEmbl = ((CachedFileNameEmblem) embl).getOriginalFileName();
+ sigEHsh = ((CachedFileNameEmblem) embl).getOriginalFileHash();
} else {
sigEmbl = embl.getFileName();
}
@@ -94,6 +97,7 @@ public class SignaturePlaceholderCache {
sigProps.load(in);
if (sigLang.equals(sigProps.getProperty(sigLangProp)) &&
sigEmbl.equals(sigProps.getProperty(sigEmblProp)) &&
+ sigEHsh.equals(sigProps.getProperty(sigEHshProp)) &&
sigNote.equals(sigProps.getProperty(sigNoteProp)) &&
sigPdfA.equals(sigProps.getProperty(sigPdfAProp))) {
log.debug("Placeholder cache hit"); //$NON-NLS-1$
@@ -102,6 +106,7 @@ public class SignaturePlaceholderCache {
log.debug("Placeholder cache miss (" + //$NON-NLS-1$
sigLang + "|" + sigProps.getProperty(sigLangProp) + " - " +//$NON-NLS-1$ //$NON-NLS-2$
sigEmbl + "|" + sigProps.getProperty(sigEmblProp) + " - " + //$NON-NLS-1$ //$NON-NLS-2$
+ sigEHsh + "|" + sigProps.getProperty(sigEHshProp) + " - " + //$NON-NLS-1$ //$NON-NLS-2$
sigNote + "|" + sigProps.getProperty(sigNoteProp) + " - " + //$NON-NLS-1$ //$NON-NLS-2$
sigPdfA + "|" + sigProps.getProperty(sigPdfAProp) + ")"); //$NON-NLS-1$ //$NON-NLS-2$
} catch (Exception e) {
@@ -112,6 +117,7 @@ public class SignaturePlaceholderCache {
try {
sigProps.setProperty(sigLangProp, sigLang);
sigProps.setProperty(sigEmblProp, sigEmbl);
+ sigProps.setProperty(sigEHshProp, sigEHsh);
sigProps.setProperty(sigNoteProp, sigNote);
sigProps.setProperty(sigPdfAProp, sigPdfA);
OutputStream out = new FileOutputStream(new File(fileDir, propFileName));