summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-06-07 23:23:02 (GMT)
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-08-17 13:30:23 (GMT)
commit8c199300fd503c59207bf98a27d31630606601bf (patch)
treef09674a216135be849c8d0d0595f447d31d980e0
parent651657a31add2bdde906165f7498791e7bd846cd (diff)
downloadmocca-8c199300fd503c59207bf98a27d31630606601bf.zip
mocca-8c199300fd503c59207bf98a27d31630606601bf.tar.gz
mocca-8c199300fd503c59207bf98a27d31630606601bf.tar.bz2
Honour PAdESCompatibility flag for CMS signatures
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/CreateCMSSignatureCommandImpl.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/cms/Signature.java3
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 2dab3cf..cbf0443 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 dc632ff..8743192 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);
}