diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2015-06-08 01:23:02 +0200 |
---|---|---|
committer | Christian Maierhofer <cmaierhofer@iaik.tugraz.at> | 2015-08-17 14:57:05 +0200 |
commit | adfb498834372540fe0fc02e74342750b889ddb2 (patch) | |
tree | 13f973c162952c185f89fed268a3cc49d567ca0c | |
parent | f615070b52c23896e5f5b4027146891f8bb5566e (diff) | |
download | mocca-adfb498834372540fe0fc02e74342750b889ddb2.tar.gz mocca-adfb498834372540fe0fc02e74342750b889ddb2.tar.bz2 mocca-adfb498834372540fe0fc02e74342750b889ddb2.zip |
Honour PAdESCompatibility flag for CMS signatures
-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); } |