From b5e475a651d7820ce26f112678dd879874af63bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ce=C4=BEuch?= Date: Tue, 30 Jan 2024 14:28:08 +0100 Subject: [PATCH] consider signature form on signed files instead of level --- .../java/digital/slovensko/autogram/core/SigningJob.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/digital/slovensko/autogram/core/SigningJob.java b/src/main/java/digital/slovensko/autogram/core/SigningJob.java index 18cce7d69..ba1e5d855 100644 --- a/src/main/java/digital/slovensko/autogram/core/SigningJob.java +++ b/src/main/java/digital/slovensko/autogram/core/SigningJob.java @@ -187,12 +187,12 @@ public static SigningJob buildFromFile(File file, Responder responder, boolean c private static SigningParameters getParametersForFile(FileDocument document, boolean checkPDFACompliance, SignatureLevel signatureType, boolean isEn319132, TSPSource tspSource, boolean plainXmlEnabled) { var level = SignatureValidator.getSignedDocumentSignatureLevel(document); - if (level != null) switch (level) { - case PAdES_BASELINE_B: + if (level != null) switch (level.getSignatureForm()) { + case PAdES: return SigningParameters.buildForPDF(document, checkPDFACompliance, isEn319132, tspSource); - case XAdES_BASELINE_B: + case XAdES: return SigningParameters.buildForASiCWithXAdES(document, isEn319132, tspSource, plainXmlEnabled); - case CAdES_BASELINE_B: + case CAdES: return SigningParameters.buildForASiCWithCAdES(document, isEn319132, tspSource, plainXmlEnabled); default: ;