From 4269338d2e11028a880c99eb906c93a397fd0c1f Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Wed, 5 Oct 2022 11:39:07 +0200 Subject: FIDO2 support once again --- .../src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pdf-over-signer/src/main/java/at/asit/pdfover') diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java index c7be135f..561452a4 100644 --- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java +++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Signer.java @@ -160,8 +160,9 @@ public class PdfAs4Signer { Throwable rootCause = e; while (rootCause.getCause() != null) rootCause = rootCause.getCause(); - try { /* error code 6001 is user cancellation */ - if (((SLPdfAsException)rootCause).getMessage().startsWith("6001 :")) + try { /* error code 60xx is user cancellation */ + int errorCode = Integer.parseInt(((SLPdfAsException)rootCause).getMessage().split(":",2)[0].trim()); + if ((6000 <= errorCode) && (errorCode <= 6099)) throw new UserCancelledException(); } catch (ClassCastException e2) { /* fall through to wrapped throw */} } -- cgit v1.2.3