diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2015-06-08 01:23:02 +0200 |
---|---|---|
committer | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2015-08-17 15:30:23 +0200 |
commit | 8c199300fd503c59207bf98a27d31630606601bf (patch) | |
tree | f09674a216135be849c8d0d0595f447d31d980e0 /bkucommon/src/main/java/at/gv/egiz | |
parent | 651657a31add2bdde906165f7498791e7bd846cd (diff) | |
download | mocca-8c199300fd503c59207bf98a27d31630606601bf.tar.gz mocca-8c199300fd503c59207bf98a27d31630606601bf.tar.bz2 mocca-8c199300fd503c59207bf98a27d31630606601bf.zip |
Honour PAdESCompatibility flag for CMS signatures
Diffstat (limited to 'bkucommon/src/main/java/at/gv/egiz')
-rw-r--r-- | bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java | 2 | ||||
-rw-r--r-- | bkucommon/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); } |