From 42d292e5cee2fc282a09e7e0b307844deb27f368 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:39:20 +0000 Subject: Also show error for encrypted PDFs git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@435 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../java/at/asit/pdfover/gui/composites/PositioningComposite.java | 5 ++++- .../src/main/resources/at/asit/pdfover/gui/messages.properties | 3 ++- .../src/main/resources/at/asit/pdfover/gui/messages_de.properties | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index c9e14898..8eb31752 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -182,11 +182,14 @@ public class PositioningComposite extends StateComposite { this.pdf = new PDFFile(buf); } catch (PDFAuthenticationFailureException e) { - throw new IOException(Messages.getString("error.PDFProtected"), e); //$NON-NLS-1$ + throw new IOException(Messages.getString("error.PDFPwdProtected"), e); //$NON-NLS-1$ } catch (IOException e) { throw new IOException(Messages.getString("error.MayNotBeAPDF"), e); //$NON-NLS-1$ } + if (this.pdf.getDefaultDecrypter().isEncryptionPresent()) + throw new IOException(Messages.getString("error.PDFProtected")); //$NON-NLS-1$ + if (this.viewer == null) { this.viewer = new SignaturePanel(this.pdf); this.frame.add(this.viewer, BorderLayout.CENTER); diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index d713a009..8d174012 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -78,7 +78,8 @@ error.InvalidSettings=Invalid settings are still present. Please check your inpu error.IOError=Input/Output Error error.LocalBKU=Please check if a local CCE (citizen card environment) is running\n\nYou need a CCE to access your citizen card. Further information under www.buergerkarte.at error.MayNotBeAPDF=This may not be a PDF file -error.PDFProtected=This PDF file is password protected +error.PDFProtected=This PDF file is encrypted and can therefore not be signed +error.PDFPwdProtected=This PDF file is password protected and can therefore not be signed error.PositioningNotPossible=Manual positioning currently not possible due to a Java Bug. Using automatic positioning. error.PrepareDocument=Failed to prepare document for signature. error.Retry=Retry diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties index 8c46bb2c..e4add447 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties @@ -78,7 +78,8 @@ error.InvalidSettings=Ung error.IOError=Ein-/Ausgabe-Fehler error.LocalBKU=Bitte prüfen sie, ob Ihre lokale BKU (Bürgerkartenumgebung) läuft\n\nSie benötigen eine BKU, um auf Ihre Bürgerkarte zuzugreifen. Weitere Informationen unter www.buergerkarte.at error.MayNotBeAPDF=Dies ist möglicherweise keine PDF-Datei -error.PDFProtected=Diese PDF-Datei ist Passwortgeschützt +error.PDFProtected=Diese PDF-Datei ist verschlüsselt und kann daher nicht signiert werden +error.PDFPwdProtected=Diese PDF-Datei ist Passwortgeschützt und kann daher nicht signiert werden error.PositioningNotPossible=Positionsauswahl ist im Moment nicht verfügbar wegen eines Java Fehlers. Die Position wird automatisch bestimmt. error.PrepareDocument=Konnte Dokument nicht zur Signatur vorbereiten. error.Retry=Wiederholen -- cgit v1.2.3