From adfb498834372540fe0fc02e74342750b889ddb2 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Mon, 8 Jun 2015 01:23:02 +0200 Subject: Honour PAdESCompatibility flag for CMS signatures --- .../at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java | 2 +- .../src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java index 2dab3cf8..cbf0443f 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java @@ -110,8 +110,8 @@ public class CreateCMSSignatureCommandImpl extends CreateCMSSignatureRequestType request = getRequestValue(); // DataObject, SigningCertificate, SigningTime - Date signingTime = new Date(); try { + Date signingTime = request.isPAdESCompatibility() ? null : new Date(); signature = new Signature(request.getDataObject(), request.getStructure(), signingCertificate, signingTime, commandContext.getURLDereferencer(), configurationFacade.getUseStrongHash()); diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java index dc632ffd..8743192e 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java @@ -138,7 +138,8 @@ public class Signature { setMimeTypeAttrib(attributes, mimeType); setContentTypeAttrib(attributes); setSigningCertificateAttrib(attributes, signingCertificate); - setSigningTimeAttrib(attributes, signingTime); + if (signingTime != null) + setSigningTimeAttrib(attributes, signingTime); Attribute[] attributeArray = attributes.toArray(new Attribute[attributes.size()]); signerInfo.setSignedAttributes(attributeArray); } -- cgit v1.2.3